1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROData_Polyline3D_HeaderFile
20 #define HYDROData_Polyline3D_HeaderFile
22 #include "HYDROData_Object.h"
24 DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object)
26 class Handle(HYDROData_PolylineXY);
27 class Handle(HYDROData_ProfileUZ);
30 /**\class HYDROData_Polyline3D
34 class HYDROData_Polyline3D : public HYDROData_Object
38 typedef gp_XYZ Polyline3DPoint;
39 typedef NCollection_Sequence<Polyline3DPoint> Polyline3DPoints;
43 * Enumeration of tags corresponding to the persistent object parameters.
47 DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
48 DataTag_PolylineXY, ///< reference hydraulic axis
49 DataTag_ProfileUZ, ///< reference profile
50 DataTag_ChildProfileUZ, ///< reference profile
54 DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
57 * Returns the kind of this object. Must be redefined in all objects of known type.
59 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
62 * Dump object to Python script representation.
64 HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
65 MapOfTreatedObjects& theTreatedObjects ) const;
68 * Returns the list of all reference objects of this object.
70 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
73 * Update the shape presentations of stream.
74 * Call this method whenever you made changes for stream data.
76 HYDRODATA_EXPORT virtual void Update();
79 * Returns default filling color for new 3D polyline.
81 HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const;
84 * Returns default border color for new 3D polyline.
86 HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const;
90 // Public methods to work with 3D polyline
93 * Sets reference x,y polyline object for 3D polyline.
95 HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline,
96 const bool theIsUpdateProfile = true );
99 * Returns reference x,y polyline object of 3D polyline.
101 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
104 * Remove reference x,y polyline object from 3D polyline.
106 HYDRODATA_EXPORT virtual void RemovePolylineXY();
110 * Sets reference u,z profile object for 3D polyline.
112 HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
115 * Returns reference u,z profile object of 3D polyline.
117 HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
120 * Remove reference u,z profile object from 3D polyline.
122 HYDRODATA_EXPORT virtual void RemoveProfileUZ();
126 * Set reference bathymetry object for geometry object.
127 * Reimplemented to remove reference u,z profile.
129 HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
132 * Clear the reference bathymetry object for geometry object.
133 * Reimplemented to remove child u,z profile.
135 HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
139 * Returns the child u,z profile which has been generated from bathymetry.
141 HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
144 * Sets the child u,z profile for polyline.
146 HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
149 * Returns list of polyline points.
150 * \return list of 3D points
152 HYDRODATA_EXPORT Polyline3DPoints GetPoints() const;
156 * Checks and if necessary create child 3D object.
157 * Reimplemented to prevent creation of 3D child object.
159 HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
165 void updateChildProfilePoints();
167 void removeChildProfileUZ();
172 friend class HYDROData_Iterator;
175 * Creates new object in the internal data structure. Use higher level objects
176 * to create objects with real content.
178 HYDRODATA_EXPORT HYDROData_Polyline3D();
181 * Destructs properties of the object and object itself, removes it from the document.
183 virtual HYDRODATA_EXPORT ~HYDROData_Polyline3D();