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
6 // under the terms of the GNU Lesser General Public 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.
14 #include <IFGraph_Compare.ixx>
15 #include <IFGraph_AllShared.hxx>
19 // Comparateur de deux sous-ensembles d un Modele
20 // Au premier sous-ensemble, est attribue le Status 1
21 // Au deuxieme sous-ensemble, est attribue le Status 2
22 // La partie commune se voit attribuer le Status 3
24 IFGraph_Compare::IFGraph_Compare (const Interface_Graph& agraph)
25 : thegraph (agraph) { }
27 void IFGraph_Compare::GetFromEntity
28 (const Handle(Standard_Transient)& ent, const Standard_Boolean first)
30 IFGraph_AllShared iter(thegraph.Model(),ent);
31 GetFromIter(iter,first);
34 void IFGraph_Compare::GetFromIter
35 (const Interface_EntityIterator& iter, const Standard_Boolean first)
37 Standard_Integer stat = 2;
39 thegraph.GetFromIter(iter,stat,3,Standard_False);
43 void IFGraph_Compare::Merge ()
45 thegraph.ChangeStatus (2,1);
46 thegraph.ChangeStatus (3,1);
49 void IFGraph_Compare::RemoveSecond ()
51 thegraph.ChangeStatus (3,1);
52 thegraph.RemoveStatus (2);
55 void IFGraph_Compare::KeepCommon ()
57 thegraph.RemoveStatus (1);
58 thegraph.RemoveStatus (2);
59 thegraph.ChangeStatus (3,1);
62 void IFGraph_Compare::ResetData ()
63 { Reset(); thegraph.Reset(); }
65 void IFGraph_Compare::Evaluate ()
67 Reset(); GetFromGraph(thegraph); // Evaluation deja faite par le graphe
70 Interface_EntityIterator IFGraph_Compare::Common () const
71 { return Interface_GraphContent(thegraph,3); }
73 Interface_EntityIterator IFGraph_Compare::FirstOnly () const
74 { return Interface_GraphContent(thegraph,1); }
76 Interface_EntityIterator IFGraph_Compare::SecondOnly () const
77 { return Interface_GraphContent(thegraph,2); }