]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IMarker.hxx
Salome HOME
d0cd303e2c2ad29e1f69a2b1cc21bf37e064daaf
[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 #define CS_ARG_SHAPE  10
39 #define CS_ARG_ORIGIN 11
40 #define CS_ARG_XVEC   12
41 #define CS_ARG_YVEC   13
42
43 class GEOMImpl_IMarker
44 {
45  public:
46
47   GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
48
49   void SetOrigin (const double theX, const double theY, const double theZ)
50   {
51     _func->SetReal(CS_ARG_O_X, theX);
52     _func->SetReal(CS_ARG_O_Y, theY);
53     _func->SetReal(CS_ARG_O_Z, theZ);
54   }
55
56   void SetXDir (const double theDX, const double theDY, const double theDZ)
57   {
58     _func->SetReal(CS_ARG_X_DX, theDX);
59     _func->SetReal(CS_ARG_X_DY, theDY);
60     _func->SetReal(CS_ARG_X_DZ, theDZ);
61   }
62
63   void SetYDir (const double theDX, const double theDY, const double theDZ)
64   {
65     _func->SetReal(CS_ARG_Y_DX, theDX);
66     _func->SetReal(CS_ARG_Y_DY, theDY);
67     _func->SetReal(CS_ARG_Y_DZ, theDZ);
68   }
69   
70   void SetShape (Handle(GEOM_Function) theShape)
71   {
72     _func->SetReference(CS_ARG_SHAPE, theShape);
73   }
74
75   void SetOrigin (Handle(GEOM_Function) theOrigin)
76   {
77     _func->SetReference(CS_ARG_ORIGIN, theOrigin);
78   }
79
80   void SetXVec (Handle(GEOM_Function) theXVec)
81   {
82     _func->SetReference(CS_ARG_XVEC, theXVec);
83   }
84
85   void SetYVec (Handle(GEOM_Function) theYVec)
86   {
87     _func->SetReference(CS_ARG_YVEC, theYVec);
88   }
89
90   void GetOrigin (double& theX, double& theY, double& theZ)
91   {
92     theX = _func->GetReal(CS_ARG_O_X);
93     theY = _func->GetReal(CS_ARG_O_Y);
94     theZ = _func->GetReal(CS_ARG_O_Z);
95   }
96
97   void GetXDir (double& theDX, double& theDY, double& theDZ)
98   {
99     theDX = _func->GetReal(CS_ARG_X_DX);
100     theDY = _func->GetReal(CS_ARG_X_DY);
101     theDZ = _func->GetReal(CS_ARG_X_DZ);
102   }
103
104   void GetYDir (double& theDX, double& theDY, double& theDZ)
105   {
106     theDX = _func->GetReal(CS_ARG_Y_DX);
107     theDY = _func->GetReal(CS_ARG_Y_DY);
108     theDZ = _func->GetReal(CS_ARG_Y_DZ);
109   }
110   
111   Handle(GEOM_Function) GetShape()
112   {
113     return _func->GetReference(CS_ARG_SHAPE); 
114   }
115
116   Handle(GEOM_Function) GetOrigin()
117   {
118     return _func->GetReference(CS_ARG_ORIGIN); 
119   }
120
121   Handle(GEOM_Function) GetXVec()
122   {
123     return _func->GetReference(CS_ARG_XVEC); 
124   }
125
126   Handle(GEOM_Function) GetYVec()
127   {
128     return _func->GetReference(CS_ARG_YVEC); 
129   }
130
131  private:
132
133   Handle(GEOM_Function) _func;
134 };