2 #ifndef HYDROData_Object_HeaderFile
3 #define HYDROData_Object_HeaderFile
5 #include <HYDROData_Entity.h>
8 DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
11 class Handle(HYDROData_Bathymetry);
12 class Handle(HYDROData_DummyObject3D);
14 /**\class HYDROData_Object
15 * \brief The base class for all geometrical objects in the HYDRO module.
18 class HYDROData_Object : public HYDROData_Entity
22 * Enumeration of tags corresponding to the persistent object parameters.
26 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
29 DataTag_Bathymetry, ///< reference bathymetry
30 DataTag_FillingColor, ///< filling color of geometrical object
31 DataTag_BorderColor, ///< border color of geometrical object
32 DataTag_Object3D ///< child 3D object
36 DEFINE_STANDARD_RTTI(HYDROData_Object);
39 * Update the geometry object.
40 * Call this method whenever you made changes for object data.
42 HYDRODATA_EXPORT virtual void Update();
45 * Returns the list of all reference objects of this object.
47 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
50 * Sets the "MustBeUpdated" flag: if object is depended on updated features.
51 * Reimplemented to update the state of child 3D object.
53 HYDRODATA_EXPORT virtual void SetToUpdate( bool theFlag );
57 * Sets the top(2d projection) shape of the object.
59 HYDRODATA_EXPORT virtual void SetTopShape( const TopoDS_Shape& theShape );
62 * Returns the top shape of the object.
64 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
67 * Sets the 3d shape of the object.
69 HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
72 * Returns the 3d shape of the object.
74 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
78 * Returns reference object which represent the 3D shape of object.
79 * Base implementation returns NULL pointer.
81 HYDRODATA_EXPORT virtual Handle(HYDROData_DummyObject3D) GetObject3D() const;
85 * Set reference bathymetry object for geometry object.
87 HYDRODATA_EXPORT virtual void SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
90 * Returns reference bathymetry object of geometry object.
92 HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const;
95 * Clear the reference bathymetry object for geometry object.
97 HYDRODATA_EXPORT virtual void RemoveBathymetry();
100 * Sets filling color for object.
102 HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
105 * Returns filling color of object.
107 HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
110 * Sets border color for object.
112 HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
115 * Returns border color of object.
117 HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
120 * Returns default filling color for new object.
122 HYDRODATA_EXPORT static QColor DefaultFillingColor();
125 * Returns default border color for new object.
127 HYDRODATA_EXPORT static QColor DefaultBorderColor();
132 * Creates new object in the internal data structure. Use higher level objects
133 * to create objects with real content.
135 HYDRODATA_EXPORT HYDROData_Object();
138 * Destructs properties of the object and object itself, removes it from the document.
140 virtual HYDRODATA_EXPORT ~HYDROData_Object();
145 * Checks and if necessary create child 3D object.
146 * Reimplement this function in your subclass if you
147 * do not want to create child 3D object.
149 HYDRODATA_EXPORT virtual void checkAndSetObject3D();
152 * Retrieve the top shape of the object from data label.
154 HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
157 * Removes the top shape from data label of the object.
159 HYDRODATA_EXPORT void removeTopShape();
163 * Retrieve the 3d shape of the object from data label.
165 HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
168 * Removes the 3d shape from data label of the object.
170 HYDRODATA_EXPORT void removeShape3D();