Salome HOME
refs #423: color for polylines presentation is correctly set
[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 data fields
67
68   /**
69    * Sets reference hydraulic axis object for stream.
70    */
71   bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
72   [bool ( const Handle_HYDROData_PolylineXY& )];
73   %MethodCode
74     Handle(HYDROData_PolylineXY) aRef =
75       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
76     if ( !aRef.IsNull() )
77     {
78       Py_BEGIN_ALLOW_THREADS
79       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
80                                sipCpp->SetHydraulicAxis( aRef );
81       Py_END_ALLOW_THREADS
82     }
83   %End
84
85   /**
86    * Returns reference hydraulic axis object of stream.
87    */
88   HYDROData_PolylineXY GetHydraulicAxis() const
89   [Handle_HYDROData_PolylineXY ()];
90   %MethodCode
91     Handle(HYDROData_PolylineXY) aRef;
92     
93     Py_BEGIN_ALLOW_THREADS
94     aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : 
95                            sipCpp->GetHydraulicAxis();
96     Py_END_ALLOW_THREADS
97     
98     sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
99   %End
100
101   /**
102    * Remove reference hydraulic axis object from stream.
103    */
104   void RemoveHydraulicAxis();
105
106   /**
107    * Add new one reference profile object for stream.
108    */
109   bool AddProfile( HYDROData_Profile theProfile )
110   [bool ( const Handle_HYDROData_Profile& )];
111   %MethodCode
112     Handle(HYDROData_Profile) aRef =
113       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
114     if ( !aRef.IsNull() )
115     {
116       Py_BEGIN_ALLOW_THREADS
117       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
118                                sipCpp->AddProfile( aRef );
119       Py_END_ALLOW_THREADS
120     }
121   %End
122
123   /**
124    * Returns all reference profile objects of stream.
125    */
126   HYDROData_SequenceOfObjects GetProfiles() const;
127
128   /**
129    * Removes reference profile object from stream.
130    */
131   bool RemoveProfile( HYDROData_Profile theProfile )
132   [bool ( const Handle_HYDROData_Profile& )];
133   %MethodCode
134     Handle(HYDROData_Profile) aRef =
135       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
136     if ( !aRef.IsNull() )
137     {
138       Py_BEGIN_ALLOW_THREADS
139       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
140                                sipCpp->RemoveProfile( aRef );
141       Py_END_ALLOW_THREADS
142     }
143   %End
144
145   /**
146    * Removes all reference profile objects from stream.
147    */
148   void RemoveProfiles();
149   
150 protected:
151   /**
152    * Creates new object in the internal data structure. Use higher level objects 
153    * to create objects with real content.
154    */
155   HYDROData_Stream();
156
157   /**
158    * Destructs properties of the object and object itself, removes it from the document.
159    */
160   virtual ~HYDROData_Stream();
161 };