// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // 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. // // 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 // %ExportedHeaderCode #include %End class HYDROData_PolylineXY : HYDROData_IPolyline { %TypeHeaderCode #include %End %ConvertToSubClassCode switch ( sipCpp->GetKind() ) { case KIND_POLYLINEXY: sipClass = sipClass_HYDROData_PolylineXY; break; default: // We don't recognise the type. sipClass = NULL; } %End public: /** * Returns default wire color for new polyline. */ static QColor DefaultWireColor(); /** * Returns the presentation of polyline section in Qt maner. */ static void BuildPainterPath( QPainterPath& thePath, const SectionType& theType, const bool& theIsClosed, const NCollection_Sequence& thePoints ); /** * Returns flag indicating that polyline can be edited or not. */ virtual bool IsEditable() const; /** * Returns true if polyline is closed * \param theIsSimpleCheck flag indicating the type of checking * - if true then all wires checked on closures * - if false then for positive result polyline should consist of * only one wire and which must be closed */ bool IsClosed( const bool theIsSimpleCheck = true ) const; /** * Returns the distance beetwen first and point with index thePointIndex * at the section with index theSectionIndex. -1 is returned if error is occurred. */ double GetDistance( const int theSectionIndex, const int thePointIndex ) const; /** * Adds new one section. * \param theSectName name of the section * \param theSectionType type of section * \param theIsClosed flag indicates closures of section */ void GetSections( NCollection_Sequence& theSectNames, NCollection_Sequence& theSectTypes, NCollection_Sequence& theSectClosures ) const; /** * Replaces point for section with index "theSectionIndex". * \param theSectionIndex index of section * \param thePoints new points */ void SetPoints( const int theSectionIndex, const HYDROData_IPolyline::PointsList& thePoints ); /** * Returns the painter path. * Note: currently only the first section of the polyline data is taken into account. * \return polyline painter path. */ virtual QPainterPath GetPainterPath() const; protected: /** * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ HYDROData_PolylineXY(); /** * Destructs properties of the object and object itself, removes it from the document. */ ~HYDROData_PolylineXY(); };