]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx
#3307 creaVtk Bug New Normal - StructuredPoint init
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPlaneWidget.cxx
index 59b6821714f9a7f0f98551f6f70108c86221b4ca..91de0a69b588b68b6c2c4bf8d7f404a23116700a 100644 (file)
@@ -44,14 +44,23 @@ void PlaneWidget::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
-       _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
-       _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
-       _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
-       _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
-       _boxcreavtkplanewidget.Process();
-       bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
-       bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
-       bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
+       if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL))
+       {
+               bbSetOutputOut( NULL );
+               std::vector<double> center;
+               std::vector<double> normal;
+               bbSetOutputCenter( center );
+               bbSetOutputNormal( normal );
+       } else {
+               _boxcreavtkplanewidget.SetActive( bbGetInputActive() );
+               _boxcreavtkplanewidget.SetImage( bbGetInputIn() );
+               _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() );
+               _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() );
+               _boxcreavtkplanewidget.Process();
+               bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() );
+               bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() );
+               bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() );
+       }
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)