1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROData_Polyline3D_HeaderFile
24 #define HYDROData_Polyline3D_HeaderFile
26 #include "HYDROData_Object.h"
28 DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object)
30 class Handle(HYDROData_PolylineXY);
31 class Handle(HYDROData_ProfileUZ);
34 /**\class HYDROData_Polyline3D
38 class HYDROData_Polyline3D : public HYDROData_Object
42 typedef gp_XYZ Polyline3DPoint;
43 typedef NCollection_Sequence<Polyline3DPoint> Polyline3DPoints;
47 * Enumeration of tags corresponding to the persistent object parameters.
51 DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
52 DataTag_PolylineXY, ///< reference hydraulic axis
53 DataTag_ProfileUZ, ///< reference profile
54 DataTag_ChildProfileUZ, ///< reference profile
58 DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
61 * Returns the kind of this object. Must be redefined in all objects of known type.
63 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
66 * Dump object to Python script representation.
68 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
71 * Returns the list of all reference objects of this object.
73 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
76 * Returns the top shape of the object.
78 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
81 * Returns the 3d shape of the object.
83 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
86 * Update the shape presentations of stream.
87 * Call this method whenever you made changes for stream data.
89 HYDRODATA_EXPORT virtual void Update();
92 * Returns default filling color for new 3D polyline.
94 HYDRODATA_EXPORT static QColor DefaultFillingColor();
97 * Returns default border color for new 3D polyline.
99 HYDRODATA_EXPORT static QColor DefaultBorderColor();
103 // Public methods to work with 3D polyline
106 * Sets reference x,y polyline object for 3D polyline.
108 HYDRODATA_EXPORT virtual bool SetPolylineXY( const Handle(HYDROData_PolylineXY)& thePolyline,
109 const bool theIsUpdateProfile = true );
112 * Returns reference x,y polyline object of 3D polyline.
114 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolylineXY() const;
117 * Remove reference x,y polyline object from 3D polyline.
119 HYDRODATA_EXPORT virtual void RemovePolylineXY();
123 * Sets reference u,z profile object for 3D polyline.
125 HYDRODATA_EXPORT virtual bool SetProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
128 * Returns reference u,z profile object of 3D polyline.
130 HYDRODATA_EXPORT virtual Handle(HYDROData_ProfileUZ) GetProfileUZ() const;
133 * Remove reference u,z profile object from 3D polyline.
135 HYDRODATA_EXPORT virtual void RemoveProfileUZ();
139 * Set reference bathymetry object for geometry object.
140 * Reimplemented to remove reference u,z profile.
142 HYDRODATA_EXPORT virtual bool SetAltitudeObject( const Handle(HYDROData_IAltitudeObject)& theAltitude );
145 * Clear the reference bathymetry object for geometry object.
146 * Reimplemented to remove child u,z profile.
148 HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
152 * Returns the child u,z profile which has been generated from bathymetry.
154 HYDRODATA_EXPORT Handle(HYDROData_ProfileUZ) GetChildProfileUZ( const bool theIsCreate = true ) const;
157 * Sets the child u,z profile for polyline.
159 HYDRODATA_EXPORT void SetChildProfileUZ( const Handle(HYDROData_ProfileUZ)& theProfile );
165 * Returns default filling color for new object.
167 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
170 * Returns default border color for new object.
172 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
175 * Checks and if necessary create child 3D object.
176 * Reimplemented to prevent creation of 3D child object.
178 HYDRODATA_EXPORT virtual void checkAndSetObject3D() {}
184 void updateChildProfilePoints();
186 void removeChildProfileUZ();
191 friend class HYDROData_Iterator;
194 * Creates new object in the internal data structure. Use higher level objects
195 * to create objects with real content.
197 HYDRODATA_EXPORT HYDROData_Polyline3D();
200 * Destructs properties of the object and object itself, removes it from the document.
202 virtual HYDRODATA_EXPORT ~HYDROData_Polyline3D();