1 #ifndef HYDROData_Polyline_HeaderFile
2 #define HYDROData_Polyline_HeaderFile
4 #include <HYDROData_Object.h>
6 #include <TCollection_ExtendedString.hxx>
9 #include <QPainterPath>
12 DEFINE_STANDARD_HANDLE(HYDROData_Polyline, HYDROData_Object)
14 struct PolylineSection{
16 enum SectionType{ SECTION_POLYLINE=0, SECTION_SPLINE=1 };
18 PolylineSection(){ myIsClosed=true; myType=SECTION_POLYLINE; mySectionName="Section";}
19 TCollection_ExtendedString mySectionName;
22 QList<double> myCoords;
25 /**\class HYDROData_Polyline
26 * \brief Class that stores/retreives information about the painter path.
28 * Keeps path as binary array of element type and coordinates
29 * of image with correspondent API for forkind wit hthese properties.
31 class HYDROData_Polyline : public HYDROData_Object
34 DEFINE_STANDARD_RTTI(HYDROData_Polyline);
37 * Returns the kind of this object. Must be redefined in all objects of known type.
39 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
42 * Replace current polyline data by new sections list
43 * \param theSections the sections list
45 HYDRODATA_EXPORT void setPolylineData( const QList<PolylineSection>& theSections );
48 * Return polyline data
49 * \return polyline section list
51 HYDRODATA_EXPORT QList<PolylineSection> getPolylineData();
54 * Return polyline dimension
55 * \return polyline dimension (2 or 3)
57 HYDRODATA_EXPORT int getDimension() const;
60 * Set polyline dimension (2 or 3)
61 * \param theDimension the polyline dimension
63 HYDRODATA_EXPORT void setDimension( int theDimension );
66 * Remove all sections from polyline
68 HYDRODATA_EXPORT void removeAll();
72 * Returns the painter path. The painter path is construct by lines
74 HYDRODATA_EXPORT QPainterPath painterPath();
79 friend class HYDROData_Iterator;
82 * Creates new object in the internal data structure. Use higher level objects
83 * to create objects with real content.
88 * Destructs properties of the object and object itself, removes it from the document.
90 ~HYDROData_Polyline();