0024814: Avoid using explicit names of Handle classes
[occt.git] / src / IFSelect / IFSelect_SelectSignedSharing.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <IFSelect_SelectSignedSharing.ixx>
15
16
17 IFSelect_SelectSignedSharing::IFSelect_SelectSignedSharing
18   (const Handle(IFSelect_Signature)& matcher,
19    const Standard_CString signtext, const Standard_Boolean exact,
20    const Standard_Integer level)
21     : IFSelect_SelectExplore (level) ,
22       thematcher (matcher) , thesigntext (signtext) , theexact (exact)    {  }
23  
24     Handle(IFSelect_Signature) IFSelect_SelectSignedSharing::Signature () const
25       {  return thematcher;  }
26  
27     const TCollection_AsciiString&  IFSelect_SelectSignedSharing::SignatureText () const
28       {  return thesigntext;  }
29
30     Standard_Boolean  IFSelect_SelectSignedSharing::IsExact () const
31       {  return theexact;  }
32
33
34     Standard_Boolean  IFSelect_SelectSignedSharing::Explore
35   (const Standard_Integer level, const Handle(Standard_Transient)& ent,
36    const Interface_Graph& G,  Interface_EntityIterator& explored) const
37 {
38   if (thematcher->Matches (ent,G.Model(),thesigntext,theexact)) return Standard_True;
39
40 //  sinon, on fait le tri ici
41   Interface_EntityIterator list = G.Sharings (ent);
42 //  Si plus de Sharing, alors c est cuit
43   if (list.NbEntities() == 0) return Standard_False;
44
45 //  Sinon, trier si on est au niveau
46   if (level < Level()) {  explored = list;  return Standard_True;  }
47   for (list.Start(); list.More(); list.Next()) {
48     if (thematcher->Matches (list.Value(),G.Model(),thesigntext,theexact))
49       explored.AddItem (list.Value());
50   }
51   return Standard_True;
52 }
53
54
55     TCollection_AsciiString IFSelect_SelectSignedSharing::ExploreLabel () const
56 {
57   TCollection_AsciiString lab("Sharing,");
58   lab.AssignCat (thematcher->Name());
59   if (theexact) lab.AssignCat(" matching ");
60   else          lab.AssignCat(" containing ");
61   lab.AssignCat(thesigntext);
62   return lab;
63 }