0022627: Change OCCT memory management defaults
[occt.git] / src / IFSelect / IFSelect_SelectSignedSharing.cxx
CommitLineData
7fd59977 1#include <IFSelect_SelectSignedSharing.ixx>
2
3
4 IFSelect_SelectSignedSharing::IFSelect_SelectSignedSharing
5 (const Handle(IFSelect_Signature)& matcher,
6 const Standard_CString signtext, const Standard_Boolean exact,
7 const Standard_Integer level)
8 : IFSelect_SelectExplore (level) ,
9 thematcher (matcher) , thesigntext (signtext) , theexact (exact) { }
10
11 Handle(IFSelect_Signature) IFSelect_SelectSignedSharing::Signature () const
12 { return thematcher; }
13
14 const TCollection_AsciiString& IFSelect_SelectSignedSharing::SignatureText () const
15 { return thesigntext; }
16
17 Standard_Boolean IFSelect_SelectSignedSharing::IsExact () const
18 { return theexact; }
19
20
21 Standard_Boolean IFSelect_SelectSignedSharing::Explore
22 (const Standard_Integer level, const Handle(Standard_Transient)& ent,
23 const Interface_Graph& G, Interface_EntityIterator& explored) const
24{
25 if (thematcher->Matches (ent,G.Model(),thesigntext,theexact)) return Standard_True;
26
27// sinon, on fait le tri ici
28 Interface_EntityIterator list = G.Sharings (ent);
29// Si plus de Sharing, alors c est cuit
30 if (list.NbEntities() == 0) return Standard_False;
31
32// Sinon, trier si on est au niveau
33 if (level < Level()) { explored = list; return Standard_True; }
34 for (list.Start(); list.More(); list.Next()) {
35 if (thematcher->Matches (list.Value(),G.Model(),thesigntext,theexact))
36 explored.AddItem (list.Value());
37 }
38 return Standard_True;
39}
40
41
42 TCollection_AsciiString IFSelect_SelectSignedSharing::ExploreLabel () const
43{
44 TCollection_AsciiString lab("Sharing,");
45 lab.AssignCat (thematcher->Name());
46 if (theexact) lab.AssignCat(" matching ");
47 else lab.AssignCat(" containing ");
48 lab.AssignCat(thesigntext);
49 return lab;
50}