Salome HOME
Import polyline from shape (Feature #228).
[modules/hydro.git] / src / HYDROData / HYDROData_ProfileUZ.h
1
2 #ifndef HYDROData_ProfileUZ_HeaderFile
3 #define HYDROData_ProfileUZ_HeaderFile
4
5 #include "HYDROData_IPolyline.h"
6
7 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
8
9 /**\class HYDROData_ProfileUZ
10  * \brief Class that stores/retreives information about the 
11  *        parametric profile points.
12  */
13 class HYDROData_ProfileUZ : public HYDROData_IPolyline
14 {
15 protected:
16   /**
17    * Enumeration of tags corresponding to the persistent object parameters.
18    */
19   enum DataTag
20   {
21     DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
22   };
23
24 public:
25   DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
26
27
28   /**
29    * Returns the kind of this object. Must be redefined in all objects of known type.
30    */
31   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
32
33 public:
34
35   /**
36    * Returns the 3D presentation of all points.
37    */
38   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
39
40   /**
41    * Returns the depth for given distance.
42    */
43   HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
44                                                        const double&     theDistance );
45
46
47   /**
48    * Returns number of sections.
49    */
50   HYDRODATA_EXPORT virtual int NbSections() const;
51
52   /**
53    * Adds new one section.
54    * \param theSectName name of the section
55    * \param theSectionType type of section
56    * \param theIsClosed flag indicates closures of section
57    */
58   HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
59                                             const SectionType              theSectionType,
60                                             const bool                     theIsClosed );
61
62   /**
63    * Returns name of section with given index.
64    * \param theSectionIndex index of section
65    */
66   HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
67
68   /**
69    * Set name for section with given index.
70    * \param theSectionIndex index of section
71    * \param theSectionName new section name
72    */
73   HYDRODATA_EXPORT virtual void SetSectionName( const int                      theSectionIndex, 
74                                                 const TCollection_AsciiString& theSectionName );
75
76   /**
77    * Returns type of section with given index.
78    * \param theSectionIndex index of section
79    */
80   HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
81
82   /**
83    * Set type for section with given index.
84    * \param theSectionIndex index of section
85    * \param theSectionType new section type
86    */
87   HYDRODATA_EXPORT virtual void SetSectionType( const int         theSectionIndex, 
88                                                 const SectionType theSectionType );
89
90   /**
91    * Returns true if section with given index is closed.
92    * \param theSectionIndex index of section
93    */
94   HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
95
96   /**
97    * Set closed flag for section with given index.
98    * \param theSectionIndex index of section
99    * \param theIsClosed new closures state
100    */
101   HYDRODATA_EXPORT virtual void SetSectionClosed( const int  theSectionIndex, 
102                                                   const bool theIsClosed );
103
104   /**
105    * Removes section with given index.
106    * \param theSectionIndex index of section
107    */
108   HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
109
110   /**
111    * Removes all sections.
112    */
113   HYDRODATA_EXPORT virtual void RemoveSections();
114
115
116   /**
117    * Adds new point for section with index "theSectionIndex".
118    * \param theSectionIndex index of section
119    * \param thePoint point to add
120    * \param theBeforeIndex if not equal -1 then insert point in this pos
121    */
122   HYDRODATA_EXPORT virtual void AddPoint( const int    theSectionIndex,
123                                           const Point& thePoint,
124                                           const int    thePointIndex = -1 );
125
126   /**
127    * Replaces point for section with index "theSectionIndex".
128    * \param theSectionIndex index of section
129    * \param thePoint new point
130    * \param thePointIndex index of point to replace
131    */
132   HYDRODATA_EXPORT virtual void SetPoint( const int    theSectionIndex,
133                                           const Point& thePoint,
134                                           const int    thePointIndex );
135
136   /**
137    * Removes point from section with index "theSectionIndex".
138    * \param theSectionIndex index of section
139    * \param thePointIndex index of point
140    */
141   HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
142                                              const int thePointIndex );
143
144
145   /**
146    * Returns list of points.
147    * \param theSectionIndex if not equal -1 then list of points returned
148    *                        only for section with this index
149    * \return list of points
150    */
151   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
152
153 protected:
154
155   friend class HYDROData_Iterator;
156
157   /**
158    * Creates new object in the internal data structure. Use higher level objects 
159    * to create objects with real content.
160    */
161   HYDRODATA_EXPORT HYDROData_ProfileUZ();
162
163   /**
164    * Destructs properties of the object and object itself, removes it from the document.
165    */
166   HYDRODATA_EXPORT ~HYDROData_ProfileUZ();
167 };
168
169 #endif