0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[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
15 #include <IFSelect_SelectSignedSharing.hxx>
16 #include <IFSelect_Signature.hxx>
17 #include <Interface_EntityIterator.hxx>
18 #include <Interface_Graph.hxx>
19 #include <Standard_Transient.hxx>
20 #include <Standard_Type.hxx>
21 #include <TCollection_AsciiString.hxx>
22
23 IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSignedSharing,IFSelect_SelectExplore)
24
25 IFSelect_SelectSignedSharing::IFSelect_SelectSignedSharing
26   (const Handle(IFSelect_Signature)& matcher,
27    const Standard_CString signtext, const Standard_Boolean exact,
28    const Standard_Integer level)
29     : IFSelect_SelectExplore (level) ,
30       thematcher (matcher) , thesigntext (signtext) , theexact (exact)    {  }
31  
32     Handle(IFSelect_Signature) IFSelect_SelectSignedSharing::Signature () const
33       {  return thematcher;  }
34  
35     const TCollection_AsciiString&  IFSelect_SelectSignedSharing::SignatureText () const
36       {  return thesigntext;  }
37
38     Standard_Boolean  IFSelect_SelectSignedSharing::IsExact () const
39       {  return theexact;  }
40
41
42     Standard_Boolean  IFSelect_SelectSignedSharing::Explore
43   (const Standard_Integer level, const Handle(Standard_Transient)& ent,
44    const Interface_Graph& G,  Interface_EntityIterator& explored) const
45 {
46   if (thematcher->Matches (ent,G.Model(),thesigntext,theexact)) return Standard_True;
47
48 //  sinon, on fait le tri ici
49   Interface_EntityIterator list = G.Sharings (ent);
50 //  Si plus de Sharing, alors c est cuit
51   if (list.NbEntities() == 0) return Standard_False;
52
53 //  Sinon, trier si on est au niveau
54   if (level < Level()) {  explored = list;  return Standard_True;  }
55   for (list.Start(); list.More(); list.Next()) {
56     if (thematcher->Matches (list.Value(),G.Model(),thesigntext,theexact))
57       explored.AddItem (list.Value());
58   }
59   return Standard_True;
60 }
61
62
63     TCollection_AsciiString IFSelect_SelectSignedSharing::ExploreLabel () const
64 {
65   TCollection_AsciiString lab("Sharing,");
66   lab.AssignCat (thematcher->Name());
67   if (theexact) lab.AssignCat(" matching ");
68   else          lab.AssignCat(" containing ");
69   lab.AssignCat(thesigntext);
70   return lab;
71 }