From 2114d2a089c36c35c09db63e003cec5c37a4a8c1 Mon Sep 17 00:00:00 2001 From: guigues Date: Mon, 3 Mar 2008 14:01:49 +0000 Subject: [PATCH] *** empty log message *** --- ...rface.cxx => bbvtkIsoSurfaceExtractor.cxx} | 64 +++++------ packages/vtk/src/bbvtkIsoSurfaceExtractor.h | 102 ++++++++++++++++++ packages/vtk/src/bbvtkSurface.h | 102 ------------------ .../appli/ExampleIsoSurfaceWithControls.bbs | 4 + .../bbs/boxes/bbIsoSurfaceWithControls.bbs | 8 +- 5 files changed, 141 insertions(+), 139 deletions(-) rename packages/vtk/src/{bbvtkSurface.cxx => bbvtkIsoSurfaceExtractor.cxx} (63%) create mode 100644 packages/vtk/src/bbvtkIsoSurfaceExtractor.h delete mode 100644 packages/vtk/src/bbvtkSurface.h diff --git a/packages/vtk/src/bbvtkSurface.cxx b/packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx similarity index 63% rename from packages/vtk/src/bbvtkSurface.cxx rename to packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx index 786aa79..1ac7257 100644 --- a/packages/vtk/src/bbvtkSurface.cxx +++ b/packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx @@ -2,9 +2,9 @@ /*========================================================================= Program: bbtk - Module: $RCSfile: bbvtkSurface.cxx,v $ + Module: $RCSfile: bbvtkIsoSurfaceExtractor.cxx,v $ Language: C++ - Date: $Date: 2008/03/03 13:33:50 $ + Date: $Date: 2008/03/03 14:01:49 $ Version: $Revision: 1.1 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de @@ -26,15 +26,15 @@ #include "vtkProperty.h" -#include "bbvtkSurface.h" +#include "bbvtkIsoSurfaceInserter.h" #include "bbvtkPackage.h" namespace bbvtk { - BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Surface) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(Surface,bbtk::AtomicBlackBox); + BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,IsoSurfaceInserter) + BBTK_USER_BLACK_BOX_IMPLEMENTATION(IsoSurfaceInserter,bbtk::AtomicBlackBox); - void Surface::bbUserConstructor() + void IsoSurfaceInserter::bbUserConstructor() { Init(); std::vector colour; @@ -44,12 +44,12 @@ namespace bbvtk bbSetInputColour(colour); } - void Surface::bbUserCopyConstructor() + void IsoSurfaceInserter::bbUserCopyConstructor() { Init(); } - void Surface::Init() + void IsoSurfaceInserter::Init() { firsttime=true; @@ -74,32 +74,32 @@ namespace bbvtk //--------------------------------------------------------------------- - void Surface::DoProcess() + void IsoSurfaceInserter::DoProcess() { // bbGetInputIn()->Print(std::cout); - // Visualisation - result volume - marchingcubes->SetInput( bbGetInputIn() ); - marchingcubes->SetValue(0, bbGetInputIsovalue() ); - marchingcubes->Update(); - - // if (_2_isoActorMC6!=NULL) - // { - // bbGetInputRenderer()->RemoveActor(vtkactor); - // } - - vtkactor->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] ); - - - vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() ); - bbSetOutputOut( vtkactor ); - - // Interface Update - - if ((firsttime==true) && (bbGetInputRenderer()!=NULL )) - { - firsttime=false; - bbGetInputRenderer()->AddActor( vtkactor ); - } + // Visualisation - result volume + marchingcubes->SetInput( bbGetInputIn() ); + marchingcubes->SetValue(0, bbGetInputIsovalue() ); + marchingcubes->Update(); + + // if (_2_isoActorMC6!=NULL) + // { + // bbGetInputRenderer()->RemoveActor(vtkactor); + // } + + vtkactor->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] ); + + + vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() ); + bbSetOutputOut( vtkactor ); + + // Interface Update + + if ((firsttime==true) && (bbGetInputRenderer()!=NULL )) + { + firsttime=false; + bbGetInputRenderer()->AddActor( vtkactor ); + } } } // EO namespace bbtk diff --git a/packages/vtk/src/bbvtkIsoSurfaceExtractor.h b/packages/vtk/src/bbvtkIsoSurfaceExtractor.h new file mode 100644 index 0000000..3b0665d --- /dev/null +++ b/packages/vtk/src/bbvtkIsoSurfaceExtractor.h @@ -0,0 +1,102 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbvtkIsoSurfaceExtractor.h,v $ + Language: C++ + Date: $Date: 2008/03/03 14:01:49 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*//** + * \brief Short description in one line + * + * Long description which + * can span multiple lines + */ +/** + * \file + * \brief Pattern for the definition of a new type of Node (header) + */ +/** + * \class bbtk::NodePatern + * \brief Pattern for the definition of a new type of Node + */ + + +#ifdef _USE_VTK_ + + +#ifndef __vtkIsoSurfaceInserter_h__ +#define __vtkIsoSurfaceInserter_h__ + +#include "vtkImageData.h" +#include "vtkRenderer.h" +#include "vtkMarchingCubes.h" +#include "vtkPolyDataMapper.h" +#include "vtkProp3D.h" +#include "vtkActor.h" +#include + +#include "bbtkAtomicBlackBox.h" + +namespace bbvtk +{ + + class /*BBTK_EXPORT*/ IsoSurfaceInserter + : + public bbtk::AtomicBlackBox + { + bool firsttime; + vtkMarchingCubes *marchingcubes; + vtkPolyDataMapper *polydatamapper; + vtkActor *vtkactor; + + + BBTK_USER_BLACK_BOX_INTERFACE(IsoSurfaceInserter,bbtk::AtomicBlackBox); + + BBTK_DECLARE_INPUT(In,vtkImageData *); + BBTK_DECLARE_INPUT(InVtkObject,vtkObject *); + BBTK_DECLARE_INPUT(Isovalue,double); + BBTK_DECLARE_INPUT(Opacity,double); + BBTK_DECLARE_INPUT(Colour,std::vector); + BBTK_DECLARE_INPUT(Renderer,vtkRenderer *); + BBTK_DECLARE_OUTPUT(Out,vtkProp3D *); + + BBTK_PROCESS(DoProcess); + void DoProcess(); + + protected: + virtual void bbUserConstructor(); + virtual void bbUserCopyConstructor(); + void Init(); + }; + + BBTK_BEGIN_DESCRIBE_BLACK_BOX(IsoSurfaceInserter,bbtk::AtomicBlackBox); + BBTK_NAME("IsoSurfaceInserter"); + BBTK_AUTHOR("eduardo.davila / laurent.guigues at creatis.insa-lyon.fr"); + BBTK_DESCRIPTION("Extracts an iso-surface of a 3D image and insert it into a 3D scene (vtkRenderer)"); + typedef std::vector vectorcolour; + BBTK_INPUT(IsoSurfaceInserter,In,"Input image",vtkImageData*); + BBTK_INPUT(IsoSurfaceInserter,InVtkObject,"Image vtkObject",vtkObject*); + BBTK_INPUT(IsoSurfaceInserter,Isovalue,"Isovalue",double); + BBTK_INPUT(IsoSurfaceInserter,Opacity,"Opacity",double); + BBTK_INPUT(IsoSurfaceInserter,Colour,"r g b",vectorcolour); + BBTK_INPUT(IsoSurfaceInserter,Renderer,"3D scene in which to insert the surface",vtkRenderer*); + BBTK_OUTPUT(IsoSurfaceInserter,Out,"Image",vtkProp3D *); + + BBTK_END_DESCRIBE_BLACK_BOX(IsoSurfaceInserter); + +}// EO namespace bbtk + + +#endif //__IsoSurfaceInserter_h__ + +#endif //_USE_VTK_ + diff --git a/packages/vtk/src/bbvtkSurface.h b/packages/vtk/src/bbvtkSurface.h deleted file mode 100644 index 7691b37..0000000 --- a/packages/vtk/src/bbvtkSurface.h +++ /dev/null @@ -1,102 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbvtkSurface.h,v $ - Language: C++ - Date: $Date: 2008/03/03 13:33:50 $ - Version: $Revision: 1.1 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*//** - * \brief Short description in one line - * - * Long description which - * can span multiple lines - */ -/** - * \file - * \brief Pattern for the definition of a new type of Node (header) - */ -/** - * \class bbtk::NodePatern - * \brief Pattern for the definition of a new type of Node - */ - - -#ifdef _USE_VTK_ - - -#ifndef __vtkSurface_h__ -#define __vtkSurface_h__ - -#include "vtkImageData.h" -#include "vtkRenderer.h" -#include "vtkMarchingCubes.h" -#include "vtkPolyDataMapper.h" -#include "vtkProp3D.h" -#include "vtkActor.h" -#include - -#include "bbtkAtomicBlackBox.h" - -namespace bbvtk -{ - - class /*BBTK_EXPORT*/ Surface - : - public bbtk::AtomicBlackBox - { - bool firsttime; - vtkMarchingCubes *marchingcubes; - vtkPolyDataMapper *polydatamapper; - vtkActor *vtkactor; - - - BBTK_USER_BLACK_BOX_INTERFACE(Surface,bbtk::AtomicBlackBox); - - BBTK_DECLARE_INPUT(In,vtkImageData *); - BBTK_DECLARE_INPUT(InVtkObject,vtkObject *); - BBTK_DECLARE_INPUT(Isovalue,double); - BBTK_DECLARE_INPUT(Opacity,double); - BBTK_DECLARE_INPUT(Colour,std::vector); - BBTK_DECLARE_INPUT(Renderer,vtkRenderer *); - BBTK_DECLARE_OUTPUT(Out,vtkProp3D *); - - BBTK_PROCESS(DoProcess); - void DoProcess(); - - protected: - virtual void bbUserConstructor(); - virtual void bbUserCopyConstructor(); - void Init(); -}; - - BBTK_BEGIN_DESCRIBE_BLACK_BOX(Surface,bbtk::AtomicBlackBox); - BBTK_NAME("Surface"); - BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); - BBTK_DESCRIPTION("Construction of a vtkActor and add it to the 3D window"); - typedef std::vector vectorcolour; - BBTK_INPUT(Surface,In,"Image",vtkImageData*); - BBTK_INPUT(Surface,InVtkObject,"Image vtkObject",vtkObject*); - BBTK_INPUT(Surface,Isovalue,"Isovalue",double); - BBTK_INPUT(Surface,Opacity,"Opacity",double); - BBTK_INPUT(Surface,Colour,"r g b",vectorcolour); - BBTK_INPUT(Surface,Renderer,"3D window to add the actor (VTK)",vtkRenderer*); - BBTK_OUTPUT(Surface,Out,"Image",vtkProp3D *); - - BBTK_END_DESCRIBE_BLACK_BOX(Surface); - -}// EO namespace bbtk - - -#endif //__Surface_h__ - -#endif //_USE_VTK_ - diff --git a/packages/wxvtk/bbs/appli/ExampleIsoSurfaceWithControls.bbs b/packages/wxvtk/bbs/appli/ExampleIsoSurfaceWithControls.bbs index 95dcfbd..0182530 100644 --- a/packages/wxvtk/bbs/appli/ExampleIsoSurfaceWithControls.bbs +++ b/packages/wxvtk/bbs/appli/ExampleIsoSurfaceWithControls.bbs @@ -1,3 +1,7 @@ +description "Example of IsoSurfaceWithControls." +author "laurent.guigues at creatis.insa-lyon.fr" +category "example" + include wxvtk/boxes/bbIsoSurfaceWithControls include vtk/boxes/bbLoadHola diff --git a/packages/wxvtk/bbs/boxes/bbIsoSurfaceWithControls.bbs b/packages/wxvtk/bbs/boxes/bbIsoSurfaceWithControls.bbs index ce95148..f416923 100644 --- a/packages/wxvtk/bbs/boxes/bbIsoSurfaceWithControls.bbs +++ b/packages/wxvtk/bbs/boxes/bbIsoSurfaceWithControls.bbs @@ -4,15 +4,14 @@ load std define IsoSurfaceWithControls author "laurent.guigues@creatis.insa-lyon.fr" - description "Image iso-surface extractor with associated control panel (isovalue, opacity and colour)" + description "Image iso-surface extractor (vtk::IsoSurfaceExtractor) with associated control panel (isovalue, opacity and colour)" category "image;mesh;widget;viewer" new LayoutLine controls new LayoutLine sliders - new Surface surface + new IsoSurfaceExtractor surface new Slider isovalue new Slider opacity -# new CommandButton colourButton new LayoutLine colourFrame new ColourSelectorButton colour new MultipleInputs refresh @@ -22,7 +21,6 @@ define IsoSurfaceWithControls connect colourFrame.Widget controls.Widget2 connect colour.Widget colourFrame.Widget1 -#Button.Widget connect isovalue.Widget sliders.Widget1 connect opacity.Widget sliders.Widget2 @@ -39,7 +37,7 @@ define IsoSurfaceWithControls # connect colourButton.BoxChange colour.BoxExecute set colourFrame.WinTitle "Colour" - set controls.Orientation 0 + set controls.Orientation HORIZONTAL set isovalue.Title "Isovalue" set opacity.Title "Opacity" set opacity.Min 0 -- 2.47.1