]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkMagnitud.h
Clean code
[bbtk.git] / packages / vtk / src / bbvtkMagnitud.h
1 /*
2  # ---------------------------------------------------------------------
3  #
4  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5  #                        pour la SantÈ)
6  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9  #
10  #  This software is governed by the CeCILL-B license under French law and
11  #  abiding by the rules of distribution of free software. You can  use,
12  #  modify and/ or redistribute the software under the terms of the CeCILL-B
13  #  license as circulated by CEA, CNRS and INRIA at the following URL
14  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15  #  or in the file LICENSE.txt.
16  #
17  #  As a counterpart to the access to the source code and  rights to copy,
18  #  modify and redistribute granted by the license, users are provided only
19  #  with a limited warranty  and the software's author,  the holder of the
20  #  economic rights,  and the successive licensors  have only  limited
21  #  liability.
22  #
23  #  The fact that you are presently reading this means that you have had
24  #  knowledge of the CeCILL-B license and that you accept its terms.
25  # ------------------------------------------------------------------------ */
26
27
28 //=====
29 // 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)
30 //===== 
31 #ifndef __bbvtkMagnitud_h_INCLUDED__
32 #define __bbvtkMagnitud_h_INCLUDED__
33 #include "bbvtk_EXPORT.h"
34 #include "bbtkAtomicBlackBox.h"
35 #include "iostream"
36
37 // ----------[
38 #include "vtkActor.h"
39 #include "vtkAppendPolyData.h"
40 #include "vtkArrowSource.h"
41 #include "vtkContourFilter.h"
42 #include "vtkDiskSource.h"
43 #include "vtkGlyph3D.h"
44 #include "vtkImageData.h"
45 #include "vtkImageExport.h"
46 #include "vtkLookupTable.h"
47 #include "vtkMaskPoints.h"
48 #include "vtkOutlineFilter.h"
49 #include "vtkPlaneWidget.h"
50 #include "vtkPlaneSource.h"
51 #include "vtkPointSource.h"
52 #include "vtkPointWidget.h"
53 #include "vtkPolyData.h"
54 #include "vtkPolyDataMapper.h"
55 #include "vtkProbeFilter.h"
56 #include "vtkProp3D.h"
57 #include "vtkProperty.h"
58 #include "vtkProperty2D.h"
59 #include "vtkRenderWindowInteractor.h"
60 #include "vtkScalarBarActor.h"
61 #include "vtkStreamTracer.h"
62 #include "vtkTransform.h"
63 #include "vtkTransformPolyDataFilter.h"
64 #include "vtkTubeFilter.h"
65 #include "vtkVectorNorm.h"
66
67 #define SIZEPLANWIDGET 64
68 // ----------]
69
70 namespace bbvtk
71 {
72
73 class bbvtk_EXPORT Magnitud
74  : 
75    public bbtk::AtomicBlackBox
76 {
77   BBTK_BLACK_BOX_INTERFACE(Magnitud,bbtk::AtomicBlackBox);
78 //===== 
79 // 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)
80 //===== 
81
82 // -------------- [
83    BBTK_DECLARE_INPUT(In,vtkImageData*);
84    BBTK_DECLARE_INPUT(MoveX,double);
85    BBTK_DECLARE_INPUT(MoveY,double);
86    BBTK_DECLARE_INPUT(MoveZ,double);
87    BBTK_DECLARE_INPUT(ValSup,double);
88    BBTK_DECLARE_INPUT(ValInf,double);
89    BBTK_DECLARE_INPUT(MRatio,int);
90    BBTK_DECLARE_INPUT(Opactity,double);
91    BBTK_DECLARE_INPUT(Scale,double);
92    BBTK_DECLARE_INPUT(Contour,int);
93    BBTK_DECLARE_INPUT(ShowPlane,int);
94    BBTK_DECLARE_INPUT(ShowStream,int);
95    BBTK_DECLARE_INPUT(PlaneCenterSL,std::vector<double>);
96
97    BBTK_DECLARE_OUTPUT(Out1,vtkProp3D*);
98    BBTK_DECLARE_OUTPUT(Out2,vtkProp3D*);
99    BBTK_DECLARE_OUTPUT(Out3,vtkProp3D*);
100    BBTK_DECLARE_OUTPUT(Out4,vtkProp3D*);
101    //BBTK_DECLARE_OUTPUT(Out5,vtkProp*);
102    BBTK_DECLARE_OUTPUT(Out5,vtkProp3D*);
103    //BBTK_DECLARE_OUTPUT(OutExport,vtkImageExport*);
104    //BBTK_DECLARE_OUTPUT(OutTest,vtkImageData*);
105 // -------------- ]
106
107   BBTK_PROCESS(Process);
108   void Process();
109 //===== 
110 // 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)
111 //===== 
112 // -------------- [
113    vtkImageData                                 *temp;
114    std::vector<double>                  tempc;
115
116    int                                                  sizeIma;
117    long                                                 int index;
118    double                                               p0[3], p1[3],p2[3], n[3], c[3], slCenter[3];
119    double                                               range[2];
120    double                                               range1[2];
121    double                                               step;
122    double                                               h;
123    double                                               nx;
124    double                                               ny;
125    double                                               nz;
126    double                                               alfa;
127    double                                               beta;
128    double                                               dRangeColorForGlyphVelocity[2];
129    double                                               dRangeColorForMultipleContourVelocity[2];
130    double                                               dRangeColorForGlyphVelocityForFlowPlane[2];
131
132    int                                                  Ratio;
133    double                                               dOpactity;
134    double                                               dScale;
135    int                                                  nContour;
136    bool                                                 bShow;
137    
138    vtkActor                                             *vGlyphActor;
139    vtkActor                                             *vMultipleContourActor;
140    vtkActor                                             *vOutlineActor;
141    vtkActor                                             *vSliceActor;
142    vtkActor                                             *vStreamlineActor2;
143    vtkAppendPolyData                    *vAppendDataForFlowWidgetVisualisation;
144    vtkArrowSource                               *cone;
145    vtkArrowSource                               *vArrowSource;
146    vtkContourFilter                             *vMultipleContourVelocity;
147    vtkDiskSource                                *vDiskSourceEED;
148    vtkGlyph3D                                   *vGlyph;
149    vtkGlyph3D                                   *vGlyphFlowPlane;
150    vtkImageExport                               *exporter;
151    vtkLookupTable                               *vGreenToRedLut;
152    vtkMaskPoints                                *vMaskPoint;
153    vtkPlaneSource                               *vPlanSource;
154    vtkProbeFilter                               *vProbeslices;
155    vtkProbeFilter                               *vProbeslicesFlowWidget;
156    vtkPlaneWidget                               *vPlaneWidget;
157    vtkPolyData                                  *point;
158    vtkPolyDataMapper                    *vSliceMapper;
159    vtkPointSource                               *source;
160    vtkPointWidget                               *vPointWidget;
161    vtkPolyDataMapper                    *vGlyphMapper;
162    vtkPolyDataMapper                    *vMultipleContourMapper;
163    vtkOutlineFilter                             *vOutlineGrid;
164    vtkPolyDataMapper                    *vOutlineMapper;
165    vtkPolyDataMapper                    *streamMapper2;
166    vtkRenderWindowInteractor    *vIren;
167    vtkScalarBarActor                    *vScalarBarActor;
168    vtkStreamTracer                              *streamer;
169    vtkTransform                                 *transformEED;
170    vtkTransformPolyDataFilter   *vtransformpolydatafilter;
171    vtkTubeFilter                                *rf;
172    vtkVectorNorm                                *vVecMagnitude;
173 // -------------- ]
174
175 };
176
177 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Magnitud,bbtk::AtomicBlackBox);
178 BBTK_NAME("Magnitud");
179 BBTK_AUTHOR("seba-tor@uniandes.edu.co");
180 BBTK_DESCRIPTION("Receive an ImgaData and generates an Actor. 'EED this box habe to be splited in 5 box'");
181 BBTK_CATEGORY("");
182 // -------------- [
183   BBTK_INPUT(Magnitud,In,"Receive the image source",vtkImageData*, "");
184   BBTK_INPUT(Magnitud,MoveX,"Move the PlaneSource - X Axis",double, "");
185   BBTK_INPUT(Magnitud,MoveY,"Move the PlaneSource - Y Axis",double, "");
186   BBTK_INPUT(Magnitud,MoveZ,"Move the PlaneSource - Z Axis",double, "");
187   BBTK_INPUT(Magnitud,ValSup,"Set the Superior Range of the Colour Range: [0% - 100%]",double, "");
188   BBTK_INPUT(Magnitud,ValInf,"Set the Inferior Range of the Colour Range: [0% - 100%]",double, "");
189   BBTK_INPUT(Magnitud,MRatio,"Set the Radio of the Mask",int, "");
190   BBTK_INPUT(Magnitud,Opactity,"Set the Opacity of the Glyph",double, "");
191   BBTK_INPUT(Magnitud,Scale,"Set the Scale of the Glyph",double, "");
192   BBTK_INPUT(Magnitud,Contour,"Set the Contour Number",int, "");
193   BBTK_INPUT(Magnitud,ShowPlane,"Show the PlaneWidget",int, "");
194   BBTK_INPUT(Magnitud,ShowStream,"Show the Stream Lines",int, "");
195   BBTK_INPUT(Magnitud,PlaneCenterSL,"Center for the Stream Lines",std::vector<double>, "");
196
197   BBTK_OUTPUT(Magnitud,Out1,"Actor1 3D - SliceActor",vtkProp3D*, "");
198   BBTK_OUTPUT(Magnitud,Out2,"Actor2 3D - GlyphActor",vtkProp3D*, "");
199   BBTK_OUTPUT(Magnitud,Out3,"Actor3 3D - OutlineActor",vtkProp3D*, "");
200   BBTK_OUTPUT(Magnitud,Out4,"Actor4 3D - MultipleContourActor",vtkProp3D*, "");
201   //BBTK_OUTPUT(Magnitud,Out5,"Actor5 2D - ScalarBarActor",vtkProp*, "");
202   BBTK_OUTPUT(Magnitud,Out5,"Actor5 3D - SteamlineActor",vtkProp3D*, "");
203   //BBTK_OUTPUT(Magnitud,OutExport,"Exports the Contour Image",vtkImageExport*, "");
204   //BBTK_OUTPUT(Magnitud,OutTest,"Test",vtkImageData*, "");
205 // -------------- ]
206 BBTK_END_DESCRIBE_BLACK_BOX(Magnitud);
207 //===== 
208 // 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)
209 //===== 
210 }
211 // EO namespace bbvtk
212
213 #endif // __bbvtkMagnitud_h_INCLUDED__
214