X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_ShapeFile.cxx;h=eef771c39552054b76c89b17c8e81f236e441431;hb=a4ddb8bafa510cc57431846ed83623fdb860c580;hp=2a38a86d1401211f791bddbcf949b289fb6d1c47;hpb=ad4482443835973ac9ee0ce2024f60f91adff716;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ShapeFile.cxx b/src/HYDROData/HYDROData_ShapeFile.cxx index 2a38a86d..eef771c3 100644 --- a/src/HYDROData/HYDROData_ShapeFile.cxx +++ b/src/HYDROData/HYDROData_ShapeFile.cxx @@ -706,7 +706,7 @@ void HYDROData_ShapeFile::GetFreeIndices(std::vector& theAllowedIndexes, QS } int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, - NCollection_Sequence& theEntities, int& theShapeTypeOfFile) + NCollection_Sequence& theEntities, int& theShapeTypeOfFile, ImportShapeType theShapeTypesToImport) { //Free(); int aStat = TryOpenShapeFile(theFileName); @@ -728,7 +728,12 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, if (!Parse(aHSHP, HYDROData_ShapeFile::ShapeType_Polyline, theShapeTypeOfFile)) return 0; - if (aHSHP->nShapeType == 3 || aHSHP->nShapeType == 23) + + int sh_type = aHSHP->nShapeType; + + if ((theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All || + theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_Polyline) + && (sh_type == 3 || sh_type == 23)) { size_t anObjsSize = mySHPObjects.size(); GetFreeIndices(anAllowedIndexes, "_PolyXY_", anObjsSize, anExistingNames, aBaseFileName); @@ -739,7 +744,8 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, } aStat = 1; } - else if (aHSHP->nShapeType == 13) + else if ((theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All || + theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_Polyline3D) && sh_type == 13) { anInd = 0; for (;anAllowedIndexes.size() < mySHPObjects.size();) @@ -760,7 +766,8 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, } aStat = 1; } - else if (aHSHP->nShapeType == 5) + else if ((theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All || + theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_Polygon) && sh_type == 5) { //import polygon's contours as polylines size_t anObjsSize = mySHPObjects.size();