Version: 9.15.0
ElementaryPoint.cxx
Go to the documentation of this file.
1 // Copyright (C) 2015-2025 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #include "ElementaryPoint.hxx"
21 #include "PointVisitor.hxx"
22 #include "NotSimpleCasePoint.hxx"
23 #include "ForkBlocPoint.hxx"
24 #include "Node.hxx"
25 
26 using namespace YACS::ENGINE;
27 
29 {
30 }
31 
33 {
34  if(node==_node)
35  return this;
36  else
37  return nullptr;
38 }
39 
41 {
42  return _node==node;
43 }
44 
45 bool ElementaryPoint::anyOf(const std::set<Node *>& nodes) const
46 {
47  return nodes.find(_node)!=nodes.end();
48 }
49 
51 {
53  ret->setFather(father);
54  return ret;
55 }
56 
58 {
59  return _node;
60 }
61 
63 {
64  return _node;
65 }
66 
68 {
69  return 1;
70 }
71 
73 {
75 }
76 
78 {
80 }
81 
83 {
84  _node->partitionRegardingDPL(pd,zeMap);
85 }
86 
87 std::string ElementaryPoint::getRepr() const
88 {
89  return _node->getName();
90 }
91 
93 {
94  pv->beginElementaryPoint(this);
95  pv->endElementaryPoint(this);
96 }
97 
98 AbstractPoint *ElementaryPoint::expandNonSimpleCaseOn(NotSimpleCasePoint *pathologicalPt, const std::set<Node *>& uncatchedNodes)
99 {
100  if(uncatchedNodes.find(_node)!=uncatchedNodes.end())
101  return this;
102  else
103  {
104  std::list<AbstractPoint *> l;
105  AbstractPoint *p0(this->deepCopy(getFather())),*p1(pathologicalPt->getUnique()->deepCopy(getFather()));
106  l.push_back(p0);
107  l.push_back(p1);
108  AbstractPoint *ret(new ForkBlocPoint(l,getFather()));
109  p0->setFather(ret); p1->setFather(ret);
110  return ret;
111  }
112 }
113 
114 std::string ElementaryPoint::getNodeName() const
115 {
116  return _node->getName();
117 }
virtual AbstractPoint * deepCopy(AbstractPoint *father) const =0
AbstractPoint * getFather() const
void setFather(AbstractPoint *father)
AbstractPoint * getUnique()
Definition: BlocPoint.cxx:111
Base class for all composed nodes.
AbstractPoint * findPointWithNode(Node *node)
void getWeightRegardingDPL(ComplexWeight *weight)
void partitionRegardingDPL(const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap) const
void accept(PointVisitor *pv) override
AbstractPoint * expandNonSimpleCaseOn(NotSimpleCasePoint *pathologicalPt, const std::set< Node * > &uncatchedNodes) override
AbstractPoint * deepCopy(AbstractPoint *father) const override
bool contains(Node *node) const override
bool anyOf(const std::set< Node * > &nodes) const override
Base class for all nodes.
Definition: Node.hxx:70
virtual int getMaxLevelOfParallelism() const =0
virtual void getWeightRegardingDPL(ComplexWeight *weight)=0
const std::string & getName() const
Definition: Node.hxx:125
virtual void partitionRegardingDPL(const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap)=0
virtual void beginElementaryPoint(ElementaryPoint *pt)=0
virtual void endElementaryPoint(ElementaryPoint *pt)=0