Salome HOME
64845e7d8dd97142645e6fd5524d03d16447ecee
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapes.hxx
1 // NOTE: This is an intreface to a function for the Shapes
2 // (Wire, Face, Shell, Solid and Compound) creation.
3
4
5 #include "GEOM_Function.hxx"
6
7 #include "TColStd_HSequenceOfTransient.hxx"
8 #include "TColStd_HArray1OfInteger.hxx"
9
10 #define SHAPE_ARG_SHAPES  1 // for Wire, Shell, Solid and Compound
11
12 #define SHAPE_ARG_BASE    2 // for Face, Solid and Sub-shape
13
14 #define SHAPE_ARG_PLANAR  3 // for Face
15
16 #define SHAPE_ARG_SUBTYPE 4 // for Sub-shape
17 #define SHAPE_ARG_INDICES 5 // for Sub-shape
18
19 class GEOMImpl_IShapes
20 {
21  public:
22
23   GEOMImpl_IShapes(Handle(GEOM_Function) theFunction): _func(theFunction) {}
24
25   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
26   { _func->SetReferenceList(SHAPE_ARG_SHAPES, theShapes); }
27
28   Handle(TColStd_HSequenceOfTransient) GetShapes()
29   { return _func->GetReferenceList(SHAPE_ARG_SHAPES); }
30
31   void SetBase(Handle(GEOM_Function) theRefBase)
32   { _func->SetReference(SHAPE_ARG_BASE, theRefBase); }
33
34   Handle(GEOM_Function) GetBase() { return _func->GetReference(SHAPE_ARG_BASE); }
35
36   void SetIsPlanar(const Standard_Boolean isPlanarWanted)
37   { _func->SetInteger(SHAPE_ARG_PLANAR, isPlanarWanted ? 1 : 0); }
38
39   Standard_Boolean GetIsPlanar() { return (_func->GetInteger(SHAPE_ARG_PLANAR) == 1); }
40
41   void SetSubShapeType(const Standard_Integer theType)
42   { _func->SetInteger(SHAPE_ARG_SUBTYPE, theType); }
43
44   Standard_Integer GetSubShapeType() { return _func->GetInteger(SHAPE_ARG_SUBTYPE); }
45
46   void SetIndices(const Handle(TColStd_HArray1OfInteger)& theIndices)
47   { _func->SetIntegerArray(SHAPE_ARG_INDICES, theIndices); }
48
49   Handle(TColStd_HArray1OfInteger) GetIndices()
50   { return _func->GetIntegerArray(SHAPE_ARG_INDICES); }
51
52  private:
53
54   Handle(GEOM_Function) _func;
55 };