Salome HOME
PAL17233: Projection 2D doesn't work (bis)
[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/ or email : webmaster.salome@opencascade.com
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 #define PART_ARG_KEEP_NONLIMIT_SHAPES 9
40
41 class GEOMImpl_IPartition
42 {
43  public:
44
45   GEOMImpl_IPartition(Handle(GEOM_Function) theFunction): _func(theFunction) {}
46
47   void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
48
49   void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
50   { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
51
52   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
53   { _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
54
55   void SetTools(const Handle(TColStd_HSequenceOfTransient)& theShapes)
56   { _func->SetReferenceList(PART_ARG_TOOLS, theShapes); }
57
58   void SetKeepIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
59   { _func->SetReferenceList(PART_ARG_KEEP_IN, theShapes); }
60
61   void SetRemoveIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
62   { _func->SetReferenceList(PART_ARG_REM_IN, theShapes); }
63
64   void SetMaterials(const Handle(TColStd_HArray1OfInteger)& theMaterials)
65   { _func->SetIntegerArray(PART_ARG_MATERIALS, theMaterials); }
66
67
68   int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
69
70   int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
71
72   Handle(TColStd_HSequenceOfTransient) GetShapes()    { return _func->GetReferenceList(PART_ARG_SHAPES); }
73   Handle(TColStd_HSequenceOfTransient) GetTools()     { return _func->GetReferenceList(PART_ARG_TOOLS); }
74   Handle(TColStd_HSequenceOfTransient) GetKeepIns()   { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
75   Handle(TColStd_HSequenceOfTransient) GetRemoveIns() { return _func->GetReferenceList(PART_ARG_REM_IN); }
76
77   Handle(TColStd_HArray1OfInteger) GetMaterials() { return _func->GetIntegerArray(PART_ARG_MATERIALS); }
78
79
80   void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(PART_ARG_SHAPE, theShape); }
81   void SetPlane(Handle(GEOM_Function) thePlane) { _func->SetReference(PART_ARG_PLANE, thePlane); }
82
83   Handle(GEOM_Function) GetShape() { return _func->GetReference(PART_ARG_SHAPE); }
84   Handle(GEOM_Function) GetPlane() { return _func->GetReference(PART_ARG_PLANE); }
85
86  private:
87
88   Handle(GEOM_Function) _func;
89 };