X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkPolyDataToActor.h;h=f0c9beb6b5387c35a65439470ac04224294f2661;hb=edb8e9b8948e7216e06b3ef5228b16f18417ca52;hp=8705f83906abff678c39337053bad68cc8172d17;hpb=620982e33be3ad63c78dc1e6d7cfcf8af1cb0c14;p=bbtk.git diff --git a/packages/vtk/src/bbvtkPolyDataToActor.h b/packages/vtk/src/bbvtkPolyDataToActor.h index 8705f83..f0c9beb 100644 --- a/packages/vtk/src/bbvtkPolyDataToActor.h +++ b/packages/vtk/src/bbvtkPolyDataToActor.h @@ -61,6 +61,9 @@ #include "vtkPolyDataMapper.h" #include "vtkProp3D.h" #include "vtkActor.h" +#include "vtkScalarsToColors.h" +#include "vtkProperty.h" + #include #include "bbtkAtomicBlackBox.h" @@ -72,21 +75,27 @@ namespace bbvtk : public bbtk::AtomicBlackBox { - bool firsttime; + bool actorAdded; vtkPolyDataMapper *polydatamapper; vtkActor *vtkactor; - - + vtkProperty *backfaceproperty; + BBTK_BLACK_BOX_INTERFACE(PolyDataToActor,bbtk::AtomicBlackBox); + BBTK_DECLARE_INPUT(Active,bool); BBTK_DECLARE_INPUT(In,vtkPolyData *); BBTK_DECLARE_INPUT(Opacity,double); BBTK_DECLARE_INPUT(Colour,std::vector); + BBTK_DECLARE_INPUT(BackFaceColour,std::vector); BBTK_DECLARE_INPUT(Renderer,vtkRenderer *); BBTK_DECLARE_INPUT(Transform, vtkLinearTransform *); BBTK_DECLARE_INPUT(Representation, int); BBTK_DECLARE_INPUT(LineWidth, double); BBTK_DECLARE_INPUT(ScalarVisibility, bool); + BBTK_DECLARE_INPUT(ScalarVisibilityOn_LookupTable, vtkScalarsToColors*); + BBTK_DECLARE_INPUT(ScalarVisibilityOn_NameColorArray, std::string); + BBTK_DECLARE_INPUT(ScalarVisibilityOn_ScalarRange, std::vector); + BBTK_DECLARE_OUTPUT(Out,vtkProp3D *); BBTK_PROCESS(DoProcess); @@ -98,18 +107,25 @@ namespace bbvtk BBTK_BEGIN_DESCRIBE_BLACK_BOX(PolyDataToActor,bbtk::AtomicBlackBox); BBTK_NAME("PolyDataToActor"); BBTK_AUTHOR("eduardo.davila at creatis.insa-lyon.fr"); - BBTK_DESCRIPTION("takes a vtkPolyData object to insert into a 3D scene (e.g. a Viewer3D)"); + BBTK_DESCRIPTION("takes a vtkPolyData object to insert into a 3D scene (e.g. a Viewer3D) (C++,Python,JavaScript)"); typedef std::vector vectorcolour; BBTK_CATEGORY("3D object creator"); BBTK_INPUT(PolyDataToActor,In,"Input image",vtkPolyData*,""); + BBTK_INPUT(PolyDataToActor,Active,"Active true/false (default true)",bool,""); BBTK_INPUT(PolyDataToActor,Opacity,"Opacity",double,""); BBTK_INPUT(PolyDataToActor,Colour,"r g b",vectorcolour,"colour"); + BBTK_INPUT(PolyDataToActor,BackFaceColour,"(default EMPTY) [r g b] (0..1)",vectorcolour,"colour"); BBTK_INPUT(PolyDataToActor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,""); 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_INPUT(PolyDataToActor,ScalarVisibility,"(false default) a) ScalarVisibility:false use color actor. b) ScalarVisibility:true use PolyData->SetScalars [3-components-RGB] (float 0..1 or int 0..255). c) ScalarVisibility:true and SetLookupTable use PolyData->SetScalars [1-component] d) ScalarVisibility:true and SetLookupTable SelectColorArray() use PolyData->SetScalars( scalar() ). e) For c/d SetScalarRange just for the mapper. d) [-1,-1] take PolyData->GetScalarRange()",bool,""); + + BBTK_INPUT(PolyDataToActor,ScalarVisibilityOn_LookupTable,"LookupTable (need ScalarVisibility true)",vtkScalarsToColors*,""); + BBTK_INPUT(PolyDataToActor,ScalarVisibilityOn_NameColorArray,"Name of the array in PolyData (need ScalarVisibility true)",std::string,""); + BBTK_INPUT(PolyDataToActor,ScalarVisibilityOn_ScalarRange,"[min,max] Make ScalarRange independent from LookupTable (need ScalarVisibility true)", std::vector ,""); + BBTK_OUTPUT(PolyDataToActor,Out,"Extracted iso-surface",vtkProp3D *,""); BBTK_END_DESCRIBE_BLACK_BOX(PolyDataToActor);