]> Creatis software - creaMaracasVisu.git/blob - lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h
addition of files
[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/06/28 16:56:13 $
7   Version:   $Revision: 1.1 $
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 class wxMaracasSurfaceRenderingManager  {
32
33 public:
34         wxMaracasSurfaceRenderingManager();
35         ~wxMaracasSurfaceRenderingManager();
36
37         /**
38         **      Sets the renderer to manage the prop3D from the surface render
39         **/
40         void setRenderer(vtkRenderer*  renderer);
41
42         /**
43         **      Gets the renderer which manages the prop3D from the surface render
44         **/
45         vtkRenderer* getRenderer();
46         
47         /**
48         ** Updates surface
49         **/
50         void Update(int pid)throw(char*);
51         
52         /**
53         **      Adds a prop3D to the manager and returns the identifier
54         **/
55         int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
56         /**
57         **      Adds a prop3D to the manager and returns the identifier
58         **/
59         int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
60         /**
61         **      Changes the opacity in a prop3D
62         **/
63         void changeOpacity(int propid, int value)throw(char*);
64
65         /**
66         **      changes the isovalue in a prop3D
67         **/
68         void changeIsoValue(int propid, double value);
69
70         void changeIsoValue(int propid, double min, double max );
71
72         /**
73         **      loads a prop3D from a nSTL file
74         **/
75         vtkProp3D* getProp3D(std::string filename);
76
77         /**
78         **      loads a MHD file to convert it into an actor
79         **/
80         vtkImageData* getImageData(std::string filename);
81
82         /**
83         ** Gets image data asotiated with the rendering manager
84         **/
85         vtkImageData* getImageData();
86
87         /**
88         **      adds or removes an actor depending of the bool value
89         **/
90         void addRemoveActor(int propid, bool addremove)throw(char*);
91         /**
92         **
93         **/
94         void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
95         /**
96         **      Check if the variables are setted correctly
97         **/
98
99         void checkInvariant()throw(char*);
100
101         /**
102         **      Given an id search the data in the vector
103         **/
104         wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
105
106         /**
107         **
108         **/
109         void setInteractor(vtkRenderWindowInteractor*  interactor);
110
111         /**
112         **      Given the id, return the max iso value from the imagedata
113         **/
114         int getMaxIsoValue(int propid)throw(char*);
115
116
117         /**
118         **      Changes the color of the actor
119         **/
120         void changeColor(int propid, double red, double green, double blue) throw(char*);
121
122         void deleteActor(int propid)throw (char *);
123
124         void Transform(vtkMatrix4x4* tmatrix);
125
126         bool interactorSet();
127
128
129         void enableBoundingBox(int propid, bool enable);
130
131         void saveProp3DSTL(int propid,const char* filename);
132         
133 private:        
134         std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
135
136         vtkRenderer*  _renderer;
137         vtkRenderWindowInteractor*  _interactor;
138         vtkImageData* image;
139
140         int _idCount;
141
142         
143
144         
145 };
146
147 #endif