Salome HOME
Merge remote-tracking branch 'origin/BR_IMPROVEMENTS' into BR_v14_rc
[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 MergeAltitudesType
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 MergeAltitudesType& theType );
60
61   /**
62    * Returns the merging type for conflict altitudes.
63    */
64   MergeAltitudesType 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::SetMergeAltitude( aRefAltitude ) : 
80                       sipCpp->SetMergeAltitude( 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     aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeAltitude() : 
96                                    sipCpp->GetMergeAltitude();
97     Py_END_ALLOW_THREADS
98     
99     sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
100   
101   %End
102
103   /**
104    * Removes the reference altitude for resolving the conflict.
105    */
106   void RemoveMergeAltitude();
107
108
109   /**
110    * dd new one geometry object for zone.
111    */
112   void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
113   %MethodCode
114
115     Handle(HYDROData_Object) aGeomObj =
116       Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
117     if ( !aGeomObj.IsNull() )
118     {
119       Py_BEGIN_ALLOW_THREADS
120       sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : 
121                       sipCpp->AddGeometryObject( aGeomObj );
122       Py_END_ALLOW_THREADS
123     }
124
125   %End
126
127   /**
128    * Returns all geometry objects of zone.
129    */
130   HYDROData_SequenceOfObjects GetGeometryObjects() const;
131
132   /**
133    * Removes all geometry objects from zone.
134    */
135   void RemoveGeometryObjects();
136
137
138   /**
139    * Sets the interpolator for zone. By default it is NULL and original
140    * interpolation algorithms are used to calculate points altitudes.
141    * If you set interpolator it won't be stored in the data model structure,
142    * it will be deleted during that time as this zone will be freed.
143    */
144   void SetInterpolator( HYDROData_IInterpolator* theInter );
145
146   /**
147    * * Returns the interpolator of zone object.
148    */
149   HYDROData_IInterpolator* GetInterpolator() const;
150
151 protected:
152
153   /**
154    * Creates new object in the internal data structure. Use higher level objects 
155    * to create objects with real content.
156    */
157   HYDROData_Zone();
158
159   /**
160    * Destructs properties of the object and object itself, removes it from the document.
161    */
162   ~HYDROData_Zone();
163 };
164
165