+// 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
DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
+class gp_XYZ;
+class Handle_HYDROData_PolylineXY;
+
/**\class HYDROData_ProfileUZ
* \brief Class that stores/retreives information about the
* parametric profile points.
*/
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:
-
- // Implementation of ICurve interface
-
-
- /***********************************************/
- /*** Section methods ***/
- /***********************************************/
-
- //! Clear the polyline (remove all sections)
- HYDRODATA_EXPORT virtual bool clear();
+ HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
- //! 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;
-
- //! Add a new section.
- HYDRODATA_EXPORT virtual int addSection( const std::string& theName,
- const CurveCreator::SectionType theType,
- const bool theIsClosed );
+ /**
+ * Returns the depth for given distance.
+ */
+ HYDRODATA_EXPORT static double GetDepthFromDistance( const PointsList& thePoints,
+ const double& theDistance );
- //! Removes the given sections.
- HYDRODATA_EXPORT virtual bool removeSection( const int theISection );
- //! Get "closed" flag of the specified section
- HYDRODATA_EXPORT virtual bool isClosed( const int theISection ) const;
+ /**
+ * Returns number of sections.
+ */
+ HYDRODATA_EXPORT virtual int NbSections() const;
/**
- * Set "closed" flag of the specified section (all sections if
- * \a theISection is -1).
+ * 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 bool setClosed( const int theISection,
- const bool theIsClosed );
+ HYDRODATA_EXPORT virtual void AddSection( const TCollection_AsciiString& theSectName,
+ const SectionType theSectionType,
+ const bool theIsClosed );
- //! Returns specifyed section name
- HYDRODATA_EXPORT virtual std::string getSectionName( const int theISection ) const;
+ /**
+ * Returns name of section with given index.
+ * \param theSectionIndex index of section
+ */
+ HYDRODATA_EXPORT virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const;
- /** Set name of the specified section */
- HYDRODATA_EXPORT virtual bool setSectionName( const int theISection,
- const std::string& theName );
+ /**
+ * 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 );
- //! Get type of the specified section
- HYDRODATA_EXPORT virtual CurveCreator::SectionType getSectionType( const int theISection ) const;
+ /**
+ * Returns type of section with given index.
+ * \param theSectionIndex index of section
+ */
+ HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const;
/**
- * Set type of the specified section (or all sections
- * if \a theISection is -1).
+ * Set type for section with given index.
+ * \param theSectionIndex index of section
+ * \param theSectionType new section type
*/
- HYDRODATA_EXPORT virtual bool setSectionType( const int theISection,
- const CurveCreator::SectionType theType );
+ HYDRODATA_EXPORT virtual void SetSectionType( const int theSectionIndex,
+ const SectionType theSectionType );
+ /**
+ * Returns true if section with given index is closed.
+ * \param theSectionIndex index of section
+ */
+ HYDRODATA_EXPORT virtual bool IsClosedSection( const int theSectionIndex ) const;
- /***********************************************/
- /*** Point methods ***/
- /***********************************************/
+ /**
+ * 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 );
/**
- * 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).
+ * Removes section with given index.
+ * \param theSectionIndex index of section
*/
- HYDRODATA_EXPORT virtual bool addPoints( const CurveCreator::Coordinates& theCoords,
- const int theISection,
- const int theIPnt = -1 );
+ HYDRODATA_EXPORT virtual void RemoveSection( const int theSectionIndex );
- //! Set coordinates of specified point
- HYDRODATA_EXPORT virtual bool setPoint( const int theISection,
- const int theIPnt,
- const CurveCreator::Coordinates& theCoords );
+ /**
+ * Removes all sections.
+ */
+ HYDRODATA_EXPORT virtual void RemoveSections();
- //! Set coordinates of specified points from different sections
- HYDRODATA_EXPORT virtual bool setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords);
- //! Remove point with given id
- HYDRODATA_EXPORT virtual bool removePoint( const int theISection, const int theIPnt = -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 void AddPoint( const int theSectionIndex,
+ const Point& thePoint,
+ const int thePointIndex = -1 );
- //! Remove several points from different sections with given ids
- HYDRODATA_EXPORT virtual bool removeSeveralPoints( const SectionToPointList &theSectionToPntIDs);
+ /**
+ * 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<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY);
protected:
- friend class HYDROData_Profile;
friend class HYDROData_Iterator;
/**