1 // Copyright (C) 2019 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 "NotSimpleCasePoint.hxx"
21 #include "PointVisitor.hxx"
22 #include "Exception.hxx"
27 using namespace YACS::ENGINE;
29 NotSimpleCasePoint::NotSimpleCasePoint(const std::list<AbstractPoint *>& nodes, AbstractPoint *father):BlocPoint(nodes,father)
33 AbstractPoint *NotSimpleCasePoint::deepCopy(AbstractPoint *father) const
35 NotSimpleCasePoint *ret(new NotSimpleCasePoint);
36 ret->deepCopyFrom(*this);
37 ret->setFather(father);
41 Node *NotSimpleCasePoint::getFirstNode()
44 throw Exception("NotSimpleCasePoint::getFirstNode : error no branches !");
45 return _nodes.front()->getFirstNode();
48 Node *NotSimpleCasePoint::getLastNode()
51 throw Exception("NotSimpleCasePoint::getFirstNode : error no branches !");
52 return _nodes.back()->getLastNode();
55 int NotSimpleCasePoint::getMaxLevelOfParallelism() const
58 for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
59 ret=std::max(ret,(*it)->getMaxLevelOfParallelism());
63 void NotSimpleCasePoint::getWeightRegardingDPL(ComplexWeight *weight)
65 ComplexWeight localWeight;
66 for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
68 (*it)->getWeightRegardingDPL(&localWeight);
69 weight->addWeight(&localWeight);
70 localWeight.setToZero();
74 void NotSimpleCasePoint::partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const
76 for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
77 (*it)->partitionRegardingDPL(pd,zeMap);
80 std::string NotSimpleCasePoint::getRepr() const
82 std::size_t sz(_nodes.size()),ii(0);
84 for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++,ii++)
86 ret+=(*it)->getRepr();
94 void NotSimpleCasePoint::accept(PointVisitor *pv)
96 pv->beginNotSimpleCasePoint(this);
99 pv->endNotSimpleCasePoint(this);
102 AbstractPoint *NotSimpleCasePoint::expandNonSimpleCaseOn(NotSimpleCasePoint *pathologicalPt, const std::set<Node *>& uncatchedNodes)
104 throw YACS::Exception("NotSimpleCasePoint::expandNonSimpleCaseOn : ooops !");