1 #include <IGESSelect_DispPerSingleView.ixx>
2 #include <IFSelect_Selection.hxx>
3 #include <IGESData_IGESModel.hxx>
4 #include <IFSelect_PacketList.hxx>
5 #include <Interface_Macros.hxx>
8 IGESSelect_DispPerSingleView::IGESSelect_DispPerSingleView ()
9 { thesorter = new IGESSelect_ViewSorter; }
11 TCollection_AsciiString IGESSelect_DispPerSingleView::Label () const
13 return TCollection_AsciiString("One File per single View or Drawing Frame");
17 void IGESSelect_DispPerSingleView::Packets
18 (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
20 if (FinalSelection().IsNull()) return;
21 Interface_EntityIterator list = FinalSelection()->UniqueResult(G);
22 thesorter->SetModel (GetCasted(IGESData_IGESModel,G.Model()));
24 thesorter->AddList (list.Content());
25 thesorter->SortSingleViews(Standard_True);
26 Handle(IFSelect_PacketList) sets = thesorter->Sets(Standard_True);
29 Standard_Integer nb = sets->NbPackets();
30 for (Standard_Integer i = 1; i <= nb; i ++) {
32 packs.GetFromIter (sets->Entities(i));
37 Standard_Boolean IGESSelect_DispPerSingleView::CanHaveRemainder () const
38 { return Standard_True; }
40 Interface_EntityIterator IGESSelect_DispPerSingleView::Remainder
41 (const Interface_Graph& G) const
43 if (thesorter->NbEntities() == 0) {
44 Interface_EntityIterator list;
45 if (FinalSelection().IsNull()) return list;
46 list = FinalSelection()->UniqueResult(G);
48 thesorter->Add (list.Content());
49 thesorter->SortSingleViews(Standard_True);
51 return thesorter->Sets(Standard_True)->Duplicated (0,Standard_False);