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();
107 //EED 21 mars 2012 FLIP probleme ..PLOP..
108 // double zz = 900; // RaC REVISAR !!
110 double zz = -900; // RaC REVISAR !!
112 manualViewPoint *mv = _copyViewPoints[i];
114 //Paints new Rectangular points bigger than the actual control points
115 mv->SetPositionXY(xx, yy, _range*2, zz);
117 vtkActor *_pointVtkActor = mv->GetVtkActor();
119 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorNormal_r , _coulorNormal_g , _coulorNormal_b );
120 if (_posibleSelected || (_posibleSelected && GetEditable() ) )
122 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorEdit_r , _coulorEdit_g , _coulorEdit_b );
126 _pointVtkActor->GetProperty()->SetDiffuseColor( _coulorSelection_r , _coulorSelection_g , _coulorSelection_b );
129 //IF you want to customize the points which are going to be painted
130 //mv->UpdateColorActor(_colorViewPoints_r,_colorViewPoints_g,_colorViewPoints_b);
131 //mv->SetWidthLine(1.3);
135 // ----------------------------------------------------------------------------
136 void manualViewPoints::ConstructVTKObjects() // VIRTUAL
141 // ----------------------------------------------------------------------------
142 void manualViewPoints::AddSplineActor() // VIRTUAL
144 int i,size=_copyViewPoints.size();
147 _wxvtkbaseview->GetRenderer()->AddActor( _copyViewPoints[i]->GetVtkActor() );
151 // ----------------------------------------------------------------------------
152 void manualViewPoints::RemoveSplineActor() // VIRTUAL
154 int i,size=_copyViewPoints.size();
157 _wxvtkbaseview->GetRenderer()->RemoveActor(_copyViewPoints[i]->GetVtkActor());