]> Creatis software - creaMaracasVisu.git/blob - lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h
72a912496969cc2cdbf01d4d3bc14ce46add8227
[creaMaracasVisu.git] / lib / Kernel / VTKObjects / VolumeRenderer / volumerenderermanager.h
1
2 /*=========================================================================
3
4   Program:   wxMaracas
5   Module:    $RCSfile: volumerenderermanager.h,v $
6   Language:  C++
7   Date:      $Date: 2011/05/31 19:03:03 $
8   Version:   $Revision: 1.1 $
9
10   Copyright: (c) 2002, 2003
11   License:
12
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18
19
20
21
22 #ifndef __VolumeRendererManagerH__
23 #define __VolumeRendererManagerH__
24
25 #include <iostream>
26 #include <vector>
27 #include <vtkMatrix4x4.h>
28
29 #include "volumerenderermanagerdata.h"
30
31
32 class VolumeRendererManager  {
33
34 public:
35         VolumeRendererManager();
36         ~VolumeRendererManager();
37
38         /**
39         **      Sets the renderer to manage the prop3D from the view
40         **/
41         void setRenderer(vtkRenderer*  renderer);
42
43         /**
44         **      Gets the renderer to manage the prop3D from the view
45         **/
46         vtkRenderer* getRenderer();
47
48         /**
49         **      Adds a volume
50         **/
51         int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*);
52
53         /**
54         **      loads a prop3D from a nSTL file
55         **/
56         vtkProp3D* getVolume(std::string filename);
57
58         /**
59         **      loads a MHD file to convert it into an actor
60         **/
61         vtkImageData* getImageData(std::string filename);
62
63         /**
64         ** Gets image data asotiated with the rendering manager
65         **/
66         vtkImageData* getImageData();
67
68         /**
69         **      adds or removes an actor depending of the bool value
70         **/
71         void addRemoveActor(int propid, bool addremove) throw(char*);
72
73         /**
74         **      Check if the variables are setted correctly
75         **/
76         void checkInvariant()throw(char*);
77
78         /**
79         ** Set Volume Opacity
80         **/
81         void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
82         /**
83         **      Set Volume Color
84         **/
85         void setVolumeColor(int volid, std::vector<double> greylevel,
86                                                                         std::vector<double> red,
87                                                                         std::vector<double> green,
88                                                                         std::vector<double> blue)throw(char*);
89
90         /**
91         ** Given an id search the data in the vector
92         **/
93         VolumeRendererManagerData* getViewData(int id)throw(char*);
94
95         void changeCompositeMIPFunction(int id, int function) throw (char *);
96
97         /**
98         ** Deletes given actor
99         **/
100         void deleteActor(int volumeid)throw (char *);
101
102         /**
103         ** Updates given volume
104         **/
105         void Update(int propid);
106
107         vtkPiecewiseFunction* GetTransferFunction(int volumeid);
108         vtkColorTransferFunction* GetColorFunction(int volumeid);
109 private:
110         std::vector<VolumeRendererManagerData*> prop3Dvect;
111
112         vtkRenderer*  _renderer;
113         vtkImageData* image;
114
115         int _idCount;
116
117
118
119
120 };
121
122 #endif