Salome HOME
22441a568104903cececcb86a9a07812d3675e21
[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_Wire GetWire() const;
39
40
41   /**
42    * Returns number of sections.
43    */
44   HYDRODATA_EXPORT virtual int NbSections() const;
45
46   /**
47    * Adds new one section.
48    * \param theIsClosed flag indicates type of polyline
49    */
50   HYDRODATA_EXPORT virtual void AddSection( const bool theIsClosed );
51
52   /**
53    * Returns true if section with given index is closed.
54    * \param theSectionIndex index of section
55    */
56   HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
57
58   /**
59    * Removes section with given index.
60    * \param theSectionIndex index of section
61    */
62   HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
63
64   /**
65    * Removes all sections.
66    */
67   HYDRODATA_EXPORT virtual void RemoveSections();
68
69
70   /**
71    * Adds new point for section with index "theSectionIndex".
72    * \param theSectionIndex index of section
73    * \param thePoint point to add
74    * \param theBeforeIndex if not equal -1 then insert point in this pos
75    */
76   HYDRODATA_EXPORT virtual void AddPoint( const int    theSectionIndex,
77                                           const Point& thePoint,
78                                           const int    thePointIndex = -1 );
79
80   /**
81    * Replaces point for section with index "theSectionIndex".
82    * \param theSectionIndex index of section
83    * \param thePointIndex index of point to replace
84    * \param thePoint new point
85    */
86   HYDRODATA_EXPORT virtual void SetPoint( const int    theSectionIndex,
87                                           const int    thePointIndex,
88                                           const Point& thePoint );
89
90   /**
91    * Removes point from section with index "theSectionIndex".
92    * \param theSectionIndex index of section
93    * \param thePointIndex index of point
94    */
95   HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
96                                              const int thePointIndex );
97
98
99   /**
100    * Returns list of points.
101    * \param theSectionIndex if not equal -1 then list of points returned
102    *                        only for section with this index
103    * \return list of points
104    */
105   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
106
107 protected:
108
109   friend class HYDROData_Iterator;
110
111   /**
112    * Creates new object in the internal data structure. Use higher level objects 
113    * to create objects with real content.
114    */
115   HYDRODATA_EXPORT HYDROData_ProfileUZ();
116
117   /**
118    * Destructs properties of the object and object itself, removes it from the document.
119    */
120   HYDRODATA_EXPORT ~HYDROData_ProfileUZ();
121 };
122
123 #endif