Salome HOME
Merge commit '9dd90968eb8ad86e7e6ae67f48bb6110bd4ffbdc' 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   DBFStatus ImportDBF( const QString& theDBFFileName, 
56     const QString& theFieldName, 
57     const QStringList& DBFValues,
58     const QStringList& StricklerTypes );
59  
60   void ExportDBF( const QString& theDBFFileName,
61     const QString& theFieldName, 
62     const QStringList& theDBFValues,
63     const QStringList& theStricklerTypes ) const;
64
65   bool ExportTelemac( const QString& theFileName, double theDeflection ) const;
66
67   bool Add( HYDROData_Object theObject, const QString& theType )
68   [bool ( const Handle_HYDROData_Object&, const QString& )];
69   %MethodCode
70     Handle(HYDROData_Object) aRef =
71       Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
72     if ( !aRef.IsNull() )
73     {
74       Py_BEGIN_ALLOW_THREADS
75       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
76                                sipCpp->Add( aRef, *a1 );
77       Py_END_ALLOW_THREADS
78     }
79   %End
80
81   bool Add( HYDROData_PolylineXY thePolyline, const QString& theType )
82   [bool ( const Handle_HYDROData_PolylineXY&, const QString& )];
83   %MethodCode
84     Handle(HYDROData_PolylineXY) aRef =
85       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
86     if ( !aRef.IsNull() )
87     {
88       Py_BEGIN_ALLOW_THREADS
89       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
90                                sipCpp->Add( aRef, *a1 );
91       Py_END_ALLOW_THREADS
92     }
93   %End
94
95   bool Split( HYDROData_PolylineXY thePolyline )
96   [bool ( const Handle_HYDROData_PolylineXY& )];
97   %MethodCode
98     Handle(HYDROData_PolylineXY) aRef =
99       Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
100     if ( !aRef.IsNull() )
101     {
102       Py_BEGIN_ALLOW_THREADS
103       sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Split( aRef ):
104                                sipCpp->Split( aRef );
105       Py_END_ALLOW_THREADS
106     }
107   %End
108 };