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_Region_HeaderFile
20 #define HYDROData_Region_HeaderFile
22 #include "HYDROData_ShapesGroup.h"
25 DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity)
27 class Handle(HYDROData_Zone);
28 class Handle(HYDROData_Document);
33 /**\class HYDROData_Region
34 * \brief Regions are groups (lists) of zones, they can include one or several zones.
36 class HYDROData_Region : public HYDROData_Entity
42 * Enumeration of tags corresponding to the persistent object parameters.
46 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
47 DataTag_ChildZone, ///< child zones
48 DataTag_Zone, ///< reference zones
52 DEFINE_STANDARD_RTTI(HYDROData_Region);
55 * Returns the kind of this object. Must be redefined in all objects of known type.
57 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; }
60 * Dump object to Python script representation.
62 HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
63 MapOfTreatedObjects& theTreatedObjects,
64 QString defRegName = QString()) const;
67 * Returns flag indicating that object is updateble or not.
69 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
73 * Removes object and it child sub-objects from the data structure.
74 * Reimplemented to update names of regions in father calculation.
76 HYDRODATA_EXPORT virtual void Remove();
79 * Returns flag indicating that object can be removed or not.
81 HYDRODATA_EXPORT virtual bool CanRemove();
84 * Returns the list of all reference objects of this object.
86 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
90 * Add new one reference zone for region.
91 * The label of theZone is changed in case if old parent is not this region.
93 HYDRODATA_EXPORT virtual bool AddZone( const Handle(HYDROData_Zone)& theZone );
96 * Returns all reference zone of region.
98 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const;
101 * Removes reference zone from region.
103 HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone );
106 * Removes all reference zones from region.
108 HYDRODATA_EXPORT virtual void RemoveZones();
111 * \brief Returns the shape of the region.
112 * Shape of the region could be:
113 * - a face which is the union of the region zones faces
114 * - a shell if the zones faces can't be united into one face
115 * \return shape as TopoDS_Shape
117 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* theSeqOfGroups = 0 ) const;
119 HYDRODATA_EXPORT bool IsSubmersible() const;
124 * Create new one reference zone for region on child label.
125 * The new zone is added into the list of reference zones.
127 HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) addNewZone( const Handle(HYDROData_Document)& theDoc,
128 const QString& thePrefix,
129 const TopoDS_Face& theFace,
130 const QStringList& theRefObjects );
134 friend class HYDROData_CalculationCase;
135 friend class HYDROData_Iterator;
138 * Creates new object in the internal data structure. Use higher level objects
139 * to create objects with real content.
141 HYDRODATA_EXPORT HYDROData_Region();
144 * Destructs properties of the object and object itself, removes it from the document.
146 HYDRODATA_EXPORT ~HYDROData_Region();