]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/SetOfPoints.cxx
Salome HOME
[EDF27816] Management of double foreach and management of proxyfile lifecycle
[modules/yacs.git] / src / engine / SetOfPoints.cxx
index 39d787168b8b6f4ce8914b3701415e0f57565a3c..25090eeb7a7c3d1a2731aa52d862c111522bad0f 100644 (file)
@@ -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<Node *>& 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();
@@ -87,9 +118,9 @@ int SetOfPoints::getMaxLevelOfParallelism() const
   return _bp->getMaxLevelOfParallelism();
 }
 
-double SetOfPoints::getWeightRegardingDPL() const
+void SetOfPoints::getWeightRegardingDPL(ComplexWeight *weight)
 {
-  return _bp->getWeightRegardingDPL();
+  _bp->getWeightRegardingDPL(weight);
 }
 
 void SetOfPoints::partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const
@@ -101,3 +132,8 @@ AbstractPoint *SetOfPoints::getUniqueAndReleaseIt() const
 {
   return _bp->getUniqueAndReleaseIt();
 }
+
+void SetOfPoints::accept(PointVisitor *pv)
+{
+  _bp->accept(pv);
+}