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);
13 class Handle(HYDROData_ShapesGroup);
15 /**\class HYDROData_Object
16 * \brief The base class for all geometrical objects in the HYDRO module.
19 class HYDROData_Object : public HYDROData_Entity
23 * Enumeration of tags corresponding to the persistent object parameters.
27 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
30 DataTag_Bathymetry, ///< reference bathymetry
31 DataTag_FillingColor, ///< filling color of geometrical object
32 DataTag_BorderColor, ///< border color of geometrical object
33 DataTag_Object3D, ///< child 3D object
34 DataTag_EdgesGroup, ///< child group objects
38 DEFINE_STANDARD_RTTI(HYDROData_Object);
41 * Update the geometry object.
42 * Call this method whenever you made changes for object data.
44 HYDRODATA_EXPORT virtual void Update();
47 * Returns the list of all reference objects of this object.
49 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
52 * Sets the "MustBeUpdated" flag: if object is depended on updated features.
53 * Reimplemented to update the state of child 3D object.
55 HYDRODATA_EXPORT virtual void SetToUpdate( bool theFlag );
59 * Sets the top(2d projection) shape of the object.
61 HYDRODATA_EXPORT virtual void SetTopShape( const TopoDS_Shape& theShape );
64 * Returns the top shape of the object.
66 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
69 * Sets the 3d shape of the object.
71 HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
74 * Returns the 3d shape of the object.
76 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
80 * Returns reference object which represent the 3D shape of object.
82 HYDRODATA_EXPORT virtual Handle(HYDROData_DummyObject3D) GetObject3D() const;
85 * Returns sequence of object groups.
87 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGroups() const;
91 * Set reference bathymetry object for geometry object.
93 HYDRODATA_EXPORT virtual bool SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
96 * Returns reference bathymetry object of geometry object.
98 HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const;
101 * Clear the reference bathymetry object for geometry object.
103 HYDRODATA_EXPORT virtual void RemoveBathymetry();
106 * Sets filling color for object.
108 HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
111 * Returns filling color of object.
113 HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
116 * Sets border color for object.
118 HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
121 * Returns border color of object.
123 HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
126 * Returns default filling color for new object.
128 HYDRODATA_EXPORT static QColor DefaultFillingColor();
131 * Returns default border color for new object.
133 HYDRODATA_EXPORT static QColor DefaultBorderColor();
138 * Returns default filling color for new object.
140 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
143 * Returns default border color for new object.
145 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
150 * Creates new object in the internal data structure. Use higher level objects
151 * to create objects with real content.
153 HYDRODATA_EXPORT HYDROData_Object();
156 * Destructs properties of the object and object itself, removes it from the document.
158 virtual HYDRODATA_EXPORT ~HYDROData_Object();
163 * Checks and if necessary create child 3D object.
164 * Reimplement this function in your subclass if you
165 * do not want to create child 3D object.
167 HYDRODATA_EXPORT virtual void checkAndSetObject3D();
171 * Create new one child group object.
173 HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject();
176 * Create all necessary child group objects.
177 * Base implementation does nothing.
179 HYDRODATA_EXPORT virtual void createGroupObjects();
182 * Remove all child group objects.
184 HYDRODATA_EXPORT virtual void removeGroupObjects();
188 * Retrieve the top shape of the object from data label.
190 HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
193 * Removes the top shape from data label of the object.
195 HYDRODATA_EXPORT void removeTopShape();
199 * Retrieve the 3d shape of the object from data label.
201 HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
204 * Removes the 3d shape from data label of the object.
206 HYDRODATA_EXPORT void removeShape3D();