Salome HOME
61a22bbcfc581ec88c072539321e8111f743ca18
[modules/hydro.git] / src / HYDROData / HYDROData_Polyline.h
1 #ifndef HYDROData_Polyline_HeaderFile
2 #define HYDROData_Polyline_HeaderFile
3
4 #include <HYDROData_Object.h>
5
6 #include <QPointF>
7 #include <QPainterPath>
8 #include <QList>
9
10 DEFINE_STANDARD_HANDLE(HYDROData_Polyline, HYDROData_Object)
11
12 /**\class HYDROData_Polyline
13  * \brief Class that stores/retreives information about the painter path.
14  *
15  * Keeps path as binary array of element type and coordinates
16  * of image with correspondent API for forkind wit hthese properties.
17  */
18 class HYDROData_Polyline : public HYDROData_Object
19 {
20 public:
21   DEFINE_STANDARD_RTTI(HYDROData_Polyline);
22
23   /**
24    * Returns the kind of this object. Must be redefined in all objects of known type.
25    */
26   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
27
28   /**
29    * Replace current array by points list
30    * \param thePoint the point to add
31    */
32   HYDRODATA_EXPORT void setPoints( QList<QPointF> thePointsList );
33
34   /**
35    * Add point to the end of point list
36    * \param thePoint the point to add
37    */
38   HYDRODATA_EXPORT void addPoint( const QPointF& thePoint );
39    
40   /**
41    * Add point to the point list at the specified position
42    * \param theIndex the index of the list the point will insert after
43    */
44   HYDRODATA_EXPORT bool insertPoint( int theIndex, const QPointF& thePoint);
45
46   /**
47    * Remove point from polyline
48    * \param theIndex the point index
49    */
50   HYDRODATA_EXPORT bool removePoint( int theIndex );
51
52   /**
53    * Remove all points from polyline
54    * \param theIndex the point index
55    */
56   HYDRODATA_EXPORT void removeAllPoints();
57
58   /**
59    * Return list point count
60    * \return list point count
61    */
62   HYDRODATA_EXPORT int pointsCount();
63
64   /**
65    * Returns list of points
66    * \return list of points
67    */
68   HYDRODATA_EXPORT QList<QPointF> points();
69
70
71   /**
72    * Returns the painter path. The painter path is construct by lines
73    */
74   HYDRODATA_EXPORT QPainterPath painterPathLinear();
75
76
77 protected:
78
79   friend class HYDROData_Iterator;
80
81   /**
82    * Creates new object in the internal data structure. Use higher level objects 
83    * to create objects with real content.
84    */
85   HYDROData_Polyline();
86
87   /**
88    * Destructs properties of the object and object itself, removes it from the document.
89    */
90   ~HYDROData_Polyline();
91
92 };
93
94 #endif