2 #ifndef HYDROData_PolylineXY_HeaderFile
3 #define HYDROData_PolylineXY_HeaderFile
5 #include "HYDROData_IPolyline.h"
7 DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
9 /**\class HYDROData_PolylineXY
10 * \brief Class that stores/retreives information about the
11 * parametric profile points.
13 class HYDROData_PolylineXY : public HYDROData_IPolyline
17 * Enumeration of tags corresponding to the persistent object parameters.
21 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
25 DEFINE_STANDARD_RTTI(HYDROData_PolylineXY);
29 * Returns the kind of this object. Must be redefined in all objects of known type.
31 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINEXY;}
36 // Implementation of IPolyline interface
39 * Returns the 3D presentation of all points.
41 HYDRODATA_EXPORT virtual ListAISObjects constructWire() const;
45 // Implementation of ICurve interface
48 /***********************************************/
49 /*** Section methods ***/
50 /***********************************************/
52 //! Clear the polyline (remove all sections)
53 HYDRODATA_EXPORT virtual bool clear();
55 //! Join range of sections to one section (join all sections if -1 is passed in one of arguments)
56 HYDRODATA_EXPORT virtual bool join( const int theISectionTo = -1,
57 const int theISectionFrom = -1 );
59 //! Get number of sections
60 HYDRODATA_EXPORT virtual int getNbSections() const;
62 //! Add a new section.
63 HYDRODATA_EXPORT virtual int addSection( const std::string& theName,
64 const CurveCreator::SectionType theType,
65 const bool theIsClosed );
67 //! Removes the given section.
68 HYDRODATA_EXPORT virtual bool removeSection( const int theISection );
70 //! Get "closed" flag of the specified section
71 HYDRODATA_EXPORT virtual bool isClosed( const int theISection ) const;
74 * Set "closed" flag of the specified section (all sections if
75 * \a theISection is -1).
77 HYDRODATA_EXPORT virtual bool setClosed( const int theISection,
78 const bool theIsClosed );
80 //! Returns specifyed section name
81 HYDRODATA_EXPORT virtual std::string getSectionName( const int theISection ) const;
83 /** Set name of the specified section */
84 HYDRODATA_EXPORT virtual bool setSectionName( const int theISection,
85 const std::string& theName );
87 //! Get type of the specified section
88 HYDRODATA_EXPORT virtual CurveCreator::SectionType getSectionType( const int theISection ) const;
91 * Set type of the specified section (or all sections
92 * if \a theISection is -1).
94 HYDRODATA_EXPORT virtual bool setSectionType( const int theISection,
95 const CurveCreator::SectionType theType );
98 /***********************************************/
99 /*** Point methods ***/
100 /***********************************************/
103 * Insert one or several points to the specified section starting from the given theIPnt index
104 * (or add these at the end of section points if \a theIPnt is -1).
106 HYDRODATA_EXPORT virtual bool addPoints( const CurveCreator::Coordinates& theCoords,
107 const int theISection,
108 const int theIPnt = -1 );
110 //! Set coordinates of specified point
111 HYDRODATA_EXPORT virtual bool setPoint( const int theISection,
113 const CurveCreator::Coordinates& theCoords );
115 //! Remove point with given id
116 HYDRODATA_EXPORT virtual bool removePoint( const int theISection, const int theIPnt = -1 );
119 * Get points of a section (the total points in Curve if theISection is equal to -1)..
121 HYDRODATA_EXPORT virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const;
125 friend class HYDROData_Profile;
126 friend class HYDROData_Iterator;
129 * Creates new object in the internal data structure. Use higher level objects
130 * to create objects with real content.
132 HYDRODATA_EXPORT HYDROData_PolylineXY();
135 * Destructs properties of the object and object itself, removes it from the document.
137 HYDRODATA_EXPORT ~HYDROData_PolylineXY();