1 // Copyright (C) 2015-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 "ElementaryPoint.hxx"
21 #include "PointVisitor.hxx"
22 #include "NotSimpleCasePoint.hxx"
23 #include "ForkBlocPoint.hxx"
26 using namespace YACS::ENGINE;
28 ElementaryPoint::~ElementaryPoint()
32 AbstractPoint *ElementaryPoint::findPointWithNode(Node *node)
40 bool ElementaryPoint::contains(Node *node) const
45 bool ElementaryPoint::anyOf(const std::set<Node *>& nodes) const
47 return nodes.find(_node)!=nodes.end();
50 AbstractPoint *ElementaryPoint::deepCopy(AbstractPoint *father) const
52 AbstractPoint *ret(new ElementaryPoint(_node));
53 ret->setFather(father);
57 Node *ElementaryPoint::getFirstNode()
62 Node *ElementaryPoint::getLastNode()
67 int ElementaryPoint::getNumberOfNodes() const
72 int ElementaryPoint::getMaxLevelOfParallelism() const
74 return _node->getMaxLevelOfParallelism();
77 void ElementaryPoint::getWeightRegardingDPL(ComplexWeight *weight)
79 _node->getWeightRegardingDPL(weight);
82 void ElementaryPoint::partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const
84 _node->partitionRegardingDPL(pd,zeMap);
87 std::string ElementaryPoint::getRepr() const
89 return _node->getName();
92 void ElementaryPoint::accept(PointVisitor *pv)
94 pv->beginElementaryPoint(this);
95 pv->endElementaryPoint(this);
98 AbstractPoint *ElementaryPoint::expandNonSimpleCaseOn(NotSimpleCasePoint *pathologicalPt, const std::set<Node *>& uncatchedNodes)
100 if(uncatchedNodes.find(_node)!=uncatchedNodes.end())
104 std::list<AbstractPoint *> l;
105 AbstractPoint *p0(this->deepCopy(getFather())),*p1(pathologicalPt->getUnique()->deepCopy(getFather()));
108 AbstractPoint *ret(new ForkBlocPoint(l,getFather()));
109 p0->setFather(ret); p1->setFather(ret);
114 std::string ElementaryPoint::getNodeName() const
116 return _node->getName();