From 45ac6d194d0a0c7b841fcf5be1d3f5626841ee6e Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 21 Jun 2007 13:01:53 +0000 Subject: [PATCH] NPAL16373: EDF485: GetShapesOn... doesn't work with a wire. Use Poly_Polygon3D, if there are no faces. --- src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx | 39 +++++++++++++------- src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx | 40 +++++++++++++-------- src/GEOMImpl/GEOMImpl_IShapesOperations.cxx | 29 +++++++++++---- 3 files changed, 75 insertions(+), 33 deletions(-) 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