2 #ifndef HYDROData_Polyline3D_HeaderFile
3 #define HYDROData_Polyline3D_HeaderFile
5 #include "HYDROData_Object.h"
7 DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object)
9 class Handle(HYDROData_PolylineXY);
10 class Handle(HYDROData_ProfileUZ);
13 /**\class HYDROData_Polyline3D
17 class HYDROData_Polyline3D : public HYDROData_Object
21 typedef gp_XYZ Polyline3DPoint;
22 typedef NCollection_Sequence<Polyline3DPoint> Polyline3DPoints;
26 * Enumeration of tags corresponding to the persistent object parameters.
30 DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
31 DataTag_PolylineXY, ///< reference hydraulic axis
32 DataTag_ProfileUZ, ///< reference profile
33 DataTag_ChildProfileUZ, ///< reference profile
37 DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
40 * Returns the kind of this object. Must be redefined in all objects of known type.
42 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
45 * Dump object to Python script representation.
47 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
50 * Returns the list of all reference objects of this object.
52 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
55 * Returns the top shape of the object.
57 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
60 * Returns the 3d shape of the object.
62 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
65 * Update the shape presentations of stream.
66 * Call this method whenever you made changes for stream data.
68 HYDRODATA_EXPORT virtual void Update();
71 * Returns default filling color for new 3D polyline.
73 HYDRODATA_EXPORT static QColor DefaultFillingColor();
76 * Returns default border color for new 3D polyline.
78 HYDRODATA_EXPORT static QColor DefaultBorderColor();
82 // Public methods to work with 3D polyline
85 * Sets reference x,y polyline object for 3D polyline.
87 HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline,
88 const bool theIsUpdateProfile = true );
91 * Returns reference x,y polyline object of 3D polyline.
93 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
96 * Remove reference x,y polyline object from 3D polyline.
98 HYDRODATA_EXPORT virtual void RemovePolylineXY();
102 * Sets reference u,z profile object for 3D polyline.
104 HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
107 * Returns reference u,z profile object of 3D polyline.
109 HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
112 * Remove reference u,z profile object from 3D polyline.
114 HYDRODATA_EXPORT virtual void RemoveProfileUZ();
118 * Set reference bathymetry object for geometry object.
119 * Reimplemented to remove reference u,z profile.
121 HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
124 * Clear the reference bathymetry object for geometry object.
125 * Reimplemented to remove child u,z profile.
127 HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
131 * Returns the child u,z profile which has been generated from bathymetry.
133 HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
136 * Sets the child u,z profile for polyline.
138 HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
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;
154 * Checks and if necessary create child 3D object.
155 * Reimplemented to prevent creation of 3D child object.
157 HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
163 void updateChildProfilePoints();
165 void removeChildProfileUZ();
170 friend class HYDROData_Iterator;
173 * Creates new object in the internal data structure. Use higher level objects
174 * to create objects with real content.
176 HYDRODATA_EXPORT HYDROData_Polyline3D();
179 * Destructs properties of the object and object itself, removes it from the document.
181 virtual HYDRODATA_EXPORT ~HYDROData_Polyline3D();