2 #ifndef HYDROData_IPolyline_HeaderFile
3 #define HYDROData_IPolyline_HeaderFile
5 #include "HYDROData_Entity.h"
8 DEFINE_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
12 class Handle(TDataStd_RealList);
14 /**\class HYDROData_IPolyline
15 * \brief Base class that stores/retreives information about the 2D points.
17 class HYDROData_IPolyline : public HYDROData_Entity
22 typedef NCollection_Sequence<Point> PointsList;
26 * Enumeration of tags corresponding to the persistent object parameters.
30 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
35 DEFINE_STANDARD_RTTI(HYDROData_IPolyline);
38 * Returns the 3D presentation of all points.
40 HYDRODATA_EXPORT virtual TopoDS_Wire GetWire() const = 0;
44 * Returns number of sections.
46 HYDRODATA_EXPORT virtual int NbSections() const = 0;
49 * Adds new one section.
50 * \param theIsClosed flag indicates type of polyline
52 HYDRODATA_EXPORT virtual void AddSection( const bool theIsClosed ) = 0;
55 * Returns true if section with given index is closed.
56 * \param theSectionIndex index of section
58 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const = 0;
61 * Removes section with given index.
62 * \param theSectionIndex index of section
64 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex ) = 0;
67 * Removes all sections.
69 HYDRODATA_EXPORT virtual void RemoveSections() = 0;
73 * Return number of profile points.
74 * \return number of points
76 HYDRODATA_EXPORT int NbPoints( const int theSectionIndex = -1 ) const;
79 * Adds new point for section with index "theSectionIndex".
80 * \param theSectionIndex index of section
81 * \param thePoint point to add
82 * \param theBeforeIndex if not equal -1 then insert point before this index
84 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
85 const Point& thePoint,
86 const int theBeforeIndex = -1 ) = 0;
89 * Replaces point for section with index "theSectionIndex".
90 * \param theSectionIndex index of section
91 * \param thePointIndex index of point to replace
92 * \param thePoint new point
94 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
95 const int thePointIndex,
96 const Point& thePoint ) = 0;
99 * Removes point from section with index "theSectionIndex".
100 * \param theSectionIndex index of section
101 * \param thePointIndex index of point
103 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
104 const int thePointIndex ) = 0;
108 * Returns list of points.
109 * \param theSectionIndex if not equal -1 then list of points returned
110 * only for section with this index
111 * \return list of points
113 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const = 0;
117 void getPointsLists( const int theSectionIndex,
118 Handle(TDataStd_RealList)& theListX,
119 Handle(TDataStd_RealList)& theListY,
120 const bool theIsCreate = true ) const;
122 void removePointsLists( const int theSectionIndex ) const;
127 * Creates new object in the internal data structure. Use higher level objects
128 * to create objects with real content.
130 HYDROData_IPolyline();
133 * Destructs properties of the object and object itself, removes it from the document.
135 ~HYDROData_IPolyline();