1 /*=========================================================================
4 Module: $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
6 Date: $Date: 2012/05/11 11:46:37 $
7 Version: $Revision: 1.3 $
9 Copyright: (c) 2002, 2003
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.
16 =========================================================================*/
21 #ifndef __wxMaracasSurfaceRenderingManagerH__
22 #define __wxMaracasSurfaceRenderingManagerH__
26 #include <vtkMatrix4x4.h>
28 #include "wxMaracasSurfaceRenderingManagerData.h"
33 class wxMaracasSurfaceRenderingManager {
36 wxMaracasSurfaceRenderingManager();
37 ~wxMaracasSurfaceRenderingManager();
40 ** Sets the renderer to manage the prop3D from the surface render
42 void setRenderer(vtkRenderer* renderer);
45 ** Gets the renderer which manages the prop3D from the surface render
47 vtkRenderer* getRenderer();
52 void Update(int pid)throw(char*);
55 ** Adds a prop3D to the manager and returns the identifier
57 int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
60 ** Adds a polydata and creates the prop3D (actor) to the manager and returns the identifier
62 int addProp3D(int idTP, std::string filename, std::string dataname = "");
65 ** Adds a prop3D to the manager and returns the identifier
67 int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
69 ** Changes the opacity in a prop3D
71 void changeOpacity(int propid, int value)throw(char*);
74 ** changes the isovalue in a prop3D
76 void changeIsoValue(int propid, double value);
78 void changeIsoValue(int propid, double min, double max );
81 ** loads a prop3D from a nSTL file
83 //vtkProp3D* getProp3D(std::string filename);
86 ** loads a MHD file to convert it into an actor
88 vtkImageData* getImageData(std::string filename);
91 ** Gets image data asotiated with the rendering manager
93 vtkImageData* getImageData();
95 virtual void setImageData(vtkImageData* img);
98 ** adds or removes an actor depending of the bool value
100 bool addRemoveActor(int propid, bool addremove)throw(char*);
104 void addRemoveSurfaceBox(int propid, bool addremove) throw(char*);
106 ** Check if the variables are setted correctly
109 void checkInvariant()throw(char*);
112 ** Given an id search the data in the vector
114 wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
119 void setInteractor(vtkRenderWindowInteractor* interactor);
122 ** Given the id, return the max iso value from the imagedata
124 int getMaxIsoValue(int propid)throw(char*);
128 ** Changes the color of the actor
130 void changeColor(int propid, double red, double green, double blue) throw(char*);
132 void deleteActor(int propid)throw (char *);
134 void Transform(vtkMatrix4x4* tmatrix);
136 bool interactorSet();
139 void enableBoundingBox(int propid, bool enable);
141 void saveProp3DSTL(int propid,const char* filename);
143 void loadProp3DSTL(const char* filename);
146 void exportImageStencil(int propid,const char* filename);
149 std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
151 vtkRenderer* _renderer;
152 vtkRenderWindowInteractor* _interactor;