]> Creatis software - creaMaracasVisu.git/blob - lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h
changes in qt for volume rendering with gpu support, if you are working with volume...
[creaMaracasVisu.git] / lib / GUI / Base / SurfaceRenderer / wxMaracasSurfaceRenderingManager.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
5   Language:  C++
6   Date:      $Date: 2011/10/05 16:26:55 $
7   Version:   $Revision: 1.2 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17
18
19
20
21 #ifndef __wxMaracasSurfaceRenderingManagerH__
22 #define __wxMaracasSurfaceRenderingManagerH__
23
24 #include <iostream>
25 #include <vector>
26 #include <vtkMatrix4x4.h>
27
28 #include "wxMaracasSurfaceRenderingManagerData.h"
29
30
31
32
33 class wxMaracasSurfaceRenderingManager  {
34
35 public:
36         wxMaracasSurfaceRenderingManager();
37         ~wxMaracasSurfaceRenderingManager();
38
39         /**
40         **      Sets the renderer to manage the prop3D from the surface render
41         **/
42         void setRenderer(vtkRenderer*  renderer);
43
44         /**
45         **      Gets the renderer which manages the prop3D from the surface render
46         **/
47         vtkRenderer* getRenderer();
48         
49         /**
50         ** Updates surface
51         **/
52         void Update(int pid)throw(char*);
53         
54         /**
55         **      Adds a prop3D to the manager and returns the identifier
56         **/
57         int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
58         /**
59         **      Adds a prop3D to the manager and returns the identifier
60         **/
61         int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
62         /**
63         **      Changes the opacity in a prop3D
64         **/
65         void changeOpacity(int propid, int value)throw(char*);
66
67         /**
68         **      changes the isovalue in a prop3D
69         **/
70         void changeIsoValue(int propid, double value);
71
72         void changeIsoValue(int propid, double min, double max );
73
74         /**
75         **      loads a prop3D from a nSTL file
76         **/
77         vtkProp3D* getProp3D(std::string filename);
78
79         /**
80         **      loads a MHD file to convert it into an actor
81         **/
82         vtkImageData* getImageData(std::string filename);
83
84         /**
85         ** Gets image data asotiated with the rendering manager
86         **/
87         vtkImageData* getImageData();
88
89         virtual void setImageData(vtkImageData* img);
90
91         /**
92         **      adds or removes an actor depending of the bool value
93         **/
94         void addRemoveActor(int propid, bool addremove)throw(char*);
95         /**
96         **
97         **/
98         void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
99         /**
100         **      Check if the variables are setted correctly
101         **/
102
103         void checkInvariant()throw(char*);
104
105         /**
106         **      Given an id search the data in the vector
107         **/
108         wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
109
110         /**
111         **
112         **/
113         void setInteractor(vtkRenderWindowInteractor*  interactor);
114
115         /**
116         **      Given the id, return the max iso value from the imagedata
117         **/
118         int getMaxIsoValue(int propid)throw(char*);
119
120
121         /**
122         **      Changes the color of the actor
123         **/
124         void changeColor(int propid, double red, double green, double blue) throw(char*);
125
126         void deleteActor(int propid)throw (char *);
127
128         void Transform(vtkMatrix4x4* tmatrix);
129
130         bool interactorSet();
131
132
133         void enableBoundingBox(int propid, bool enable);
134
135         void saveProp3DSTL(int propid,const char* filename);
136
137         void loadProp3DSTL(const char* filename);
138
139
140         
141 private:        
142         std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
143
144         vtkRenderer*  _renderer;
145         vtkRenderWindowInteractor*  _interactor;
146         vtkImageData* image;
147
148         int _idCount;
149
150         
151
152         
153 };
154
155 #endif