1 // Created on: 1994-09-02
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_PacketList_HeaderFile
18 #define _IFSelect_PacketList_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TColStd_Array1OfInteger.hxx>
24 #include <Interface_IntList.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TCollection_AsciiString.hxx>
28 #include <MMgt_TShared.hxx>
29 #include <Standard_CString.hxx>
30 #include <TColStd_HSequenceOfTransient.hxx>
31 class Interface_InterfaceModel;
32 class Interface_InterfaceError;
33 class Standard_Transient;
34 class Interface_EntityIterator;
37 class IFSelect_PacketList;
38 DEFINE_STANDARD_HANDLE(IFSelect_PacketList, MMgt_TShared)
40 //! This class gives a simple way to return then consult a
41 //! list of packets, determined from the content of a Model,
42 //! by various criteria.
44 //! It allows to describe several lists with entities from a
45 //! given model, possibly more than one list knowing every entity,
46 //! and to determine the remaining list (entities in no lists) and
47 //! the duplications (with their count).
48 class IFSelect_PacketList : public MMgt_TShared
54 //! Creates a PackList, empty, ready to receive entities from a
56 Standard_EXPORT IFSelect_PacketList(const Handle(Interface_InterfaceModel)& model);
58 //! Sets a name to a packet list : this makes easier a general
59 //! routine to print it. Default is "Packets"
60 Standard_EXPORT void SetName (const Standard_CString name);
62 //! Returns the recorded name for a packet list
63 Standard_EXPORT Standard_CString Name() const;
65 //! Returns the Model of reference
66 Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
68 //! Declares a new Packet, ready to be filled
69 //! The entities to be added will be added to this Packet
70 Standard_EXPORT void AddPacket();
72 //! Adds an entity from the Model into the current packet for Add
73 Standard_EXPORT void Add (const Handle(Standard_Transient)& ent);
75 //! Adds an list of entities into the current packet for Add
76 Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list);
78 //! Returns the count of non-empty packets
79 Standard_EXPORT Standard_Integer NbPackets() const;
81 //! Returns the count of entities in a Packet given its rank, or 0
82 Standard_EXPORT Standard_Integer NbEntities (const Standard_Integer numpack) const;
84 //! Returns the content of a Packet given its rank
85 //! Null Handle if <numpack> is out of range
86 Standard_EXPORT Interface_EntityIterator Entities (const Standard_Integer numpack) const;
88 //! Returns the highest number of packets which know a same entity
89 //! For no duplication, should be one
90 Standard_EXPORT Standard_Integer HighestDuplicationCount() const;
92 //! Returns the count of entities duplicated :
93 //! <count> times, if <andmore> is False, or
94 //! <count> or more times, if <andmore> is True
95 //! See Duplicated for more details
96 Standard_EXPORT Standard_Integer NbDuplicated (const Standard_Integer count, const Standard_Boolean andmore) const;
98 //! Returns a list of entities duplicated :
99 //! <count> times, if <andmore> is False, or
100 //! <count> or more times, if <andmore> is True
101 //! Hence, count=2 & andmore=True gives all duplicated entities
102 //! count=1 gives non-duplicated entities (in only one packet)
103 //! count=0 gives remaining entities (in no packet at all)
104 Standard_EXPORT Interface_EntityIterator Duplicated (const Standard_Integer count, const Standard_Boolean andmore) const;
109 DEFINE_STANDARD_RTTIEXT(IFSelect_PacketList,MMgt_TShared)
119 Handle(Interface_InterfaceModel) themodel;
120 TColStd_Array1OfInteger thedupls;
121 Interface_IntList thepacks;
122 TColStd_Array1OfInteger theflags;
123 Standard_Integer thelast;
124 Standard_Boolean thebegin;
125 TCollection_AsciiString thename;
136 #endif // _IFSelect_PacketList_HeaderFile