X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkPlaneWidget.cxx;h=833d6be9d99e7db0df9d39f0435e7920e68f00b1;hb=970a183246a4df7f29e583846745086c5b9f7090;hp=02346246ffdb896c345c8070088a97de28e55b1f;hpb=41a74698bb0203749248628baa1503144e1f12f7;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx index 0234624..833d6be 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx @@ -10,11 +10,13 @@ namespace bbcreaVtk void boxcreaVtkPlaneWidget::Execute() // virutal { - printf("EED bbcreaVtkPlaneWidget::Execute (virtual) start \n"); - box->bbSetOutputOut( box->_boxcreavtkplanewidget.GetPlaneSource()->GetOutput() ); - printf("EED bbcreaVtkPlaneWidget::Execute (virtual) start 1\n"); + box->bbSetOutputOut( box->_boxcreavtkplanewidget.GetPlaneSource()->GetOutput() ); box->bbSignalOutputModification(std::string("Out")); - printf("EED bbcreaVtkPlaneWidget::Execute (virtual) end \n"); + box->bbSetOutputCenter( box->_boxcreavtkplanewidget.GetCenter() ); + box->bbSignalOutputModification(std::string("Center")); + box->bbSetOutputNormal( box->_boxcreavtkplanewidget.GetNormal() ); + box->bbSignalOutputModification(std::string("Normal")); + } //---------------------------------------------------------------------------------------------- @@ -42,12 +44,28 @@ 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() ); + + if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL)) + { + bbSetOutputOut( NULL ); + std::vector center; + std::vector normal; + bbSetOutputCenter( center ); + bbSetOutputNormal( normal ); + } else { + _boxcreavtkplanewidget.SetActive( bbGetInputActive() ); + _boxcreavtkplanewidget.SetImage( bbGetInputIn() ); + _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() ); + _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() ); + _boxcreavtkplanewidget.SetRepresentation( bbGetInputRepresentation() ); + _boxcreavtkplanewidget.SetOrigin( bbGetInputOrigin() ); + _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) @@ -61,6 +79,7 @@ void PlaneWidget::bbUserSetDefaultValues() bbSetInputActive(false); bbSetInputIn(NULL); bbSetInputResolution(60); + bbSetInputRepresentation(1); bbSetInputRenderer(NULL); bbSetOutputOut(NULL); _boxcreavtkplanewidget.box = this; @@ -90,7 +109,7 @@ void PlaneWidget::bbUserFinalizeProcessing() // if any } -} -// EO namespace bbcreaVtk + +}// EO namespace bbcreaVtk