]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h
2d5ec1292f81742de12b1df9c7336b40dde1c028
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuTubeTreeFilter.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 //=====
27 // 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)
28 //=====
29 #ifndef __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
30 #define __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
31 #include "bbcreaMaracasVisu_EXPORT.h"
32 #include "bbtkAtomicBlackBox.h"
33 #include "iostream"
34
35
36 #include <vtkProp3D.h>
37 #include <vtkRenderer.h>
38 #include "vtkImageData.h"
39 #include "vtkActor.h"
40 #include "vtkPolyData.h"
41 #include "vtkPolyDataMapper.h"
42 #include "vtkPoints.h"
43 #include "vtkCellArray.h"
44 #include "vtkProperty.h"
45 #include "vtkLinearTransform.h"
46 #include "vtkLookupTable.h"
47 #include "vtkScalarsToColors.h"
48
49
50
51 class /*VTK_COMMON_EXPORT*/ vtkLookupTableEED : public vtkScalarsToColors
52         {
53         public:
54                 // Description:
55                 // Construct with range=[0,1]; and hsv ranges set up for rainbow color table 
56                 // (from red to blue).
57                 static vtkLookupTableEED *New();
58                 
59                 vtkTypeMacro(vtkLookupTableEED,vtkScalarsToColors);
60                 void PrintSelf(ostream& os, vtkIndent indent);
61                 
62                 double *GetRange() { return this->GetTableRange(); };
63                 void SetRange(double min, double max) { this->SetTableRange(min, max); };
64                 void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); };
65                 
66                 void SetTableRange(double r[2]); 
67                 virtual void SetTableRange(double min, double max);
68                 vtkGetVectorMacro(TableRange,double,2);
69                 
70                 unsigned char *MapValue(double v);
71                 
72                 void GetColor(double x, double rgb[3]);
73                 
74                 void MapScalarsThroughTable2(void *input, unsigned char *output,
75                                                                          int inputDataType, int numberOfValues,
76                                                                          int inputIncrement, int outputIncrement);
77                 
78                 
79         protected:
80                 
81                 double TableRange[2];
82                 vtkLookupTableEED(int sze=256, int ext=256);
83                 ~vtkLookupTableEED();
84                 
85                 
86         private:
87                 vtkLookupTableEED(const vtkLookupTableEED&);  // Not implemented.
88                 void operator=(const vtkLookupTableEED&);  // Not implemented.
89 };
90
91
92
93
94
95 namespace bbcreaMaracasVisu
96 {
97         
98
99 class bbcreaMaracasVisu_EXPORT TubeTreeFilter
100  :
101    public bbtk::AtomicBlackBox
102 {
103   BBTK_BLACK_BOX_INTERFACE(TubeTreeFilter,bbtk::AtomicBlackBox);
104 //=====
105 // 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)
106 //=====
107         BBTK_DECLARE_INPUT(Renderer     , vtkRenderer*);
108         BBTK_DECLARE_INPUT(lstIndexs    , std::vector<int>);
109         BBTK_DECLARE_INPUT(lstPointX    , std::vector<double>);
110         BBTK_DECLARE_INPUT(lstPointY    , std::vector<double>);
111         BBTK_DECLARE_INPUT(lstPointZ    , std::vector<double>);
112         BBTK_DECLARE_INPUT(lstRadio     , std::vector<double>);
113         BBTK_DECLARE_INPUT(Colour       , std::vector<double>);
114         BBTK_DECLARE_INPUT(ColourLaw    , int);
115         BBTK_DECLARE_INPUT(Transform    , vtkLinearTransform *);
116         BBTK_DECLARE_INPUT(Opacity      , double );
117         BBTK_DECLARE_INPUT(iTube        , int );
118         BBTK_DECLARE_OUTPUT(OutTube,vtkProp3D *);
119         BBTK_PROCESS(Process);
120   void Process();
121
122   private:
123         std::vector<vtkActor*>          vecVtkActors;
124         void DrawOneTube(int iGeneral,int numPoints, int iTube);
125         void SetGraphicProperties();
126     int oldLstSize;
127
128 //=====
129 // 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)
130 //=====
131 };
132
133 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TubeTreeFilter,bbtk::AtomicBlackBox);
134         BBTK_NAME("TubeTreeFilter");
135         BBTK_AUTHOR("Info-Dev");
136         BBTK_DESCRIPTION("vtk Tube Tree Filter");
137         BBTK_CATEGORY("actor");
138
139         BBTK_INPUT(TubeTreeFilter,Renderer,"Renderer",vtkRenderer*,"");
140         BBTK_INPUT(TubeTreeFilter,lstIndexs,"Indexs",std::vector<int>,"");
141         BBTK_INPUT(TubeTreeFilter,lstPointX,"lstPointX",std::vector<double>,"");
142         BBTK_INPUT(TubeTreeFilter,lstPointY,"lstPointY",std::vector<double>,"");
143         BBTK_INPUT(TubeTreeFilter,lstPointZ,"lstPointZ",std::vector<double>,"");
144         BBTK_INPUT(TubeTreeFilter,lstRadio,"lstRadio",std::vector<double>,"");
145         BBTK_INPUT(TubeTreeFilter,Colour,"Colour",std::vector<double>,"");
146     BBTK_INPUT(TubeTreeFilter,ColourLaw,"ColorLaw 1(default) solid color, 2 color by segment, 3 color for each point",int,"");
147         BBTK_INPUT(TubeTreeFilter,Transform,"vtkTransform", vtkLinearTransform *,"");
148         BBTK_INPUT(TubeTreeFilter,iTube,"iTube",int,"");
149         BBTK_INPUT(TubeTreeFilter,Opacity,"Opacity",double,"");
150         BBTK_OUTPUT(TubeTreeFilter,OutTube,"Tube[iTube]",vtkProp3D *,"");
151
152
153
154 BBTK_END_DESCRIBE_BLACK_BOX(TubeTreeFilter);
155 //=====
156 // 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)
157 //=====
158 }
159 // EO namespace bbcreaMaracasVisu
160
161 #endif // __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
162