Salome HOME
Merge branch 'BR_v14_rc' into BR_quadtree
[modules/hydro.git] / src / HYDROPy / HYDROData_Zone.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_Zone.h>
21 %End
22
23 class HYDROData_Zone : public HYDROData_Entity
24 {
25
26 %ConvertToSubClassCode
27     switch ( sipCpp->GetKind() )
28     {
29       case KIND_ZONE:
30         sipClass = sipClass_HYDROData_Zone;
31         break;
32
33       default:
34         // We don't recognise the type.
35         sipClass = NULL;
36     }
37 %End
38
39 %TypeHeaderCode
40 #include <HYDROData_Zone.h>
41 %End
42
43 public:
44
45   // Enumeration of mergin types for conflict altitudes
46   enum MergeType
47   {
48     Merge_ZMIN,   // The minimum values
49     Merge_ZMAX,   // The maximum values
50     Merge_Object   // Only one altitude will be taken into account
51   };
52
53 public:      
54
55   /**
56    * Sets the merging type for conflict altitudes.
57    * By default it is set to Merge_ZMIN.
58    */
59   void SetMergeType( const MergeType& theType );
60
61   /**
62    * Returns the merging type for conflict altitudes.
63    */
64   MergeType GetMergeType() const;
65
66
67   /**
68    * Sets the reference altitude to resolve the conflict.
69    * This object is used only in case of "Merge_Object" merge type.
70    */
71   void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)];
72   %MethodCode
73
74     Handle(HYDROData_IAltitudeObject) aRefAltitude =
75       Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
76     if ( !aRefAltitude.IsNull() )
77     {
78       Py_BEGIN_ALLOW_THREADS
79       sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefAltitude ) : 
80                       sipCpp->SetMergeObject( aRefAltitude );
81       Py_END_ALLOW_THREADS
82     }
83
84   %End
85
86   /**
87    * Returns the reference altitude to resolve the conflict.
88    */
89   HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()];
90   %MethodCode
91
92     Handle(HYDROData_IAltitudeObject) aRefAltitude;
93     
94     Py_BEGIN_ALLOW_THREADS
95     Handle(HYDROData_Entity) aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() : 
96                                                           sipCpp->GetMergeObject();
97         aRefAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( aRefObject );
98     Py_END_ALLOW_THREADS
99     
100     sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
101   
102   %End
103
104   /**
105    * Removes the reference altitude for resolving the conflict.
106    */
107   void RemoveMergeAltitude();
108   %MethodCode
109
110     Py_BEGIN_ALLOW_THREADS
111       sipSelfWasArg ? sipCpp->HYDROData_Zone::RemoveMergeObject() : 
112                       sipCpp->RemoveMergeObject();
113     Py_END_ALLOW_THREADS
114
115   %End
116
117   /**
118    * Sets the reference object to resolve the conflict.
119    * This object is used only in case of "Merge_Object" merge type.
120    */
121   void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
122   %MethodCode
123
124     Handle(HYDROData_Entity) aRefObject =
125       Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
126     if ( !aRefObject.IsNull() )
127     {
128       Py_BEGIN_ALLOW_THREADS
129       sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefObject ) : 
130                       sipCpp->SetMergeObject( aRefObject );
131       Py_END_ALLOW_THREADS
132     }
133
134   %End
135
136   /**
137    * Returns the reference object to resolve the conflict.
138    */
139   HYDROData_Entity GetMergeObject() const [Handle_HYDROData_Entity ()];
140   %MethodCode
141
142     Handle(HYDROData_Entity) aRefObject;
143     
144     Py_BEGIN_ALLOW_THREADS
145     aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() : 
146                                  sipCpp->GetMergeObject();
147     Py_END_ALLOW_THREADS
148     
149     sipRes = (HYDROData_Entity*)createPointer( aRefObject );
150   
151   %End
152
153   /**
154    * Removes the reference object for resolving the conflict.
155    */
156   void RemoveMergeObject();
157
158   /**
159    * Add new one object for zone.
160    */
161   void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
162   %MethodCode
163
164     Handle(HYDROData_Entity) anObj =
165       Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
166     if ( !anObj.IsNull() )
167     {
168       Py_BEGIN_ALLOW_THREADS
169       sipSelfWasArg ? sipCpp->HYDROData_Zone::AddObject( anObj ) : 
170                       sipCpp->AddObject( anObj );
171       Py_END_ALLOW_THREADS
172     }
173
174   %End
175
176   /**
177    * Returns all objects of zone.
178    */
179   HYDROData_SequenceOfObjects GetObjects() const;
180
181   /**
182    * Removes all objects from zone.
183    */
184   void RemoveObjects();
185
186
187   /**
188    * Sets the interpolator for zone. By default it is NULL and original
189    * interpolation algorithms are used to calculate points altitudes.
190    * If you set interpolator it won't be stored in the data model structure,
191    * it will be deleted during that time as this zone will be freed.
192    */
193   void SetInterpolator( HYDROData_IInterpolator* theInter );
194
195   /**
196    * * Returns the interpolator of zone object.
197    */
198   HYDROData_IInterpolator* GetInterpolator() const;
199
200 protected:
201
202   /**
203    * Creates new object in the internal data structure. Use higher level objects 
204    * to create objects with real content.
205    */
206   HYDROData_Zone();
207
208   /**
209    * Destructs properties of the object and object itself, removes it from the document.
210    */
211   ~HYDROData_Zone();
212 };
213
214