1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
31 Date: $Date: 2012/11/15 14:17:03 $
32 Version: $Revision: 1.4 $
34 Copyright: (c) 2002, 2003
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.
41 =========================================================================*/
46 #ifndef __wxMaracasSurfaceRenderingManagerH__
47 #define __wxMaracasSurfaceRenderingManagerH__
51 #include <vtkMatrix4x4.h>
53 #include "wxMaracasSurfaceRenderingManagerData.h"
58 class wxMaracasSurfaceRenderingManager {
61 wxMaracasSurfaceRenderingManager();
62 ~wxMaracasSurfaceRenderingManager();
65 ** Sets the renderer to manage the prop3D from the surface render
67 void setRenderer(vtkRenderer* renderer);
70 ** Gets the renderer which manages the prop3D from the surface render
72 vtkRenderer* getRenderer();
77 void Update(int pid)throw(char*);
80 ** Adds a prop3D to the manager and returns the identifier
82 int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
85 ** Adds a polydata and creates the prop3D (actor) to the manager and returns the identifier
87 int addProp3D(int idTP, std::string filename, std::string dataname = "");
90 ** Adds a prop3D to the manager and returns the identifier
92 int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
94 ** Changes the opacity in a prop3D
96 void changeOpacity(int propid, int value)throw(char*);
99 ** changes the isovalue in a prop3D
101 void changeIsoValue(int propid, double value);
103 void changeIsoValue(int propid, double min, double max );
106 ** loads a prop3D from a nSTL file
108 //vtkProp3D* getProp3D(std::string filename);
111 ** loads a MHD file to convert it into an actor
113 vtkImageData* getImageData(std::string filename);
116 ** Gets image data asotiated with the rendering manager
118 vtkImageData* getImageData();
120 virtual void setImageData(vtkImageData* img);
123 ** adds or removes an actor depending of the bool value
125 bool addRemoveActor(int propid, bool addremove)throw(char*);
129 void addRemoveSurfaceBox(int propid, bool addremove) throw(char*);
131 ** Check if the variables are setted correctly
134 void checkInvariant()throw(char*);
137 ** Given an id search the data in the vector
139 wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
144 void setInteractor(vtkRenderWindowInteractor* interactor);
147 ** Given the id, return the max iso value from the imagedata
149 int getMaxIsoValue(int propid)throw(char*);
153 ** Changes the color of the actor
155 void changeColor(int propid, double red, double green, double blue) throw(char*);
157 void deleteActor(int propid)throw (char *);
159 void Transform(vtkMatrix4x4* tmatrix);
161 bool interactorSet();
164 void enableBoundingBox(int propid, bool enable);
166 void saveProp3DSTL(int propid,const char* filename);
168 void loadProp3DSTL(const char* filename);
171 void exportImageStencil(int propid,const char* filename);
174 std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
176 vtkRenderer* _renderer;
177 vtkRenderWindowInteractor* _interactor;