Salome HOME
4b28e6d8451b06d6c5b8ac9585623294ac6cda57
[modules/hydro.git] / src / HYDROPy / HYDROData_Zone.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_Zone.h>
25 %End
26
27 class HYDROData_Zone : HYDROData_Entity
28 {
29
30 %TypeHeaderCode
31 #include <HYDROData_Zone.h>
32 %End
33
34 %ConvertToSubClassCode
35     switch ( sipCpp->GetKind() )
36     {
37       case KIND_ZONE:
38         sipClass = sipClass_HYDROData_Zone;
39         break;
40
41       default:
42         // We don't recognise the type.
43         sipClass = NULL;
44     }
45 %End
46
47 public:
48
49   // Enumeration of mergin types for conflict bathymetries
50   enum MergeBathymetriesType
51   {
52     Merge_ZMIN,   // The minimum values
53     Merge_ZMAX,   // The maximum values
54     Merge_Object  // Only one bathymetry will be taken into account
55   };
56
57 public:      
58
59   /**
60    * Sets the merging type for conflict bathymetries.
61    * By default it is set to Merge_ZMIN.
62    */
63   void SetMergeType( const MergeBathymetriesType& theType );
64
65   /**
66    * Returns the merging type for conflict bathymetries.
67    */
68   MergeBathymetriesType GetMergeType() const;
69
70
71   /**
72    * Sets the reference bathymetry to resolve the conflict.
73    * This object is used only in case of "Merge_Object" merge type.
74    */
75   void SetMergeBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
76   %MethodCode
77
78     Handle(HYDROData_Bathymetry) aRefBath =
79       Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
80     if ( !aRefBath.IsNull() )
81     {
82       Py_BEGIN_ALLOW_THREADS
83       sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeBathymetry( aRefBath ) : 
84                       sipCpp->SetMergeBathymetry( aRefBath );
85       Py_END_ALLOW_THREADS
86     }
87
88   %End
89
90   /**
91    * Returns the reference bathymetry to resolve the conflict.
92    */
93   HYDROData_Bathymetry GetMergeBathymetry() const [Handle_HYDROData_Bathymetry ()];
94   %MethodCode
95
96     Handle(HYDROData_Bathymetry) aRefBath;
97     
98     Py_BEGIN_ALLOW_THREADS
99     aRefBath = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeBathymetry() : 
100                                sipCpp->GetMergeBathymetry();
101     Py_END_ALLOW_THREADS
102     
103     sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
104   
105   %End
106
107   /**
108    * Removes the reference bathymetry for resolving the conflict.
109    */
110   void RemoveMergeBathymetry();
111
112
113   /**
114    * dd new one geometry object for zone.
115    */
116   void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
117   %MethodCode
118
119     Handle(HYDROData_Object) aGeomObj =
120       Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
121     if ( !aGeomObj.IsNull() )
122     {
123       Py_BEGIN_ALLOW_THREADS
124       sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : 
125                       sipCpp->AddGeometryObject( aGeomObj );
126       Py_END_ALLOW_THREADS
127     }
128
129   %End
130
131   /**
132    * Returns all geometry objects of zone.
133    */
134   //HYDROData_SequenceOfObjects GetGeometryObjects() const;
135
136   /**
137    * Removes all geometry objects from zone.
138    */
139   void RemoveGeometryObjects();
140
141 protected:
142
143   /**
144    * Creates new object in the internal data structure. Use higher level objects 
145    * to create objects with real content.
146    */
147   HYDROData_Zone();
148
149   /**
150    * Destructs properties of the object and object itself, removes it from the document.
151    */
152   ~HYDROData_Zone();
153 };
154
155