Back to index

salome-geom  6.5.0
GEOMImpl_IRotate.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  NOTE: This is an interface to a function for the Rotate operation.
00024 
00025 #include "GEOM_Function.hxx"
00026 
00027 #include <gp_XYZ.hxx>
00028 
00029 #define ROTATE_ANGLE    1  
00030 #define ROTATE_AXIS     2
00031 #define ROTATE_ORGN     3
00032 #define ROTATE_STEP1      4
00033 #define ROTATE_NBITER1    5
00034 #define ROTATE_NBITER2    6
00035 #define ROTATE_CENTRAL_POINT    7  
00036 #define ROTATE_POINT1           8
00037 #define ROTATE_POINT2           9
00038 #define ROTATE_DIR2_X     10
00039 #define ROTATE_DIR2_Y     11
00040 #define ROTATE_DIR2_Z     12
00041 
00042 class GEOMImpl_IRotate
00043 {
00044  public:
00045   
00046   GEOMImpl_IRotate(Handle(GEOM_Function) theFunction): _func(theFunction) {}
00047   
00048   void SetCentPoint(Handle(GEOM_Function) theCentPoint) { _func->SetReference(ROTATE_CENTRAL_POINT, theCentPoint); }
00049   
00050   Handle(GEOM_Function) GetCentPoint() { return _func->GetReference(ROTATE_CENTRAL_POINT); }
00051 
00052   void SetPoint1(Handle(GEOM_Function) thePoint1) { _func->SetReference(ROTATE_POINT1, thePoint1); }
00053   
00054   Handle(GEOM_Function) GetPoint1() { return _func->GetReference(ROTATE_POINT1); }
00055   
00056   void SetPoint2(Handle(GEOM_Function) thePoint2) { _func->SetReference(ROTATE_POINT2, thePoint2); }
00057   
00058   Handle(GEOM_Function) GetPoint2() { return _func->GetReference(ROTATE_POINT2); }
00059   
00060   void SetAngle(Standard_Real theAngle) { _func->SetReal(ROTATE_ANGLE, theAngle); }
00061   
00062   Standard_Real GetAngle() { return _func->GetReal(ROTATE_ANGLE); }
00063   
00064   void SetAxis(Handle(GEOM_Function) theVector) { _func->SetReference(ROTATE_AXIS, theVector); }
00065   
00066   Handle(GEOM_Function) GetAxis() { return _func->GetReference(ROTATE_AXIS); } 
00067   
00068   void SetOriginal(Handle(GEOM_Function) theOriginal) { _func->SetReference(ROTATE_ORGN, theOriginal); }
00069 
00070   Handle(GEOM_Function) GetOriginal() { return _func->GetReference(ROTATE_ORGN); }
00071 
00072   void SetStep(double theStep) { _func->SetReal(ROTATE_STEP1, theStep); }
00073 
00074   double GetStep() { return _func->GetReal(ROTATE_STEP1); }
00075 
00076   void SetNbIter1(int theNbIter) { _func->SetInteger(ROTATE_NBITER1, theNbIter); }
00077 
00078   int GetNbIter1() { return _func->GetInteger(ROTATE_NBITER1); } 
00079 
00080   void SetNbIter2(int theNbIter) { _func->SetInteger(ROTATE_NBITER2, theNbIter); }
00081 
00082   int GetNbIter2() { return _func->GetInteger(ROTATE_NBITER2); } 
00083 
00084   void SetDir2 (gp_XYZ theDir2)
00085   {
00086     _func->SetReal(ROTATE_DIR2_X, theDir2.X());
00087     _func->SetReal(ROTATE_DIR2_Y, theDir2.Y());
00088     _func->SetReal(ROTATE_DIR2_Z, theDir2.Z());
00089   }
00090 
00091   gp_XYZ GetDir2()
00092   {
00093     gp_XYZ aRes (0., 0., 0.);
00094     aRes.SetX(_func->GetReal(ROTATE_DIR2_X));
00095     aRes.SetY(_func->GetReal(ROTATE_DIR2_Y));
00096     aRes.SetZ(_func->GetReal(ROTATE_DIR2_Z));
00097     return aRes;
00098   }
00099   
00100  private:
00101   
00102   Handle(GEOM_Function) _func;  
00103 };