Salome HOME
Dump to python corrected.
[modules/hydro.git] / src / HYDROData / HYDROData_ShapesGroup.h
1
2 #ifndef HYDROData_ShapesGroup_HeaderFile
3 #define HYDROData_ShapesGroup_HeaderFile
4
5 #include <HYDROData_Entity.h>
6
7 #include <TopTools_SequenceOfShape.hxx>
8
9 #include <QString>
10
11 class TopoDS_Shape;
12 class TopTools_ListOfShape;
13 class BRepBuilderAPI_MakeShape;
14 class ShapeUpgrade_UnifySameDomain;
15
16 DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
17
18 /**\class HYDROData_ShapesGroup
19  * \brief Class that stores/retreives the sequence of shapes.
20  */
21 class HYDROData_ShapesGroup : public HYDROData_Entity
22 {
23 public:
24
25   struct GroupDefinition
26   {
27     GroupDefinition() {}
28
29     static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
30                         BRepBuilderAPI_MakeShape*              theAlgo );
31
32     static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
33                         ShapeUpgrade_UnifySameDomain*          theAlgo );
34
35     void        Dump( std::ostream& theStream ) const;
36
37     static void Dump( std::ostream&                                theStream,
38                       const NCollection_Sequence<GroupDefinition>& theGroups );
39
40     TCollection_AsciiString            Name;
41     TopTools_SequenceOfShape           Shapes;
42   };
43   typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
44
45 protected:
46   /**
47    * Enumeration of tags corresponding to the persistent object parameters.
48    */
49   enum DataTag
50   {
51     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
52     DataTag_Shape,   ///< reference edges
53   };
54
55 public:
56   DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
57
58   /**
59    * Returns the kind of this object. Must be redefined in all objects of known type.
60    */
61   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
62
63   /**
64    * Returns flag indicating that object is updateble or not.
65    */
66   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
67
68     /**
69    * Returns flag indicating that object can be removed or not.
70    */
71   HYDRODATA_EXPORT virtual bool CanRemove();
72
73 public:      
74   // Public methods to work with reference Shapes
75
76   /**
77    * Add new one shape for the group.
78    */
79   HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
80
81   /**
82    * Sets new sequence of shapes for the group.
83    */
84   HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
85
86   /**
87    * Sets new list of shapes for the group.
88    */
89   HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
90
91   /**
92    * Returns all shapes of the group.
93    */
94   HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
95
96   /**
97    * Removes all shapes from the group.
98    */
99   HYDRODATA_EXPORT virtual void RemoveShapes();
100
101
102 protected:
103
104   friend class HYDROData_Iterator;
105
106   /**
107    * Creates new object in the internal data structure. Use higher level objects 
108    * to create objects with real content.
109    */
110   HYDRODATA_EXPORT HYDROData_ShapesGroup();
111
112   /**
113    * Destructs properties of the object and object itself, removes it from the document.
114    */
115   virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();
116 };
117
118 #endif