1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and / or modify it
6 // under the terms of the GNU Lesser General Public version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <IFGraph_SCRoots.ixx>
15 //#include <Interface_GraphContent.hxx>
16 #include <IFGraph_StrongComponants.hxx>
17 #include <IFGraph_ExternalSources.hxx>
18 #include <Standard_Transient.hxx>
23 IFGraph_SCRoots::IFGraph_SCRoots
24 (const Interface_Graph& agraph, const Standard_Boolean whole)
25 : IFGraph_StrongComponants (agraph,whole) { }
27 IFGraph_SCRoots::IFGraph_SCRoots (IFGraph_StrongComponants& subparts)
28 : IFGraph_StrongComponants (subparts) { }
30 // StrongComponants racines d un ensemble donne
31 // On ne tient pas compte du reste eventuel (c est un autre probleme)
32 // On part du fait que StrongComponants donne les Composants dans l ordre de
33 // dependance, le premier ne dependant de rien (les autres, on ne sait pas ...)
35 void IFGraph_SCRoots::Evaluate ()
37 IFGraph_StrongComponants complist (Model(),Standard_False);
38 complist.GetFromIter(Loaded());
39 // Interface_Graph G(Model());
40 Interface_Graph G(thegraph);
42 cout<<" SCRoots:"<<endl;
45 for (complist.Start(); complist.More(); complist.Next()) {
46 Handle(Standard_Transient) ent = complist.FirstEntity();
47 Standard_Integer num = G.EntityNumber(ent);
49 cout<<" Iteration,num="<<num<<(G.IsPresent(num) ? " Pris" : " A prendre")<<endl;
51 if (!G.IsPresent(num)) { // enregistrer pour suivants
52 G.GetFromEntity(ent,Standard_True);
53 Interface_EntityIterator list = complist.Entities();
60 /* ce qui suit, c etait autre chose : les SC qui n ont pas d ExternalSource
61 Interface_EntityIterator list = complist.Entities();
62 IFGraph_ExternalSources eval (Model());
63 eval.GetFromIter(list);