manualViewCircle.cpp

Go to the documentation of this file.
00001 #include "manualViewCircle.h"
00002 
00003 
00004 // ----------------------------------------------------------------------------
00005 // ----------------------------------------------------------------------------
00006 // ----------------------------------------------------------------------------
00007 
00008 // EED08
00009 
00010 manualViewCircle::manualViewCircle()
00011 {
00012 //      _sizePointsContour=5;   // default 100
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         // Fathers object
00033         manualViewBaseContour::CopyAttributesTo(cloneObject);
00034 }
00035 
00036 
00037 // ----------------------------------------------------------------------------
00038 int manualViewCircle::GetType() // virtual
00039 {
00040         return 3;
00041 }
00042 
00043 // ----------------------------------------------------------------------------
00044 
00045 void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
00046 {
00047         manualPoint     *mpA,*mpB;
00048     unsigned int  np;
00049         double radio;
00050         double difX,difY;
00051     np  = GetNumberOfPoints( );
00052         if (np==2)
00053         {
00054                 mpA             = _manContModel->GetManualPoint(0);
00055                 mpB             = _manContModel->GetManualPoint(1);
00056                 difX    = mpA->GetX() - mpB->GetX();
00057                 difY    = mpA->GetY() - mpB->GetY();
00058                 radio   = sqrt( difX*difX + difY*difY );
00059                 minX=mpA->GetX()-radio;
00060                 minY=mpA->GetY()-radio;
00061                 maxX=mpA->GetX()+radio;
00062                 maxY=mpA->GetY()+radio;
00063         } else {
00064                 minX=0;
00065                 maxX=0;
00066                 minY=0;
00067                 maxY=0;
00068         }
00069 }
00070 
00071 
00072 // ----------------------------------------------------------------------------
00073 
00074 void manualViewCircle::InitMove(int x, int y, int z)  // virtual
00075 {
00076         manualPoint *mp;
00077         double XX=x;
00078         double YY=y;
00079         double ZZ=z;
00080         TransfromCoordViewWorld(XX,YY,ZZ);
00081 
00082         if (_manContModel->GetSizeLstPoints()==2){
00083                 mp = _manContModel->GetManualPoint(0);
00084                 _dp0[0]= mp->GetX() - XX;
00085                 _dp0[1]= mp->GetY() - YY;
00086                 _dp0[2]= mp->GetZ();
00087 
00088                 mp = _manContModel->GetManualPoint(1);
00089                 _dp1[0]= mp->GetX() - XX;
00090                 _dp1[1]= mp->GetY() - YY;
00091                 _dp1[2]= mp->GetZ();
00092 /*
00093                 mp = _manContModel->GetManualPoint(2);
00094                 _dp2[0]= mp->GetX() - XX;
00095                 _dp2[1]= mp->GetY() - YY;
00096                 _dp2[2]= mp->GetZ();
00097 
00098                 mp = _manContModel->GetManualPoint(3);
00099                 _dp3[0]= mp->GetX() - XX;
00100                 _dp3[1]= mp->GetY() - YY;
00101                 _dp3[2]= mp->GetZ();
00102 */
00103         }
00104 }
00105 
00106 
00107 // ----------------------------------------------------------------------------
00108 void manualViewCircle::MoveContour(int x, int y, int z) // virtual
00109 {
00110         manualPoint *mp;
00111         double XX=x;
00112         double YY=y;
00113         double ZZ=z;
00114         TransfromCoordViewWorld(XX,YY,ZZ);
00115 
00116         mp = _manContModel->GetManualPoint(0);
00117         mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
00118 
00119         mp = _manContModel->GetManualPoint(1);
00120         mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
00121 
00122 //      mp = _manContModel->GetManualPoint(2);
00123 //      mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);
00124 
00125 //      mp = _manContModel->GetManualPoint(3);
00126 //      mp->SetPoint(_dp3[0]+XX,_dp3[1]+YY,_dp0[2]);
00127 
00128         UpdateViewPoint(0);
00129         UpdateViewPoint(1);
00130 //      UpdateViewPoint(2);
00131 //      UpdateViewPoint(3);
00132 
00133 }

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1