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_ProfileUZ_HeaderFile
24 #define HYDROData_ProfileUZ_HeaderFile
26 #include "HYDROData_IPolyline.h"
28 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
30 /**\class HYDROData_ProfileUZ
31 * \brief Class that stores/retreives information about the
32 * parametric profile points.
34 class HYDROData_ProfileUZ : public HYDROData_IPolyline
38 * Enumeration of tags corresponding to the persistent object parameters.
42 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
46 DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
50 * Returns the kind of this object. Must be redefined in all objects of known type.
52 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
57 * Returns the 3D presentation of all points.
59 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
62 * Returns the depth for given distance.
64 HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
65 const double& theDistance );
69 * Returns number of sections.
71 HYDRODATA_EXPORT virtual int NbSections() const;
74 * Adds new one section.
75 * \param theSectName name of the section
76 * \param theSectionType type of section
77 * \param theIsClosed flag indicates closures of section
79 HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
80 const SectionType theSectionType,
81 const bool theIsClosed );
84 * Returns name of section with given index.
85 * \param theSectionIndex index of section
87 HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
90 * Set name for section with given index.
91 * \param theSectionIndex index of section
92 * \param theSectionName new section name
94 HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex,
95 const TCollection_AsciiString& theSectionName );
98 * Returns type of section with given index.
99 * \param theSectionIndex index of section
101 HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
104 * Set type for section with given index.
105 * \param theSectionIndex index of section
106 * \param theSectionType new section type
108 HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
109 const SectionType theSectionType );
112 * Returns true if section with given index is closed.
113 * \param theSectionIndex index of section
115 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
118 * Set closed flag for section with given index.
119 * \param theSectionIndex index of section
120 * \param theIsClosed new closures state
122 HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex,
123 const bool theIsClosed );
126 * Removes section with given index.
127 * \param theSectionIndex index of section
129 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
132 * Removes all sections.
134 HYDRODATA_EXPORT virtual void RemoveSections();
138 * Adds new point for section with index "theSectionIndex".
139 * \param theSectionIndex index of section
140 * \param thePoint point to add
141 * \param theBeforeIndex if not equal -1 then insert point in this pos
143 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
144 const Point& thePoint,
145 const int thePointIndex = -1 );
148 * Replaces point for section with index "theSectionIndex".
149 * \param theSectionIndex index of section
150 * \param thePoint new point
151 * \param thePointIndex index of point to replace
153 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
154 const Point& thePoint,
155 const int thePointIndex );
158 * Removes point from section with index "theSectionIndex".
159 * \param theSectionIndex index of section
160 * \param thePointIndex index of point
162 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
163 const int thePointIndex );
167 * Returns list of points.
168 * \param theSectionIndex if not equal -1 then list of points returned
169 * only for section with this index
170 * \return list of points
172 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
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();