]> Creatis software - creaMaracasVisu.git/blob - lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h
addition of image stencil to surface rendering
[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: 2012/05/11 11:46:37 $
7   Version:   $Revision: 1.3 $
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         /**
60         **      Adds a polydata and creates the prop3D (actor) to the manager and returns the identifier
61         **/
62         int addProp3D(int idTP, std::string filename, std::string dataname = "");
63
64         /**
65         **      Adds a prop3D to the manager and returns the identifier
66         **/
67         int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
68         /**
69         **      Changes the opacity in a prop3D
70         **/
71         void changeOpacity(int propid, int value)throw(char*);
72
73         /**
74         **      changes the isovalue in a prop3D
75         **/
76         void changeIsoValue(int propid, double value);
77
78         void changeIsoValue(int propid, double min, double max );
79
80         /**
81         **      loads a prop3D from a nSTL file
82         **/
83         //vtkProp3D* getProp3D(std::string filename);
84
85         /**
86         **      loads a MHD file to convert it into an actor
87         **/
88         vtkImageData* getImageData(std::string filename);
89
90         /**
91         ** Gets image data asotiated with the rendering manager
92         **/
93         vtkImageData* getImageData();
94
95         virtual void setImageData(vtkImageData* img);
96
97         /**
98         **      adds or removes an actor depending of the bool value
99         **/
100         bool addRemoveActor(int propid, bool addremove)throw(char*);
101         /**
102         **
103         **/
104         void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
105         /**
106         **      Check if the variables are setted correctly
107         **/
108
109         void checkInvariant()throw(char*);
110
111         /**
112         **      Given an id search the data in the vector
113         **/
114         wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
115
116         /**
117         **
118         **/
119         void setInteractor(vtkRenderWindowInteractor*  interactor);
120
121         /**
122         **      Given the id, return the max iso value from the imagedata
123         **/
124         int getMaxIsoValue(int propid)throw(char*);
125
126
127         /**
128         **      Changes the color of the actor
129         **/
130         void changeColor(int propid, double red, double green, double blue) throw(char*);
131
132         void deleteActor(int propid)throw (char *);
133
134         void Transform(vtkMatrix4x4* tmatrix);
135
136         bool interactorSet();
137
138
139         void enableBoundingBox(int propid, bool enable);
140
141         void saveProp3DSTL(int propid,const char* filename);
142
143         void loadProp3DSTL(const char* filename);
144
145
146         void exportImageStencil(int propid,const char* filename);
147         
148 private:        
149         std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
150
151         vtkRenderer*  _renderer;
152         vtkRenderWindowInteractor*  _interactor;
153         vtkImageData* image;
154
155         int _idCount;
156
157         
158
159         
160 };
161
162 #endif