]> Creatis software - creaMaracasVisu.git/blob - lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h
ad0ba5f372df05978f7edbf96078bf974e26edb2
[creaMaracasVisu.git] / lib / Kernel / VTKObjects / VolumeRenderer / volumerenderermanagerdata.h
1
2 #ifndef VolumeRendererManagerData_H_
3 #define VolumeRendererManagerData_H_
4
5 #include <vtkVolumeRayCastCompositeFunction.h>
6 #include <vtkPlanes.h>
7 #include <vtkVolumeRayCastMapper.h>
8 #include <vtkVolumeProperty.h>
9 #include <vtkVolume.h>
10 #include <vtkPiecewiseFunction.h>
11 #include <vtkColorTransferFunction.h>
12 #include <vtkImageData.h>
13 #include <vtkProp3D.h>
14 #include <vtkRenderer.h>
15 #include <vtkVolumeRayCastMIPFunction.h>
16 #include <vtkLookupTable.h>
17 #include <vector>
18
19
20 class VolumeRendererManagerData  {
21
22 public:
23         VolumeRendererManagerData(vtkImageData* vol, std::string dataname="");
24         VolumeRendererManagerData(vtkImageData* vol, vtkRenderer* render, std::string dataname="");
25         ~VolumeRendererManagerData();
26
27         /**
28         **      Check if the variables are setted correctly
29         **/
30         void checkInvariant()throw (char *);
31
32         /**
33         ** Updates volume
34         **/
35         void Update();
36
37         /**
38         **      get the prop3D
39         **/
40         vtkProp3D* getProp3D();
41
42         /**
43         **      return the id from the daat
44         **/
45         int getId();
46
47         /**
48         **      set data id
49         **/
50         void setId(int propid);
51
52         /**
53         **      Get the filanme
54         **/
55     std::string getDataname();
56
57         /**
58         ** Set the filanme
59         **/
60     void setDataname(std::string dataname);
61
62         /**
63         **      Set Volume Color
64         **/
65         void setVolumeColor(std::vector<double>& greylevel,
66                                                                         std::vector<double>& red,
67                                                                         std::vector<double>& green,
68                                                                         std::vector<double>& blue);
69
70         /**
71         **      Volume Opacity
72         **/
73         void setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value);
74
75         vtkPiecewiseFunction* GetTransferFunction(){
76                 return _tfun;
77         }
78
79         vtkColorTransferFunction* GetColorFunction(){
80                 return _ctfun;
81         }
82
83         void changeCompositeMIPFunction(int function) throw (char *);
84
85         void SetLookupTable(vtkLookupTable* lookuptable);
86
87 protected:
88         /**
89          * Prop 3D (data actor)
90          */
91         vtkImageData* _vol;
92         /**
93          *  Dataname given by the user (ex. filename)
94          **/
95         std::string _dataname;
96
97
98 private:
99
100         /*
101          * id of the data
102          */
103         int _id;
104
105         vtkVolumeRayCastCompositeFunction       *_compositeFunction;
106         vtkPlanes                                                       *_volumePlanes;
107         vtkVolumeRayCastMapper                          *_volumeMapper;
108         vtkVolumeProperty                                       *_volumeProperty;
109         vtkVolume                                                       *_newvol;
110         vtkPiecewiseFunction* _tfun;
111         vtkColorTransferFunction* _ctfun;
112         vtkVolumeRayCastMIPFunction* _MIPFunction;
113
114         void Initialize(vtkImageData* vol, std::string dataname);
115
116
117 };
118
119 #endif /*VolumeRendererManagerData_H_*/