manualViewCircle.cpp
Go to the documentation of this file.00001 #include "manualViewCircle.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010 manualViewCircle::manualViewCircle()
00011 {
00012
00013 }
00014
00015 manualViewCircle::~manualViewCircle()
00016 {
00017 }
00018
00019
00020
00021 manualViewCircle * manualViewCircle :: Clone()
00022 {
00023 manualViewCircle * clone = new manualViewCircle();
00024 CopyAttributesTo(clone);
00025 return clone;
00026 }
00027
00028
00029
00030 void manualViewCircle::CopyAttributesTo( manualViewCircle * cloneObject)
00031 {
00032
00033 manualViewBaseContour::CopyAttributesTo(cloneObject);
00034 }
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 int manualViewCircle::GetType()
00079 {
00080 return 3;
00081 }
00082
00083
00084
00085 void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
00086 {
00087 manualPoint *mpA,*mpB;
00088 unsigned int np;
00089 double radio;
00090 double difX,difY;
00091 np = GetNumberOfPoints( );
00092 if (np==2)
00093 {
00094 mpA = _manContModel->GetManualPoint(0);
00095 mpB = _manContModel->GetManualPoint(1);
00096 difX = mpA->GetX() - mpB->GetX();
00097 difY = mpA->GetY() - mpB->GetY();
00098 radio = sqrt( difX*difX + difY*difY );
00099 minX=mpA->GetX()-radio;
00100 minY=mpA->GetY()-radio;
00101 maxX=mpA->GetX()+radio;
00102 maxY=mpA->GetY()+radio;
00103 } else {
00104 minX=0;
00105 maxX=0;
00106 minY=0;
00107 maxY=0;
00108 }
00109 }
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 void manualViewCircle::InitMove(int x, int y, int z)
00152 {
00153 manualPoint *mp;
00154 double XX=x;
00155 double YY=y;
00156 double ZZ=z;
00157 TransfromCoordViewWorld(XX,YY,ZZ);
00158
00159 if (_manContModel->GetSizeLstPoints()==2){
00160 mp = _manContModel->GetManualPoint(0);
00161 _dp0[0]= mp->GetX() - XX;
00162 _dp0[1]= mp->GetY() - YY;
00163 _dp0[2]= mp->GetZ();
00164
00165 mp = _manContModel->GetManualPoint(1);
00166 _dp1[0]= mp->GetX() - XX;
00167 _dp1[1]= mp->GetY() - YY;
00168 _dp1[2]= mp->GetZ();
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 }
00181 }
00182
00183
00184
00185 void manualViewCircle::MoveContour(int x, int y, int z)
00186 {
00187 manualPoint *mp;
00188 double XX=x;
00189 double YY=y;
00190 double ZZ=z;
00191 TransfromCoordViewWorld(XX,YY,ZZ);
00192
00193 mp = _manContModel->GetManualPoint(0);
00194 mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
00195
00196 mp = _manContModel->GetManualPoint(1);
00197 mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
00198
00199
00200
00201
00202
00203
00204
00205 UpdateViewPoint(0);
00206 UpdateViewPoint(1);
00207
00208
00209
00210 }