]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_ProfileUZ.h
Salome HOME
#refs 522 (very draft) //import only
[modules/hydro.git] / src / HYDROData / HYDROData_ProfileUZ.h
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROData_ProfileUZ_HeaderFile
24 #define HYDROData_ProfileUZ_HeaderFile
25
26 #include "HYDROData_IPolyline.h"
27
28 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
29
30 /**\class HYDROData_ProfileUZ
31  * \brief Class that stores/retreives information about the 
32  *        parametric profile points.
33  */
34 class HYDROData_ProfileUZ : public HYDROData_IPolyline
35 {
36 protected:
37   /**
38    * Enumeration of tags corresponding to the persistent object parameters.
39    */
40   enum DataTag
41   {
42     DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
43   };
44
45 public:
46   DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
47
48
49   /**
50    * Returns the kind of this object. Must be redefined in all objects of known type.
51    */
52   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
53
54 public:
55
56   /**
57    * Returns the 3D presentation of all points.
58    */
59   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
60
61   /**
62    * Returns the depth for given distance.
63    */
64   HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
65                                                        const double&     theDistance );
66
67
68   /**
69    * Returns number of sections.
70    */
71   HYDRODATA_EXPORT virtual int NbSections() const;
72
73   /**
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
78    */
79   HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
80                                             const SectionType              theSectionType,
81                                             const bool                     theIsClosed );
82
83   /**
84    * Returns name of section with given index.
85    * \param theSectionIndex index of section
86    */
87   HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
88
89   /**
90    * Set name for section with given index.
91    * \param theSectionIndex index of section
92    * \param theSectionName new section name
93    */
94   HYDRODATA_EXPORT virtual void SetSectionName( const int                      theSectionIndex, 
95                                                 const TCollection_AsciiString& theSectionName );
96
97   /**
98    * Returns type of section with given index.
99    * \param theSectionIndex index of section
100    */
101   HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
102
103   /**
104    * Set type for section with given index.
105    * \param theSectionIndex index of section
106    * \param theSectionType new section type
107    */
108   HYDRODATA_EXPORT virtual void SetSectionType( const int         theSectionIndex, 
109                                                 const SectionType theSectionType );
110
111   /**
112    * Returns true if section with given index is closed.
113    * \param theSectionIndex index of section
114    */
115   HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
116
117   /**
118    * Set closed flag for section with given index.
119    * \param theSectionIndex index of section
120    * \param theIsClosed new closures state
121    */
122   HYDRODATA_EXPORT virtual void SetSectionClosed( const int  theSectionIndex, 
123                                                   const bool theIsClosed );
124
125   /**
126    * Removes section with given index.
127    * \param theSectionIndex index of section
128    */
129   HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
130
131   /**
132    * Removes all sections.
133    */
134   HYDRODATA_EXPORT virtual void RemoveSections();
135
136
137   /**
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
142    */
143   HYDRODATA_EXPORT virtual void AddPoint( const int    theSectionIndex,
144                                           const Point& thePoint,
145                                           const int    thePointIndex = -1 );
146
147   /**
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
152    */
153   HYDRODATA_EXPORT virtual void SetPoint( const int    theSectionIndex,
154                                           const Point& thePoint,
155                                           const int    thePointIndex );
156
157   /**
158    * Removes point from section with index "theSectionIndex".
159    * \param theSectionIndex index of section
160    * \param thePointIndex index of point
161    */
162   HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
163                                              const int thePointIndex );
164
165
166   /**
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
171    */
172   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
173
174 protected:
175
176   friend class HYDROData_Iterator;
177
178   /**
179    * Creates new object in the internal data structure. Use higher level objects 
180    * to create objects with real content.
181    */
182   HYDRODATA_EXPORT HYDROData_ProfileUZ();
183
184   /**
185    * Destructs properties of the object and object itself, removes it from the document.
186    */
187   HYDRODATA_EXPORT ~HYDROData_ProfileUZ();
188 };
189
190 #endif