X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_ProfileUZ.h;h=2fcb3899a9d1595eeac31b94abe5c4a967360077;hb=ad4482443835973ac9ee0ce2024f60f91adff716;hp=fbb7eb0a9acbc511726fac5f9c718fefc84e6aa8;hpb=7e825ec456c9331ef0df1cb59865cc55f0d8516a;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ProfileUZ.h b/src/HYDROData/HYDROData_ProfileUZ.h index fbb7eb0a..2fcb3899 100644 --- a/src/HYDROData/HYDROData_ProfileUZ.h +++ b/src/HYDROData/HYDROData_ProfileUZ.h @@ -1,10 +1,28 @@ +// Copyright (C) 2014-2015 EDF-R&D +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef HYDROData_ProfileUZ_HeaderFile #define HYDROData_ProfileUZ_HeaderFile #include "HYDROData_IPolyline.h" -DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline) +class gp_XYZ; +class HYDROData_PolylineXY; /**\class HYDROData_ProfileUZ * \brief Class that stores/retreives information about the @@ -22,7 +40,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ); + DEFINE_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline); /** @@ -30,111 +48,131 @@ public: */ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;} - public: - // Implementation of IPolyline interface - /** * Returns the 3D presentation of all points. */ - HYDRODATA_EXPORT virtual ListAISObjects constructWire() const; - -public: + HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const; - // Implementation of ICurve interface - - - /***********************************************/ - /*** Section methods ***/ - /***********************************************/ - - //! Clear the polyline (remove all sections) - HYDRODATA_EXPORT virtual bool clear(); + /** + * Returns the depth for given distance. + */ + HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints, + const double& theDistance ); - //! Join range of sections to one section (join all sections if -1 is passed in one of arguments) - HYDRODATA_EXPORT virtual bool join( const int theISectionTo = -1, - const int theISectionFrom = -1 ); - //! Get number of sections - HYDRODATA_EXPORT virtual int getNbSections() const; + /** + * Returns number of sections. + */ + HYDRODATA_EXPORT virtual int NbSections() const; - //! Add a new section. - HYDRODATA_EXPORT virtual int addSection( const std::string& theName, - const CurveCreator::SectionType theType, - const bool theIsClosed ); + /** + * Adds new one section. + * \param theSectName name of the section + * \param theSectionType type of section + * \param theIsClosed flag indicates closures of section + */ + HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName, + const SectionType theSectionType, + const bool theIsClosed ); - //! Removes the given sections. - HYDRODATA_EXPORT virtual bool removeSection( const int theISection ); + /** + * Returns name of section with given index. + * \param theSectionIndex index of section + */ + HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const; - //! Get "closed" flag of the specified section - HYDRODATA_EXPORT virtual bool isClosed( const int theISection ) const; + /** + * Set name for section with given index. + * \param theSectionIndex index of section + * \param theSectionName new section name + */ + HYDRODATA_EXPORT virtual void SetSectionName( const int theSectionIndex, + const TCollection_AsciiString& theSectionName ); /** - * Set "closed" flag of the specified section (all sections if - * \a theISection is -1). + * Returns type of section with given index. + * \param theSectionIndex index of section */ - HYDRODATA_EXPORT virtual bool setClosed( const int theISection, - const bool theIsClosed ); + HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const; - //! Returns specifyed section name - HYDRODATA_EXPORT virtual std::string getSectionName( const int theISection ) const; + /** + * Set type for section with given index. + * \param theSectionIndex index of section + * \param theSectionType new section type + */ + HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex, + const SectionType theSectionType ); - /** Set name of the specified section */ - HYDRODATA_EXPORT virtual bool setSectionName( const int theISection, - const std::string& theName ); + /** + * Returns true if section with given index is closed. + * \param theSectionIndex index of section + */ + HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const; - //! Get type of the specified section - HYDRODATA_EXPORT virtual CurveCreator::SectionType getSectionType( const int theISection ) const; + /** + * Set closed flag for section with given index. + * \param theSectionIndex index of section + * \param theIsClosed new closures state + */ + HYDRODATA_EXPORT virtual void SetSectionClosed( const int theSectionIndex, + const bool theIsClosed ); /** - * Set type of the specified section (or all sections - * if \a theISection is -1). + * Removes section with given index. + * \param theSectionIndex index of section */ - HYDRODATA_EXPORT virtual bool setSectionType( const int theISection, - const CurveCreator::SectionType theType ); + HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex ); + /** + * Removes all sections. + */ + HYDRODATA_EXPORT virtual void RemoveSections(); - /***********************************************/ - /*** Point methods ***/ - /***********************************************/ /** - * Insert one or several points to the specified section starting from the given theIPnt index - * (or add these at the end of section points if \a theIPnt is -1). + * Adds new point for section with index "theSectionIndex". + * \param theSectionIndex index of section + * \param thePoint point to add + * \param theBeforeIndex if not equal -1 then insert point in this pos */ - HYDRODATA_EXPORT virtual bool addPoints( const CurveCreator::Coordinates& theCoords, - const int theISection, - const int theIPnt = -1 ); + HYDRODATA_EXPORT virtual void AddPoint( const int theSectionIndex, + const Point& thePoint, + const int thePointIndex = -1 ); - //! Set coordinates of specified point - HYDRODATA_EXPORT virtual bool setPoint( const int theISection, - const int theIPnt, - const CurveCreator::Coordinates& theCoords ); - - //! Remove point with given id - HYDRODATA_EXPORT virtual bool removePoint( const int theISection, const int theIPnt = -1 ); + /** + * Replaces point for section with index "theSectionIndex". + * \param theSectionIndex index of section + * \param thePoint new point + * \param thePointIndex index of point to replace + */ + HYDRODATA_EXPORT virtual void SetPoint( const int theSectionIndex, + const Point& thePoint, + const int thePointIndex ); /** - * Get points of a section (the total points in Curve if theISection is equal to -1).. + * Removes point from section with index "theSectionIndex". + * \param theSectionIndex index of section + * \param thePointIndex index of point */ - HYDRODATA_EXPORT virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const; + HYDRODATA_EXPORT virtual void RemovePoint( const int theSectionIndex, + const int thePointIndex ); -protected: /** - * Insert point to the specified section after the given theIPnt index. - * (or add these at the end of section points if \a theIPnt is -1). + * Returns list of points. + * \param theSectionIndex if not equal -1 then list of points returned + * only for section with this index + * \return list of points */ - HYDRODATA_EXPORT virtual bool addPoint( - const CurveCreator::TypeCoord& theCoordX, - const CurveCreator::TypeCoord& theCoordY, - const int theISection, - const int theIPnt = -1 ); + HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const; + + HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence& theXYZPoints, + Handle(HYDROData_PolylineXY)& thePolylineXY); protected: - friend class HYDROData_Profile; friend class HYDROData_Iterator; /**