Salome HOME
Merge remote-tracking branch 'remotes/origin/BR_LAND_COVER_MAP' into BR_LCM_COMP
[modules/hydro.git] / src / HYDROPy / HYDROData_LandCoverMap.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_LandCoverMap.h>
21 %End
22
23 class HYDROData_LandCoverMap : public HYDROData_Entity
24 {
25 %TypeHeaderCode
26 #include <HYDROData_LandCoverMap.h>
27 %End
28
29 %ConvertToSubClassCode
30     switch ( sipCpp->GetKind() )
31     {
32       case KIND_LAND_COVER_MAP:
33         sipClass = sipClass_HYDROData_LandCoverMap;
34         break;
35
36       default:
37         // We don't recognise the type.
38         sipClass = NULL;
39     }
40 %End
41
42 public:
43   enum DBFStatus
44   {
45     DBFStatus_OK,
46     DBFStatus_DIFF_SIZE_ERROR,
47     DBFStatus_OPEN_FILE_ERROR,
48     DBFStatus_NO_SUCH_FIELD_ERROR,
49     DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING
50   };
51
52   HYDROData_LandCoverMap();
53   ~HYDROData_LandCoverMap();
54
55   bool ImportSHP( const QString& theSHPFileName );
56   void ExportSHP( const QString& theSHPFileName ) const;
57
58   DBFStatus ImportDBF( const QString& theDBFFileName, 
59     const QString& theFieldName, 
60     const QStringList& DBFValues,
61     const QStringList& StricklerTypes );
62  
63   void ExportDBF( const QString& theDBFFileName,
64     const QString& theFieldName, 
65     const QStringList& theDBFValues,
66     const QStringList& theStricklerTypes ) const;
67  
68   bool ImportShp( const QString& theFileName);
69
70   bool ExportShp( const QString& theFileName) const;
71
72   bool ExportTelemac( const QString& theFileName, double theDeflection,
73                                           HYDROData_StricklerTable theTable ) const
74   [bool( const QString&, double, const Handle_HYDROData_StricklerTable& )];
75   %MethodCode
76     Handle(HYDROData_StricklerTable) aRef =
77       Handle(HYDROData_StricklerTable)::DownCast( createHandle( a2 ) );
78     if ( !aRef.IsNull() )
79     {
80       Py_BEGIN_ALLOW_THREADS
81       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::ExportTelemac( *a0, a1, aRef ):
82                                sipCpp->ExportTelemac( *a0, a1, aRef );
83       Py_END_ALLOW_THREADS
84     }
85   %End
86
87   bool Add( HYDROData_Object theObject, const QString& theType )
88   [bool ( const Handle_HYDROData_Object&, const QString& )];
89   %MethodCode
90     Handle(HYDROData_Object) aRef =
91       Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
92     if ( !aRef.IsNull() )
93     {
94       Py_BEGIN_ALLOW_THREADS
95       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
96                                sipCpp->Add( aRef, *a1 );
97       Py_END_ALLOW_THREADS
98     }
99   %End
100
101   bool Add( HYDROData_PolylineXY thePolyline, const QString& theType )
102   [bool ( const Handle_HYDROData_PolylineXY&, const QString& )];
103   %MethodCode
104     Handle(HYDROData_PolylineXY) aRef =
105       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
106     if ( !aRef.IsNull() )
107     {
108       Py_BEGIN_ALLOW_THREADS
109       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
110                                sipCpp->Add( aRef, *a1 );
111       Py_END_ALLOW_THREADS
112     }
113   %End
114
115   bool Split( HYDROData_PolylineXY thePolyline )
116   [bool ( const Handle_HYDROData_PolylineXY& )];
117   %MethodCode
118     Handle(HYDROData_PolylineXY) aRef =
119       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
120     if ( !aRef.IsNull() )
121     {
122       Py_BEGIN_ALLOW_THREADS
123       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Split( aRef ):
124                                sipCpp->Split( aRef );
125       Py_END_ALLOW_THREADS
126     }
127   %End
128 };