Back to index

salome-geom  6.5.0
GEOMImpl_IMarker.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 local coordinate system creation.
00024 //
00025 #include "GEOM_Function.hxx"
00026 
00027 #define CS_ARG_O_X   1
00028 #define CS_ARG_O_Y   2
00029 #define CS_ARG_O_Z   3
00030 
00031 #define CS_ARG_X_DX  4
00032 #define CS_ARG_X_DY  5
00033 #define CS_ARG_X_DZ  6
00034 
00035 #define CS_ARG_Y_DX  7
00036 #define CS_ARG_Y_DY  8
00037 #define CS_ARG_Y_DZ  9
00038 
00039 #define CS_ARG_SHAPE  10
00040 #define CS_ARG_ORIGIN 11
00041 #define CS_ARG_XVEC   12
00042 #define CS_ARG_YVEC   13
00043 
00044 class GEOMImpl_IMarker
00045 {
00046  public:
00047 
00048   GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
00049 
00050   void SetOrigin (const double theX, const double theY, const double theZ)
00051   {
00052     _func->SetReal(CS_ARG_O_X, theX);
00053     _func->SetReal(CS_ARG_O_Y, theY);
00054     _func->SetReal(CS_ARG_O_Z, theZ);
00055   }
00056 
00057   void SetXDir (const double theDX, const double theDY, const double theDZ)
00058   {
00059     _func->SetReal(CS_ARG_X_DX, theDX);
00060     _func->SetReal(CS_ARG_X_DY, theDY);
00061     _func->SetReal(CS_ARG_X_DZ, theDZ);
00062   }
00063 
00064   void SetYDir (const double theDX, const double theDY, const double theDZ)
00065   {
00066     _func->SetReal(CS_ARG_Y_DX, theDX);
00067     _func->SetReal(CS_ARG_Y_DY, theDY);
00068     _func->SetReal(CS_ARG_Y_DZ, theDZ);
00069   }
00070   
00071   void SetShape (Handle(GEOM_Function) theShape)
00072   {
00073     _func->SetReference(CS_ARG_SHAPE, theShape);
00074   }
00075 
00076   void SetOrigin (Handle(GEOM_Function) theOrigin)
00077   {
00078     _func->SetReference(CS_ARG_ORIGIN, theOrigin);
00079   }
00080 
00081   void SetXVec (Handle(GEOM_Function) theXVec)
00082   {
00083     _func->SetReference(CS_ARG_XVEC, theXVec);
00084   }
00085 
00086   void SetYVec (Handle(GEOM_Function) theYVec)
00087   {
00088     _func->SetReference(CS_ARG_YVEC, theYVec);
00089   }
00090 
00091   void GetOrigin (double& theX, double& theY, double& theZ)
00092   {
00093     theX = _func->GetReal(CS_ARG_O_X);
00094     theY = _func->GetReal(CS_ARG_O_Y);
00095     theZ = _func->GetReal(CS_ARG_O_Z);
00096   }
00097 
00098   void GetXDir (double& theDX, double& theDY, double& theDZ)
00099   {
00100     theDX = _func->GetReal(CS_ARG_X_DX);
00101     theDY = _func->GetReal(CS_ARG_X_DY);
00102     theDZ = _func->GetReal(CS_ARG_X_DZ);
00103   }
00104 
00105   void GetYDir (double& theDX, double& theDY, double& theDZ)
00106   {
00107     theDX = _func->GetReal(CS_ARG_Y_DX);
00108     theDY = _func->GetReal(CS_ARG_Y_DY);
00109     theDZ = _func->GetReal(CS_ARG_Y_DZ);
00110   }
00111   
00112   Handle(GEOM_Function) GetShape()
00113   {
00114     return _func->GetReference(CS_ARG_SHAPE); 
00115   }
00116 
00117   Handle(GEOM_Function) GetOrigin()
00118   {
00119     return _func->GetReference(CS_ARG_ORIGIN); 
00120   }
00121 
00122   Handle(GEOM_Function) GetXVec()
00123   {
00124     return _func->GetReference(CS_ARG_XVEC); 
00125   }
00126 
00127   Handle(GEOM_Function) GetYVec()
00128   {
00129     return _func->GetReference(CS_ARG_YVEC); 
00130   }
00131 
00132  private:
00133 
00134   Handle(GEOM_Function) _func;
00135 };