Salome HOME
56bed37c3cd04fa652007831c6f8705624c17f75
[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     TCollection_AsciiString            Name;
36     TopTools_SequenceOfShape           Shapes;
37   };
38   typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
39
40 protected:
41   /**
42    * Enumeration of tags corresponding to the persistent object parameters.
43    */
44   enum DataTag
45   {
46     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
47     DataTag_Shape,   ///< reference edges
48   };
49
50 public:
51   DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
52
53   /**
54    * Returns the kind of this object. Must be redefined in all objects of known type.
55    */
56   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
57
58   /**
59    * Returns flag indicating that object is updateble or not.
60    */
61   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
62
63     /**
64    * Returns flag indicating that object can be removed or not.
65    */
66   HYDRODATA_EXPORT virtual bool CanRemove();
67
68 public:      
69   // Public methods to work with reference Shapes
70
71   /**
72    * Add new one shape for the group.
73    */
74   HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
75
76   /**
77    * Sets new sequence of shapes for the group.
78    */
79   HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
80
81   /**
82    * Sets new list of shapes for the group.
83    */
84   HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
85
86   /**
87    * Returns all shapes of the group.
88    */
89   HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
90
91   /**
92    * Removes all shapes from the group.
93    */
94   HYDRODATA_EXPORT virtual void RemoveShapes();
95
96
97 protected:
98
99   friend class HYDROData_Iterator;
100
101   /**
102    * Creates new object in the internal data structure. Use higher level objects 
103    * to create objects with real content.
104    */
105   HYDRODATA_EXPORT HYDROData_ShapesGroup();
106
107   /**
108    * Destructs properties of the object and object itself, removes it from the document.
109    */
110   virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();
111 };
112
113 #endif