0027067: Avoid use of virtual methods for implementation of destructors in legacy...
[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
15 #include <IFGraph_ExternalSources.hxx>
16 #include <IFGraph_SCRoots.hxx>
17 #include <IFGraph_StrongComponants.hxx>
18 #include <Interface_Graph.hxx>
19 #include <Standard_Transient.hxx>
20
21 //#include <Interface_GraphContent.hxx>
22 IFGraph_SCRoots::IFGraph_SCRoots
23   (const Interface_Graph& agraph, const Standard_Boolean whole)
24       : IFGraph_StrongComponants (agraph,whole)    {  }
25
26     IFGraph_SCRoots::IFGraph_SCRoots (IFGraph_StrongComponants& subparts)
27       : IFGraph_StrongComponants (subparts)    {  }
28
29 // StrongComponants racines d un ensemble donne
30 // On ne tient pas compte du reste eventuel (c est un autre probleme)
31 // On part du fait que StrongComponants donne les Composants dans l ordre de
32 // dependance, le premier ne dependant de rien (les autres, on ne sait pas ...)
33
34     void  IFGraph_SCRoots::Evaluate ()
35 {
36   IFGraph_StrongComponants complist (Model(),Standard_False);
37   complist.GetFromIter(Loaded());
38 //  Interface_Graph G(Model());
39   Interface_Graph G(thegraph);
40 #ifdef OCCT_DEBUG
41   cout<<" SCRoots:"<<endl;
42 #endif
43   G.ResetStatus();
44   for (complist.Start(); complist.More(); complist.Next()) {
45     Handle(Standard_Transient) ent = complist.FirstEntity();
46     Standard_Integer num = G.EntityNumber(ent);
47 #ifdef OCCT_DEBUG
48     cout<<"   Iteration,num="<<num<<(G.IsPresent(num) ? " Pris" : " A prendre")<<endl;
49 #endif
50     if (!G.IsPresent(num)) {        //  enregistrer pour suivants
51       G.GetFromEntity(ent,Standard_True);
52       Interface_EntityIterator list = complist.Entities();
53       AddPart();
54       GetFromIter(list);
55     }
56   }
57 }
58
59 /*     ce qui suit, c etait autre chose : les SC qui n ont pas d ExternalSource
60     Interface_EntityIterator list = complist.Entities();
61     IFGraph_ExternalSources  eval (Model());
62     eval.GetFromIter(list);
63     if (eval.IsEmpty()) {
64       AddPart();
65       GetFromIter(list);
66     }
67   }
68 }
69 */