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();
72 * Sets color for section of polyline.
74 virtual void SetSectionColor( const int theSectionIndex, const QColor& theColor );
77 * Returns color of section of polyline.
79 virtual bool GetSectionColor( const int theSectionIndex, QColor &theColor ) const;
85 * Returns number of sections.
87 virtual int NbSections() const = 0;
90 * Adds new one section.
91 * \param theSectName name of the section
92 * \param theSectionType type of section
93 * \param theIsClosed flag indicates closures of section
95 virtual void AddSection( const TCollection_AsciiString& theSectName,
96 const HYDROData_IPolyline::SectionType theSectionType,
97 const bool theIsClosed ) = 0;
100 * Returns name of section with given index.
101 * \param theSectionIndex index of section
103 virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const = 0;
106 * Set name for section with given index.
107 * \param theSectionIndex index of section
108 * \param theSectionName new section name
110 virtual void SetSectionName( const int theSectionIndex,
111 const TCollection_AsciiString& theSectionName ) = 0;
114 * Returns type of section with given index.
115 * \param theSectionIndex index of section
117 virtual HYDROData_IPolyline::SectionType GetSectionType( const int theSectionIndex ) const = 0;
120 * Set type for section with given index.
121 * \param theSectionIndex index of section
122 * \param theSectionType new section type
124 virtual void SetSectionType( const int theSectionIndex,
125 const HYDROData_IPolyline::SectionType theSectionType ) = 0;
128 * Returns true if section with given index is closed.
129 * \param theSectionIndex index of section
131 virtual bool IsClosedSection( const int theSectionIndex ) const = 0;
134 * Set closed flag for section with given index.
135 * \param theSectionIndex index of section
136 * \param theIsClosed new closures state
138 virtual void SetSectionClosed( const int theSectionIndex,
139 const bool theIsClosed ) = 0;
142 * Removes section with given index.
143 * \param theSectionIndex index of section
145 virtual void RemoveSection( const int theSectionIndex ) = 0;
148 * Removes all sections.
150 virtual void RemoveSections() = 0;
154 * Return number of profile points.
155 * \return number of points
157 int NbPoints( const int theSectionIndex = -1 ) const;
160 * Adds new point for section with index "theSectionIndex".
161 * \param theSectionIndex index of section
162 * \param thePoint point to add
163 * \param theBeforeIndex if not equal -1 then insert point before this index
165 virtual void AddPoint( const int theSectionIndex,
166 const HYDROData_IPolyline::Point& thePoint,
167 const int theBeforeIndex = -1 ) = 0;
170 * Replaces point for section with index "theSectionIndex".
171 * \param theSectionIndex index of section
172 * \param thePoint new point
173 * \param thePointIndex index of point to replace
175 virtual void SetPoint( const int theSectionIndex,
176 const HYDROData_IPolyline::Point& thePoint,
177 const int thePointIndex ) = 0;
180 * Removes point from section with index "theSectionIndex".
181 * \param theSectionIndex index of section
182 * \param thePointIndex index of point
184 virtual void RemovePoint( const int theSectionIndex,
185 const int thePointIndex ) = 0;
189 * Returns list of points.
190 * \param theSectionIndex if not equal -1 then list of points returned
191 * only for section with this index
192 * \return list of points
194 virtual HYDROData_IPolyline::PointsList GetPoints( const int theSectionIndex = -1 ) const = 0;
199 * Creates new object in the internal data structure. Use higher level objects
200 * to create objects with real content.
202 HYDROData_IPolyline();
205 * Destructs properties of the object and object itself, removes it from the document.
207 ~HYDROData_IPolyline();