1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #include <IFSelect_Dispatch.ixx>
19 #include <IFGraph_Compare.hxx>
22 void IFSelect_Dispatch::SetRootName
23 (const Handle(TCollection_HAsciiString)& name)
28 Standard_Boolean IFSelect_Dispatch::HasRootName () const
29 { return (!thename.IsNull()); }
31 const Handle(TCollection_HAsciiString)& IFSelect_Dispatch::RootName () const
34 void IFSelect_Dispatch::SetFinalSelection
35 (const Handle(IFSelect_Selection)& sel)
38 Handle(IFSelect_Selection) IFSelect_Dispatch::FinalSelection () const
41 IFSelect_SelectionIterator IFSelect_Dispatch::Selections () const
43 IFSelect_SelectionIterator iter;
44 iter.AddItem(thefinal);
45 for(; iter.More(); iter.Next()) {
46 iter.Value()->FillIterator(iter); // Iterateur qui se court apres
52 Standard_Boolean IFSelect_Dispatch::CanHaveRemainder () const
53 { return Standard_False; }
55 Standard_Boolean IFSelect_Dispatch::LimitedMax
56 (const Standard_Integer , Standard_Integer& max) const
57 { max = 0; return Standard_False; }
59 Interface_EntityIterator IFSelect_Dispatch::GetEntities
60 (const Interface_Graph& G) const
61 { return thefinal->UniqueResult(G); }
63 Standard_Boolean IFSelect_Dispatch::PacketsCount
64 (const Interface_Graph& , Standard_Integer& pcount) const
65 { pcount = 0; return Standard_False; } // par defaut 0
67 Interface_EntityIterator IFSelect_Dispatch::Packeted
68 (const Interface_Graph& G) const
70 Interface_EntityIterator total = GetEntities(G);
71 Interface_EntityIterator remain = Remainder(G);
72 if (remain.NbEntities() == 0) return total;
73 // sinon, faire la difference !
74 IFGraph_Compare GC(G);
75 GC.GetFromIter (total, Standard_True);
76 GC.GetFromIter (remain,Standard_False);
77 return GC.FirstOnly();
80 Interface_EntityIterator IFSelect_Dispatch::Remainder
81 (const Interface_Graph& ) const
82 { Interface_EntityIterator iter; return iter; } // par defaut vide