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_IAltitudeObject);
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_AltitudeObject, ///< reference altitude object
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
35 DataTag_ChildAltitudeObject, ///< child altitude object
39 DEFINE_STANDARD_RTTI(HYDROData_Object);
42 * Updates the name of this object.
43 * Reimplemented to update the names child groups.
45 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
48 * Update the geometry object.
49 * Call this method whenever you made changes for object data.
51 HYDRODATA_EXPORT virtual void Update();
54 * Returns the list of all reference objects of this object.
56 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
59 * Sets the "MustBeUpdated" flag: if object is depended on updated features.
60 * Reimplemented to update the state of child 3D object.
62 HYDRODATA_EXPORT virtual void SetToUpdate( bool theFlag );
66 * Sets the top(2d projection) shape of the object.
68 HYDRODATA_EXPORT virtual void SetTopShape( const TopoDS_Shape& theShape );
71 * Returns the top shape of the object.
73 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0;
76 * Sets the 3d shape of the object.
78 HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
81 * Returns the 3d shape of the object.
83 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0;
87 * Returns reference object which represent the 3D shape of object.
89 HYDRODATA_EXPORT virtual Handle(HYDROData_DummyObject3D) GetObject3D() const;
93 * Returns sequence of object groups.
95 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGroups() const;
98 * Returns group data model object by it id.
100 HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) GetGroup( const int theGroupId ) const;
103 * Returns group id by data model object.
105 HYDRODATA_EXPORT virtual int GetGroupId( const Handle(HYDROData_ShapesGroup)& theGroup ) const;
109 * Set reference altitude object for geometry object.
111 HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
114 * Returns reference altitude object of geometry object.
116 HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetAltitudeObject() const;
119 * Clear the reference altitude object for geometry object.
121 HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
125 * Sets filling color for object.
127 HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
130 * Returns filling color of object.
132 HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
135 * Sets border color for object.
137 HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
140 * Returns border color of object.
142 HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
147 * Returns default filling color for new object.
149 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
152 * Returns default border color for new object.
154 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
159 * Creates new object in the internal data structure. Use higher level objects
160 * to create objects with real content.
162 HYDRODATA_EXPORT HYDROData_Object();
165 * Destructs properties of the object and object itself, removes it from the document.
167 virtual HYDRODATA_EXPORT ~HYDROData_Object();
172 * Checks and if necessary create child 3D object.
173 * Reimplement this function in your subclass if you
174 * do not want to create child 3D object.
176 HYDRODATA_EXPORT virtual void checkAndSetObject3D();
180 * Returns the type of child altitude object.
181 * Base implementation returns KIND_UNKNOWN, it means that child altitude
182 * object will not be created inside of checkAndSetAltitudeObject() function.
183 * Reimplement this function in your subclass an return correct altitude
184 * object type if you want to create child altitude object.
186 HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
189 * Checks and if necessary create child altitude object.
191 HYDRODATA_EXPORT virtual void checkAndSetAltitudeObject();
194 * Return the child altitude object.
196 HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) getChildAltitudeObject() const;
200 * Create new one child group object.
202 HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject();
205 * Remove all child group objects.
207 HYDRODATA_EXPORT virtual void removeGroupObjects();
211 * Retrieve the top shape of the object from data label.
213 HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
216 * Removes the top shape from data label of the object.
218 HYDRODATA_EXPORT void removeTopShape();
222 * Retrieve the 3d shape of the object from data label.
224 HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
227 * Removes the 3d shape from data label of the object.
229 HYDRODATA_EXPORT void removeShape3D();