1 #include "manualViewCircle.h"
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
6 // ----------------------------------------------------------------------------
10 manualViewCircle::manualViewCircle()
12 // _sizePointsContour=5; // default 100
14 // ----------------------------------------------------------------------------
15 manualViewCircle::~manualViewCircle()
20 // ----------------------------------------------------------------------------
21 manualViewCircle * manualViewCircle :: Clone()
23 manualViewCircle * clone = new manualViewCircle();
24 CopyAttributesTo(clone);
28 // ---------------------------------------------------------------------------
30 void manualViewCircle::CopyAttributesTo( manualViewCircle * cloneObject)
33 manualViewBaseContour::CopyAttributesTo(cloneObject);
37 // ----------------------------------------------------------------------------
38 int manualViewCircle::GetType() // virtual
43 // ----------------------------------------------------------------------------
45 void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
47 manualPoint *mpA,*mpB;
51 np = GetNumberOfPoints( );
54 mpA = _manContModel->GetManualPoint(0);
55 mpB = _manContModel->GetManualPoint(1);
56 difX = mpA->GetX() - mpB->GetX();
57 difY = mpA->GetY() - mpB->GetY();
58 radio = sqrt( difX*difX + difY*difY );
59 minX=mpA->GetX()-radio;
60 minY=mpA->GetY()-radio;
61 maxX=mpA->GetX()+radio;
62 maxY=mpA->GetY()+radio;
72 // ----------------------------------------------------------------------------
74 void manualViewCircle::InitMove(int x, int y, int z) // virtual
80 TransfromCoordViewWorld(XX,YY,ZZ);
82 if (_manContModel->GetSizeLstPoints()==2){
83 mp = _manContModel->GetManualPoint(0);
84 _dp0[0]= mp->GetX() - XX;
85 _dp0[1]= mp->GetY() - YY;
88 mp = _manContModel->GetManualPoint(1);
89 _dp1[0]= mp->GetX() - XX;
90 _dp1[1]= mp->GetY() - YY;
93 mp = _manContModel->GetManualPoint(2);
94 _dp2[0]= mp->GetX() - XX;
95 _dp2[1]= mp->GetY() - YY;
98 mp = _manContModel->GetManualPoint(3);
99 _dp3[0]= mp->GetX() - XX;
100 _dp3[1]= mp->GetY() - YY;
107 // ----------------------------------------------------------------------------
108 void manualViewCircle::MoveContour(int x, int y, int z) // virtual
114 TransfromCoordViewWorld(XX,YY,ZZ);
116 mp = _manContModel->GetManualPoint(0);
117 mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
119 mp = _manContModel->GetManualPoint(1);
120 mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
122 // mp = _manContModel->GetManualPoint(2);
123 // mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);
125 // mp = _manContModel->GetManualPoint(3);
126 // mp->SetPoint(_dp3[0]+XX,_dp3[1]+YY,_dp0[2]);
130 // UpdateViewPoint(2);
131 // UpdateViewPoint(3);