1 /*=========================================================================
4 Module: $RCSfile: wxMaracasSurfaceRenderingManager.h,v $
6 Date: $Date: 2011/10/05 16:26:55 $
7 Version: $Revision: 1.2 $
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*);
59 ** Adds a prop3D to the manager and returns the identifier
61 int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
63 ** Changes the opacity in a prop3D
65 void changeOpacity(int propid, int value)throw(char*);
68 ** changes the isovalue in a prop3D
70 void changeIsoValue(int propid, double value);
72 void changeIsoValue(int propid, double min, double max );
75 ** loads a prop3D from a nSTL file
77 vtkProp3D* getProp3D(std::string filename);
80 ** loads a MHD file to convert it into an actor
82 vtkImageData* getImageData(std::string filename);
85 ** Gets image data asotiated with the rendering manager
87 vtkImageData* getImageData();
89 virtual void setImageData(vtkImageData* img);
92 ** adds or removes an actor depending of the bool value
94 void addRemoveActor(int propid, bool addremove)throw(char*);
98 void addRemoveSurfaceBox(int propid, bool addremove) throw(char*);
100 ** Check if the variables are setted correctly
103 void checkInvariant()throw(char*);
106 ** Given an id search the data in the vector
108 wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
113 void setInteractor(vtkRenderWindowInteractor* interactor);
116 ** Given the id, return the max iso value from the imagedata
118 int getMaxIsoValue(int propid)throw(char*);
122 ** Changes the color of the actor
124 void changeColor(int propid, double red, double green, double blue) throw(char*);
126 void deleteActor(int propid)throw (char *);
128 void Transform(vtkMatrix4x4* tmatrix);
130 bool interactorSet();
133 void enableBoundingBox(int propid, bool enable);
135 void saveProp3DSTL(int propid,const char* filename);
137 void loadProp3DSTL(const char* filename);
142 std::vector<wxMaracasSurfaceRenderingManagerData*> prop3Dvect;
144 vtkRenderer* _renderer;
145 vtkRenderWindowInteractor* _interactor;