]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h
f0a090e02fbc89fc7b6243fbfe767a33ec110f42
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuTubeTreeFilter.h
1 //=====
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //=====
4 #ifndef __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
5 #define __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
6 #include "bbcreaMaracasVisu_EXPORT.h"
7 #include "bbtkAtomicBlackBox.h"
8 #include "iostream"
9
10
11 #include <vtkProp3D.h>
12 #include <vtkRenderer.h>
13 #include "vtkImageData.h"
14 #include "vtkActor.h"
15 #include "vtkPolyData.h"
16 #include "vtkPolyDataMapper.h"
17 #include "vtkPoints.h"
18 #include "vtkCellArray.h"
19 #include "vtkProperty.h"
20 #include "vtkLinearTransform.h"
21 #include "vtkLookupTable.h"
22 #include "vtkScalarsToColors.h"
23
24
25
26 class /*VTK_COMMON_EXPORT*/ vtkLookupTableEED : public vtkScalarsToColors
27         {
28         public:
29                 // Description:
30                 // Construct with range=[0,1]; and hsv ranges set up for rainbow color table 
31                 // (from red to blue).
32                 static vtkLookupTableEED *New();
33                 
34                 vtkTypeMacro(vtkLookupTableEED,vtkScalarsToColors);
35                 void PrintSelf(ostream& os, vtkIndent indent);
36                 
37                 double *GetRange() { return this->GetTableRange(); };
38                 void SetRange(double min, double max) { this->SetTableRange(min, max); };
39                 void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); };
40                 
41                 void SetTableRange(double r[2]); 
42                 virtual void SetTableRange(double min, double max);
43                 vtkGetVectorMacro(TableRange,double,2);
44                 
45                 unsigned char *MapValue(double v);
46                 
47                 void GetColor(double x, double rgb[3]);
48                 
49                 void MapScalarsThroughTable2(void *input, unsigned char *output,
50                                                                          int inputDataType, int numberOfValues,
51                                                                          int inputIncrement, int outputIncrement);
52                 
53                 
54         protected:
55                 
56                 double TableRange[2];
57                 vtkLookupTableEED(int sze=256, int ext=256);
58                 ~vtkLookupTableEED();
59                 
60                 
61         private:
62                 vtkLookupTableEED(const vtkLookupTableEED&);  // Not implemented.
63                 void operator=(const vtkLookupTableEED&);  // Not implemented.
64 };
65
66
67
68
69
70 namespace bbcreaMaracasVisu
71 {
72         
73
74 class bbcreaMaracasVisu_EXPORT TubeTreeFilter
75  :
76    public bbtk::AtomicBlackBox
77 {
78   BBTK_BLACK_BOX_INTERFACE(TubeTreeFilter,bbtk::AtomicBlackBox);
79 //=====
80 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
81 //=====
82         BBTK_DECLARE_INPUT(Renderer     , vtkRenderer*);
83         BBTK_DECLARE_INPUT(lstIndexs    , std::vector<int>);
84         BBTK_DECLARE_INPUT(lstPointX    , std::vector<double>);
85         BBTK_DECLARE_INPUT(lstPointY    , std::vector<double>);
86         BBTK_DECLARE_INPUT(lstPointZ    , std::vector<double>);
87         BBTK_DECLARE_INPUT(lstRadio     , std::vector<double>);
88         BBTK_DECLARE_INPUT(Colour       , std::vector<double>);
89         BBTK_DECLARE_INPUT(ColourLaw    , int);
90         BBTK_DECLARE_INPUT(Transform    , vtkLinearTransform *);
91         BBTK_DECLARE_INPUT(Opacity      , double );
92         BBTK_DECLARE_INPUT(iTube        , int );
93         BBTK_DECLARE_OUTPUT(OutTube,vtkProp3D *);
94         BBTK_PROCESS(Process);
95   void Process();
96
97   private:
98         std::vector<vtkActor*>          vecVtkActors;
99         void DrawOneTube(int iGeneral,int numPoints, int iTube);
100         void SetGraphicProperties();
101     int oldLstSize;
102
103 //=====
104 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
105 //=====
106 };
107
108 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TubeTreeFilter,bbtk::AtomicBlackBox);
109         BBTK_NAME("TubeTreeFilter");
110         BBTK_AUTHOR("Info-Dev");
111         BBTK_DESCRIPTION("vtk Tube Tree Filter");
112         BBTK_CATEGORY("actor");
113
114         BBTK_INPUT(TubeTreeFilter,Renderer,"Renderer",vtkRenderer*,"");
115         BBTK_INPUT(TubeTreeFilter,lstIndexs,"Indexs",std::vector<int>,"");
116         BBTK_INPUT(TubeTreeFilter,lstPointX,"lstPointX",std::vector<double>,"");
117         BBTK_INPUT(TubeTreeFilter,lstPointY,"lstPointY",std::vector<double>,"");
118         BBTK_INPUT(TubeTreeFilter,lstPointZ,"lstPointZ",std::vector<double>,"");
119         BBTK_INPUT(TubeTreeFilter,lstRadio,"lstRadio",std::vector<double>,"");
120         BBTK_INPUT(TubeTreeFilter,Colour,"Colour",std::vector<double>,"");
121     BBTK_INPUT(TubeTreeFilter,ColourLaw,"ColorLaw 1(default) solid color, 2 color by segment, 3 color for each point",int,"");
122         BBTK_INPUT(TubeTreeFilter,Transform,"vtkTransform", vtkLinearTransform *,"");
123         BBTK_INPUT(TubeTreeFilter,iTube,"iTube",int,"");
124         BBTK_INPUT(TubeTreeFilter,Opacity,"Opacity",double,"");
125         BBTK_OUTPUT(TubeTreeFilter,OutTube,"Tube[iTube]",vtkProp3D *,"");
126
127
128
129 BBTK_END_DESCRIBE_BLACK_BOX(TubeTreeFilter);
130 //=====
131 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
132 //=====
133 }
134 // EO namespace bbcreaMaracasVisu
135
136 #endif // __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
137