]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IPartition.hxx
Salome HOME
Copyrights update
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IPartition.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 intreface to a function for the Partition creation.
21
22
23 #include "GEOM_Function.hxx"
24
25 #include "TColStd_HSequenceOfTransient.hxx"
26 #include "TColStd_HArray1OfInteger.hxx"
27
28 #define PART_ARG_LIMIT   1
29 #define PART_ARG_SHAPES  2
30 #define PART_ARG_TOOLS   3
31 #define PART_ARG_KEEP_IN 4
32 #define PART_ARG_REM_IN  5
33
34 #define PART_ARG_MATERIALS 6
35
36 #define PART_ARG_SHAPE 7
37 #define PART_ARG_PLANE 8
38
39 class GEOMImpl_IPartition
40 {
41  public:
42
43   GEOMImpl_IPartition(Handle(GEOM_Function) theFunction): _func(theFunction) {}
44
45   void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
46
47   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
48   { _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
49
50   void SetTools(const Handle(TColStd_HSequenceOfTransient)& theShapes)
51   { _func->SetReferenceList(PART_ARG_TOOLS, theShapes); }
52
53   void SetKeepIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
54   { _func->SetReferenceList(PART_ARG_KEEP_IN, theShapes); }
55
56   void SetRemoveIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
57   { _func->SetReferenceList(PART_ARG_REM_IN, theShapes); }
58
59   void SetMaterials(const Handle(TColStd_HArray1OfInteger)& theMaterials)
60   { _func->SetIntegerArray(PART_ARG_MATERIALS, theMaterials); }
61
62
63   int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
64
65   Handle(TColStd_HSequenceOfTransient) GetShapes()    { return _func->GetReferenceList(PART_ARG_SHAPES); }
66   Handle(TColStd_HSequenceOfTransient) GetTools()     { return _func->GetReferenceList(PART_ARG_TOOLS); }
67   Handle(TColStd_HSequenceOfTransient) GetKeepIns()   { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
68   Handle(TColStd_HSequenceOfTransient) GetRemoveIns() { return _func->GetReferenceList(PART_ARG_REM_IN); }
69
70   Handle(TColStd_HArray1OfInteger) GetMaterials() { return _func->GetIntegerArray(PART_ARG_MATERIALS); }
71
72
73   void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(PART_ARG_SHAPE, theShape); }
74   void SetPlane(Handle(GEOM_Function) thePlane) { _func->SetReference(PART_ARG_PLANE, thePlane); }
75
76   Handle(GEOM_Function) GetShape() { return _func->GetReference(PART_ARG_SHAPE); }
77   Handle(GEOM_Function) GetPlane() { return _func->GetReference(PART_ARG_PLANE); }
78
79  private:
80
81   Handle(GEOM_Function) _func;
82 };