X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNMTTools%2FNMTTools_PaveFiller.cxx;h=236a077dcc04ffb74213b12b852a20c02c23f412;hb=b568e7744737ad193de8a49b27a5769a4777d7fd;hp=cfbd9d0f7d937f96e68b340d97de83439f3a9f61;hpb=9499b99fe2dcb53e1ea364f97986f8f432b04600;p=modules%2Fgeom.git diff --git a/src/NMTTools/NMTTools_PaveFiller.cxx b/src/NMTTools/NMTTools_PaveFiller.cxx index cfbd9d0f7..236a077dc 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cxx +++ b/src/NMTTools/NMTTools_PaveFiller.cxx @@ -27,7 +27,8 @@ #include #include #include -//QQ #include "utilities.h" +#include +#include //======================================================================= // function: NMTTools_PaveFiller::NMTTools_PaveFiller @@ -35,63 +36,88 @@ //======================================================================= NMTTools_PaveFiller::NMTTools_PaveFiller() { - myIntrPool=NULL; myDS=NULL; + myDSIt=NULL; myIsDone=Standard_False; myNbSources=0; myNbEdges=0; + myIP=NULL; } //======================================================================= -// function:NMTTools_PaveFiller::NMTTools_PaveFiller +// function: ~ // purpose: //======================================================================= - NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP) + NMTTools_PaveFiller::~NMTTools_PaveFiller() { - SetInterferencePool(aIP); + Clear(); } //======================================================================= -// function: Destroy +// function: Clear // purpose: //======================================================================= - void NMTTools_PaveFiller::Destroy() + void NMTTools_PaveFiller::Clear() { + if (myDSIt) { + delete myDSIt; + } + if (myDS) { + delete myDS; + } + myDSIt=NULL; + myDS=NULL; + + if (myIP) { + delete myIP; + } + myIP=NULL; } //======================================================================= -// function: SetInterferencePool +// function: SetCompositeShape // purpose: //======================================================================= - void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP) + void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS) { - myIsDone=Standard_False; - // - myIntrPool=(BOPTools_InterferencePool*)&aIP; - myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS(); - myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool(); - myNbEdges=myDS->NbEdges(); + myCompositeShape=aS; } //======================================================================= -// function: InterfPool +// function: CompositeShape // purpose: //======================================================================= - BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool() + const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const { - return myIntrPool; + return myCompositeShape; } //======================================================================= -// function:IsDone +// function: DS // purpose: //======================================================================= - Standard_Boolean NMTTools_PaveFiller::IsDone() const + NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS() { - return myIsDone; + return myDS; } //======================================================================= -// function: DS +// function: DSIt // purpose: //======================================================================= - NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS() + NMTDS_PIterator NMTTools_PaveFiller::DSIt() { - return myDS; + return myDSIt; +} +//======================================================================= +// function: IP +// purpose: +//======================================================================= + NMTDS_PInterfPool NMTTools_PaveFiller::IP() +{ + return myIP; +} +//======================================================================= +// function:IsDone +// purpose: +//======================================================================= + Standard_Boolean NMTTools_PaveFiller::IsDone() const +{ + return myIsDone; } //======================================================================= // function: Context @@ -149,7 +175,6 @@ { return mySplitShapesPool; } - //======================================================================= // function: ChangeSplitShapesPool // purpose: @@ -164,26 +189,55 @@ //======================================================================= void NMTTools_PaveFiller::Init() { - myDSIt.SetDS(myDS); + myIsDone=Standard_False; + if (myCompositeShape.IsNull()) { + return; + } + // + Clear(); + // 1. + myDS=new NMTDS_ShapesDataStructure; + myDS->SetCompositeShape(myCompositeShape); + myDS->Init(); + // + // 2. + myDSIt=new NMTDS_Iterator; + myDSIt->SetDS(myDS); + myDSIt->Prepare(); + // + // 3. + myNbSources=myDS->NumberOfShapesOfTheObject()+ + myDS->NumberOfShapesOfTheTool(); + myNbEdges=myDS->NbEdges(); + // + // 4 + myIP=new NMTDS_InterfPool; } + //======================================================================= // function: Perform // purpose: //======================================================================= void NMTTools_PaveFiller::Perform() { + myIsDone=Standard_False; + // + //---------------- try { // 0. - Init();//myDSIt.SetDS(myDS); - // + // Modified Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + Init(); + // Contribution of Samtech www.samcef.com END //1.VV + // PerformVV(); - PerformNewVertices(); // // 2.VE myPavePool.Resize (myNbEdges); - PrepareEdges(); + PrepareEdges(); + PerformVE(); // // 3.VF @@ -193,7 +247,7 @@ myCommonBlockPool.Resize (myNbEdges); mySplitShapesPool.Resize (myNbEdges); myPavePoolNew .Resize (myNbEdges); - + PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE); PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE); // @@ -207,15 +261,20 @@ // 5.EF PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE); PerformEF(); + // RefinePavePool(); // myPavePoolNew.Destroy(); + MakeSplitEdges(); + UpdateCommonBlocks(); // // 6. FF PerformFF (); + // MakeBlocks(); + // MakePCurves(); // // 7.Postprocessing @@ -224,8 +283,13 @@ NMTTools_DEProcessor aDEP(*this); aDEP.Do(); // + // Modified to treat Alone Vertices Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + MakeAloneVertices(); + // Contribution of Samtech www.samcef.com END + // + myIsDone=Standard_True; } - catch (BOPTColStd_Failure& /*x*/) { - //QQ MESSAGE(x.Message() << flush); + catch (BOPTColStd_Failure& ) { } }