X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.h;h=78f8736efaf44a97d8a7e7f8ccad45d298af2546;hb=5b4f8c7000189059d1c32f1982e24ca998d994fe;hp=a75650479eb774fbe191740b662314ffb64dd495;hpb=3c2f840b90b9ef46d41ebaa857290091ce11c627;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.h b/src/HYDROData/HYDROData_Polyline.h index a7565047..78f8736e 100755 --- a/src/HYDROData/HYDROData_Polyline.h +++ b/src/HYDROData/HYDROData_Polyline.h @@ -9,9 +9,12 @@ #include #include +class TopoDS_Wire; + DEFINE_STANDARD_HANDLE(HYDROData_Polyline, HYDROData_Object) -struct PolylineSection{ +struct PolylineSection +{ public: enum SectionType{ SECTION_POLYLINE=0, SECTION_SPLINE=1 }; @@ -30,6 +33,24 @@ public: */ class HYDROData_Polyline : public HYDROData_Object { +public: + + typedef QList PolylineData; + +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve + DataTag_SectionsName, + DataTag_SectionsClosed, + DataTag_SectionsSize, + DataTag_SectionsType, + DataTag_ZValue + }; + public: DEFINE_STANDARD_RTTI(HYDROData_Polyline); @@ -38,41 +59,76 @@ public: */ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_POLYLINE;} + /** + * Returns the top shape of the object. + */ + HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; + + /** + * Returns the 3d shape of the object. + */ + HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; + + /** + * Dump object to Python script representation. + */ + HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const; + + /** + * Returns data of object wrapped to QVariant. + * Reimplemented to wrap and return saved path. + */ + HYDRODATA_EXPORT virtual QVariant GetDataVariant(); + /** * Replace current polyline data by new sections list * \param theSections the sections list */ - HYDRODATA_EXPORT void setPolylineData( const QList& theSections ); + HYDRODATA_EXPORT void SetPolylineData( const PolylineData& theSections ); /** * Return polyline data * \return polyline section list */ - HYDRODATA_EXPORT QList getPolylineData(); + HYDRODATA_EXPORT PolylineData GetPolylineData() const; + /** + * Returns true if polyline is closed + */ + HYDRODATA_EXPORT bool IsClosed() const; + /** * Return polyline dimension * \return polyline dimension (2 or 3) */ - HYDRODATA_EXPORT int getDimension() const; + HYDRODATA_EXPORT int GetDimension() const; /** * Set polyline dimension (2 or 3) * \param theDimension the polyline dimension */ - HYDRODATA_EXPORT void setDimension( int theDimension ); + HYDRODATA_EXPORT void SetDimension( int theDimension ); /** * Remove all sections from polyline */ - HYDRODATA_EXPORT void removeAll(); - + HYDRODATA_EXPORT void RemoveAll(); /** - * Returns the painter path. The painter path is construct by lines + * Returns the painter path. + * Note: currently only the first section of the polyline data is taken into account. */ - HYDRODATA_EXPORT QPainterPath painterPath(); + HYDRODATA_EXPORT QPainterPath GetPainterPath() const; + HYDRODATA_EXPORT void SetZValue( const double theZValue ); + HYDRODATA_EXPORT double ZValue() const; + +protected: + + /** + * Update the wire contour on the basis of the polyline data. + */ + void UpdateWire( const PolylineData& theSections ); protected: