From: jfa Date: Thu, 21 Jun 2007 13:01:53 +0000 (+0000) Subject: NPAL16373: EDF485: GetShapesOn... doesn't work with a wire. Use Poly_Polygon3D, if... X-Git-Tag: V3_2_7~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=45ac6d194d0a0c7b841fcf5be1d3f5626841ee6e;p=modules%2Fgeom.git NPAL16373: EDF485: GetShapesOn... doesn't work with a wire. Use Poly_Polygon3D, if there are no faces. --- diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx index 98f4afe30..78c540b08 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -688,19 +689,32 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE, aLP.Clear(); BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc); if (aTRE.IsNull() || aPTE.IsNull()) { - myErrorStatus=20; // no triangulation found - return; + Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc); + if (aPE.IsNull()) { + myErrorStatus=20; // no triangulation found + return; + } + const gp_Trsf& aTrsf=aLoc.Transformation(); + const TColgp_Array1OfPnt& aNodes=aPE->Nodes(); + // + aNbNodes=aPE->NbNodes(); + Standard_Integer low = aNodes.Lower(), up = aNodes.Upper(); + for (j=low+1; jNodes(); - // - aNbNodes=aPTE->NbNodes(); - const TColStd_Array1OfInteger& aInds=aPTE->Nodes(); - for (j=2; jNodes(); + // + aNbNodes=aPTE->NbNodes(); + const TColStd_Array1OfInteger& aInds=aPTE->Nodes(); + for (j=2; j #include #include +#include #include #include @@ -748,19 +749,32 @@ aLP.Clear(); BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc); if (aTRE.IsNull() || aPTE.IsNull()) { - myErrorStatus=20; // no triangulation found - return; + Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc); + if (aPE.IsNull()) { + myErrorStatus=20; // no triangulation found + return; + } + const gp_Trsf& aTrsf=aLoc.Transformation(); + const TColgp_Array1OfPnt& aNodes=aPE->Nodes(); + // + aNbNodes=aPE->NbNodes(); + Standard_Integer low = aNodes.Lower(), up = aNodes.Upper(); + for (j=low+1; jNodes(); - // - aNbNodes=aPTE->NbNodes(); - const TColStd_Array1OfInteger& aInds=aPTE->Nodes(); - for (j=2; jNodes(); + // + aNbNodes=aPTE->NbNodes(); + const TColStd_Array1OfInteger& aInds=aPTE->Nodes(); + for (j=2; j