X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FSetOfPoints.cxx;h=25090eeb7a7c3d1a2731aa52d862c111522bad0f;hb=3faa9bfe96ae74fdca18143c639dcfb9b41cd43e;hp=76f892577b9db0403fa5aaf0eae719728446d1d6;hpb=e41351582d47d960d682e138f8137edcce783652;p=modules%2Fyacs.git diff --git a/src/engine/SetOfPoints.cxx b/src/engine/SetOfPoints.cxx index 76f892577..25090eeb7 100644 --- a/src/engine/SetOfPoints.cxx +++ b/src/engine/SetOfPoints.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2016 CEA/DEN, EDF R&D +// Copyright (C) 2015-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -40,12 +40,10 @@ SetOfPoints::SetOfPoints(const std::list& nodes):_bp(0) SetOfPoints::~SetOfPoints() { - if(!_bp) - return; delete _bp; } -void SetOfPoints::simplify() +void SetOfPoints::basicSimplify() { while(_bp->size()>1) { @@ -60,11 +58,44 @@ void SetOfPoints::simplify() if(somethingDone) continue; _bp->deal2Ter(somethingDone); + if(somethingDone) + continue; + _bp->deal2Quatro(somethingDone); if(!somethingDone) throw Exception("SetOfPoints::simplify : not implemented yet !\nPlease check if there are any recursively redundant links (can be removed by removeRecursivelyRedundantCL method)."); } } +void SetOfPoints::simplify() +{ + while( _bp->internalContinueForSimplify() ) + { + bool somethingDone(false); + _bp->deal1(somethingDone); + if(somethingDone) + continue; + _bp->deal2(somethingDone); + if(somethingDone) + continue; + _bp->deal2Bis(somethingDone); + if(somethingDone) + continue; + _bp->deal2Ter(somethingDone); + if(somethingDone) + continue; + _bp->deal2Quatro(somethingDone); + if(somethingDone) + continue; + _bp->dealNotSimpleCase(somethingDone); + if(!somethingDone) + throw Exception("SetOfPoints::simplify : not implemented yet !\nPlease check if there are any recursively redundant links (can be removed by removeRecursivelyRedundantCL method)."); + } + if( _bp->presenceOfNonSimpleCase() ) + { + _bp->expandNonSimpleCase(); + } +} + std::string SetOfPoints::getRepr() const { return _bp->getRepr(); @@ -101,3 +132,8 @@ AbstractPoint *SetOfPoints::getUniqueAndReleaseIt() const { return _bp->getUniqueAndReleaseIt(); } + +void SetOfPoints::accept(PointVisitor *pv) +{ + _bp->accept(pv); +}