]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManagerData.cxx
addition of surface rendering, qt support
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSurfaceRenderingManagerData.cxx
1
2 #include "wxMaracasSurfaceRenderingManagerData.h"
3
4 /********************************************************************************************
5 ** Start of data viewmanagerData
6 *********************************************************************************************/
7
8 wxMaracasSurfaceRenderingManagerData::wxMaracasSurfaceRenderingManagerData(vtkProp3D* prop3Dvect, std::string dataname, vtkRenderWindowInteractor*  interactor){
9
10         _prop3D = prop3Dvect;   
11         _dataname = dataname;   
12         _boxWidgetS1=NULL;
13         
14         initializeBoxWidget(interactor);
15         
16
17         
18
19         /*_boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(0) );
20         _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(1) );
21         _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(2) );
22         _boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(3) );*/
23 }
24
25
26 wxMaracasSurfaceRenderingManagerData::~wxMaracasSurfaceRenderingManagerData(){
27         
28         _prop3D->Delete();      
29         if (_boxWidgetS1!=NULL)                                  { _boxWidgetS1         -> Delete();                                    }
30 }
31
32 void wxMaracasSurfaceRenderingManagerData::initializeBoxWidget(vtkRenderWindowInteractor*  interactor){
33         if(interactor!= NULL){
34         
35         }
36 }
37
38 /**
39 **      Adds a prop3D to the world of the application
40 **/
41 void wxMaracasSurfaceRenderingManagerData::setProp3D(vtkProp3D* prop3D){
42         _prop3D = prop3D;
43 }
44
45 void wxMaracasSurfaceRenderingManagerData::addRemoveSurfaceBox(bool visible)
46 {
47         if(_boxWidgetS1){
48                 if (visible==true){
49                         _boxWidgetS1->On();
50                 } else {
51                         _boxWidgetS1->Off();
52                 }
53         }
54 }
55 /**
56 **      Changes the opacity in a prop3D
57 **/
58 void wxMaracasSurfaceRenderingManagerData::changeOpacity(int value){
59         std::cout<<"chage op"<<value<<std::endl;
60         vtkActor* actor = (vtkActor*)this->_prop3D;     
61         actor->GetProperty()->SetOpacity((double)value/100.0);
62
63         
64
65 }
66 void wxMaracasSurfaceRenderingManagerData::changeColor(double red, double green, double blue){
67         std::cout<<"chage col"<<red<<green<<blue<<std::endl;
68     vtkActor* actor = (vtkActor*)this->_prop3D; 
69         actor->GetProperty()->SetColor(red,green,blue); 
70 }
71 /**
72 **      Check if the variables are setted correctly
73 **/
74 void wxMaracasSurfaceRenderingManagerData::checkInvariant(){
75
76 }
77 /**
78 **      get the prop3D 
79 **/
80 vtkProp3D* wxMaracasSurfaceRenderingManagerData::getProp3D(){
81         return this->_prop3D;
82 }
83 /**
84 **      return the id from the daat
85 **/
86 int wxMaracasSurfaceRenderingManagerData::getId(){
87         return _id;
88 }
89 /**
90 **      set data id
91 **/
92 void wxMaracasSurfaceRenderingManagerData::setId(int propid){
93         _id = propid;
94 }
95
96 /**
97 **      Get the filanme
98 **/
99 std::string wxMaracasSurfaceRenderingManagerData::getDataname(){
100         return _dataname;
101 }
102 /**
103 ** Set the filanme
104 **/
105 void wxMaracasSurfaceRenderingManagerData::setDataname(std::string dataname){
106         _dataname = dataname;
107 }
108