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.
14 #include <IFSelect_GraphCounter.ixx>
15 #include <Interface_EntityIterator.hxx>
16 #include <IFSelect_SelectPointed.hxx>
21 IFSelect_GraphCounter::IFSelect_GraphCounter
22 (const Standard_Boolean withmap, const Standard_Boolean withlist)
23 : IFSelect_SignCounter (withmap,withlist) { }
25 Handle(IFSelect_SelectDeduct) IFSelect_GraphCounter::Applied () const
26 { return theapplied; }
28 void IFSelect_GraphCounter::SetApplied
29 (const Handle(IFSelect_SelectDeduct)& applied)
30 { theapplied = applied; }
32 void IFSelect_GraphCounter::AddWithGraph
33 (const Handle(TColStd_HSequenceOfTransient)& list,
34 const Interface_Graph& graph)
36 if (theapplied.IsNull()) { AddList (list,graph.Model()); return; }
37 if (list.IsNull()) return;
38 Standard_Integer i, nb = list->Length();
39 for (i = 1; i <= nb; i ++) {
41 Handle(Standard_Transient) ent = list->Value(i);
42 theapplied->Alternate()->SetEntity (ent);
43 Interface_EntityIterator iter = theapplied->UniqueResult(graph);
44 Standard_Integer n = iter.NbEntities();
46 case 0: Add (ent,"0"); break;
47 case 1: Add (ent,"1"); break;
48 case 2: Add (ent,"2"); break;
49 case 3: Add (ent,"3"); break;
50 case 4: Add (ent,"4"); break;
51 case 5: Add (ent,"5"); break;
52 case 6: Add (ent,"6"); break;
53 case 7: Add (ent,"7"); break;
54 case 8: Add (ent,"8"); break;
55 case 9: Add (ent,"9"); break;