LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StricklerTable.cc)
SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StricklerTable.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_LandCoverMap.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_LandCoverMap.cc)
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
const QString& theFieldName,
const QStringList& theDBFValues,
const QStringList& theStricklerTypes,
- QMap<int, int> theIndices )
+ const QList<int>& theIndices )
{
if (theDBFValues.size() != theStricklerTypes.size())
return DBFStatus_DIFF_SIZE_ERROR;
#include <HYDROData_Entity.h>
#include <TDataStd_ExtStringArray.hxx>
-#include <QMap>
DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity )
DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING
};
- HYDROData_LandCoverMap();
- ~HYDROData_LandCoverMap();
+ HYDRODATA_EXPORT HYDROData_LandCoverMap();
+ HYDRODATA_EXPORT virtual ~HYDROData_LandCoverMap();
- virtual const ObjectKind GetKind() const;
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
- DBFStatus ImportDBF( const QString& theDBFFileName,
- const QString& theFieldName,
- const QStringList& DBFValues,
- const QStringList& StricklerTypes,
- QMap<int, int> theIndices );
+ HYDRODATA_EXPORT DBFStatus ImportDBF( const QString& theDBFFileName,
+ const QString& theFieldName,
+ const QStringList& DBFValues,
+ const QStringList& StricklerTypes,
+ const QList<int>& theIndices );
- void ExportDBF( const QString& theDBFFileName,
- const QString& theFieldName,
- const QStringList& theDBFValues,
- const QStringList& theStricklerTypes) const;
+ HYDRODATA_EXPORT void ExportDBF( const QString& theDBFFileName,
+ const QString& theFieldName,
+ const QStringList& theDBFValues,
+ const QStringList& theStricklerTypes ) const;
- bool ExportTelemac( const QString& theFileName, double theDeflection ) const;
+ HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName, double theDeflection ) const;
- bool Add( const Handle( HYDROData_Object )&, const QString& theType );
- bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType );
+ HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType );
+ HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType );
- bool Remove( const TopoDS_Face& );
- bool Remove( const TopTools_ListOfShape& );
+ HYDRODATA_EXPORT bool Remove( const TopoDS_Face& );
+ HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& );
- bool Split( const Handle( HYDROData_PolylineXY )& );
- bool Merge( const TopTools_ListOfShape&, const QString& theType );
+ HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& );
+ HYDRODATA_EXPORT bool Merge( const TopTools_ListOfShape&, const QString& theType );
- TopoDS_Face FindByPoint( const gp_Pnt2d&, QString& theType ) const;
+ HYDRODATA_EXPORT TopoDS_Face FindByPoint( const gp_Pnt2d&, QString& theType ) const;
HYDRODATA_EXPORT TopoDS_Shape GetShape() const;
HYDROData_Document.sip
HYDROData_Application.sip
HYDROData_IProfilesInterpolator.sip
+ HYDROData_LandCoverMap.sip
)
# --- sources ---
--- /dev/null
+// Copyright (C) 2014-2015 EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%ExportedHeaderCode
+#include <HYDROData_LandCoverMap.h>
+%End
+
+class HYDROData_LandCoverMap : public HYDROData_Entity
+{
+%TypeHeaderCode
+#include <HYDROData_LandCoverMap.h>
+%End
+
+%ConvertToSubClassCode
+ switch ( sipCpp->GetKind() )
+ {
+ case KIND_LAND_COVER_MAP:
+ sipClass = sipClass_HYDROData_LandCoverMap;
+ break;
+
+ default:
+ // We don't recognise the type.
+ sipClass = NULL;
+ }
+%End
+
+public:
+ enum DBFStatus
+ {
+ DBFStatus_OK,
+ DBFStatus_DIFF_SIZE_ERROR,
+ DBFStatus_OPEN_FILE_ERROR,
+ DBFStatus_NO_SUCH_FIELD_ERROR,
+ DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING
+ };
+
+ HYDROData_LandCoverMap();
+ ~HYDROData_LandCoverMap();
+
+ DBFStatus ImportDBF( const QString& theDBFFileName,
+ const QString& theFieldName,
+ const QStringList& DBFValues,
+ const QStringList& StricklerTypes,
+ const QList<int>& theIndices );
+
+ void ExportDBF( const QString& theDBFFileName,
+ const QString& theFieldName,
+ const QStringList& theDBFValues,
+ const QStringList& theStricklerTypes ) const;
+
+ bool ExportTelemac( const QString& theFileName, double theDeflection ) const;
+
+ bool Add( HYDROData_Object theObject, const QString& theType )
+ [bool ( const Handle_HYDROData_Object&, const QString& )];
+ %MethodCode
+ Handle(HYDROData_Object) aRef =
+ Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
+ sipCpp->Add( aRef, *a1 );
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
+ bool Add( HYDROData_PolylineXY thePolyline, const QString& theType )
+ [bool ( const Handle_HYDROData_PolylineXY&, const QString& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Add( aRef, *a1 ):
+ sipCpp->Add( aRef, *a1 );
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
+ bool Split( HYDROData_PolylineXY thePolyline )
+ [bool ( const Handle_HYDROData_PolylineXY& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ sipRes = sipSelfWasArg ? sipCpp->HYDROData_LandCoverMap::Split( aRef ):
+ sipCpp->Split( aRef );
+ Py_END_ALLOW_THREADS
+ }
+ %End
+};
CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
- QMap<int, int> Inds;
- Inds.insert(1, 1);
- Inds.insert(2, 2);
- Inds.insert(3, 3);
+ QList<int> Inds = QList<int>() << 1 << 2 << 3;
aMap->ImportDBF(aFileName, "TESTFIELD1", aDBFV, aST, Inds);
HYDROData_LandCoverMap::Iterator anIt( aMap );
- CPPUNIT_ASSERT_EQUAL(true, "water" == anIt.StricklerType());
+ CPPUNIT_ASSERT_EQUAL( QString( "forest" ), anIt.StricklerType() );
anIt.Next();
- CPPUNIT_ASSERT_EQUAL(true, "forest" == anIt.StricklerType());
-
+ CPPUNIT_ASSERT_EQUAL( QString( "road" ), anIt.StricklerType() );
}
void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types()