From 9b9216637625ef194db8082148930bc2249c9bd4 Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 13 Nov 2015 12:49:03 +0300 Subject: [PATCH] deny to write internal/non-closed wires to the shp-file --- src/HYDROData/HYDROData_ShapeFile.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/HYDROData/HYDROData_ShapeFile.cxx b/src/HYDROData/HYDROData_ShapeFile.cxx index 629de51b..0afa865a 100644 --- a/src/HYDROData/HYDROData_ShapeFile.cxx +++ b/src/HYDROData/HYDROData_ShapeFile.cxx @@ -264,11 +264,16 @@ void HYDROData_ShapeFile::ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandl if (aW.IsNull()) continue; NbWires++; + if (aW.Orientation() == TopAbs_INTERNAL) + //cant write internal wires/edges + continue; // Try to reorder edges Handle(ShapeFix_Wire) aSFW = new ShapeFix_Wire( aW, theFace, Precision::Confusion() ); aSFW->FixReorder(); Handle(ShapeExtend_WireData) aSEWD = aSFW->WireData(); Standard_Integer nbE = aSEWD->NbEdges(); + if (nbE == 0) + continue; // anPartStart.push_back(x.size()); NCollection_Sequence aPnts; @@ -341,6 +346,8 @@ bool HYDROData_ShapeFile::Parse(SHPHandle theHandle, ShapeType theType, int& the void HYDROData_ShapeFile::ReadSHPPolygon(SHPObject* anObj, int i, TopoDS_Face& F) { + if (!anObj) + return; TopoDS_Wire W; TopoDS_Edge E; int nParts = anObj->nParts; -- 2.39.2