0024885: Getting rid of "TKAdvTools" toolkit
[occt.git] / src / IFGraph / IFGraph_SCRoots.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License 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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
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>
19
20 //#define PRINTDEB
21
22
23 IFGraph_SCRoots::IFGraph_SCRoots
24   (const Interface_Graph& agraph, const Standard_Boolean whole)
25       : IFGraph_StrongComponants (agraph,whole)    {  }
26
27     IFGraph_SCRoots::IFGraph_SCRoots (IFGraph_StrongComponants& subparts)
28       : IFGraph_StrongComponants (subparts)    {  }
29
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 ...)
34
35     void  IFGraph_SCRoots::Evaluate ()
36 {
37   IFGraph_StrongComponants complist (Model(),Standard_False);
38   complist.GetFromIter(Loaded());
39 //  Interface_Graph G(Model());
40   Interface_Graph G(thegraph);
41 #ifdef PRINTDEB
42   cout<<" SCRoots:"<<endl;
43 #endif
44   G.ResetStatus();
45   for (complist.Start(); complist.More(); complist.Next()) {
46     Handle(Standard_Transient) ent = complist.FirstEntity();
47     Standard_Integer num = G.EntityNumber(ent);
48 #ifdef PRINTDEB
49     cout<<"   Iteration,num="<<num<<(G.IsPresent(num) ? " Pris" : " A prendre")<<endl;
50 #endif
51     if (!G.IsPresent(num)) {        //  enregistrer pour suivants
52       G.GetFromEntity(ent,Standard_True);
53       Interface_EntityIterator list = complist.Entities();
54       AddPart();
55       GetFromIter(list);
56     }
57   }
58 }
59
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);
64     if (eval.IsEmpty()) {
65       AddPart();
66       GetFromIter(list);
67     }
68   }
69 }
70 */