1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROData_ShapesGroup_HeaderFile
24 #define HYDROData_ShapesGroup_HeaderFile
26 #include <HYDROData_Entity.h>
28 #include <TopTools_SequenceOfShape.hxx>
33 class TopTools_ListOfShape;
34 class BRepBuilderAPI_MakeShape;
35 class ShapeUpgrade_UnifySameDomain;
37 DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
39 /**\class HYDROData_ShapesGroup
40 * \brief Class that stores/retreives the sequence of shapes.
42 class HYDROData_ShapesGroup : public HYDROData_Entity
46 struct GroupDefinition
50 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
51 BRepBuilderAPI_MakeShape* theAlgo );
53 static void Update( NCollection_Sequence<GroupDefinition>* theGroupsDefs,
54 ShapeUpgrade_UnifySameDomain* theAlgo );
56 void Dump( std::ostream& theStream ) const;
58 static void Dump( std::ostream& theStream,
59 const NCollection_Sequence<GroupDefinition>& theGroups );
61 TCollection_AsciiString Name;
62 TopTools_SequenceOfShape Shapes;
64 typedef NCollection_Sequence<GroupDefinition> SeqOfGroupsDefs;
68 * Enumeration of tags corresponding to the persistent object parameters.
72 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
73 DataTag_Shape, ///< reference edges
77 DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
80 * Returns the kind of this object. Must be redefined in all objects of known type.
82 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
85 * Returns flag indicating that object is updateble or not.
87 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
90 * Returns flag indicating that object can be removed or not.
92 HYDRODATA_EXPORT virtual bool CanRemove();
95 // Public methods to work with reference Shapes
98 * Add new one shape for the group.
100 HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
103 * Sets new sequence of shapes for the group.
105 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
108 * Sets new list of shapes for the group.
110 HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
113 * Returns all shapes of the group.
115 HYDRODATA_EXPORT virtual void GetShapes( TopTools_SequenceOfShape& theShapes ) const;
118 * Removes all shapes from the group.
120 HYDRODATA_EXPORT virtual void RemoveShapes();
125 friend class HYDROData_Iterator;
128 * Creates new object in the internal data structure. Use higher level objects
129 * to create objects with real content.
131 HYDRODATA_EXPORT HYDROData_ShapesGroup();
134 * Destructs properties of the object and object itself, removes it from the document.
136 virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();