Salome HOME
32f43fa17c0eb6cf85abd9656121c12998273a0e
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IChamfer.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 Chamfer and creation.
23 //
24 #include "GEOM_Function.hxx"
25
26 #define CHAM_ARG_SH    1
27 #define CHAM_ARG_D1    2
28 #define CHAM_ARG_D2    3
29 #define CHAM_ARG_ANGLE 3
30 #define CHAM_ARG_LENG  4
31 #define CHAM_ARG_LAST  4
32
33 class GEOMImpl_IChamfer
34 {
35  public:
36
37   GEOMImpl_IChamfer(Handle(GEOM_Function) theFunction): _func(theFunction) {}
38
39   void SetShape(Handle(GEOM_Function) theRef) { _func->SetReference(CHAM_ARG_SH, theRef); }
40
41   Handle(GEOM_Function) GetShape() { return _func->GetReference(CHAM_ARG_SH); }
42
43   void SetD (double theD) { _func->SetReal(CHAM_ARG_D1, theD); }
44   void SetD1(double theD) { _func->SetReal(CHAM_ARG_D1, theD); }
45   void SetD2(double theD) { _func->SetReal(CHAM_ARG_D2, theD); }
46   void SetAngle(double theAngle) { _func->SetReal(CHAM_ARG_ANGLE, theAngle); }
47
48   double GetD () { return _func->GetReal(CHAM_ARG_D1); }
49   double GetD1() { return _func->GetReal(CHAM_ARG_D1); }
50   double GetD2() { return _func->GetReal(CHAM_ARG_D2); }
51   double GetAngle() { return _func->GetReal(CHAM_ARG_ANGLE); }
52
53   void SetLength(int theLen) { _func->SetInteger(CHAM_ARG_LENG, theLen); }
54
55   int GetLength() { return _func->GetInteger(CHAM_ARG_LENG); }
56
57   void SetFace(int theInd, int theFace)
58               { _func->SetInteger(CHAM_ARG_LAST + theInd, theFace); }
59   void SetFace1(int theFace)
60               { _func->SetInteger(CHAM_ARG_LAST + 1, theFace); }
61   void SetFace2(int theFace)
62               { _func->SetInteger(CHAM_ARG_LAST + 2, theFace); }
63   void SetEdge(int theInd, int theEdge)
64               { _func->SetInteger(CHAM_ARG_LAST + theInd, theEdge); }
65
66   int GetFace(int theInd) { return _func->GetInteger(CHAM_ARG_LAST + theInd); }
67   int GetFace1() { return _func->GetInteger(CHAM_ARG_LAST + 1); }
68   int GetFace2() { return _func->GetInteger(CHAM_ARG_LAST + 2); }
69   int GetEdge(int theInd) { return _func->GetInteger(CHAM_ARG_LAST + theInd); }
70
71  private:
72
73   Handle(GEOM_Function) _func;
74 };