0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IFGraph / IFGraph_AllConnected.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 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
973c2be1 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.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
7fd59977 14
42cf5bc1 15#include <IFGraph_AllConnected.hxx>
16#include <Interface_Graph.hxx>
17#include <Standard_Transient.hxx>
7fd59977 18
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)
b311480e 24IFGraph_AllConnected::IFGraph_AllConnected (const Interface_Graph& agraph)
7fd59977 25 : thegraph (agraph) { }
26
27
28 IFGraph_AllConnected::IFGraph_AllConnected
29 (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
30 : thegraph (agraph)
31 { GetFromEntity(ent); }
32
33 void IFGraph_AllConnected::GetFromEntity
34 (const Handle(Standard_Transient)& ent)
35{
36 if (!thegraph.IsPresent(thegraph.EntityNumber(ent))) return;
37 thegraph.GetFromEntity(ent,Standard_False);
38
39 for (Interface_EntityIterator shareds = thegraph.Shareds(ent);
40 shareds.More(); shareds.Next())
41 GetFromEntity(shareds.Value());
42
43 for (Interface_EntityIterator sharings = thegraph.Sharings(ent);
44 sharings.More(); sharings.Next())
45 GetFromEntity(sharings.Value());
46}
47
48 void IFGraph_AllConnected::ResetData ()
49 { Reset(); thegraph.Reset(); }
50
51 void IFGraph_AllConnected::Evaluate()
52 { GetFromGraph(thegraph); } // GetFromEntity a tout fait