]> Creatis software - bbtk.git/commitdiff
2117 BBTK Bug In Progress Normal - Conflict between SurfaceTexture box and PolyDataTo...
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 7 Jul 2014 20:52:19 +0000 (22:52 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 7 Jul 2014 20:52:19 +0000 (22:52 +0200)
kernel/src/bbtkVtkBlackBoxMacros.h
packages/vtk/src/bbvtkPolyDataToActor.cxx
packages/vtk/src/bbvtkPolyDataToActor.h
packages/vtk/src/bbvtkSphereSource.xml
packages/vtk/src/bbvtkSurfaceTexture.cxx
packages/vtk/src/bbvtkSurfaceTexture.h

index bd2d0e89d8d3623df6007cf2d6ca247d03110578..0bf9acc1a4756efcfcdc6c5f65349bda5e0101ef 100644 (file)
 
 //===========================================================================
 #define BBTK_VTK_SET_DEFAULT_VALUES()          \
-  mVtkObject = NULL;
+  mVtkObject = bbVtkObject::New();
+//  mVtkObject = NULL;
 
 //===========================================================================
 #define BBTK_VTK_INITIALIZE_PROCESSING()       \
-  mVtkObject = bbVtkObject::New();
+  mVtkObject = mVtkObject;
+//  mVtkObject = bbVtkObject::New();
 
 //===========================================================================
 #define BBTK_VTK_FINALIZE_PROCESSING()         \
index 1af68a234c07f03e8013f911a2ccf2a7d1e72865..d49a2949b670e82ad829317b29e209f6b70ad5d4 100644 (file)
@@ -67,6 +67,7 @@ namespace bbvtk
           bbSetInputOpacity(1);
           bbSetInputRepresentation(2);
           bbSetInputLineWidth(1);
+          bbSetInputScalarVisibility(false);
 
           polydatamapper = NULL;
           vtkactor       = NULL;
@@ -82,8 +83,6 @@ namespace bbvtk
 //     polydatamapper->SetInput(marchingcubes->GetOutput());
      vtkactor->SetMapper(polydatamapper);
 
-   polydatamapper->ScalarVisibilityOff();
-//     polydatamapper->ScalarVisibilityOn();
      polydatamapper->ImmediateModeRenderingOn();
    }
 
@@ -130,8 +129,20 @@ namespace bbvtk
      {
        firsttime=false;
        bbGetInputRenderer()->AddActor( vtkactor );
-     } 
+     }  // firsttime
+
+     if (bbGetInputScalarVisibility()==true )
+     {
+            polydatamapper->ScalarVisibilityOn();
+     } else {
+            polydatamapper->ScalarVisibilityOff();
+     } // ScalarVisibility
+
+
    }
+
+
+
 } // EO namespace bbtk
 
 #endif //_USE_VTK_
index 035dc643e1016693ec570e7661aee4c3ca5d98d6..8705f83906abff678c39337053bad68cc8172d17 100644 (file)
@@ -84,8 +84,9 @@ namespace bbvtk
     BBTK_DECLARE_INPUT(Colour,std::vector<double>);
     BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
     BBTK_DECLARE_INPUT(Transform, vtkLinearTransform *);
-       BBTK_DECLARE_INPUT(Representation, int);
-       BBTK_DECLARE_INPUT(LineWidth, double);
+    BBTK_DECLARE_INPUT(Representation, int);
+    BBTK_DECLARE_INPUT(LineWidth, double);
+    BBTK_DECLARE_INPUT(ScalarVisibility, bool);
     BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
     
     BBTK_PROCESS(DoProcess);
@@ -108,6 +109,7 @@ namespace bbvtk
   BBTK_INPUT(PolyDataToActor,Transform,"Linear Transform (4x4 homogeneous)",vtkLinearTransform*,"");
   BBTK_INPUT(PolyDataToActor,Representation,"0 points,1 wireframe, 2(default) surface",int,"");
   BBTK_INPUT(PolyDataToActor,LineWidth,"Width of the wireframe (1 default)",double,"");
