X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FAbstractPoint.hxx;h=5c0f54b0b9023eaa411ea71a14a5454a6acae416;hb=c9208a8ef7f32a620d9650908588320ff159a167;hp=e75f07739ada0e4f0cb2e5ae583a52ad2421a68f;hpb=9c7a4a63121fcdcb19eaae1ecb4368a4a0110a0d;p=modules%2Fyacs.git diff --git a/src/engine/AbstractPoint.hxx b/src/engine/AbstractPoint.hxx index e75f07739..5c0f54b0b 100644 --- a/src/engine/AbstractPoint.hxx +++ b/src/engine/AbstractPoint.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2016 CEA/DEN, EDF R&D +// Copyright (C) 2015-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -25,15 +25,18 @@ #include "AutoRefCnt.hxx" #include +#include #include #include #include +#include namespace YACS { namespace ENGINE { class Node; + class Bloc; class InGate; class OutGate; class BlocPoint; @@ -41,14 +44,17 @@ namespace YACS class ForkBlocPoint; class PointVisitor; class LinkedBlocPoint; + class NotSimpleCasePoint; + class ElementaryPoint; class YACSLIBENGINE_EXPORT AbstractPoint { public: + AbstractPoint() = default; AbstractPoint(AbstractPoint *father):_father(father) { } AbstractPoint *getFather() const { return _father; } AbstractPoint *getGodFather(); - bool amIGod() { return getGodFather()==0; } + bool amIGod() { return getGodFather()==nullptr; } void setFather(AbstractPoint *father) { _father=father; } // bool isBegin(); @@ -56,22 +62,30 @@ namespace YACS bool isSimplyLinkedBeforeAfter(BlocPoint *sop); bool isSimplyLinkedAfterNullBefore(BlocPoint *sop); bool isSimplyLinkedBeforeNullAfter(BlocPoint *sop); + bool isNullBeforeNullAfter(BlocPoint *sop); // LinkedBlocPoint *tryAsLink(BlocPoint *sop); ForkBlocPoint *tryAsFork(BlocPoint *sop); ForkBlocPoint *tryAsForkBis(BlocPoint *sop); ForkBlocPoint *tryAsForkTer(BlocPoint *sop); + ForkBlocPoint *tryAsForkQuatro(BlocPoint *sop); + //void tryAsNotSimpleCase(BlocPoint *sop, std::list& nodes, bool& somethingDone); + static void TryAsNotSimpleCase(AbstractPoint *father, const std::vector& ptsToKill, std::list& nodes, bool& somethingDone); + // + virtual AbstractPoint *deepCopy(AbstractPoint *father) const = 0; // virtual Node *getFirstNode() = 0; virtual Node *getLastNode() = 0; virtual AbstractPoint *findPointWithNode(Node *node) = 0; - virtual bool contains(Node *node) = 0; + virtual bool contains(Node *node) const = 0; + virtual bool anyOf(const std::set& nodes) const = 0; virtual int getNumberOfNodes() const = 0; virtual int getMaxLevelOfParallelism() const = 0; virtual void getWeightRegardingDPL(ComplexWeight *weight) = 0; virtual void partitionRegardingDPL(const PartDefinition *pd, std::map >& zeMap) const = 0; virtual std::string getRepr() const = 0; virtual void accept(PointVisitor *pv) = 0; + virtual AbstractPoint *expandNonSimpleCaseOn(NotSimpleCasePoint *pathologicalPt, const std::set& uncatchedNodes) = 0; virtual ~AbstractPoint(); public: static bool IsGatherB4Ext(Node *node); @@ -87,8 +101,13 @@ namespace YACS static AbstractPoint *GetDirectSonOf(AbstractPoint *refFather, AbstractPoint *sonOrLittleSon); static bool IsCommonDirectSonOf(AbstractPoint *refFather, const std::list& outgs, AbstractPoint *&ret); static bool IsCommonDirectSonOf(AbstractPoint *refFather, const std::list& ings, AbstractPoint *&ret); + static void FeedData(AbstractPoint *ptToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr > > *m); + static void FeedData(const std::list& ptsToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr > > *m); + static void Rewire(const std::vector& ptsToKill, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr > > *m); + static void UnRewire(std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr > >& m); + static void Display(std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr > > *m); protected: - AbstractPoint *_father; + AbstractPoint *_father = nullptr; }; } }