manualViewRotationTool.cpp

Go to the documentation of this file.
00001 #include "manualViewRotationTool.h"
00002 
00003 // ----------------------------------------------------------------------------
00004 // ----------------------------------------------------------------------------
00005 // ----------------------------------------------------------------------------
00006 
00007 manualViewRotationTool::manualViewRotationTool()
00008 {       
00009 
00010 }
00011 // ----------------------------------------------------------------------------
00012 manualViewRotationTool::~manualViewRotationTool()
00013 {
00014 
00015 }
00016 
00017 // ----------------------------------------------------------------------------
00018 manualViewRotationTool * manualViewRotationTool :: Clone()
00019 {
00020         manualViewRotationTool * clone = new manualViewRotationTool();
00021         CopyAttributesTo(clone);
00022         return clone;
00023 }
00024 
00025 // ---------------------------------------------------------------------------
00026 void manualViewRotationTool::CopyAttributesTo( manualViewRotationTool * cloneObject)
00027 {
00028         manualViewBaseContour::CopyAttributesTo(cloneObject);
00029 }
00030 
00031 // ----------------------------------------------------------------------------
00032 int manualViewRotationTool::GetType() // virtual
00033 {
00034         return 8;
00035 }
00036 
00037 // ----------------------------------------------------------------------------
00038 void manualViewRotationTool::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
00039 {
00040         manualPoint     *mpA,*mpB;
00041     unsigned int  np;
00042         double radio;
00043         double difX,difY;
00044     np  = GetNumberOfPoints( );
00045         
00046         if (np==3)
00047         {
00048                 mpA             = _manContModel->GetManualPoint(0);
00049                 mpB             = _manContModel->GetManualPoint(1);
00050                 difX    = mpA->GetX() - mpB->GetX();
00051                 difY    = mpA->GetY() - mpB->GetY();
00052                 radio   = sqrt( difX*difX + difY*difY );
00053                 minX=mpA->GetX()-radio;
00054                 minY=mpA->GetY()-radio;
00055                 maxX=mpA->GetX()+radio;
00056                 maxY=mpA->GetY()+radio;
00057         } 
00058         else 
00059         {
00060                 minX=0;
00061                 maxX=0;
00062                 minY=0;
00063                 maxY=0;
00064         }
00065 }
00066 
00067 // ----------------------------------------------------------------------------
00068 
00069 void manualViewRotationTool::InitMove(int x, int y, int z)  // virtual
00070 {
00071         manualPoint *mp;
00072         double XX=x;
00073         double YY=y;
00074         double ZZ=z;
00075         TransfromCoordViewWorld(XX,YY,ZZ);
00076 
00077         if (_manContModel->GetSizeLstPoints()==3)
00078         {
00079                 mp = _manContModel->GetManualPoint(0);
00080                 _dp0[0]= mp->GetX() - XX;
00081                 _dp0[1]= mp->GetY() - YY;
00082                 _dp0[2]= mp->GetZ();
00083 
00084                 mp = _manContModel->GetManualPoint(1);
00085                 _dp1[0]= mp->GetX() - XX;
00086                 _dp1[1]= mp->GetY() - YY;
00087                 _dp1[2]= mp->GetZ();
00088 
00089                 mp = _manContModel->GetManualPoint(2);
00090                 _dp2[0]= mp->GetX() - XX;
00091                 _dp2[1]= mp->GetY() - YY;
00092                 _dp2[2]= mp->GetZ();
00093 
00094         }
00095 }
00096 
00097 // ----------------------------------------------------------------------------
00098 void manualViewRotationTool::MoveContour(int x, int y, int z) // virtual
00099 {
00100         manualPoint *mp;
00101         double XX=x;
00102         double YY=y;
00103         double ZZ=z;
00104         TransfromCoordViewWorld(XX,YY,ZZ);
00105 
00106         mp = _manContModel->GetManualPoint(0);
00107         mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
00108 
00109         mp = _manContModel->GetManualPoint(1);
00110         mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
00111 
00112         mp = _manContModel->GetManualPoint(2);
00113         mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);
00114 
00115         UpdateViewPoint(0);
00116         UpdateViewPoint(1);
00117         UpdateViewPoint(2);
00118 }

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1