1 #include "manualViewRotationTool.h"
3 // ----------------------------------------------------------------------------
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
7 manualViewRotationTool::manualViewRotationTool()
11 // ----------------------------------------------------------------------------
12 manualViewRotationTool::~manualViewRotationTool()
17 // ----------------------------------------------------------------------------
18 manualViewRotationTool * manualViewRotationTool :: Clone()
20 manualViewRotationTool * clone = new manualViewRotationTool();
21 CopyAttributesTo(clone);
25 // ---------------------------------------------------------------------------
26 void manualViewRotationTool::CopyAttributesTo( manualViewRotationTool * cloneObject)
28 manualViewBaseContour::CopyAttributesTo(cloneObject);
31 // ----------------------------------------------------------------------------
32 int manualViewRotationTool::GetType() // virtual
37 // ----------------------------------------------------------------------------
38 void manualViewRotationTool::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
40 manualPoint *mpA,*mpB;
44 np = GetNumberOfPoints( );
48 mpA = _manContModel->GetManualPoint(0);
49 mpB = _manContModel->GetManualPoint(1);
50 difX = mpA->GetX() - mpB->GetX();
51 difY = mpA->GetY() - mpB->GetY();
52 radio = sqrt( difX*difX + difY*difY );
53 minX=mpA->GetX()-radio;
54 minY=mpA->GetY()-radio;
55 maxX=mpA->GetX()+radio;
56 maxY=mpA->GetY()+radio;
67 // ----------------------------------------------------------------------------
69 void manualViewRotationTool::InitMove(int x, int y, int z) // virtual
75 TransfromCoordViewWorld(XX,YY,ZZ);
77 if (_manContModel->GetSizeLstPoints()==3)
79 mp = _manContModel->GetManualPoint(0);
80 _dp0[0]= mp->GetX() - XX;
81 _dp0[1]= mp->GetY() - YY;
84 mp = _manContModel->GetManualPoint(1);
85 _dp1[0]= mp->GetX() - XX;
86 _dp1[1]= mp->GetY() - YY;
89 mp = _manContModel->GetManualPoint(2);
90 _dp2[0]= mp->GetX() - XX;
91 _dp2[1]= mp->GetY() - YY;
97 // ----------------------------------------------------------------------------
98 void manualViewRotationTool::MoveContour(int x, int y, int z) // virtual
104 TransfromCoordViewWorld(XX,YY,ZZ);
106 mp = _manContModel->GetManualPoint(0);
107 mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
109 mp = _manContModel->GetManualPoint(1);
110 mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
112 mp = _manContModel->GetManualPoint(2);
113 mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);