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>
23 #include <TopTools_SequenceOfShape.hxx>
24 #include <TopTools_ListOfShape.hxx>
28 class BRepBuilderAPI_MakeShape;
29 class ShapeUpgrade_UnifySameDomain;
31 /**\class HYDROData_ShapesGroup
32 * \brief Class that stores/retreives the sequence of shapes.
34 class HYDROData_ShapesGroup : public HYDROData_Entity
38 struct GroupDefinition
42 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
43 BRepBuilderAPI_MakeShape* theAlgo );
45 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
46 ShapeUpgrade_UnifySameDomain* theAlgo );
48 void Dump( std::ostream& theStream ) const;
50 static void Dump( std::ostream& theStream,
51 const NCollection_Sequence<GroupDefinition>& theGroups );
53 TCollection_AsciiString Name;
54 TopTools_SequenceOfShape Shapes;
56 typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
60 * Enumeration of tags corresponding to the persistent object parameters.
64 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
65 DataTag_Shape, ///< reference edges
69 DEFINE_STANDARD_RTTIEXT(HYDROData_ShapesGroup, HYDROData_Entity);
72 * Returns the kind of this object. Must be redefined in all objects of known type.
74 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
77 * Returns flag indicating that object is updateble or not.
79 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
82 * Returns flag indicating that object can be removed or not.
84 HYDRODATA_EXPORT virtual bool CanRemove();
87 // Public methods to work with reference Shapes
90 * Add new one shape for the group.
92 HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
95 * Sets new sequence of shapes for the group.
97 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
100 * Sets new list of shapes for the group.
102 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
105 * Returns all shapes of the group.
107 HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
110 * Removes all shapes from the group.
112 HYDRODATA_EXPORT virtual void RemoveShapes();
117 friend class HYDROData_Iterator;
120 * Creates new object in the internal data structure. Use higher level objects
121 * to create objects with real content.
123 HYDRODATA_EXPORT HYDROData_ShapesGroup();
126 * Destructs properties of the object and object itself, removes it from the document.
128 virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();