0022735: Data races in BRepMesh working in parallel mode
[occt.git] / src / IFSelect / IFSelect_SelectRoots.cxx
1 #include <IFSelect_SelectRoots.ixx>
2 #include <IFGraph_Cumulate.hxx>
3
4
5     IFSelect_SelectRoots::IFSelect_SelectRoots ()    {  }
6
7
8 // Refait pour travailler en une fois
9
10     Interface_EntityIterator  IFSelect_SelectRoots::RootResult
11   (const Interface_Graph& G) const
12 {
13   Interface_EntityIterator input = InputResult(G);
14   Interface_EntityIterator iter;
15   IFGraph_Cumulate GC(G);
16
17 //  On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous
18 //  niveaux). Les Roots initiales comptees une seule fois sont bonnes
19   for (input.Start(); input.More(); input.Next()) {
20     Handle(Standard_Transient) ent = input.Value();
21     GC.GetFromEntity(ent);
22   }
23 //  A present, on retient, parmi les inputs, celles comptees une seule fois
24   for (input.Start(); input.More(); input.Next()) {
25     Handle(Standard_Transient) ent = input.Value();
26     if ((Standard_Boolean)(GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
27   }
28   return iter;
29 }
30
31     Standard_Boolean  IFSelect_SelectRoots::HasUniqueResult () const
32       {  return Standard_True;  }
33
34     Standard_Boolean  IFSelect_SelectRoots::Sort
35   (const Standard_Integer , const Handle(Standard_Transient)& ,
36    const Handle(Interface_InterfaceModel)& ) const 
37       {  return Standard_True;  }
38
39     TCollection_AsciiString  IFSelect_SelectRoots::ExtractLabel () const 
40       {  return TCollection_AsciiString("Local Roots");  }