X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Region.h;h=7139837bc89959d04bf38453ffeef4722ded3a6e;hb=df8dab16fdc81951add536635285bfadb8a8856d;hp=23cd0d6232fa9be8dc418b896def1d46ff685df4;hpb=f664563df96e1f99e099bc90a1088533e6a018b0;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Region.h b/src/HYDROData/HYDROData_Region.h index 23cd0d62..7139837b 100644 --- a/src/HYDROData/HYDROData_Region.h +++ b/src/HYDROData/HYDROData_Region.h @@ -2,26 +2,31 @@ #ifndef HYDROData_Region_HeaderFile #define HYDROData_Region_HeaderFile -#include +#include "HYDROData_Entity.h" -DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Domain) +DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity) +class Handle(HYDROData_Zone); -/**\class HYDROData_Domain - * \brief Class that stores/retreives information about the 2d surface. +class TopoDS_Shape; + +/**\class HYDROData_Region + * \brief Regions are groups (lists) of zones, they can include one or several zones. */ -class HYDROData_Region : public HYDROData_Domain +class HYDROData_Region : public HYDROData_Entity { protected: + /** * Enumeration of tags corresponding to the persistent object parameters. */ enum DataTag { - DataTag_First = HYDROData_Domain::DataTag_First + 100, ///< first tag, to reserve - DataTag_Face + DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve + DataTag_ChildZone, ///< child zones + DataTag_Zone, ///< reference zones }; public: @@ -33,34 +38,87 @@ public: HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; } /** - * Sets the shape of the object. + * Dump object to Python script representation. + */ + HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const; + + + /** + * Returns flag indicating that object is updateble or not. + */ + HYDRODATA_EXPORT virtual bool CanBeUpdated() const; + + + /** + * Removes object and it child sub-objects from the data structure. + * Reimplemented to update names of regions in father calculation. */ - HYDRODATA_EXPORT void SetFace( const TopoDS_Face& theFace ); + HYDRODATA_EXPORT virtual void Remove(); /** - * Returns the shape of the the object (redefined method). + * Returns flag indicating that object can be removed or not. */ - HYDRODATA_EXPORT virtual TopoDS_Face Face() const; + HYDRODATA_EXPORT virtual bool CanRemove(); + + /** + * Returns the list of all reference objects of this object. + */ + HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const; + + + /** + * Add new one reference zone for region. + * The label of theZone is changed in case if old parent is not this region. + */ + HYDRODATA_EXPORT virtual bool AddZone( const Handle(HYDROData_Zone)& theZone ); + + /** + * Returns all reference zone of region. + */ + HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const; + + /** + * Removes reference zone from region. + */ + HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone ); + + /** + * Removes all reference zones from region. + */ + HYDRODATA_EXPORT virtual void RemoveZones(); + + /** + * \brief Returns the shape of the region. + * Shape of the region could be: + * - a face which is the union of the region zones faces + * - a shell if the zones faces can't be united into one face + * \return shape as TopoDS_Shape + */ + HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const; protected: + /** + * Create new one reference zone for region on child label. + * The new zone is added into the list of reference zones. + */ + HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) addNewZone(); + +protected: + + friend class HYDROData_CalculationCase; friend class HYDROData_Iterator; /** * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ - HYDROData_Region(); + HYDRODATA_EXPORT HYDROData_Region(); /** * Destructs properties of the object and object itself, removes it from the document. */ - ~HYDROData_Region(); - - /** - * Returns id for creation of object in python scripting. - */ - virtual QString getPythonKindId() const; + HYDRODATA_EXPORT ~HYDROData_Region(); }; #endif