--- /dev/null
+# Copyright (C) 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import pilot
+import SALOMERuntime
+import loader
+from collections import OrderedDict
+
+fname = "graph.xml"
+dbgFname = "dbg.xml"
+
+def IntToStr(i,prefix=""):
+ if i<26:
+ return prefix+chr( ord('A')+i )
+ else:
+ factor = (i//26)-1 ; remain = i%26
+ return IntToStr(factor,prefix)+IntToStr(remain)
+
+def GenerateSimplifiedOne(p0):
+ children = p0.getChildren()
+
+ dico = OrderedDict()
+ revDico = {}
+
+ for i,c in enumerate(children):
+ newName = IntToStr(i)
+ #if newName in ["R","A"]:
+ # continue
+ dico[c.getName()] = newName
+ revDico[newName] = c.getName()
+ pass
+
+ newProc = r.createProc("TOP")
+ for k,v in dico.items():
+ node = r.createScriptNode("Salome",v)#createProc
+ newProc.edAddChild(node)
+
+ for c in children:
+ if c.getName() not in dico:
+ continue
+ og = c.getOutGate()
+ sn = newProc.getChildByName( dico[ c.getName() ] )
+ outg = len( og.edMapInGate() )
+ if outg > 1:
+ print( "More than one link ( {} ) for {} !".format( outg, dico[c.getName()] ) )
+ for ol in og.edMapInGate():
+ en = newProc.getChildByName( dico[ ol[0].getNode().getName() ])
+ newProc.edAddCFLink(sn,en)
+ return newProc, dico, revDico
+
+
+SALOMERuntime.RuntimeSALOME.setRuntime()
+r = SALOMERuntime.getSALOMERuntime()
+l = loader.YACSLoader()
+p = l.load(fname)
+
+p0 = p.getChildren()[0]
+newProc, dico, revDico = GenerateSimplifiedOne( p0 )
+newProc.saveSchema( dbgFname )
+
+indepGraphs = newProc.splitIntoIndependantGraph()
+
+if len(indepGraphs) != 1:
+ raise RuntimeError("Ooops !")
+
+sop = pilot.SetOfPoints(indepGraphs[0])
+sop.simplify()
#include "NotSimpleCasePoint.hxx"
#include "ElementaryPoint.hxx"
#include "ObserverAsPlugin.hxx"
+#include "InGate.hxx"
using namespace YACS::ENGINE;
%template() std::pair<YACS::ENGINE::OutPort *,YACS::ENGINE::InPort *>;
%template() std::pair<YACS::ENGINE::InPort *,YACS::ENGINE::OutPort *>;
%template() std::pair< std::string, int >;
+%template() std::pair< YACS::ENGINE::InGate *, bool>;
%template(ItPy3TC) IteratorPy3<YACS::ENGINE::TypeCode *>;
//%template(TCmap) std::map<std::string, YACS::ENGINE::TypeCode *>;
REFCOUNT_TEMPLATE(TCmap,YACS::ENGINE::TypeCode)
%template() std::pair<std::string, std::string>;
%template(propmap) std::map<std::string, std::string>;
%template(ItPy3Comp) IteratorPy3<YACS::ENGINE::ComponentInstance *>;
+%template(listpairingatebool) std::list< std::pair< YACS::ENGINE::InGate *, bool> >;
+
REFCOUNT_TEMPLATE(CompoInstmap,YACS::ENGINE::ComponentInstance)
%include "exception.i"