]> Creatis software - creaMaracasVisu.git/blob - lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / GUI / Base / SurfaceRenderer / wxMaracasSurfaceRenderingManager.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:17:03 $
32   Version:   $Revision: 1.4 $
33
34   Copyright: (c) 2002, 2003
35   License:
36   
37      This software is distributed WITHOUT ANY WARRANTY; without even 
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42
43
44
45
46 #ifndef __wxMaracasSurfaceRenderingManagerH__
47 #define __wxMaracasSurfaceRenderingManagerH__
48
49 #include <iostream>
50 #include <vector>
51 #include <vtkMatrix4x4.h>
52
53 #include "wxMaracasSurfaceRenderingManagerData.h"
54
55
56
57
58 class wxMaracasSurfaceRenderingManager  {
59
60 public:
61         wxMaracasSurfaceRenderingManager();
62         ~wxMaracasSurfaceRenderingManager();
63
64         /**
65         **      Sets the renderer to manage the prop3D from the surface render
66         **/
67         void setRenderer(vtkRenderer*  renderer);
68
69         /**
70         **      Gets the renderer which manages the prop3D from the surface render
71         **/
72         vtkRenderer* getRenderer();
73         
74         /**
75         ** Updates surface
76         **/
77         void Update(int pid)throw(char*);
78         
79         /**
80         **      Adds a prop3D to the manager and returns the identifier
81         **/
82         int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
83
84         /**
85         **      Adds a polydata and creates the prop3D (actor) to the manager and returns the identifier
86         **/
87         int addProp3D(int idTP, std::string filename, std::string dataname = "");
88
89         /**
90         **      Adds a prop3D to the manager and returns the identifier
91         **/
92         int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
93         /**
94         **      Changes the opacity in a prop3D
95         **/
96         void changeOpacity(int propid, int value)throw(char*);
97
98         /**
99         **      changes the isovalue in a prop3D
100         **/
101         void changeIsoValue(int propid, double value);
102
103         void changeIsoValue(int propid, double min, double max );
104
105         /**
106         **      loads a prop3D from a nSTL file
107         **/
108         //vtkProp3D* getProp3D(std::string filename);
109
110         /**
111         **      loads a MHD file to convert it into an actor
112         **/
113         vtkImageData* getImageData(std::string filename);
114
115         /**
116         ** Gets image data asotiated with the rendering manager
117         **/
118         vtkImageData* getImageData();
119
120         virtual void setImageData(vtkImageData* img);
121
122         /**
123         **      adds or removes an actor depending of the bool value
124         **/
125         bool addRemoveActor(int propid, bool addremove)throw(char*);
126         /**
127         **
128         **/
129         void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
130         /**
131         **      Check if the variables are setted correctly
132         **/
133
134         void checkInvariant()throw(char*);
135
136         /**
137         **      Given an id search the data in the vector
138         **/
139         wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
140
141         /**
142         **
143         **/
144         void setInteractor(vtkRenderWindowInteractor*  interactor);
145
146         /**
147         **      Given the id, return the max iso value from the imagedata
148         **/
149         int getMaxIsoValue(int propid)throw(char*);
150
151
152         /**
153         **      Changes the color of the actor
154         **/
155         void changeColor(int propid, double red, double green, double blue) throw(char*);
156
157         void deleteActor(int propid)throw (char *);
158
159         void Transform(vtkMatrix4x4* tmatrix);
160
161         bool interactorSet();
162
163
164         void enableBoundingBox(int propid, bool enable);
165
166         void saveProp3DSTL(int propid,const char* filename);
167
168         void loadProp3DSTL(const char* filename);
169
170
171         void exportImageStencil(int propid,const char* filename);
172         
173 private:        
174         std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
175
176         vtkRenderer*  _renderer;
177         vtkRenderWindowInteractor*  _interactor;
178         vtkImageData* image;
179
180         int _idCount;
181
182         
183
184         
185 };
186
187 #endif