Salome HOME
Update copyrights 2014.
[modules/smesh.git] / src / StdMeshers / StdMeshers_Import_1D.cxx
index c24c20aac3bd377ae835e24978b6010285d9e9ef..ee9fe4ef1032964c27bb5edec130bb6795b04a36 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -227,6 +227,8 @@ namespace // INTERNAL STUFF
         switch ( sm->GetSubShape().ShapeType() )
         {
         case TopAbs_EDGE:
+          if ( SMESH_Algo::isDegenerated( TopoDS::Edge( sm->GetSubShape() )))
+            continue;
         case TopAbs_FACE:
           _subM.insert( sm );
           if ( !sm->IsEmpty() )
@@ -567,7 +569,8 @@ namespace // INTERNAL STUFF
       aBuilder.MakeCompound( comp );
       shapeForSrcMesh = comp;
       for ( int iSub = 0; iSub < nbSubShapes; ++iSub )
-        aBuilder.Add( comp, pseudoSubShapes( subIndex+iSub ));
+        if ( subIndex+iSub <= pseudoSubShapes.Extent() )
+          aBuilder.Add( comp, pseudoSubShapes( subIndex+iSub ));
       TopExp_Explorer vExp( tgtMeshDS->ShapeToMesh(), TopAbs_VERTEX );
       aBuilder.Add( comp, vExp.Current() );
     }