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_IPolyline.h>
23 class HYDROData_IPolyline : public HYDROData_Entity /Abstract/
26 #include <HYDROData_IPolyline.h>
30 typedef NCollection_Sequence<gp_XY> PointsList;
33 %ConvertToSubClassCode
34 switch ( sipCpp->GetKind() )
37 sipClass = sipClass_HYDROData_PolylineXY;
41 sipClass = sipClass_HYDROData_ProfileUZ;
45 // We don't recognise the type.
52 enum SectionType{ SECTION_POLYLINE = 0, SECTION_SPLINE = 1 };
57 * Sets wire color for object.
59 virtual void SetWireColor( const QColor& theColor );
62 * Returns wire color of object.
64 virtual QColor GetWireColor() const;
67 * Returns default wire color for new object.
69 static QColor DefaultWireColor();
74 * Returns number of sections.
76 virtual int NbSections() const = 0;
79 * Adds new one section.
80 * \param theSectName name of the section
81 * \param theSectionType type of section
82 * \param theIsClosed flag indicates closures of section
84 virtual void AddSection( const TCollection_AsciiString& theSectName,
85 const HYDROData_IPolyline::SectionType theSectionType,
86 const bool theIsClosed ) = 0;
89 * Returns name of section with given index.
90 * \param theSectionIndex index of section
92 virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const = 0;
95 * Set name for section with given index.
96 * \param theSectionIndex index of section
97 * \param theSectionName new section name
99 virtual void SetSectionName( const int theSectionIndex,
100 const TCollection_AsciiString& theSectionName ) = 0;
103 * Returns type of section with given index.
104 * \param theSectionIndex index of section
106 virtual HYDROData_IPolyline::SectionType GetSectionType( const int theSectionIndex ) const = 0;
109 * Set type for section with given index.
110 * \param theSectionIndex index of section
111 * \param theSectionType new section type
113 virtual void SetSectionType( const int theSectionIndex,
114 const HYDROData_IPolyline::SectionType theSectionType ) = 0;
117 * Returns true if section with given index is closed.
118 * \param theSectionIndex index of section
120 virtual bool IsClosedSection( const int theSectionIndex ) const = 0;
123 * Set closed flag for section with given index.
124 * \param theSectionIndex index of section
125 * \param theIsClosed new closures state
127 virtual void SetSectionClosed( const int theSectionIndex,
128 const bool theIsClosed ) = 0;
131 * Removes section with given index.
132 * \param theSectionIndex index of section
134 virtual void RemoveSection( const int theSectionIndex ) = 0;
137 * Removes all sections.
139 virtual void RemoveSections() = 0;
143 * Return number of profile points.
144 * \return number of points
146 int NbPoints( const int theSectionIndex = -1 ) const;
149 * Adds new point for section with index "theSectionIndex".
150 * \param theSectionIndex index of section
151 * \param thePoint point to add
152 * \param theBeforeIndex if not equal -1 then insert point before this index
154 virtual void AddPoint( const int theSectionIndex,
155 const HYDROData_IPolyline::Point& thePoint,
156 const int theBeforeIndex = -1 ) = 0;
159 * Replaces point for section with index "theSectionIndex".
160 * \param theSectionIndex index of section
161 * \param thePoint new point
162 * \param thePointIndex index of point to replace
164 virtual void SetPoint( const int theSectionIndex,
165 const HYDROData_IPolyline::Point& thePoint,
166 const int thePointIndex ) = 0;
169 * Removes point from section with index "theSectionIndex".
170 * \param theSectionIndex index of section
171 * \param thePointIndex index of point
173 virtual void RemovePoint( const int theSectionIndex,
174 const int thePointIndex ) = 0;
178 * Returns list of points.
179 * \param theSectionIndex if not equal -1 then list of points returned
180 * only for section with this index
181 * \return list of points
183 virtual HYDROData_IPolyline::PointsList GetPoints( const int theSectionIndex = -1 ) const = 0;
188 * Creates new object in the internal data structure. Use higher level objects
189 * to create objects with real content.
191 HYDROData_IPolyline();
194 * Destructs properties of the object and object itself, removes it from the document.
196 ~HYDROData_IPolyline();