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 * Updates the name of this object.
42 * Reimplemented to update the names child groups.
44 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
47 * Update the geometry object.
48 * Call this method whenever you made changes for object data.
50 HYDRODATA_EXPORT virtual void Update();
53 * Returns the list of all reference objects of this object.
55 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
58 * Sets the "MustBeUpdated" flag: if object is depended on updated features.
59 * Reimplemented to update the state of child 3D object.
61 HYDRODATA_EXPORT virtual void SetToUpdate( bool theFlag );
65 * Sets the top(2d projection) shape of the object.
67 HYDRODATA_EXPORT virtual void SetTopShape( const TopoDS_Shape& theShape );
70 * Returns the top shape of the object.
72 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
75 * Sets the 3d shape of the object.
77 HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
80 * Returns the 3d shape of the object.
82 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
86 * Returns reference object which represent the 3D shape of object.
88 HYDRODATA_EXPORT virtual Handle(HYDROData_DummyObject3D) GetObject3D() const;
91 * Returns sequence of object groups.
93 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGroups() const;
97 * Set reference bathymetry object for geometry object.
99 HYDRODATA_EXPORT virtual bool SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
102 * Returns reference bathymetry object of geometry object.
104 HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry() const;
107 * Clear the reference bathymetry object for geometry object.
109 HYDRODATA_EXPORT virtual void RemoveBathymetry();
112 * Sets filling color for object.
114 HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
117 * Returns filling color of object.
119 HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
122 * Sets border color for object.
124 HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
127 * Returns border color of object.
129 HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
132 * Returns default filling color for new object.
134 HYDRODATA_EXPORT static QColor DefaultFillingColor();
137 * Returns default border color for new object.
139 HYDRODATA_EXPORT static QColor DefaultBorderColor();
144 * Returns default filling color for new object.
146 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
149 * Returns default border color for new object.
151 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
156 * Creates new object in the internal data structure. Use higher level objects
157 * to create objects with real content.
159 HYDRODATA_EXPORT HYDROData_Object();
162 * Destructs properties of the object and object itself, removes it from the document.
164 virtual HYDRODATA_EXPORT ~HYDROData_Object();
169 * Checks and if necessary create child 3D object.
170 * Reimplement this function in your subclass if you
171 * do not want to create child 3D object.
173 HYDRODATA_EXPORT virtual void checkAndSetObject3D();
177 * Create new one child group object.
179 HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject();
182 * Create all necessary child group objects.
183 * Base implementation does nothing.
185 HYDRODATA_EXPORT virtual void createGroupObjects();
188 * Remove all child group objects.
190 HYDRODATA_EXPORT virtual void removeGroupObjects();
194 * Retrieve the top shape of the object from data label.
196 HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
199 * Removes the top shape from data label of the object.
201 HYDRODATA_EXPORT void removeTopShape();
205 * Retrieve the 3d shape of the object from data label.
207 HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
210 * Removes the 3d shape from data label of the object.
212 HYDRODATA_EXPORT void removeShape3D();