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>
25 typedef bool BOOLTYPE;
28 class HYDROData_PolylineXY : HYDROData_IPolyline
32 #include <HYDROData_PolylineXY.h>
35 %ConvertToSubClassCode
36 switch ( sipCpp->GetKind() )
39 sipClass = sipClass_HYDROData_PolylineXY;
43 // We don't recognise the type.
51 * Returns default wire color for new polyline.
53 static QColor DefaultWireColor();
56 * Returns the presentation of polyline section in Qt maner.
58 static void BuildPainterPath( QPainterPath& thePath,
59 const SectionType& theType,
60 const bool& theIsClosed,
61 const NCollection_Sequence<gp_XYZ>& thePoints );
64 * Returns flag indicating that polyline can be edited or not.
66 virtual bool IsEditable() const;
70 * Returns true if polyline is closed
71 * \param theIsSimpleCheck flag indicating the type of checking
72 * - if true then all wires checked on closures
73 * - if false then for positive result polyline should consist of
74 * only one wire and which must be closed
76 bool IsClosed( const bool theIsSimpleCheck = true ) const;
79 * Returns the distance beetwen first and point with index thePointIndex
80 * at the section with index theSectionIndex. -1 is returned if error is occurred.
82 double GetDistance( const int theSectionIndex,
83 const int thePointIndex ) const;
86 * Adds new one section.
87 * \param theSectName name of the section
88 * \param theSectionType type of section
89 * \param theIsClosed flag indicates closures of section
91 void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames,
92 NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes,
93 /*NCollection_Sequence<bool>&*/ NCollection_Sequence<BOOLTYPE>& theSectClosures ) const;
96 * Replaces point for section with index "theSectionIndex".
97 * \param theSectionIndex index of section
98 * \param thePoints new points
100 void SetPoints( const int theSectionIndex,
101 const HYDROData_IPolyline::PointsList& thePoints );
104 * Returns the painter path.
105 * Note: currently only the first section of the polyline data is taken into account.
106 * \return polyline painter path.
108 virtual QPainterPath GetPainterPath() const;
113 * Creates new object in the internal data structure. Use higher level objects
114 * to create objects with real content.
116 HYDROData_PolylineXY();
119 * Destructs properties of the object and object itself, removes it from the document.
121 ~HYDROData_PolylineXY();