Salome HOME
e948b4d323c733cc0e806bea88c3188126eef1fe
[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   /**
34    * Dump object to Python script representation.
35    */
36   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
37
38 public:
39
40   /**
41    * Returns the 3D presentation of all points.
42    */
43   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
44
45   /**
46    * Returns the depth for given distance.
47    */
48   HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
49                                                        const double&     theDistance );
50
51
52   /**
53    * Returns number of sections.
54    */
55   HYDRODATA_EXPORT virtual int NbSections() const;
56
57   /**
58    * Adds new one section.
59    * \param theSectName name of the section
60    * \param theSectionType type of section
61    * \param theIsClosed flag indicates closures of section
62    */
63   HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
64                                             const SectionType              theSectionType,
65                                             const bool                     theIsClosed );
66
67   /**
68    * Returns name of section with given index.
69    * \param theSectionIndex index of section
70    */
71   HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
72
73   /**
74    * Set name for section with given index.
75    * \param theSectionIndex index of section
76    * \param theSectionName new section name
77    */
78   HYDRODATA_EXPORT virtual void SetSectionName( const int                      theSectionIndex, 
79                                                 const TCollection_AsciiString& theSectionName );
80
81   /**
82    * Returns type of section with given index.
83    * \param theSectionIndex index of section
84    */
85   HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
86
87   /**
88    * Set type for section with given index.
89    * \param theSectionIndex index of section
90    * \param theSectionType new section type
91    */
92   HYDRODATA_EXPORT virtual void SetSectionType( const int         theSectionIndex, 
93                                                 const SectionType theSectionType );
94
95   /**
96    * Returns true if section with given index is closed.
97    * \param theSectionIndex index of section
98    */
99   HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
100
101   /**
102    * Set closed flag for section with given index.
103    * \param theSectionIndex index of section
104    * \param theIsClosed new closures state
105    */
106   HYDRODATA_EXPORT virtual void SetSectionClosed( const int  theSectionIndex, 
107                                                   const bool theIsClosed );
108
109   /**
110    * Removes section with given index.
111    * \param theSectionIndex index of section
112    */
113   HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
114
115   /**
116    * Removes all sections.
117    */
118   HYDRODATA_EXPORT virtual void RemoveSections();
119
120
121   /**
122    * Adds new point for section with index "theSectionIndex".
123    * \param theSectionIndex index of section
124    * \param thePoint point to add
125    * \param theBeforeIndex if not equal -1 then insert point in this pos
126    */
127   HYDRODATA_EXPORT virtual void AddPoint( const int    theSectionIndex,
128                                           const Point& thePoint,
129                                           const int    thePointIndex = -1 );
130
131   /**
132    * Replaces point for section with index "theSectionIndex".
133    * \param theSectionIndex index of section
134    * \param thePoint new point
135    * \param thePointIndex index of point to replace
136    */
137   HYDRODATA_EXPORT virtual void SetPoint( const int    theSectionIndex,
138                                           const Point& thePoint,
139                                           const int    thePointIndex );
140
141   /**
142    * Removes point from section with index "theSectionIndex".
143    * \param theSectionIndex index of section
144    * \param thePointIndex index of point
145    */
146   HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
147                                              const int thePointIndex );
148
149
150   /**
151    * Returns list of points.
152    * \param theSectionIndex if not equal -1 then list of points returned
153    *                        only for section with this index
154    * \return list of points
155    */
156   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
157
158 protected:
159
160   friend class HYDROData_Iterator;
161
162   /**
163    * Creates new object in the internal data structure. Use higher level objects 
164    * to create objects with real content.
165    */
166   HYDRODATA_EXPORT HYDROData_ProfileUZ();
167
168   /**
169    * Destructs properties of the object and object itself, removes it from the document.
170    */
171   HYDRODATA_EXPORT ~HYDROData_ProfileUZ();
172 };
173
174 #endif