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_ProfileUZ_HeaderFile
20 #define HYDROData_ProfileUZ_HeaderFile
22 #include "HYDROData_IPolyline.h"
25 class HYDROData_PolylineXY;
27 /**\class HYDROData_ProfileUZ
28 * \brief Class that stores/retreives information about the
29 * parametric profile points.
31 class HYDROData_ProfileUZ : public HYDROData_IPolyline
35 * Enumeration of tags corresponding to the persistent object parameters.
39 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
43 DEFINE_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline);
47 * Returns the kind of this object. Must be redefined in all objects of known type.
49 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
54 * Returns the 3D presentation of all points.
56 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
59 * Returns the depth for given distance.
61 HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
62 const double& theDistance );
66 * Returns number of sections.
68 HYDRODATA_EXPORT virtual int NbSections() const;
71 * Adds new one section.
72 * \param theSectName name of the section
73 * \param theSectionType type of section
74 * \param theIsClosed flag indicates closures of section
76 HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
77 const SectionType theSectionType,
78 const bool theIsClosed );
81 * Returns name of section with given index.
82 * \param theSectionIndex index of section
84 HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
87 * Set name for section with given index.
88 * \param theSectionIndex index of section
89 * \param theSectionName new section name
91 HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex,
92 const TCollection_AsciiString& theSectionName );
95 * Returns type of section with given index.
96 * \param theSectionIndex index of section
98 HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
101 * Set type for section with given index.
102 * \param theSectionIndex index of section
103 * \param theSectionType new section type
105 HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
106 const SectionType theSectionType );
109 * Returns true if section with given index is closed.
110 * \param theSectionIndex index of section
112 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
115 * Set closed flag for section with given index.
116 * \param theSectionIndex index of section
117 * \param theIsClosed new closures state
119 HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex,
120 const bool theIsClosed );
123 * Removes section with given index.
124 * \param theSectionIndex index of section
126 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
129 * Removes all sections.
131 HYDRODATA_EXPORT virtual void RemoveSections();
135 * Adds new point for section with index "theSectionIndex".
136 * \param theSectionIndex index of section
137 * \param thePoint point to add
138 * \param theBeforeIndex if not equal -1 then insert point in this pos
140 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
141 const Point& thePoint,
142 const int thePointIndex = -1 );
145 * Replaces point for section with index "theSectionIndex".
146 * \param theSectionIndex index of section
147 * \param thePoint new point
148 * \param thePointIndex index of point to replace
150 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
151 const Point& thePoint,
152 const int thePointIndex );
155 * Removes point from section with index "theSectionIndex".
156 * \param theSectionIndex index of section
157 * \param thePointIndex index of point
159 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
160 const int thePointIndex );
164 * Returns list of points.
165 * \param theSectionIndex if not equal -1 then list of points returned
166 * only for section with this index
167 * \return list of points
169 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
171 HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints,
172 Handle(HYDROData_PolylineXY)& thePolylineXY, bool fillPolyXY);
176 friend class HYDROData_Iterator;
179 * Creates new object in the internal data structure. Use higher level objects
180 * to create objects with real content.
182 HYDRODATA_EXPORT HYDROData_ProfileUZ();
185 * Destructs properties of the object and object itself, removes it from the document.
187 HYDRODATA_EXPORT ~HYDROData_ProfileUZ();