1 #include "manualViewPoints.h"
3 // ----------------------------------------------------------------------------
4 manualViewPoints::manualViewPoints()
8 // ----------------------------------------------------------------------------
9 manualViewPoints::~manualViewPoints()
11 int i,size=_copyViewPoints.size();
12 for (i=0;i<size; i++){
13 delete _copyViewPoints[i];
15 _copyViewPoints.clear();
19 // ----------------------------------------------------------------------------
20 manualViewPoints * manualViewPoints :: Clone()
22 manualViewPoints * clone = new manualViewPoints();
23 CopyAttributesTo(clone);
27 // ---------------------------------------------------------------------------
28 void manualViewPoints::CopyAttributesTo( manualViewPoints * cloneObject)
31 manualViewBaseContour::CopyAttributesTo(cloneObject);
34 // ----------------------------------------------------------------------------
35 int manualViewPoints::GetType() // VIRTUAL
41 // ----------------------------------------------------------------------------
42 bool manualViewPoints::ifTouchContour(int x,int y,int z) //VIRTUAL
48 TransfromCoordViewWorld(xx,yy,zz);
55 int id = _manContModel->GetIdPoint(xx,yy,zz,_range,2);
65 // ----------------------------------------------------------------------------
66 void manualViewPoints::Refresh() // VIRTUAL
69 manualViewBaseContour::Refresh();
72 // ----------------------------------------------------------------------------
73 void manualViewPoints::RefreshContour() // VIRTUAL
75 int np = GetNumberOfPoints();
76 int copynp= _copyViewPoints.size();
82 manualViewPoint *mvp = new manualViewPoint(_wxvtkbaseview);
83 vtkActor *actor = mvp->CreateVtkPointActor();
84 _wxvtkbaseview->GetRenderer()->AddActor( actor );
86 _copyViewPoints.push_back(mvp);
90 manualViewPoint *t = _copyViewPoints[0];
91 _wxvtkbaseview->GetRenderer()->RemoveActor( t->GetVtkActor() );
92 std::vector<manualViewPoint*>::iterator itNum = _copyViewPoints.begin();
93 _copyViewPoints.erase(itNum);
96 copynp= _copyViewPoints.size();
103 double xx = _manContModel->GetManualPoint(i)->GetX();
104 double yy = _manContModel->GetManualPoint(i)->GetY();
105 double zz = 900; // RaC REVISAR !!
107 manualViewPoint *mv = _copyViewPoints[i];
109 //Paints new Rectangular points bigger than the actual control points
110 mv->SetPositionXY(xx, yy, _range*2, zz);
112 vtkActor *_pointVtkActor = mv->GetVtkActor();
114 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorNormal_r , _coulorNormal_g , _coulorNormal_b );
115 if (_posibleSelected || (_posibleSelected && GetEditable() ) )
117 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorEdit_r , _coulorEdit_g , _coulorEdit_b );
121 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorSelection_r , _coulorSelection_g , _coulorSelection_b );
124 //IF you want to customize the points which are going to be painted
125 //mv->UpdateColorActor(_colorViewPoints_r,_colorViewPoints_g,_colorViewPoints_b);
126 //mv->SetWidthLine(1.3);
130 // ----------------------------------------------------------------------------
131 void manualViewPoints::ConstructVTKObjects() // VIRTUAL
136 // ----------------------------------------------------------------------------
137 void manualViewPoints::AddSplineActor() // VIRTUAL
139 int i,size=_copyViewPoints.size();
142 _wxvtkbaseview->GetRenderer()->AddActor( _copyViewPoints[i]->GetVtkActor() );
146 // ----------------------------------------------------------------------------
147 void manualViewPoints::RemoveSplineActor() // VIRTUAL
149 int i,size=_copyViewPoints.size();
152 _wxvtkbaseview->GetRenderer()->RemoveActor(_copyViewPoints[i]->GetVtkActor());