X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNMTTools%2FNMTTools_DEProcessor.cxx;h=9c5f860f5fca955c6cf1ba8dc0f371ed0fbe8e5a;hb=4cf6ece050adcf0ae832f44b82cdeb65ec923245;hp=1c6ea3068088670a6fd102c51f72a66f45ebe086;hpb=d3dd282390888d7dc091ba2c2ffe7923bd7458e6;p=modules%2Fgeom.git diff --git a/src/NMTTools/NMTTools_DEProcessor.cxx b/src/NMTTools/NMTTools_DEProcessor.cxx index 1c6ea3068..9c5f860f5 100644 --- a/src/NMTTools/NMTTools_DEProcessor.cxx +++ b/src/NMTTools/NMTTools_DEProcessor.cxx @@ -1,4 +1,23 @@ -// File: BOPTools_DEProcessor.cxx +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File: NMTTools_DEProcessor.cxx // Created: Wed Sep 12 12:10:52 2001 // Author: Peter KURNEV // @@ -61,11 +80,15 @@ #include -//#include #include // #include #include +// +#include + +#include +#include @@ -118,14 +141,14 @@ aNb=myDS->NumberOfShapesOfTheObject(); // for (i=1; i<=aNb; i++) { - const TopoDS_Shape& aF=myDS->Shape(i); + const TopoDS_Shape aF=myDS->Shape(i);//mpv if (aF.ShapeType()==TopAbs_FACE) { TopExp::MapShapesAndAncestors (aF, TopAbs_EDGE, TopAbs_FACE, aMEF); } } // for (i=1; i<=aNb; i++) { - const TopoDS_Shape& aS=myDS->Shape(i); + const TopoDS_Shape aS=myDS->Shape(i);//mpv if (aS.ShapeType()==TopAbs_EDGE) { const TopoDS_Edge& aE=TopoDS::Edge(aS); @@ -166,8 +189,9 @@ void NMTTools_DEProcessor::DoPaves() { - Standard_Integer i, aNbE, nED, nVD, nFD=0; + Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB; // + nFD=0; aNbE=myDEMap.Extent(); for (i=1; i<=aNbE; i++) { nED=myDEMap.FindKey(i); @@ -179,9 +203,16 @@ TColStd_ListIteratorOfListOfInteger anIt(nLF); for (; anIt.More(); anIt.Next()) { nFD=anIt.Value(); - + // BOPTools_ListOfPaveBlock aLPB; FindPaveBlocks(nED, nVD, nFD, aLPB); + //modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f + // + aNbLPB=aLPB.Extent(); + if (!aNbLPB) { + continue; + } + //modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t FillPaveSet (nED, nVD, nFD, aLPB); } // @@ -287,11 +318,16 @@ // Clear aPaveSet, aSplitEdges aPaveSet.ChangeSet().Clear(); // - const TopoDS_Edge& aDE=TopoDS::Edge(myDS->Shape(nED)); - const TopoDS_Face& aDF=TopoDS::Face(myDS->Shape(nFD)); + const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED));//mpv + const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD));//mpv // // 2D Curve of degenerated edge on the face aDF - Handle(Geom2d_Curve) aC2DDE=BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); + // Modified Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + //Handle(Geom2d_Curve) aC2DDE=BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); + Handle(Geom2d_Curve) aC2DDE1=BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); + Handle(Geom2d_TrimmedCurve)aC2DDE=new Geom2d_TrimmedCurve(aC2DDE1, aTD1, aTD2); + // Contribution of Samtech www.samcef.com END // // Choose direction for Degenerated Edge gp_Pnt2d aP2d1, aP2d2; @@ -314,7 +350,7 @@ for (; anIt.More(); anIt.Next()) { const BOPTools_PaveBlock& aPB=anIt.Value(); nE=aPB.Edge(); - const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE)); + const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv Handle(Geom2d_Curve) aC2D=BRep_Tool::CurveOnSurface(aE, aDF, aT1, aT2); // @@ -341,7 +377,17 @@ for (j=1; j<=aNbPoints; ++j) { gp_Pnt2d aP2D=aGInter.Point(j).Value(); // - aX=(bXDir) ? aP2D.X(): aP2D.Y(); + // Modified to obtain exact parameter Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + Handle(Geom2d_Line) aCLDE=Handle(Geom2d_Line)::DownCast(aC2DDE1); + if (aCLDE.IsNull()) { + continue; + } + gp_Lin2d aLDE=aCLDE->Lin2d(); + aX=ElCLib::Parameter(aLDE, aP2D); + // + //aX=(bXDir) ? aP2D.X(): aP2D.Y(); + // Contribution of Samtech www.samcef.com END // if (fabs (aX-aTD1) < aDT || fabs (aX-aTD2) < aDT) { continue; @@ -408,8 +454,8 @@ TopoDS_Edge aE, aESplit; TopoDS_Vertex aV1, aV2; - const TopoDS_Edge& aDE=TopoDS::Edge(myDS->Shape(nED)); - const TopoDS_Face& aDF=TopoDS::Face(myDS->Shape(nFD)); + const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED));//mpv + const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD));//mpv BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges);