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