1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <HYDROData_PolylineXY.h>
23 class HYDROData_PolylineXY : public HYDROData_IPolyline
27 #include <HYDROData_PolylineXY.h>
30 %ConvertToSubClassCode
31 switch ( sipCpp->GetKind() )
34 sipClass = sipClass_HYDROData_PolylineXY;
38 // We don't recognise the type.
46 * Returns default wire color for new polyline.
48 static QColor DefaultWireColor() const;
51 * Returns the presentation of polyline section in Qt maner.
53 static void BuildPainterPath( QPainterPath& thePath,
54 const SectionType& theType,
55 const bool& theIsClosed,
56 const NCollection_Sequence<gp_XYZ>& thePoints );
59 * Returns flag indicating that polyline can be edited or not.
61 virtual bool IsEditable() const;
67 * Imports shape from IOR.
68 * \param theIOR the IOR of Geom object
69 * \return \c true if shape has been successfully imported
71 bool ImportFromGeomIOR( const TCollection_AsciiString& theIOR );
74 * Stores the study entry of the imported GEOM object.
75 * \param theEntry GEOM object entry
77 void SetGeomObjectEntry( const TCollection_AsciiString& theEntry );
80 * Returns the imported GEOM object entry.
82 TCollection_AsciiString GetGeomObjectEntry() const;
88 * Returns true if polyline is closed
89 * \param theIsSimpleCheck flag indicating the type of checking
90 * - if true then all wires checked on closures
91 * - if false then for positive result polyline should consist of
92 * only one wire and which must be closed
94 bool IsClosed( const bool theIsSimpleCheck = true ) const;
97 * Returns the distance beetwen first and point with index thePointIndex
98 * at the section with index theSectionIndex. -1 is returned if error is occurred.
100 double GetDistance( const int theSectionIndex,
101 const int thePointIndex ) const;
104 * Adds new one section.
105 * \param theSectName name of the section
106 * \param theSectionType type of section
107 * \param theIsClosed flag indicates closures of section
109 void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames /Out/,
110 NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes /Out/,
111 NCollection_Sequence<bool>& theSectClosures /Out/ ) const;
114 * Replaces point for section with index "theSectionIndex".
115 * \param theSectionIndex index of section
116 * \param thePoints new points
118 void SetPoints( const int theSectionIndex,
119 const HYDROData_IPolyline::PointsList& thePoints );
122 * Returns the painter path.
123 * Note: currently only the first section of the polyline data is taken into account.
124 * \return polyline painter path.
126 virtual QPainterPath GetPainterPath() const;
131 * Creates new object in the internal data structure. Use higher level objects
132 * to create objects with real content.
134 HYDROData_PolylineXY();
137 * Destructs properties of the object and object itself, removes it from the document.
139 ~HYDROData_PolylineXY();