1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROData_ShapesGroup_HeaderFile
20 #define HYDROData_ShapesGroup_HeaderFile
22 #include <HYDROData_Entity.h>
24 #include <TopTools_SequenceOfShape.hxx>
29 class TopTools_ListOfShape;
30 class BRepBuilderAPI_MakeShape;
31 class ShapeUpgrade_UnifySameDomain;
33 DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
35 /**\class HYDROData_ShapesGroup
36 * \brief Class that stores/retreives the sequence of shapes.
38 class HYDROData_ShapesGroup : public HYDROData_Entity
42 struct GroupDefinition
46 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
47 BRepBuilderAPI_MakeShape* theAlgo );
49 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
50 ShapeUpgrade_UnifySameDomain* theAlgo );
52 void Dump( std::ostream& theStream ) const;
54 static void Dump( std::ostream& theStream,
55 const NCollection_Sequence<GroupDefinition>& theGroups );
57 TCollection_AsciiString Name;
58 TopTools_SequenceOfShape Shapes;
60 typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
64 * Enumeration of tags corresponding to the persistent object parameters.
68 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
69 DataTag_Shape, ///< reference edges
73 DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
76 * Returns the kind of this object. Must be redefined in all objects of known type.
78 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
81 * Returns flag indicating that object is updateble or not.
83 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
86 * Returns flag indicating that object can be removed or not.
88 HYDRODATA_EXPORT virtual bool CanRemove();
91 // Public methods to work with reference Shapes
94 * Add new one shape for the group.
96 HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
99 * Sets new sequence of shapes for the group.
101 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
104 * Sets new list of shapes for the group.
106 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
109 * Returns all shapes of the group.
111 HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
114 * Removes all shapes from the group.
116 HYDRODATA_EXPORT virtual void RemoveShapes();
121 friend class HYDROData_Iterator;
124 * Creates new object in the internal data structure. Use higher level objects
125 * to create objects with real content.
127 HYDRODATA_EXPORT HYDROData_ShapesGroup();
130 * Destructs properties of the object and object itself, removes it from the document.
132 virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();