Salome HOME
8a254d09c7dd1e0b376f5e0170f2446867238c8c
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IMarker.hxx
1 // Copyright (C) 2007-2023  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, or (at your option) any later version.
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
23 //NOTE: This is an interface to a function for the local coordinate system creation.
24 //
25 #include "GEOM_Function.hxx"
26
27 #define CS_ARG_O_X   1
28 #define CS_ARG_O_Y   2
29 #define CS_ARG_O_Z   3
30
31 #define CS_ARG_X_DX  4
32 #define CS_ARG_X_DY  5
33 #define CS_ARG_X_DZ  6
34
35 #define CS_ARG_Y_DX  7
36 #define CS_ARG_Y_DY  8
37 #define CS_ARG_Y_DZ  9
38
39 #define CS_ARG_SHAPE  10
40 #define CS_ARG_ORIGIN 11
41 #define CS_ARG_XVEC   12
42 #define CS_ARG_YVEC   13
43
44 class GEOMImpl_IMarker
45 {
46  public:
47
48   GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
49
50   void SetOrigin (const double theX, const double theY, const double theZ)
51   {
52     _func->SetReal(CS_ARG_O_X, theX);
53     _func->SetReal(CS_ARG_O_Y, theY);
54     _func->SetReal(CS_ARG_O_Z, theZ);
55   }
56
57   void SetXDir (const double theDX, const double theDY, const double theDZ)
58   {
59     _func->SetReal(CS_ARG_X_DX, theDX);
60     _func->SetReal(CS_ARG_X_DY, theDY);
61     _func->SetReal(CS_ARG_X_DZ, theDZ);
62   }
63
64   void SetYDir (const double theDX, const double theDY, const double theDZ)
65   {
66     _func->SetReal(CS_ARG_Y_DX, theDX);
67     _func->SetReal(CS_ARG_Y_DY, theDY);
68     _func->SetReal(CS_ARG_Y_DZ, theDZ);
69   }
70   
71   void SetShape (Handle(GEOM_Function) theShape)
72   {
73     _func->SetReference(CS_ARG_SHAPE, theShape);
74   }
75
76   void SetOrigin (Handle(GEOM_Function) theOrigin)
77   {
78     _func->SetReference(CS_ARG_ORIGIN, theOrigin);
79   }
80
81   void SetXVec (Handle(GEOM_Function) theXVec)
82   {
83     _func->SetReference(CS_ARG_XVEC, theXVec);
84   }
85
86   void SetYVec (Handle(GEOM_Function) theYVec)
87   {
88     _func->SetReference(CS_ARG_YVEC, theYVec);
89   }
90
91   void GetOrigin (double& theX, double& theY, double& theZ)
92   {
93     theX = _func->GetReal(CS_ARG_O_X);
94     theY = _func->GetReal(CS_ARG_O_Y);
95     theZ = _func->GetReal(CS_ARG_O_Z);
96   }
97
98   void GetXDir (double& theDX, double& theDY, double& theDZ)
99   {
100     theDX = _func->GetReal(CS_ARG_X_DX);
101     theDY = _func->GetReal(CS_ARG_X_DY);
102     theDZ = _func->GetReal(CS_ARG_X_DZ);
103   }
104
105   void GetYDir (double& theDX, double& theDY, double& theDZ)
106   {
107     theDX = _func->GetReal(CS_ARG_Y_DX);
108     theDY = _func->GetReal(CS_ARG_Y_DY);
109     theDZ = _func->GetReal(CS_ARG_Y_DZ);
110   }
111   
112   Handle(GEOM_Function) GetShape()
113   {
114     return _func->GetReference(CS_ARG_SHAPE); 
115   }
116
117   Handle(GEOM_Function) GetOrigin()
118   {
119     return _func->GetReference(CS_ARG_ORIGIN); 
120   }
121
122   Handle(GEOM_Function) GetXVec()
123   {
124     return _func->GetReference(CS_ARG_XVEC); 
125   }
126
127   Handle(GEOM_Function) GetYVec()
128   {
129     return _func->GetReference(CS_ARG_YVEC); 
130   }
131
132  private:
133
134   Handle(GEOM_Function) _func;
135 };