X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNMTTools%2FNMTTools_PaveFiller_8.cxx;h=fd3a6edaa5f17279c0efe26ea217977ef53230d7;hb=ccaa4673b9493057cce545295f1d9023024eb72d;hp=007478455897b9983ce625c4504197fd6ebc88ab;hpb=a62a321c849518376e3aa4d24a0b902a24167c64;p=modules%2Fgeom.git diff --git a/src/NMTTools/NMTTools_PaveFiller_8.cxx b/src/NMTTools/NMTTools_PaveFiller_8.cxx index 007478455..fd3a6edaa 100644 --- a/src/NMTTools/NMTTools_PaveFiller_8.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_8.cxx @@ -1,30 +1,33 @@ -// 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-2010 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/ +// 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_8.cxx -// Created: Fri Dec 19 11:15:53 2003 -// Author: Peter KURNEV -// - +// File: NMTTools_PaveFiller_8.cxx +// Created: Fri Dec 19 11:15:53 2003 +// Author: Peter KURNEV +// +// #include +#include #include #include @@ -42,6 +45,78 @@ #include #include + +// Modified to add new method Thu Sep 14 14:35:18 2006 +// Contribution of Samtech www.samcef.com BEGIN +//======================================================================= +// function: SharedEdges +// purpose: +//======================================================================= + void NMTTools_PaveFiller::SharedEdges(const Standard_Integer nF1, + const Standard_Integer nF2, + TColStd_ListOfInteger& aLNE, + TopTools_ListOfShape& aLSE) +{ + Standard_Integer nE1, nE2; + TColStd_MapOfInteger aM1; + // + BooleanOperations_ShapesDataStructure *pDS=myDS; + BooleanOperations_OnceExplorer aExp(*pDS); + // + aExp.Init(nF1, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + nE1=aExp.Current(); + aM1.Add(nE1); + } + + aExp.Init(nF2, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + nE2=aExp.Current(); + if (aM1.Contains(nE2)) { + aLNE.Append(nE2); + const TopoDS_Shape& aE2=myDS->Shape(nE2); + aLSE.Append(aE2); + } + } +} +// Contribution of Samtech www.samcef.com END +// +//======================================================================= +// function: RealPaveBlock +// purpose: +//======================================================================= + const BOPTools_PaveBlock& NMTTools_PaveFiller::RealPaveBlock + (const BOPTools_PaveBlock& aPB, + TColStd_ListOfInteger& aLB, + Standard_Integer& aIsCommonBlock) +{ + Standard_Integer nE, nSpx; + BOPTools_ListIteratorOfListOfPaveBlock aItPBx; + // + aIsCommonBlock=0; + aLB.Clear(); + nE=aPB.OriginalEdge(); + const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE)); + NMTTools_CommonBlockAPI aCBAPI(aLCBE); + if (aCBAPI.IsCommonBlock(aPB)) { + NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB); + // + aIsCommonBlock=1; + // + const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks(); + aItPBx.Initialize(aLPBx); + for (; aItPBx.More(); aItPBx.Next()) { + const BOPTools_PaveBlock& aPBx=aItPBx.Value(); + nSpx=aPBx.Edge(); + aLB.Append(nSpx); + } + // + const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1(); + return aPBx; + } + return aPB; +} +// //======================================================================= // function: RealPaveBlock // purpose: @@ -65,7 +140,7 @@ // purpose: //======================================================================= Standard_Integer NMTTools_PaveFiller::CommonBlocksFace(const Standard_Integer nF, - NMTTools_ListOfCommonBlock& aLCB) + NMTTools_ListOfCommonBlock& aLCB) { Standard_Integer nE; TopAbs_ShapeEnum aT; @@ -101,7 +176,7 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsFace(const Standard_Integer nF, - BOPTools_ListOfPaveBlock& aLPB) + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE; BOPTools_ListIteratorOfListOfPaveBlock anIt; @@ -126,7 +201,7 @@ // purpose: //======================================================================= Standard_Boolean NMTTools_PaveFiller::HasRealSplitsInOnFace(const Standard_Integer nF1, - const Standard_Integer nF2) + const Standard_Integer nF2) { Standard_Boolean bFlag; BOPTools_ListOfPaveBlock aLPB; @@ -148,9 +223,9 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF1, + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE1; // @@ -167,8 +242,8 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nE1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nF1; // @@ -188,7 +263,7 @@ for (; anItLFCB.More(); anItLFCB.Next()) { nF1=anItLFCB.Value(); if (nF1==nF2) { - aLPB.Append(aPB1R); + aLPB.Append(aPB1R); } } } @@ -198,8 +273,8 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsOnEdge(const Standard_Integer nE1, - const Standard_Integer nE2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nE2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE; // @@ -220,7 +295,7 @@ const BOPTools_PaveBlock& aPB2=anIt.Value(); nE=aPB2.OriginalEdge(); if (nE==nE2) { - aLPB.Append(aPB1R); + aLPB.Append(aPB1R); } } } @@ -230,8 +305,8 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer nE1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE2; // @@ -248,9 +323,9 @@ // purpose: //======================================================================= void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF1, + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE1; // @@ -269,7 +344,7 @@ // purpose: //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF, - BOPTools_ListOfPaveBlock& aLPB) + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE; TopAbs_ShapeEnum aT; @@ -302,9 +377,9 @@ // purpose: splits of edges from nF1 in nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF1, + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE1; TopAbs_ShapeEnum aT1, aT2; @@ -329,8 +404,8 @@ // purpose: splits of edge nE1 in aFace2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nF1; TopAbs_ShapeEnum aT1, aT2; @@ -357,7 +432,7 @@ for (; anItLFCB.More(); anItLFCB.Next()) { nF1=anItLFCB.Value(); if (nF1==nF2) { - aLPB.Append(aPB1); + aLPB.Append(aPB1); } } } @@ -368,8 +443,8 @@ // purpose: splits of edge nE1 on nE2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1, - const Standard_Integer nE2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nE2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE; TopAbs_ShapeEnum aT1, aT2; @@ -397,7 +472,7 @@ const BOPTools_PaveBlock& aPB2=anIt.Value(); nE=aPB2.OriginalEdge(); if (nE==nE2) { - aLPB.Append(aPB1); + aLPB.Append(aPB1); } } } @@ -408,8 +483,8 @@ // purpose: splits of edge nE1 on face nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE2, ip; TopAbs_ShapeEnum aT1, aT2; @@ -437,9 +512,9 @@ // purpose: splits of edges from face nF1 on face nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - BOPTools_ListOfPaveBlock& aLPB) + const Standard_Integer nF1, + const Standard_Integer nF2, + BOPTools_ListOfPaveBlock& aLPB) { Standard_Integer nE1, ip; TopAbs_ShapeEnum aT1, aT2; @@ -469,7 +544,7 @@ // purpose: //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF, - TColStd_ListOfInteger& aSplits) + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt; @@ -494,9 +569,9 @@ // purpose: splits of edges from nF1 in nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - TColStd_ListOfInteger& aSplits) + const Standard_Integer nF1, + const Standard_Integer nF2, + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt; @@ -519,8 +594,8 @@ // purpose: splits of edge nE1 in aFace2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1, - const Standard_Integer nF2, - TColStd_ListOfInteger& aSplits) + const Standard_Integer nF2, + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt; @@ -543,8 +618,8 @@ // purpose: splits of edge nE1 on nE2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1, - const Standard_Integer nE2, - TColStd_ListOfInteger& aSplits) + const Standard_Integer nE2, + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt; @@ -567,8 +642,8 @@ // purpose: splits of edge nE1 on face nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1, - const Standard_Integer nF2, - TColStd_ListOfInteger& aSplits) + const Standard_Integer nF2, + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt; @@ -591,9 +666,9 @@ // purpose: splits of edges from face nF1 on face nF2 //======================================================================= Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding - const Standard_Integer nF1, - const Standard_Integer nF2, - TColStd_ListOfInteger& aSplits) + const Standard_Integer nF1, + const Standard_Integer nF2, + TColStd_ListOfInteger& aSplits) { Standard_Integer nE, iErr; BOPTools_ListIteratorOfListOfPaveBlock aIt;