]> Creatis software - bbtk.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 18 Dec 2009 18:37:44 +0000 (18:37 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 18 Dec 2009 18:37:44 +0000 (18:37 +0000)
kernel/src/bbtkVtkBlackBoxMacros.h
packages/vtk/bbs/appli/exampleSave_vtkPolyData.bbs
packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
packages/vtk/src/bbvtkMarchingCubes.cxx
packages/vtk/src/bbvtkMarchingCubes.h
packages/vtk/src/bbvtkPolyDataToActor.cxx
packages/vtk/src/bbvtkPolyDataToActor.h

index cdbd65540454cef4db8a8cfb7c8c63a5e6944580..6102fef06bdb30fa24a03e785bf1ded593a8c423 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkVtkBlackBoxMacros.h,v $
   Language:  C++
-  Date:      $Date: 2009/05/28 08:12:06 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2009/12/18 18:37:44 $
+  Version:   $Revision: 1.14 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
   {                                                                    \
     bbtkBlackBoxDebugMessage("process",1,"**> Processing..."           \
                             <<std::endl);                              \
-    mVtkObject->Update();                                              \
+    mVtkObject->Update();      \
+printf("EED Process %s\n", bbGetFullName().c_str() ); \
+  vtkIndent indent(2); \
+   mVtkObject->PrintSelf(std::cout, indent ); \
     bbtkBlackBoxDebugMessage("process",2,"<** Processing"              \
                             <<std::endl);                              \
   }
index d8f98895eb96ef6063eb2b2b9e3efc1cfd77ef8d..6f76fdae7e300d163d90aa090679d8fd8a1beabf 100644 (file)
@@ -11,7 +11,7 @@ include "vtk/boxes/bbLoadHola"
 new LoadHola reader
 
 new MarchingCubes mc
-  set mc.Value 800
+  set mc.Value 1000
   connect reader.Out mc.In
 
 
@@ -37,4 +37,6 @@ new LayoutSplit main
   connect viewer.Widget main.Widget1
   connect button.Widget main.Widget2
 
-exec viewer
+exec main
+
+
index 70cfaa9b2235d3221982a512cd8b57125e60d035..4e4fbf959b02146820f7fb7db0f7b85a0442dde1 100644 (file)
@@ -9,19 +9,24 @@ define IsoSurfaceExtractor vtk
 # ---                ---
 
   new MarchingCubes   mc
-  new PolyDataToActor eedTrans    
+  new PolyDataToActor polydatatoactor   
+    connect mc.Out polydatatoactor.In
 
-  connect mc.Out eedTrans.In
+  new MagicBox  mb
+   connect mb.BoxChange mc.BoxExecute
+   connect mb.BoxChange polydatatoactor.BoxExecute
   
 # ---                ---
 
   input In        mc.In              "vtkImageData"
-  input Isovalue  eedTrans.Isovalue  "Isovalue"
-  input Opacity   eedTrans.Opacity   "Opacity"  
-  input Colour    eedTrans.Colour    "R G B"
-  input Renderer  eedTrans.Renderer  "3D scene in which to insert the surface"
-  input Transform eedTrans.Transform "Linear Transform (4x4 homogeneous)"     
-  output Out eedTrans.Out "Extracted iso-surface (as a vtkProp3D *)"
+  input Isovalue  mc.Value          "Isovalue"
+  input Opacity   polydatatoactor.Opacity   "Opacity"  
+  input Colour    polydatatoactor.Colour    "R G B"
+  input Renderer  polydatatoactor.Renderer  "3D scene in which to insert the surface"
+  input Transform polydatatoactor.Transform "Linear Transform (4x4 homogeneous)"     
+  input BoxExecute mb.BoxExecute "BoxExecute"     
+    
+
+  output Out polydatatoactor.Out "Extracted iso-surface (as a vtkProp3D *)"
 
 endefine
index ae988f4787acdca84b4cdc8a7e3560e2632c9d81..5a72fb9d6d997ce231c5c67cf3d2c31ba87586cb 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkMarchingCubes.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/12/18 16:47:44 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2009/12/18 18:41:42 $
+  Version:   $Revision: 1.7 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -46,10 +46,17 @@ namespace bbvtk
    BBTK_BLACK_BOX_IMPLEMENTATION(MarchingCubes,bbtk::AtomicBlackBox);
 
 
+       void MarchingCubes::Process()
+       {
+               bbGetVtkObject()->SetValue(0, bbGetInputValue() );
+               bbGetVtkObject()->Update();             
+       }
+       
        //-----------------------------------------------------------------     
        void MarchingCubes::bbUserSetDefaultValues()
        {
                 BBTK_VTK_SET_DEFAULT_VALUES();
+               bbSetInputValue(400);
        }
        
        //-----------------------------------------------------------------     
index 94a689cf7ae86c3519af22dd3ae8d5ef0bebccf4..a04e3bb54f0dc209fbe5726a8ca05592fca00c98 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkMarchingCubes.h,v $
   Language:  C++
-  Date:      $Date: 2009/12/18 16:47:45 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2009/12/18 18:37:56 $
+  Version:   $Revision: 1.9 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -61,27 +61,39 @@ namespace bbvtk
    //=======================================================================
   class /*BBTK_EXPORT*/ MarchingCubes
     : 
-    public bbtk::AtomicBlackBox,
-    public vtkMarchingCubes
+    public bbtk::AtomicBlackBox 
+//    ,public vtkMarchingCubes
   {
     BBTK_VTK_BLACK_BOX_INTERFACE(MarchingCubes,
                                 bbtk::AtomicBlackBox,
                                 vtkMarchingCubes);
 
     BBTK_DECLARE_VTK_INPUT(In,vtkImageData *);
+       BBTK_DECLARE_INPUT(Value,double);
     BBTK_DECLARE_VTK_OUTPUT(Out,vtkPolyData *);
 
     // For the 'Value' parameter, the standard bbtk macro does not work 
     // as vtk Get/Set accessors have a parameter...
     //  BBTK_DECLARE_VTK_PARAM(vtkMarchingCubes,Value,double);
     // Hence have to wrap the accessors "by hand" :
+         
+        /* 
     double bbGetInputValue ()
        { return vtkMarchingCubes::GetValue(0); }
     void bbSetInputValue (double d)    
-       { vtkMarchingCubes::SetValue(0,d); }
-
-   BBTK_VTK_PROCESS();
-
+       { // vtkMarchingCubes::SetValue(0,d);
+                  
+                  mVtkObject->SetValue(0,1000.0);
+
+                  std::cout <<  "EED MarchingCubes::bbSetInputValue " << d << std::endl;
+          
+          }
+*/
+         
+         
+  // BBTK_VTK_PROCESS();
+         BBTK_PROCESS(Process);
+         void Process();
 
   };
   //=======================================================================
index 7f336ad1af493659f48c7b6cfb0e8d294f4b5955..73d46a1ecd6f5ac84a310894165bbb4e9832f471 100644 (file)
@@ -59,7 +59,6 @@ namespace bbvtk
           bbSetInputIn(NULL);
           bbSetInputRenderer(NULL);
           bbSetInputTransform(NULL);
-          bbSetInputIsovalue(400);
           bbSetInputOpacity(1);
 
           polydatamapper       = NULL;
@@ -99,8 +98,8 @@ namespace bbvtk
 //---------------------------------------------------------------------
 
    void PolyDataToActor::DoProcess()
-   {
-     polydatamapper->SetInput( bbGetInputIn() );
+   {      
+          polydatamapper->SetInput( bbGetInputIn() );
      
      vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],  
                                        bbGetInputColour()[1], 
index e17ec370140fbe76f6132bc247404e56a229d69e..dd23a693d7e7f32ce4a6b330a315cfd568ab11d5 100644 (file)
@@ -75,7 +75,6 @@ namespace bbvtk
     BBTK_BLACK_BOX_INTERFACE(PolyDataToActor,bbtk::AtomicBlackBox);
     
     BBTK_DECLARE_INPUT(In,vtkPolyData *);
-    BBTK_DECLARE_INPUT(Isovalue,double);
     BBTK_DECLARE_INPUT(Opacity,double);
     BBTK_DECLARE_INPUT(Colour,std::vector<double>);
     BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
@@ -96,7 +95,6 @@ namespace bbvtk
   BBTK_CATEGORY("3D object creator");
   BBTK_INPUT(PolyDataToActor,In,"Input image",vtkPolyData*,"");
 
-  BBTK_INPUT(PolyDataToActor,Isovalue,"Isovalue",double,"");
   BBTK_INPUT(PolyDataToActor,Opacity,"Opacity",double,"");
   BBTK_INPUT(PolyDataToActor,Colour,"r g b",vectorcolour,"colour");
   BBTK_INPUT(PolyDataToActor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,"");