Salome HOME
deny to write internal/non-closed wires to the shp-file
authorisn <isn@opencascade.com>
Fri, 13 Nov 2015 09:49:03 +0000 (12:49 +0300)
committerisn <isn@opencascade.com>
Fri, 13 Nov 2015 09:49:03 +0000 (12:49 +0300)
src/HYDROData/HYDROData_ShapeFile.cxx

index 629de51bf30d10a74d5862d00f1cf350bd0a7421..0afa865a0b05595fecdbc187fd52ff9c4fc3aa28 100644 (file)
@@ -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<gp_Pnt2d> 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;