From: isn Date: Fri, 13 Nov 2015 09:49:03 +0000 (+0300) Subject: deny to write internal/non-closed wires to the shp-file X-Git-Tag: v1.5~50^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9b9216637625ef194db8082148930bc2249c9bd4;p=modules%2Fhydro.git deny to write internal/non-closed wires to the shp-file --- 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;