]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Mon, 3 Mar 2008 14:01:49 +0000 (14:01 +0000)
committerguigues <guigues>
Mon, 3 Mar 2008 14:01:49 +0000 (14:01 +0000)
packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx [moved from packages/vtk/src/bbvtkSurface.cxx with 63% similarity]
packages/vtk/src/bbvtkIsoSurfaceExtractor.h [new file with mode: 0644]
packages/vtk/src/bbvtkSurface.h [deleted file]
packages/wxvtk/bbs/appli/ExampleIsoSurfaceWithControls.bbs
packages/wxvtk/bbs/boxes/bbIsoSurfaceWithControls.bbs

similarity index 63%
rename from packages/vtk/src/bbvtkSurface.cxx
rename to packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx
index 786aa792359cbb55642cbb74da4e808324b48b01..1ac72578591d49e62a6302117ae275f616f3894a 100644 (file)
@@ -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
 
 #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<double> 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 (file)
index 0000000..3b0665d
--- /dev/null
@@ -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 <vector>
+
+#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<double>);
+    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<double> 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 (file)
index 7691b37..0000000
+++ /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 <vector>
-
-#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<double>);
-      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<double> 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_
-
index 95dcfbd21f304033a9aca7a9c0b7f21fbe422ad2..0182530fd6e97173fa5bcc6567e8b3e2327a2ba8 100644 (file)
@@ -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
  
index ce9514895ee2e44c263e057ab5d0800906f5384b..f4169234cf01abe9559fd885dfe3455e8ee04bf1 100644 (file)
@@ -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