1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
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)
29 #ifndef __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
30 #define __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__
31 #include "bbcreaMaracasVisu_EXPORT.h"
32 #include "bbtkAtomicBlackBox.h"
36 #include <vtkProp3D.h>
37 #include <vtkRenderer.h>
38 #include "vtkImageData.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"
51 class /*VTK_COMMON_EXPORT*/ vtkLookupTableEED : public vtkScalarsToColors
55 // Construct with range=[0,1]; and hsv ranges set up for rainbow color table
56 // (from red to blue).
57 static vtkLookupTableEED *New();
59 vtkTypeMacro(vtkLookupTableEED,vtkScalarsToColors);
60 void PrintSelf(ostream& os, vtkIndent indent);
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]); };
66 void SetTableRange(double r[2]);
67 virtual void SetTableRange(double min, double max);
68 vtkGetVectorMacro(TableRange,double,2);
70 unsigned char *MapValue(double v);
72 void GetColor(double x, double rgb[3]);
74 void MapScalarsThroughTable2(void *input, unsigned char *output,
75 int inputDataType, int numberOfValues,
76 int inputIncrement, int outputIncrement);
82 vtkLookupTableEED(int sze=256, int ext=256);
87 vtkLookupTableEED(const vtkLookupTableEED&); // Not implemented.
88 void operator=(const vtkLookupTableEED&); // Not implemented.
95 namespace bbcreaMaracasVisu
99 class bbcreaMaracasVisu_EXPORT TubeTreeFilter
101 public bbtk::AtomicBlackBox
103 BBTK_BLACK_BOX_INTERFACE(TubeTreeFilter,bbtk::AtomicBlackBox);
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)
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(lstRadioLaw , int);
114 BBTK_DECLARE_INPUT(Colour , std::vector<double>);
115 BBTK_DECLARE_INPUT(ColourLaw , int);
116 BBTK_DECLARE_INPUT(Transform , vtkLinearTransform *);
117 BBTK_DECLARE_INPUT(Opacity , double );
118 BBTK_DECLARE_INPUT(iTube , int );
119 BBTK_DECLARE_OUTPUT(OutTube,vtkProp3D *);
120 BBTK_PROCESS(Process);
124 std::vector<vtkActor*> vecVtkActors;
125 std::vector< vtkDoubleArray* > vecTubeRadiosArray;
127 void DrawOneTube(int iGeneral,int numPoints, int iTube);
128 void SetGraphicProperties();
129 void SetRadioTube(int iGeneral,int numPoints, int iTube);
133 // 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)
137 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TubeTreeFilter,bbtk::AtomicBlackBox);
138 BBTK_NAME("TubeTreeFilter");
139 BBTK_AUTHOR("Info-Dev");
140 BBTK_DESCRIPTION("vtk Tube Tree Filter");
141 BBTK_CATEGORY("actor");
143 BBTK_INPUT(TubeTreeFilter,Renderer,"Renderer",vtkRenderer*,"");
144 BBTK_INPUT(TubeTreeFilter,lstIndexs,"Indexs",std::vector<int>,"");
145 BBTK_INPUT(TubeTreeFilter,lstPointX,"lstPointX",std::vector<double>,"");
146 BBTK_INPUT(TubeTreeFilter,lstPointY,"lstPointY",std::vector<double>,"");
147 BBTK_INPUT(TubeTreeFilter,lstPointZ,"lstPointZ",std::vector<double>,"");
148 BBTK_INPUT(TubeTreeFilter,lstRadio,"lstRadio (default 1) ",std::vector<double>,"");
149 BBTK_INPUT(TubeTreeFilter,lstRadioLaw,"0(default) radio for all, 1 radio by segment, 2 radio by point",int,"");
150 BBTK_INPUT(TubeTreeFilter,Colour,"Colour",std::vector<double>,"");
151 BBTK_INPUT(TubeTreeFilter,ColourLaw,"ColorLaw 1(default) solid color, 2 color by segment, 3 color for each point",int,"");
152 BBTK_INPUT(TubeTreeFilter,Transform,"vtkTransform", vtkLinearTransform *,"");
153 BBTK_INPUT(TubeTreeFilter,iTube,"iTube",int,"");
154 BBTK_INPUT(TubeTreeFilter,Opacity,"Opacity",double,"");
156 BBTK_OUTPUT(TubeTreeFilter,OutTube,"Tube[iTube]",vtkProp3D *,"");
158 BBTK_END_DESCRIBE_BLACK_BOX(TubeTreeFilter);
160 // 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)
163 // EO namespace bbcreaMaracasVisu
165 #endif // __bbcreaMaracasVisuTubeTreeFilter_h_INCLUDED__