From 6c3c67c6ee3f8f988980f02e9e9dbcc345cea468 Mon Sep 17 00:00:00 2001 From: isn Date: Mon, 16 Nov 2015 12:12:36 +0300 Subject: [PATCH] concretions after Merge op. --- src/HYDROData/HYDROData_LandCoverMap.cxx | 41 +++--------------------- src/HYDROData/HYDROData_LandCoverMap.h | 9 +++--- src/HYDROPy/HYDROData_LandCoverMap.sip | 4 +-- 3 files changed, 10 insertions(+), 44 deletions(-) diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 3300a211..227405ca 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -229,34 +229,6 @@ bool HYDROData_LandCoverMap::IsEmpty() const return false; } -bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName ) -{ - HYDROData_ShapeFile anImporter; - QStringList aPolygonsList; - TopTools_SequenceOfShape aPolygonFaces; - int aShapeTypeOfFile; - int aStatus = anImporter.ImportPolygons( theSHPFileName, aPolygonsList, aPolygonFaces, aShapeTypeOfFile); - - bool isOK = ( aStatus == 1 ); - if( isOK ) - { - QString aDefaultStricklerType = ""; - - HYDROData_MapOfFaceToStricklerType aFaces; - for( int i=1, n=aPolygonFaces.Length(); i<=n; i++ ) - { - TopoDS_Shape aShape = aPolygonFaces.Value( i ); - if( aShape.ShapeType()==TopAbs_FACE ) - aFaces.Add( TopoDS::Face( aShape ), aDefaultStricklerType ); - } - - StoreLandCovers( aFaces ); - } - - anImporter.Free(); - return isOK; -} - /** Load attributes from DBF File /// @@ -303,11 +275,6 @@ HYDROData_LandCoverMap::DBFStatus HYDROData_LandCoverMap::ImportDBF( const QStri return DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING; } -void HYDROData_LandCoverMap::ExportSHP( const QString& theSHPFileName ) const -{ - //TODO -} - /** Export attributes to DBF File /// @@ -1038,14 +1005,14 @@ double HYDROData_LandCoverMap::GetTransparency() const } -bool HYDROData_LandCoverMap::ImportShp( const QString& theFileName, +bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName, const QList& theIndices ) { HYDROData_ShapeFile anImporter; QStringList aPolyList; TopTools_SequenceOfShape aFaces; int aSHapeType = -1; - int Stat = anImporter.ImportPolygons(theFileName, aPolyList, aFaces, aSHapeType); + int Stat = anImporter.ImportPolygons(theSHPFileName, aPolyList, aFaces, aSHapeType); // if (Stat != 1) return false; @@ -1082,11 +1049,11 @@ bool HYDROData_LandCoverMap::ImportShp( const QString& theFileName, return true; } -bool HYDROData_LandCoverMap::ExportShp( const QString& theFileName) const +bool HYDROData_LandCoverMap::ExportSHP( const QString& theSHPFileName) const { HYDROData_ShapeFile anExporter; QStringList aList; - anExporter.Export(theFileName, this, aList); + anExporter.Export(theSHPFileName, this, aList); if (aList.empty()) return true; else diff --git a/src/HYDROData/HYDROData_LandCoverMap.h b/src/HYDROData/HYDROData_LandCoverMap.h index 7df0dcba..d88e65d2 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@ -90,15 +90,16 @@ public: HYDRODATA_EXPORT virtual const ObjectKind GetKind() const; - HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName ); + HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName, + const QList& theIndices = QList()); + + HYDRODATA_EXPORT bool ExportSHP( const QString& theSHPFileName ) const; HYDRODATA_EXPORT DBFStatus ImportDBF( const QString& theDBFFileName, const QString& theFieldName, const QStringList& DBFValues, const QStringList& StricklerTypes, const QList& theIndices = QList() ); - - HYDRODATA_EXPORT void ExportSHP( const QString& theSHPFileName ) const; HYDRODATA_EXPORT void ExportDBF( const QString& theDBFFileName, const QString& theFieldName, @@ -108,8 +109,6 @@ public: HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName, double theDeflection, const Handle_HYDROData_StricklerTable& theTable ) const; - bool ExportShp( const QString& theFileName) const; - HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType ); HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType ); diff --git a/src/HYDROPy/HYDROData_LandCoverMap.sip b/src/HYDROPy/HYDROData_LandCoverMap.sip index 802811dd..d8e3706a 100644 --- a/src/HYDROPy/HYDROData_LandCoverMap.sip +++ b/src/HYDROPy/HYDROData_LandCoverMap.sip @@ -65,9 +65,9 @@ public: const QStringList& theDBFValues, const QStringList& theStricklerTypes ) const; - bool ImportShp( const QString& theFileName); + bool ImportSHP( const QString& theFileName); - bool ExportShp( const QString& theFileName) const; + bool ExportSHP( const QString& theFileName) const; bool ExportTelemac( const QString& theFileName, double theDeflection, HYDROData_StricklerTable theTable ) const -- 2.39.2