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
35 * Enumeration of tags corresponding to the persistent object parameters.
39 DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
41 DataTag_SectionsClosed,
47 DEFINE_STANDARD_RTTI(HYDROData_Polyline);
50 * Returns the kind of this object. Must be redefined in all objects of known type.
52 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;}
55 * Replace current polyline data by new sections list
56 * \param theSections the sections list
58 HYDRODATA_EXPORT void setPolylineData( const QList<PolylineSection>& theSections );
61 * Return polyline data
62 * \return polyline section list
64 HYDRODATA_EXPORT QList<PolylineSection> getPolylineData();
67 * Return polyline dimension
68 * \return polyline dimension (2 or 3)
70 HYDRODATA_EXPORT int getDimension() const;
73 * Set polyline dimension (2 or 3)
74 * \param theDimension the polyline dimension
76 HYDRODATA_EXPORT void setDimension( int theDimension );
79 * Remove all sections from polyline
81 HYDRODATA_EXPORT void removeAll();
85 * Returns the painter path. The painter path is construct by lines
87 HYDRODATA_EXPORT QPainterPath painterPath();
92 friend class HYDROData_Iterator;
95 * Creates new object in the internal data structure. Use higher level objects
96 * to create objects with real content.
101 * Destructs properties of the object and object itself, removes it from the document.
103 ~HYDROData_Polyline();