}
int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName,
- NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile)
+ NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile, ImportShapeType theShapeTypesToImport)
{
//Free();
int aStat = TryOpenShapeFile(theFileName);
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);
}
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();)
}
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();