Salome HOME
6fc7a002a055b37350968aaf9a1d38b5abe4ddfc
[modules/hydro.git] / src / HYDROPy / HYDROData_Stream.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_Stream.h"
25 %End
26
27 class HYDROData_Stream : public HYDROData_NaturalObject
28 {
29 %TypeHeaderCode
30 #include "HYDROData_Stream.h"
31 %End
32
33 public:
34   /**
35    * Update the shape presentations of stream.
36    */
37   void UpdatePrs();
38
39   /**
40    * Returns default filling color for new stream.
41    */
42   static QColor DefaultFillingColor();
43
44   /**
45    * Returns default border color for new stream.
46    */
47   static QColor DefaultBorderColor();
48
49   /**
50    * Returns true if given polyline can be used as stream axis.
51    */
52   static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) 
53   [bool ( const Handle_HYDROData_PolylineXY& )];
54   %MethodCode
55     Handle(HYDROData_PolylineXY) aRef =
56       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
57     if ( !aRef.IsNull() )
58     {
59       Py_BEGIN_ALLOW_THREADS
60       sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
61       Py_END_ALLOW_THREADS
62     }
63   %End
64
65 public:      
66   // Public methods to work with Stream presentation
67   
68   /**
69    * Returns the left edge of the stream.
70    */
71 //  virtual TopoDS_Shape GetLeftShape() const;
72
73   /**
74    * Returns the right edge of the stream.
75    */
76 //  virtual TopoDS_Shape GetRightShape() const;
77
78   /**
79    * Returns the inlet edge of the stream.
80    */
81 //  virtual TopoDS_Shape GetInletShape() const;
82
83   /**
84    * Returns the outlet edge of the stream.
85    */
86 //  virtual TopoDS_Shape GetOutletShape() const;
87
88
89 public:      
90   // Public methods to work with Stream data fields
91
92   /**
93    * Sets reference hydraulic axis object for stream.
94    */
95   bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
96   [bool ( const Handle_HYDROData_PolylineXY& )];
97   %MethodCode
98     Handle(HYDROData_PolylineXY) aRef =
99       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
100     if ( !aRef.IsNull() )
101     {
102       Py_BEGIN_ALLOW_THREADS
103       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
104                                sipCpp->SetHydraulicAxis( aRef );
105       Py_END_ALLOW_THREADS
106     }
107   %End
108
109   /**
110    * Returns reference hydraulic axis object of stream.
111    */
112   HYDROData_PolylineXY GetHydraulicAxis() const
113   [Handle_HYDROData_PolylineXY ()];
114   %MethodCode
115     Handle(HYDROData_PolylineXY) aRef;
116     
117     Py_BEGIN_ALLOW_THREADS
118     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : 
119                            sipCpp->GetHydraulicAxis();
120     Py_END_ALLOW_THREADS
121     
122     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
123   %End
124
125   /**
126    * Remove reference hydraulic axis object from stream.
127    */
128   void RemoveHydraulicAxis();
129
130   /**
131    * Returns true if profile has the intersection with the given hydraulic axis.
132    * Returns the parameter of inresection point on axis if axis is presented by one curve,
133    * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point. 
134    */
135 //  static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis, 
136 //                               const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
137 //                                                     Standard_Real& outPar);
138
139   /**
140    * Returns true if profile has the intersection with reference hydraulic axis.
141    * Returns the parameter of inresection point on axis if axis is presented by one curve,
142    * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point. 
143    */
144 //  bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
145 //                                                                                                                       Standard_Real& outPar) const;
146
147    /**
148    * Builds a planar face
149    */
150 //  bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
151
152   /**
153    * Add new one reference profile object for stream.
154    */
155   bool AddProfile( HYDROData_Profile theProfile )
156   [bool ( const Handle_HYDROData_Profile& )];
157   %MethodCode
158     Handle(HYDROData_Profile) aRef =
159       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
160     if ( !aRef.IsNull() )
161     {
162       Py_BEGIN_ALLOW_THREADS
163       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
164                                sipCpp->AddProfile( aRef );
165       Py_END_ALLOW_THREADS
166     }
167   %End
168
169   /**
170    * Returns all reference profile objects of stream.
171    */
172   HYDROData_SequenceOfObjects GetProfiles() const;
173
174   /**
175    * Removes reference profile object from stream.
176    */
177   bool RemoveProfile( HYDROData_Profile theProfile )
178   [bool ( const Handle_HYDROData_Profile& )];
179   %MethodCode
180     Handle(HYDROData_Profile) aRef =
181       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
182     if ( !aRef.IsNull() )
183     {
184       Py_BEGIN_ALLOW_THREADS
185       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
186                                sipCpp->RemoveProfile( aRef );
187       Py_END_ALLOW_THREADS
188     }
189   %End
190
191   /**
192    * Removes all reference profile objects from stream.
193    */
194   void RemoveProfiles();
195   
196 protected:
197   /**
198    * Creates new object in the internal data structure. Use higher level objects 
199    * to create objects with real content.
200    */
201   HYDROData_Stream();
202
203   /**
204    * Destructs properties of the object and object itself, removes it from the document.
205    */
206   virtual ~HYDROData_Stream();
207 };