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