Salome HOME
Minor change - public keyword added.
[modules/hydro.git] / src / HYDROPy / HYDROData_IPolyline.sip
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 %ExportedHeaderCode
24 #include <HYDROData_IPolyline.h>
25 %End
26
27 class HYDROData_IPolyline : public HYDROData_Entity /Abstract/
28 {
29 %TypeHeaderCode
30 #include <HYDROData_IPolyline.h>
31 %End
32
33   typedef gp_XY                       Point;
34   typedef NCollection_Sequence<gp_XY> PointsList;
35
36
37 %ConvertToSubClassCode
38     switch ( sipCpp->GetKind() )
39     {
40       case KIND_POLYLINEXY:
41         sipClass = sipClass_HYDROData_PolylineXY;
42         break;
43
44       case KIND_PROFILEUZ:
45         sipClass = sipClass_HYDROData_ProfileUZ;
46         break;
47
48       default:
49         // We don't recognise the type.
50         sipClass = NULL;
51     }
52 %End
53
54 public:
55
56   enum SectionType{ SECTION_POLYLINE = 0, SECTION_SPLINE = 1 };
57
58 public:      
59
60   /**
61    * Sets wire color for object.
62    */
63   virtual void SetWireColor( const QColor& theColor );
64
65   /**
66    * Returns wire color of object.
67    */
68   virtual QColor GetWireColor() const;
69
70   /**
71    * Returns default wire color for new object.
72    */
73   static QColor DefaultWireColor();
74
75 public:
76
77   /**
78    * Returns number of sections.
79    */
80   virtual int NbSections() const = 0;
81
82   /**
83    * Adds new one section.
84    * \param theSectName name of the section
85    * \param theSectionType type of section
86    * \param theIsClosed flag indicates closures of section
87    */
88   virtual void AddSection( const TCollection_AsciiString& theSectName,
89                            const HYDROData_IPolyline::SectionType theSectionType,
90                            const bool                     theIsClosed ) = 0;
91
92   /**
93    * Returns name of section with given index.
94    * \param theSectionIndex index of section
95    */
96   virtual TCollection_AsciiString GetSectionName( const int theSectionIndex ) const = 0;
97
98   /**
99    * Set name for section with given index.
100    * \param theSectionIndex index of section
101    * \param theSectionName new section name
102    */
103   virtual void SetSectionName( const int                      theSectionIndex, 
104                                const TCollection_AsciiString& theSectionName ) = 0;
105
106   /**
107    * Returns type of section with given index.
108    * \param theSectionIndex index of section
109    */
110   virtual HYDROData_IPolyline::SectionType GetSectionType( const int theSectionIndex ) const = 0;
111
112   /**
113    * Set type for section with given index.
114    * \param theSectionIndex index of section
115    * \param theSectionType new section type
116    */
117   virtual void SetSectionType( const int         theSectionIndex, 
118                                const HYDROData_IPolyline::SectionType theSectionType ) = 0;
119
120   /**
121    * Returns true if section with given index is closed.
122    * \param theSectionIndex index of section
123    */
124   virtual bool IsClosedSection( const int theSectionIndex ) const = 0;
125
126   /**
127    * Set closed flag for section with given index.
128    * \param theSectionIndex index of section
129    * \param theIsClosed new closures state
130    */
131   virtual void SetSectionClosed( const int  theSectionIndex, 
132                                  const bool theIsClosed ) = 0;
133
134   /**
135    * Removes section with given index.
136    * \param theSectionIndex index of section
137    */
138   virtual void RemoveSection( const int theSectionIndex ) = 0;
139
140   /**
141    * Removes all sections.
142    */
143   virtual void RemoveSections() = 0;
144
145
146   /**
147    * Return number of profile points.
148    * \return number of points
149    */
150   int NbPoints( const int theSectionIndex = -1 ) const;
151
152   /**
153    * Adds new point for section with index "theSectionIndex".
154    * \param theSectionIndex index of section
155    * \param thePoint point to add
156    * \param theBeforeIndex if not equal -1 then insert point before this index
157    */
158   virtual void AddPoint( const int    theSectionIndex,
159                          const HYDROData_IPolyline::Point& thePoint,
160                          const int    theBeforeIndex = -1 ) = 0;
161
162   /**
163    * Replaces point for section with index "theSectionIndex".
164    * \param theSectionIndex index of section
165    * \param thePoint new point
166    * \param thePointIndex index of point to replace
167    */
168   virtual void SetPoint( const int    theSectionIndex,
169                          const HYDROData_IPolyline::Point& thePoint,
170                          const int    thePointIndex ) = 0;
171
172   /**
173    * Removes point from section with index "theSectionIndex".
174    * \param theSectionIndex index of section
175    * \param thePointIndex index of point
176    */
177   virtual void RemovePoint( const int theSectionIndex,
178                             const int thePointIndex ) = 0;
179
180
181   /**
182    * Returns list of points.
183    * \param theSectionIndex if not equal -1 then list of points returned
184    *                        only for section with this index
185    * \return list of points
186    */
187   virtual HYDROData_IPolyline::PointsList GetPoints( const int theSectionIndex = -1 ) const = 0;
188
189 protected:
190
191   /**
192    * Creates new object in the internal data structure. Use higher level objects 
193    * to create objects with real content.
194    */
195   HYDROData_IPolyline();
196
197   /**
198    * Destructs properties of the object and object itself, removes it from the document.
199    */
200   ~HYDROData_IPolyline();
201 };
202
203