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;
92 * Returns sequence of object groups.
94 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGroups() const;
98 * Set reference altitude object for geometry object.
100 HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
103 * Returns reference altitude object of geometry object.
105 HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetAltitudeObject() const;
108 * Clear the reference altitude object for geometry object.
110 HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
114 * Sets filling color for object.
116 HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
119 * Returns filling color of object.
121 HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
124 * Sets border color for object.
126 HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
129 * Returns border color of object.
131 HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
136 * Returns default filling color for new object.
138 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
141 * Returns default border color for new object.
143 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
148 * Creates new object in the internal data structure. Use higher level objects
149 * to create objects with real content.
151 HYDRODATA_EXPORT HYDROData_Object();
154 * Destructs properties of the object and object itself, removes it from the document.
156 virtual HYDRODATA_EXPORT ~HYDROData_Object();
161 * Checks and if necessary create child 3D object.
162 * Reimplement this function in your subclass if you
163 * do not want to create child 3D object.
165 HYDRODATA_EXPORT virtual void checkAndSetObject3D();
169 * Returns the type of child altitude object.
170 * Base implementation returns KIND_UNKNOWN, it means that child altitude
171 * object will not be created inside of checkAndSetAltitudeObject() function.
172 * Reimplement this function in your subclass an return correct altitude
173 * object type if you want to create child altitude object.
175 HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
178 * Checks and if necessary create child altitude object.
180 HYDRODATA_EXPORT virtual void checkAndSetAltitudeObject();
183 * Return the child altitude object.
185 HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) getChildAltitudeObject() const;
189 * Create new one child group object.
191 HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject();
194 * Remove all child group objects.
196 HYDRODATA_EXPORT virtual void removeGroupObjects();
200 * Retrieve the top shape of the object from data label.
202 HYDRODATA_EXPORT TopoDS_Shape getTopShape() const;
205 * Removes the top shape from data label of the object.
207 HYDRODATA_EXPORT void removeTopShape();
211 * Retrieve the 3d shape of the object from data label.
213 HYDRODATA_EXPORT TopoDS_Shape getShape3D() const;
216 * Removes the 3d shape from data label of the object.
218 HYDRODATA_EXPORT void removeShape3D();