X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNMTTools%2FNMTTools_PaveFiller_3.cxx;h=039cbbc1b594137fd7dc6a4247ee50717a8c85dc;hb=d2046800b5f3ab6a56c3b9a72766f5d317a235e7;hp=85bcb659992d33929b434cfbb1cb0577234731b7;hpb=9499b99fe2dcb53e1ea364f97986f8f432b04600;p=modules%2Fgeom.git diff --git a/src/NMTTools/NMTTools_PaveFiller_3.cxx b/src/NMTTools/NMTTools_PaveFiller_3.cxx index 85bcb6599..039cbbc1b 100644 --- a/src/NMTTools/NMTTools_PaveFiller_3.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_3.cxx @@ -1,28 +1,29 @@ -// 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. +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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_PaveFiller_3.cxx // Created: Mon Dec 8 16:06:56 2003 // Author: Peter KURNEV // - - +// #include #include @@ -30,11 +31,22 @@ #include #include +#include + #include #include +#include #include +#include + +// Modified Thu Sep 14 14:35:18 2006 +// Contribution of Samtech www.samcef.com BEGIN +static + Standard_Boolean Contains(const TopoDS_Face& aF, + const TopoDS_Vertex& aV); +// Contribution of Samtech www.samcef.com END //======================================================================= // function: PerformVF // purpose: @@ -43,65 +55,101 @@ { myIsDone=Standard_False; // - Standard_Boolean aJustAddInterference; + Standard_Boolean aJustAdd; Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV; Standard_Real aU, aV; TopoDS_Vertex aV1; TopoDS_Face aF2; // - BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences(); + BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences(); // // V/E Interferences - myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE); + myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE); // // BlockLength correction - aNbVSs=ExpectedPoolLength(); + aNbVSs=myDSIt->BlockLength(); aBlockLength=aVSs.BlockLength(); if (aNbVSs > aBlockLength) { aVSs.SetBlockLength(aNbVSs); } // - for (; myDSIt.More(); myDSIt.Next()) { - myDSIt.Current(n1, n2, aJustAddInterference); - // - if (! myIntrPool->IsComputed(n1, n2)) { - if (! IsSuccesstorsComputed(n1, n2)) { - anIndexIn=0; - aWhat=n1; // Vertex - aWith=n2; // Face - SortTypes(aWhat, aWith); - // - iSDV=FindSDVertex(aWhat); - // - if(aJustAddInterference) { - myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn); - continue; - } + for (; myDSIt->More(); myDSIt->Next()) { + myDSIt->Current(n1, n2, aJustAdd); + if (! IsSuccessorsComputed(n1, n2)) { + anIndexIn=0; + aWhat=n1; // Vertex + aWith=n2; // Face + if (myDS->GetShapeType(n1)==TopAbs_FACE) { + aWhat=n2; + aWith=n1; + } + // + iSDV=FindSDVertex(aWhat); // - aV1=TopoDS::Vertex(myDS->Shape(aWhat)); - if (iSDV) { - aV1=TopoDS::Vertex(myDS->Shape(iSDV)); - } + if(aJustAdd) { + //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn); + continue; + } + // + aV1=TopoDS::Vertex(myDS->Shape(aWhat)); + if (iSDV) { + aV1=TopoDS::Vertex(myDS->Shape(iSDV)); + } // - aF2=TopoDS::Face(myDS->Shape(aWith)); + aF2=TopoDS::Face(myDS->Shape(aWith)); + // + // Modified Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + if (Contains(aF2, aV1)) { + continue; + } + // Contribution of Samtech www.samcef.com END + // + aFlag=myContext.ComputeVS (aV1, aF2, aU, aV); + // + if (!aFlag) { // - aFlag=myContext.ComputeVS (aV1, aF2, aU, aV); + // Add Interference to the Pool + BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV); + anIndexIn=aVSs.Append(anInterf); // - if (!aFlag) { - // - // Add Interference to the Pool - BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV); - anIndexIn=aVSs.Append(anInterf); - // - // SetState for Vertex in DS; - myDS->SetState (aWhat, BooleanOperations_ON); - // Insert Vertex in Interference Object - BOPTools_VSInterference& aVS=aVSs(anIndexIn); - aVS.SetNewShape(aWhat); + // SetState for Vertex in DS; + myDS->SetState (aWhat, BooleanOperations_ON); + // Insert Vertex in Interference Object + BOPTools_VSInterference& aVS=aVSs(anIndexIn); + aVS.SetNewShape(aWhat); + // qqf + { + myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF); } - myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn); + // qqt } + //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn); } } myIsDone=Standard_True; } +// Modified Thu Sep 14 14:35:18 2006 +// Contribution of Samtech www.samcef.com BEGIN +//======================================================================= +//function : Contains +//purpose : +//======================================================================= +Standard_Boolean Contains(const TopoDS_Face& aF, + const TopoDS_Vertex& aV) +{ + Standard_Boolean bRet; + TopExp_Explorer aExp; + // + bRet=Standard_False; + aExp.Init(aF, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aVF=aExp.Current(); + if (aVF.IsSame(aV)) { + bRet=!bRet; + break; + } + } + return bRet; +} +// Contribution of Samtech www.samcef.com END