0024057: Eliminate compiler warning C4100 in MSVC++ with warning level 4
[occt.git] / src / IGESSelect / IGESSelect_DispPerSingleView.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
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.
7//
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.
10//
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.
17
7fd59977 18#include <IGESSelect_DispPerSingleView.ixx>
19#include <IFSelect_Selection.hxx>
20#include <IGESData_IGESModel.hxx>
21#include <IFSelect_PacketList.hxx>
22#include <Interface_Macros.hxx>
23
24
b311480e 25IGESSelect_DispPerSingleView::IGESSelect_DispPerSingleView ()
7fd59977 26 { thesorter = new IGESSelect_ViewSorter; }
27
28 TCollection_AsciiString IGESSelect_DispPerSingleView::Label () const
29{
30 return TCollection_AsciiString("One File per single View or Drawing Frame");
31}
32
33
34 void IGESSelect_DispPerSingleView::Packets
35 (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
36{
37 if (FinalSelection().IsNull()) return;
38 Interface_EntityIterator list = FinalSelection()->UniqueResult(G);
39 thesorter->SetModel (GetCasted(IGESData_IGESModel,G.Model()));
40 thesorter->Clear();
41 thesorter->AddList (list.Content());
42 thesorter->SortSingleViews(Standard_True);
43 Handle(IFSelect_PacketList) sets = thesorter->Sets(Standard_True);
44
45 packs.SetLoad();
46 Standard_Integer nb = sets->NbPackets();
47 for (Standard_Integer i = 1; i <= nb; i ++) {
48 packs.AddPart();
49 packs.GetFromIter (sets->Entities(i));
50 }
51}
52
53
54 Standard_Boolean IGESSelect_DispPerSingleView::CanHaveRemainder () const
55 { return Standard_True; }
56
57 Interface_EntityIterator IGESSelect_DispPerSingleView::Remainder
58 (const Interface_Graph& G) const
59{
60 if (thesorter->NbEntities() == 0) {
61 Interface_EntityIterator list;
62 if (FinalSelection().IsNull()) return list;
63 list = FinalSelection()->UniqueResult(G);
64 thesorter->Clear();
65 thesorter->Add (list.Content());
66 thesorter->SortSingleViews(Standard_True);
67 }
68 return thesorter->Sets(Standard_True)->Duplicated (0,Standard_False);
69}