2 #ifndef HYDROData_PolylineXY_HeaderFile
3 #define HYDROData_PolylineXY_HeaderFile
5 #include "HYDROData_IPolyline.h"
7 DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
11 /**\class HYDROData_PolylineXY
12 * \brief Class that stores/retreives information about the
13 * parametric profile points.
15 class HYDROData_PolylineXY : public HYDROData_IPolyline
19 * Enumeration of tags corresponding to the persistent object parameters.
23 DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
27 DEFINE_STANDARD_RTTI(HYDROData_PolylineXY);
31 * Returns the kind of this object. Must be redefined in all objects of known type.
33 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINEXY;}
36 * Dump object to Python script representation.
38 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
41 * Returns data of object wrapped to QVariant.
42 * Reimplemented to wrap and return saved path.
44 HYDRODATA_EXPORT virtual QVariant GetDataVariant();
49 * Returns the 3D presentation of all points.
51 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape();
54 * Update the wire contour on the basis of the polyline data.
55 * Call this method whenever you made changes for polyline data.
57 HYDRODATA_EXPORT virtual void Update();
61 * Returns true if polyline is closed
63 HYDRODATA_EXPORT bool IsClosed() const;
67 * Returns number of sections.
69 HYDRODATA_EXPORT virtual int NbSections() const;
72 * Adds new one section.
73 * \param theSectName name of the section
74 * \param theSectionType type of section
75 * \param theIsClosed flag indicates closures of section
77 HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
78 const SectionType theSectionType,
79 const bool theIsClosed );
82 * Returns name of section with given index.
83 * \param theSectionIndex index of section
85 HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
88 * Set name for section with given index.
89 * \param theSectionIndex index of section
90 * \param theSectionName new section name
92 HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex,
93 const TCollection_AsciiString& theSectionName );
96 * Returns type of section with given index.
97 * \param theSectionIndex index of section
99 HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
102 * Set type for section with given index.
103 * \param theSectionIndex index of section
104 * \param theSectionType new section type
106 HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
107 const SectionType theSectionType );
110 * Returns true if section with given index is closed.
111 * \param theSectionIndex index of section
113 HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
116 * Set closed flag for section with given index.
117 * \param theSectionIndex index of section
118 * \param theIsClosed new closures state
120 HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex,
121 const bool theIsClosed );
124 * Adds new one section.
125 * \param theSectName name of the section
126 * \param theSectionType type of section
127 * \param theIsClosed flag indicates closures of section
129 HYDRODATA_EXPORT virtual void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames,
130 NCollection_Sequence<SectionType>& theSectTypes,
131 NCollection_Sequence<bool>& theSectClosures ) const;
134 * Removes section with given index.
135 * \param theSectionIndex index of section
137 HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
140 * Removes all sections.
142 HYDRODATA_EXPORT virtual void RemoveSections();
146 * Adds new point for section with index "theSectionIndex".
147 * \param theSectionIndex index of section
148 * \param thePoint point to add
149 * \param theBeforeIndex if not equal -1 then insert point in this pos
151 HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex,
152 const Point& thePoint,
153 const int thePointIndex = -1 );
156 * Replaces point for section with index "theSectionIndex".
157 * \param theSectionIndex index of section
158 * \param thePoint new point
159 * \param thePointIndex index of point to replace
161 HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex,
162 const Point& thePoint,
163 const int thePointIndex );
166 * Removes point from section with index "theSectionIndex".
167 * \param theSectionIndex index of section
168 * \param thePointIndex index of point
170 HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex,
171 const int thePointIndex );
175 * Returns list of points.
176 * \param theSectionIndex if not equal -1 then list of points returned
177 * only for section with this index
178 * \return list of points
180 HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
184 * Returns the painter path.
185 * Note: currently only the first section of the polyline data is taken into account.
186 * \return polyline painter path.
188 HYDRODATA_EXPORT virtual QPainterPath GetPainterPath() const;
193 friend class HYDROData_Profile;
194 friend class HYDROData_Iterator;
197 * Creates new object in the internal data structure. Use higher level objects
198 * to create objects with real content.
200 HYDRODATA_EXPORT HYDROData_PolylineXY();
203 * Destructs properties of the object and object itself, removes it from the document.
205 HYDRODATA_EXPORT ~HYDROData_PolylineXY();