Salome HOME
Merge remote-tracking branch 'origin/BR_quadtree' into V7_dev
[modules/hydro.git] / src / HYDROPy / HYDROData_Channel.sip
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.
6 //
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.
11 //
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
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 %ExportedHeaderCode
20 #include "HYDROData_Channel.h"
21 %End
22
23 class HYDROData_Channel : public HYDROData_ArtificialObject
24 {
25 %TypeHeaderCode
26 #include "HYDROData_Channel.h"
27 %End
28
29 %ConvertToSubClassCode
30     // HYDROData_Channel sub-classes provide a unique kind ID.
31     switch ( sipCpp->GetKind() )
32     {
33       case KIND_DIGUE:
34         sipClass = sipClass_HYDROData_Digue;
35         break;
36
37       case KIND_UNKNOWN:
38         sipClass = sipClass_HYDROData_ArtificialObject;
39         break;
40
41       default:
42         // We don't recognise the type.
43         sipClass = NULL;
44     }
45 %End
46
47 public:
48   /**
49    * Returns default filling color for new channel.
50    */
51   virtual QColor DefaultFillingColor() const;
52
53   /**
54    * Returns default border color for new channel.
55    */
56   virtual QColor DefaultBorderColor() const;
57
58
59 public:      
60   // Public methods to work with Channel
61   
62   /**
63    * Sets reference guide line object for channel.
64    */
65   bool SetGuideLine( HYDROData_Polyline3D theGuideLine )
66   [bool ( const Handle_HYDROData_Polyline3D& )];
67   %MethodCode
68     Handle(HYDROData_Polyline3D) aRef =
69       Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
70     if ( !aRef.IsNull() )
71     {
72       Py_BEGIN_ALLOW_THREADS
73       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Channel::SetGuideLine( aRef ):
74                                sipCpp->SetGuideLine( aRef );
75       Py_END_ALLOW_THREADS
76     }
77   %End
78
79   /**
80    * Returns reference guide line object of channel.
81    */
82   HYDROData_Polyline3D GetGuideLine() const
83   [Handle_HYDROData_Polyline3D ()];
84   %MethodCode
85     Handle(HYDROData_Polyline3D) aRef;
86     
87     Py_BEGIN_ALLOW_THREADS
88     aRef = sipSelfWasArg ? sipCpp->HYDROData_Channel::GetGuideLine() : 
89                            sipCpp->GetGuideLine();
90     Py_END_ALLOW_THREADS
91     
92     sipRes = (HYDROData_Polyline3D*)createPointer( aRef );
93   %End
94
95   /**
96    * Remove reference guide line object from channel.
97    */
98   void RemoveGuideLine();
99
100
101   /**
102    * Sets reference profile object for channel.
103    */
104   bool SetProfile( HYDROData_Profile theProfile )
105   [bool ( const Handle_HYDROData_Profile& )];
106   %MethodCode
107     Handle(HYDROData_Profile) aRef =
108       Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
109     if ( !aRef.IsNull() )
110     {
111       Py_BEGIN_ALLOW_THREADS
112       sipRes = sipSelfWasArg ? sipCpp->HYDROData_Channel::SetProfile( aRef ):
113                                sipCpp->SetProfile( aRef );
114       Py_END_ALLOW_THREADS
115     }
116   %End
117
118   /**
119    * Returns reference profile object of channel.
120    */
121   HYDROData_Profile GetProfile() const
122   [Handle_HYDROData_Profile ()];
123   %MethodCode
124     Handle(HYDROData_Profile) aRef;
125     
126     Py_BEGIN_ALLOW_THREADS
127     aRef = sipSelfWasArg ? sipCpp->HYDROData_Channel::GetProfile() : 
128                            sipCpp->GetProfile();
129     Py_END_ALLOW_THREADS
130     
131     sipRes = (HYDROData_Profile*)createPointer( aRef );
132   %End
133
134   /**
135    * Remove reference profile object from channel.
136    */
137   void RemoveProfile();
138
139   void SetEquiDistance( double );
140   double GetEquiDistance() const;
141   
142 protected:
143
144   /**
145    * Creates new object in the internal data structure. Use higher level objects 
146    * to create objects with real content.
147    */
148   HYDROData_Channel();
149
150   /**
151    * Destructs properties of the object and object itself, removes it from the document.
152    */
153   virtual ~HYDROData_Channel();
154 };