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 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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IFGraph_AllConnected.hxx>
16 #include <Interface_Graph.hxx>
17 #include <Standard_Transient.hxx>
19 // AllConnected prend toutes les Entites connectees a une Entite donnee
20 // c-a-d toutes les "Shared" + toutes les "Sharings" et on recommence
21 // Autrement dit le contenu du "Composant Connexe" du graphe d'ensemble
22 // qui contient cette entite
23 // Le calcul est effectue par GetFromEntity (Evaluate n'a rien a faire)
24 IFGraph_AllConnected::IFGraph_AllConnected (const Interface_Graph& agraph)
25 : thegraph (agraph) { }
28 IFGraph_AllConnected::IFGraph_AllConnected
29 (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
31 { GetFromEntity(ent); }
33 void IFGraph_AllConnected::GetFromEntity
34 (const Handle(Standard_Transient)& ent)
36 if (!thegraph.IsPresent(thegraph.EntityNumber(ent))) return;
37 thegraph.GetFromEntity(ent,Standard_False);
39 for (Interface_EntityIterator shareds = thegraph.Shareds(ent);
40 shareds.More(); shareds.Next())
41 GetFromEntity(shareds.Value());
43 for (Interface_EntityIterator sharings = thegraph.Sharings(ent);
44 sharings.More(); sharings.Next())
45 GetFromEntity(sharings.Value());
48 void IFGraph_AllConnected::ResetData ()
49 { Reset(); thegraph.Reset(); }
51 void IFGraph_AllConnected::Evaluate()
52 { GetFromGraph(thegraph); } // GetFromEntity a tout fait