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"
24 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
27 class Handle_HYDROData_PolylineXY;
29 /**\class HYDROData_ProfileUZ
30 * \brief Class that stores/retreives information about the
31 * parametric profile points.
33 class HYDROData_ProfileUZ : public HYDROData_IPolyline
37 * Enumeration of tags corresponding to the persistent object parameters.
41 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
45 DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
49 * Returns the kind of this object. Must be redefined in all objects of known type.
51 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
56 * Returns the 3D presentation of all points.
58 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
61 * Returns the depth for given distance.
63 HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
64 const double& theDistance );
68 * Returns number of sections.
70 HYDRODATA_EXPORT virtual int NbSections() const;
73 * Adds new one section.
74 * \param theSectName name of the section
75 * \param theSectionType type of section
76 * \param theIsClosed flag indicates closures of section
78 HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
79 const SectionType theSectionType,
80 const bool theIsClosed );
83 * Returns name of section with given index.
84 * \param theSectionIndex index of section
86 HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
89 * Set name for section with given index.
90 * \param theSectionIndex index of section
91 * \param theSectionName new section name
93 HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex,
94 const TCollection_AsciiString& theSectionName );
97 * Returns type of section with given index.
98 * \param theSectionIndex index of section
100 HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
103 * Set type for section with given index.
104 * \param theSectionIndex index of section
105 * \param theSectionType new section type
107 HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
108 const SectionType theSectionType );
111 * Returns true if section with given index is closed.
112 * \param theSectionIndex index of section
114 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
117 * Set closed flag for section with given index.
118 * \param theSectionIndex index of section
119 * \param theIsClosed new closures state
121 HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex,
122 const bool theIsClosed );
125 * Removes section with given index.
126 * \param theSectionIndex index of section
128 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
131 * Removes all sections.
133 HYDRODATA_EXPORT virtual void RemoveSections();
137 * Adds new point for section with index "theSectionIndex".
138 * \param theSectionIndex index of section
139 * \param thePoint point to add
140 * \param theBeforeIndex if not equal -1 then insert point in this pos
142 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
143 const Point& thePoint,
144 const int thePointIndex = -1 );
147 * Replaces point for section with index "theSectionIndex".
148 * \param theSectionIndex index of section
149 * \param thePoint new point
150 * \param thePointIndex index of point to replace
152 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
153 const Point& thePoint,
154 const int thePointIndex );
157 * Removes point from section with index "theSectionIndex".
158 * \param theSectionIndex index of section
159 * \param thePointIndex index of point
161 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
162 const int thePointIndex );
166 * Returns list of points.
167 * \param theSectionIndex if not equal -1 then list of points returned
168 * only for section with this index
169 * \return list of points
171 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
173 HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY);
177 friend class HYDROData_Iterator;
180 * Creates new object in the internal data structure. Use higher level objects
181 * to create objects with real content.
183 HYDRODATA_EXPORT HYDROData_ProfileUZ();
186 * Destructs properties of the object and object itself, removes it from the document.
188 HYDRODATA_EXPORT ~HYDROData_ProfileUZ();