1 // Copyright (C) 2015-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "SetOfPoints.hxx"
21 #include "BagPoint.hxx"
22 #include "LinkedBlocPoint.hxx"
23 #include "ForkBlocPoint.hxx"
24 #include "ElementaryPoint.hxx"
25 #include "Exception.hxx"
29 using namespace YACS::ENGINE;
31 SetOfPoints::SetOfPoints(const std::list<Node *>& nodes):_bp(0)
33 std::list<AbstractPoint *> nodes2;
34 for(std::list<Node *>::const_iterator it=nodes.begin();it!=nodes.end();it++)
36 nodes2.push_back(new ElementaryPoint(*it));
38 _bp=new BagPoint(nodes2,0);
41 SetOfPoints::~SetOfPoints()
46 void SetOfPoints::basicSimplify()
50 bool somethingDone(false);
51 _bp->deal1(somethingDone);
54 _bp->deal2(somethingDone);
57 _bp->deal2Bis(somethingDone);
60 _bp->deal2Ter(somethingDone);
63 _bp->deal2Quatro(somethingDone);
65 throw Exception("SetOfPoints::simplify : not implemented yet !\nPlease check if there are any recursively redundant links (can be removed by removeRecursivelyRedundantCL method).");
69 void SetOfPoints::simplify()
71 while( _bp->internalContinueForSimplify() )
73 bool somethingDone(false);
74 _bp->deal1(somethingDone);
77 _bp->deal2(somethingDone);
80 _bp->deal2Bis(somethingDone);
83 _bp->deal2Ter(somethingDone);
86 _bp->deal2Quatro(somethingDone);
89 _bp->dealNotSimpleCase(somethingDone);
91 throw Exception("SetOfPoints::simplify : not implemented yet !\nPlease check if there are any recursively redundant links (can be removed by removeRecursivelyRedundantCL method).");
93 if( _bp->presenceOfNonSimpleCase() )
95 _bp->expandNonSimpleCase();
99 std::string SetOfPoints::getRepr() const
101 return _bp->getRepr();
104 AbstractPoint *SetOfPoints::findPointWithNode(Node *node)
108 return _bp->findPointWithNode(node);
111 const std::list<AbstractPoint *>& SetOfPoints::getListOfPoints() const
113 return _bp->getListOfPoints();
116 int SetOfPoints::getMaxLevelOfParallelism() const
118 return _bp->getMaxLevelOfParallelism();
121 void SetOfPoints::getWeightRegardingDPL(ComplexWeight *weight)
123 _bp->getWeightRegardingDPL(weight);
126 void SetOfPoints::partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const
128 _bp->partitionRegardingDPL(pd,zeMap);
131 AbstractPoint *SetOfPoints::getUniqueAndReleaseIt() const
133 return _bp->getUniqueAndReleaseIt();
136 void SetOfPoints::accept(PointVisitor *pv)