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;
32 class BRepTools_ReShape;
34 DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
36 /**\class HYDROData_ShapesGroup
37 * \brief Class that stores/retreives the sequence of shapes.
39 class HYDROData_ShapesGroup : public HYDROData_Entity
43 struct GroupDefinition
47 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
48 BRepBuilderAPI_MakeShape* theAlgo );
50 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
51 ShapeUpgrade_UnifySameDomain* theAlgo );
53 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
54 BRepTools_ReShape* theAlgo );
57 void Dump( std::ostream& theStream ) const;
59 static void Dump( std::ostream& theStream,
60 const NCollection_Sequence<GroupDefinition>& theGroups );
62 TCollection_AsciiString Name;
63 TopTools_SequenceOfShape Shapes;
65 typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
69 * Enumeration of tags corresponding to the persistent object parameters.
73 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
74 DataTag_Shape, ///< reference edges
78 DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
81 * Returns the kind of this object. Must be redefined in all objects of known type.
83 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
86 * Returns flag indicating that object is updateble or not.
88 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
91 * Returns flag indicating that object can be removed or not.
93 HYDRODATA_EXPORT virtual bool CanRemove();
96 // Public methods to work with reference Shapes
99 * Add new one shape for the group.
101 HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
104 * Sets new sequence of shapes for the group.
106 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
109 * Sets new list of shapes for the group.
111 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
114 * Returns all shapes of the group.
116 HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
119 * Removes all shapes from the group.
121 HYDRODATA_EXPORT virtual void RemoveShapes();
126 friend class HYDROData_Iterator;
129 * Creates new object in the internal data structure. Use higher level objects
130 * to create objects with real content.
132 HYDRODATA_EXPORT HYDROData_ShapesGroup();
135 * Destructs properties of the object and object itself, removes it from the document.
137 virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();