Salome HOME
ae8c848f3737408a01ed1253d0e1056bd34503cd
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineXY.h
1
2 #ifndef HYDROData_PolylineXY_HeaderFile
3 #define HYDROData_PolylineXY_HeaderFile
4
5 #include "HYDROData_IPolyline.h"
6
7 DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
8
9 /**\class HYDROData_PolylineXY
10  * \brief Class that stores/retreives information about the 
11  *        parametric profile points.
12  */
13 class HYDROData_PolylineXY : 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_PolylineXY);
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_POLYLINEXY;}
32
33
34 public:
35
36   /**
37    * Returns the 3D presentation of all points.
38    */
39   HYDRODATA_EXPORT virtual TopoDS_Wire GetWire() const;
40
41
42   /**
43    * Returns number of sections.
44    */
45   HYDRODATA_EXPORT virtual int NbSections() const;
46
47   /**
48    * Adds new one section.
49    * \param theIsClosed flag indicates type of polyline
50    */
51   HYDRODATA_EXPORT virtual void AddSection( const bool theIsClosed );
52
53   /**
54    * Returns true if section with given index is closed.
55    * \param theSectionIndex index of section
56    */
57   HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
58
59   /**
60    * Removes section with given index.
61    * \param theSectionIndex index of section
62    */
63   HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
64
65   /**
66    * Removes all sections.
67    */
68   HYDRODATA_EXPORT virtual void RemoveSections();
69
70
71   /**
72    * Adds new point for section with index "theSectionIndex".
73    * \param theSectionIndex index of section
74    * \param thePoint point to add
75    * \param theBeforeIndex if not equal -1 then insert point in this pos
76    */
77   HYDRODATA_EXPORT virtual void AddPoint( const int    theSectionIndex,
78                                           const Point& thePoint,
79                                           const int    thePointIndex = -1 );
80
81   /**
82    * Replaces point for section with index "theSectionIndex".
83    * \param theSectionIndex index of section
84    * \param thePointIndex index of point to replace
85    * \param thePoint new point
86    */
87   HYDRODATA_EXPORT virtual void SetPoint( const int    theSectionIndex,
88                                           const int    thePointIndex,
89                                           const Point& thePoint );
90
91   /**
92    * Removes point from section with index "theSectionIndex".
93    * \param theSectionIndex index of section
94    * \param thePointIndex index of point
95    */
96   HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
97                                              const int thePointIndex );
98
99
100   /**
101    * Returns list of points.
102    * \param theSectionIndex if not equal -1 then list of points returned
103    *                        only for section with this index
104    * \return list of points
105    */
106   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
107
108 protected:
109
110   friend class HYDROData_Profile;
111   friend class HYDROData_Iterator;
112
113   /**
114    * Creates new object in the internal data structure. Use higher level objects 
115    * to create objects with real content.
116    */
117   HYDRODATA_EXPORT HYDROData_PolylineXY();
118
119   /**
120    * Destructs properties of the object and object itself, removes it from the document.
121    */
122   HYDRODATA_EXPORT ~HYDROData_PolylineXY();
123 };
124
125 #endif