+  BBTK_INPUT(PolyDataToActor,ScalarVisibility,"Scalar Visibility (false default)",bool,"");
   BBTK_OUTPUT(PolyDataToActor,Out,"Extracted iso-surface",vtkProp3D *,"");
   
   BBTK_END_DESCRIBE_BLACK_BOX(PolyDataToActor);
index 967cd2d1c9ad28d6637699dd9ef8ec99ca006c5f..270713136d9ef33c16a168fbaa1bfcc9bba64c5b 100644 (file)
 <input name="CenterX" type="double" description="Center X coord"/>
 <input name="CenterY" type="double" description="Center Y coord"/>
 <input name="CenterZ" type="double" description="Center Z coord"/>
-<input name="PhiResolution" type="int" description="Sphere PhiResolution" special="vtk parameter"/>
-<input name="Radius" type="double" description="Sphere Radius" special="vtk parameter"/>
-<input name="ThetaResolution" type="int" description="Sphere ThetaResolution"special="vtk parameter"/>
+<input name="PhiResolution" type="int" description="Sphere PhiResolution" special="vtk parameter" />
+<input name="Radius" type="double" description="Sphere Radius" special="vtk parameter" />
+<input name="ThetaResolution" type="int" description="Sphere ThetaResolution" special="vtk parameter" />
 
 <process>
 <PRE>
+
 bbGetVtkObject()->SetCenter(bbGetInputCenterX(), 
           bbGetInputCenterY(), 
           bbGetInputCenterZ());
+//bbGetVtkObject()->SetPhiResolution(bbGetInputPhiResolution());
+//bbGetVtkObject()->SetThetaResolution(bbGetInputThetaResolution());
+//bbGetVtkObject()->SetRadius(bbGetInputRadius());
+//printf("EED box vtk:SphereSource theta=%d  phi=%d\n", bbGetInputThetaResolution() , bbGetInputPhiResolution());
+
 bbGetVtkObject()->Update();
 </PRE>
 </process>
index d59b7a866d2afd13f222ed180b9447bbf3fc74e9..12d32b03aeed898588478a3b1bc4693d72755962 100644 (file)
@@ -62,9 +62,26 @@ printf("EED SurfaceTexture::Process Start\n");
                } else {
                        colorLookupTable = vtkLookupTable::New();
                }
+               colorLookupTable->SetTableRange(range[0],range[1]);
+               colorLookupTable->Build();
+               double rgba1[4];
+               double rgba2[4];
+               for (int iLookTable = 0; iLookTable<128; iLookTable++)
+               {
+                 colorLookupTable->GetTableValue(      iLookTable, rgba1);
+                 colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
+
+                 colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
+                 colorLookupTable->SetTableValue(      iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
+               } // for iLookTable
+
        }
-       colorLookupTable->SetTableRange(range[0],range[1]);
-       colorLookupTable->Build();
+
+
+
+       
+
+
        bbGetInputMesh()->GetPointData()->SetScalars(colors);
 
        if (bbGetInputColorType()==1)
index a0b3ea416b5b4c77e6fce5dcffee330c9a8ca4c0..2ad306296c4d0c773080140cfaa3492bd2d39d09 100644 (file)
@@ -52,7 +52,7 @@ BBTK_DESCRIPTION("Surface texture");
 BBTK_CATEGORY("");
        BBTK_INPUT(SurfaceTexture,Mesh,"Mesh topology",vtkPolyData*,"");
        BBTK_INPUT(SurfaceTexture,Image,"Image Reference",vtkImageData*,"");
-       BBTK_INPUT(SurfaceTexture,ColorType,"Color Type (default 0) 0 Colors, 1 ColorWindowLevel",int,"");
+       BBTK_INPUT(SurfaceTexture,ColorType,"Color Type (default 0) 0 Colors(JET), 1 ColorWindowLevel",int,"");
        BBTK_INPUT(SurfaceTexture,ColorLevel,"Color Level (default 500)",double,"");
        BBTK_INPUT(SurfaceTexture,ColorWindow,"ColorWindow (default 500)",double,"");
        BBTK_INPUT(SurfaceTexture,Transform,"vtk Linear Transform (default NULL)",vtkLinearTransform*,"");