X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Polyline.h;h=53395cd813cb79460818615884a6b57282fc68ac;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=3906ac5321178f2b6b58676ff6162be212056750;hpb=5bdd5a07050d0879edb5efdc7e009850a46c64f8;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Polyline.h b/src/HYDROData/HYDROData_Polyline.h index 3906ac53..53395cd8 100755 --- a/src/HYDROData/HYDROData_Polyline.h +++ b/src/HYDROData/HYDROData_Polyline.h @@ -9,9 +9,11 @@ #include #include +class TopoDS_Wire; + DEFINE_STANDARD_HANDLE(HYDROData_Polyline, HYDROData_Object) -struct PolylineSection +struct HYDRODATA_EXPORT PolylineSection { public: enum SectionType{ SECTION_POLYLINE=0, SECTION_SPLINE=1 }; @@ -45,7 +47,8 @@ protected: DataTag_SectionsName, DataTag_SectionsClosed, DataTag_SectionsSize, - DataTag_SectionsType + DataTag_SectionsType, + DataTag_ZValue }; public: @@ -56,6 +59,16 @@ 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. */ @@ -71,42 +84,51 @@ public: * Replace current polyline data by new sections list * \param theSections the sections list */ - HYDRODATA_EXPORT void setPolylineData( const PolylineData& theSections ); + HYDRODATA_EXPORT void SetPolylineData( const PolylineData& theSections ); /** * Return polyline data * \return polyline section list */ - HYDRODATA_EXPORT PolylineData getPolylineData() const; + HYDRODATA_EXPORT PolylineData GetPolylineData() const; /** * Returns true if polyline is closed */ - HYDRODATA_EXPORT bool isClosed() const; + 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() const; + 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: @@ -116,12 +138,12 @@ protected: * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ - HYDROData_Polyline(); + HYDRODATA_EXPORT HYDROData_Polyline(); /** * Destructs properties of the object and object itself, removes it from the document. */ - ~HYDROData_Polyline(); + HYDRODATA_EXPORT ~HYDROData_Polyline(); }; #endif