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)
26 /**\class HYDROData_ProfileUZ
27 * \brief Class that stores/retreives information about the
28 * parametric profile points.
30 class HYDROData_ProfileUZ : public HYDROData_IPolyline
34 * Enumeration of tags corresponding to the persistent object parameters.
38 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
42 DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
46 * Returns the kind of this object. Must be redefined in all objects of known type.
48 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
53 * Returns the 3D presentation of all points.
55 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
58 * Returns the depth for given distance.
60 HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
61 const double& theDistance );
65 * Returns number of sections.
67 HYDRODATA_EXPORT virtual int NbSections() const;
70 * Adds new one section.
71 * \param theSectName name of the section
72 * \param theSectionType type of section
73 * \param theIsClosed flag indicates closures of section
75 HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
76 const SectionType theSectionType,
77 const bool theIsClosed );
80 * Returns name of section with given index.
81 * \param theSectionIndex index of section
83 HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
86 * Set name for section with given index.
87 * \param theSectionIndex index of section
88 * \param theSectionName new section name
90 HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex,
91 const TCollection_AsciiString& theSectionName );
94 * Returns type of section with given index.
95 * \param theSectionIndex index of section
97 HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
100 * Set type for section with given index.
101 * \param theSectionIndex index of section
102 * \param theSectionType new section type
104 HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
105 const SectionType theSectionType );
108 * Returns true if section with given index is closed.
109 * \param theSectionIndex index of section
111 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
114 * Set closed flag for section with given index.
115 * \param theSectionIndex index of section
116 * \param theIsClosed new closures state
118 HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex,
119 const bool theIsClosed );
122 * Removes section with given index.
123 * \param theSectionIndex index of section
125 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
128 * Removes all sections.
130 HYDRODATA_EXPORT virtual void RemoveSections();
134 * Adds new point for section with index "theSectionIndex".
135 * \param theSectionIndex index of section
136 * \param thePoint point to add
137 * \param theBeforeIndex if not equal -1 then insert point in this pos
139 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
140 const Point& thePoint,
141 const int thePointIndex = -1 );
144 * Replaces point for section with index "theSectionIndex".
145 * \param theSectionIndex index of section
146 * \param thePoint new point
147 * \param thePointIndex index of point to replace
149 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
150 const Point& thePoint,
151 const int thePointIndex );
154 * Removes point from section with index "theSectionIndex".
155 * \param theSectionIndex index of section
156 * \param thePointIndex index of point
158 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
159 const int thePointIndex );
163 * Returns list of points.
164 * \param theSectionIndex if not equal -1 then list of points returned
165 * only for section with this index
166 * \return list of points
168 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
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_ProfileUZ();
181 * Destructs properties of the object and object itself, removes it from the document.
183 HYDRODATA_EXPORT ~HYDROData_ProfileUZ();