Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IFGraph / IFGraph_ExternalSources.cxx
CommitLineData
7fd59977 1#include <IFGraph_ExternalSources.ixx>
2
3
4
5// ExternalSources exploite les resultats stockes dans le Graphe sur Sharings
6// Soit les "Sharings" des entites notees par GetFromEntity et GetFromIter
7// Celles des "Sharings" qui n etaient pas deja notees sont ExternalSources
8// Les status :
9// - Les entites de depart sont au Status 0
10// - Les entites Sharing NOUVELLES (ExternalSources) sont au Status 1
11
12
13 IFGraph_ExternalSources::IFGraph_ExternalSources
14 (const Interface_Graph& agraph)
15 : thegraph (agraph) { }
16
17
18 void IFGraph_ExternalSources::GetFromEntity
19 (const Handle(Standard_Transient)& ent)
20 { thegraph.GetFromEntity(ent,Standard_True); }
21
22 void IFGraph_ExternalSources::GetFromIter
23 (const Interface_EntityIterator& iter)
24 { thegraph.GetFromIter(iter,0); }
25
26 void IFGraph_ExternalSources::ResetData ()
27 { Reset(); thegraph.Reset(); }
28
29
30 void IFGraph_ExternalSources::Evaluate ()
31{
32 Reset();
33 thegraph.RemoveStatus(1);
34 Standard_Integer nb = thegraph.Size();
35 for (Standard_Integer i = 1; i <= nb; i ++) {
36 if (thegraph.IsPresent(i) && thegraph.Status(i) == 0)
37 thegraph.GetFromIter ( thegraph.Sharings(thegraph.Entity(i)), 1 );
38 }
39 GetFromGraph(thegraph,1);
40}
41
42 Standard_Boolean IFGraph_ExternalSources::IsEmpty ()
43{
44 Evaluate();
45 Standard_Integer nb = thegraph.Size();
46 for (Standard_Integer i = 1; i <= nb; i ++) {
47 if (thegraph.IsPresent(i) || thegraph.Status(i) == 1)
48 return Standard_False;
49 }
50 return Standard_True;
51}