1 // NOTE: This is an intreface to a function for the Shapes
2 // (Wire, Face, Shell, Solid and Compound) creation.
5 #include "GEOM_Function.hxx"
7 #include "TColStd_HSequenceOfTransient.hxx"
8 #include "TColStd_HArray1OfInteger.hxx"
10 #define SHAPE_ARG_SHAPES 1 // for Wire, Shell, Solid and Compound
12 #define SHAPE_ARG_BASE 2 // for Face, Solid and Sub-shape
14 #define SHAPE_ARG_PLANAR 3 // for Face
16 #define SHAPE_ARG_SUBTYPE 4 // for Sub-shape
17 #define SHAPE_ARG_INDICES 5 // for Sub-shape
19 class GEOMImpl_IShapes
23 GEOMImpl_IShapes(Handle(GEOM_Function) theFunction): _func(theFunction) {}
25 void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
26 { _func->SetReferenceList(SHAPE_ARG_SHAPES, theShapes); }
28 Handle(TColStd_HSequenceOfTransient) GetShapes()
29 { return _func->GetReferenceList(SHAPE_ARG_SHAPES); }
31 void SetBase(Handle(GEOM_Function) theRefBase)
32 { _func->SetReference(SHAPE_ARG_BASE, theRefBase); }
34 Handle(GEOM_Function) GetBase() { return _func->GetReference(SHAPE_ARG_BASE); }
36 void SetIsPlanar(const Standard_Boolean isPlanarWanted)
37 { _func->SetInteger(SHAPE_ARG_PLANAR, isPlanarWanted ? 1 : 0); }
39 Standard_Boolean GetIsPlanar() { return (_func->GetInteger(SHAPE_ARG_PLANAR) == 1); }
41 void SetSubShapeType(const Standard_Integer theType)
42 { _func->SetInteger(SHAPE_ARG_SUBTYPE, theType); }
44 Standard_Integer GetSubShapeType() { return _func->GetInteger(SHAPE_ARG_SUBTYPE); }
46 void SetIndices(const Handle(TColStd_HArray1OfInteger)& theIndices)
47 { _func->SetIntegerArray(SHAPE_ARG_INDICES, theIndices); }
49 Handle(TColStd_HArray1OfInteger) GetIndices()
50 { return _func->GetIntegerArray(SHAPE_ARG_INDICES); }
54 Handle(GEOM_Function) _func;