1 /*=========================================================================
4 Module: $RCSfile: wxMaracasIRMViewManager.cxx,v $
6 Date: $Date: 2009/04/01 16:16:59 $
7 Version: $Revision: 1.1 $
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 =========================================================================*/
17 #include "wxMaracasIRMViewManager.h"
20 ** Start of the manager class
22 wxMaracasIRMViewManager::wxMaracasIRMViewManager(){
25 wxMaracasIRMViewManager::~wxMaracasIRMViewManager(){
29 ** Sets the renderer to manage the prop3D from the view
31 void wxMaracasIRMViewManager::setRenderer(vtkRenderer* renderer){
35 ** Adds a prop3D to the manager and returns the identifier
37 int wxMaracasIRMViewManager::addProp3D(vtkProp3D* prop3D){
39 prop3Dvect.push_back(prop3D);
42 _renderer->AddActor(prop3D);
44 throw "Imposible to add actor, check renderer";
48 return prop3Dvect.size()-1;
54 ** Changes the opacity in a prop3D
56 void wxMaracasIRMViewManager::changeOpacity(int propid, int value){
57 if(propid < prop3Dvect.size()){
58 vtkActor* actor = (vtkActor*)prop3Dvect[propid];
59 actor->GetProperty()->SetOpacity((double)value/100.0);
65 ** changes the isovalue in a prop3D
67 void wxMaracasIRMViewManager::changeIsoValue(int propid, int value){
68 if(propid<prop3Dvect.size()){
73 vtkProp3D* wxMaracasIRMViewManager:: getProp3D(std::string filename){
74 if(filename.compare("")!= 0){
75 vtkSTLReader *STLReader=vtkSTLReader::New();
76 STLReader->SetFileName(filename.c_str());
78 vtkPolyDataMapper* dataMapper = vtkPolyDataMapper::New();
79 dataMapper->SetInput(STLReader->GetOutput());
81 vtkActor* dataActor = vtkActor::New();
82 dataActor->SetMapper(dataMapper);
83 dataActor->GetProperty()->SetOpacity(1);