1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include <HYDROData_PolylineXY.h>
27 class HYDROData_PolylineXY : HYDROData_IPolyline
31 #include <HYDROData_PolylineXY.h>
34 %ConvertToSubClassCode
35 switch ( sipCpp->GetKind() )
38 sipClass = sipClass_HYDROData_PolylineXY;
42 // We don't recognise the type.
50 * Returns default wire color for new polyline.
52 static QColor DefaultWireColor();
55 * Returns the presentation of polyline section in Qt maner.
57 static void BuildPainterPath( QPainterPath& thePath,
58 const SectionType& theType,
59 const bool& theIsClosed,
60 const NCollection_Sequence<gp_XYZ>& thePoints );
63 * Returns flag indicating that polyline can be edited or not.
65 virtual bool IsEditable() const;
69 * Returns true if polyline is closed
70 * \param theIsSimpleCheck flag indicating the type of checking
71 * - if true then all wires checked on closures
72 * - if false then for positive result polyline should consist of
73 * only one wire and which must be closed
75 bool IsClosed( const bool theIsSimpleCheck = true ) const;
78 * Returns the distance beetwen first and point with index thePointIndex
79 * at the section with index theSectionIndex. -1 is returned if error is occurred.
81 double GetDistance( const int theSectionIndex,
82 const int thePointIndex ) const;
85 * Adds new one section.
86 * \param theSectName name of the section
87 * \param theSectionType type of section
88 * \param theIsClosed flag indicates closures of section
90 /*TODO: void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames,
91 NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes,
92 NCollection_Sequence<bool>& theSectClosures /Constrained/) const;
95 * Replaces point for section with index "theSectionIndex".
96 * \param theSectionIndex index of section
97 * \param thePoints new points
99 void SetPoints( const int theSectionIndex,
100 const HYDROData_IPolyline::PointsList& thePoints );
103 * Returns the painter path.
104 * Note: currently only the first section of the polyline data is taken into account.
105 * \return polyline painter path.
107 virtual QPainterPath GetPainterPath() const;
112 * Creates new object in the internal data structure. Use higher level objects
113 * to create objects with real content.
115 HYDROData_PolylineXY();
118 * Destructs properties of the object and object itself, removes it from the document.
120 ~HYDROData_PolylineXY();