Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMarker.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //NOTE: This is an interface to a function for the local coordinate system creation.
23 //
24 #include "GEOM_Function.hxx"
25
26 #define CS_ARG_O_X   1
27 #define CS_ARG_O_Y   2
28 #define CS_ARG_O_Z   3
29
30 #define CS_ARG_X_DX  4
31 #define CS_ARG_X_DY  5
32 #define CS_ARG_X_DZ  6
33
34 #define CS_ARG_Y_DX  7
35 #define CS_ARG_Y_DY  8
36 #define CS_ARG_Y_DZ  9
37
38 class GEOMImpl_IMarker
39 {
40  public:
41
42   GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
43
44   void SetOrigin (const double theX, const double theY, const double theZ)
45   {
46     _func->SetReal(CS_ARG_O_X, theX);
47     _func->SetReal(CS_ARG_O_Y, theY);
48     _func->SetReal(CS_ARG_O_Z, theZ);
49   }
50
51   void SetXDir (const double theDX, const double theDY, const double theDZ)
52   {
53     _func->SetReal(CS_ARG_X_DX, theDX);
54     _func->SetReal(CS_ARG_X_DY, theDY);
55     _func->SetReal(CS_ARG_X_DZ, theDZ);
56   }
57
58   void SetYDir (const double theDX, const double theDY, const double theDZ)
59   {
60     _func->SetReal(CS_ARG_Y_DX, theDX);
61     _func->SetReal(CS_ARG_Y_DY, theDY);
62     _func->SetReal(CS_ARG_Y_DZ, theDZ);
63   }
64
65   void GetOrigin (double& theX, double& theY, double& theZ)
66   {
67     theX = _func->GetReal(CS_ARG_O_X);
68     theY = _func->GetReal(CS_ARG_O_Y);
69     theZ = _func->GetReal(CS_ARG_O_Z);
70   }
71
72   void GetXDir (double& theDX, double& theDY, double& theDZ)
73   {
74     theDX = _func->GetReal(CS_ARG_X_DX);
75     theDY = _func->GetReal(CS_ARG_X_DY);
76     theDZ = _func->GetReal(CS_ARG_X_DZ);
77   }
78
79   void GetYDir (double& theDX, double& theDY, double& theDZ)
80   {
81     theDX = _func->GetReal(CS_ARG_Y_DX);
82     theDY = _func->GetReal(CS_ARG_Y_DY);
83     theDZ = _func->GetReal(CS_ARG_Y_DZ);
84   }
85
86  private:
87
88   Handle(GEOM_Function) _func;
89 };