]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManager.h
addition of surface rendering, qt support
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSurfaceRenderingManager.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
5   Language:  C++
6   Date:      $Date: 2010/01/21 13:54:15 $
7   Version:   $Revision: 1.5 $
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)throw(char*);
69
70         /**
71         **      loads a prop3D from a nSTL file
72         **/
73         vtkProp3D* getProp3D(std::string filename);
74
75         /**
76         **      loads a MHD file to convert it into an actor
77         **/
78         vtkImageData* getImageData(std::string filename);
79
80         /**
81         ** Gets image data asotiated with the rendering manager
82         **/
83         vtkImageData* getImageData();
84
85         /**
86         **      adds or removes an actor depending of the bool value
87         **/
88         void addRemoveActor(int propid, bool addremove)throw(char*);
89         /**
90         **
91         **/
92         void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
93         /**
94         **      Check if the variables are setted correctly
95         **/
96
97         void checkInvariant()throw(char*);
98
99         /**
100         **      Given an id search the data in the vector
101         **/
102         wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
103
104         /**
105         **
106         **/
107         void setInteractor(vtkRenderWindowInteractor*  interactor);
108
109         /**
110         **      Given the id, return the max iso value from the imagedata
111         **/
112         int getMaxIsoValue(int propid)throw(char*);
113
114
115         /**
116         **      Changes the color of the actor
117         **/
118         void changeColor(int propid, double red, double green, double blue) throw(char*);
119
120         void deleteActor(int propid)throw (char *);
121
122         void Transform(vtkMatrix4x4* tmatrix);
123
124         bool interactorSet();
125         
126 private:        
127         std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
128
129         vtkRenderer*  _renderer;
130         vtkRenderWindowInteractor*  _interactor;
131         vtkImageData* image;
132
133         int _idCount;
134
135         
136
137         
138 };
139
140 #endif