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
///
return DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING;
}
-void HYDROData_LandCoverMap::ExportSHP( const QString& theSHPFileName ) const
-{
- //TODO
-}
-
/**
Export attributes to DBF File
///
}
-bool HYDROData_LandCoverMap::ImportShp( const QString& theFileName,
+bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName,
const QList<int>& 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;
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
HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
- HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName );
+ HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName,
+ const QList<int>& theIndices = QList<int>());
+
+ 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<int>& theIndices = QList<int>() );
-
- HYDRODATA_EXPORT void ExportSHP( const QString& theSHPFileName ) const;
HYDRODATA_EXPORT void ExportDBF( const QString& theDBFFileName,
const QString& theFieldName,
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 );
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