0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / IFSelect / IFSelect_PacketList.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IFSelect_PacketList_HeaderFile
18 #define _IFSelect_PacketList_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
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 <Standard_Transient.hxx>
29 #include <Standard_CString.hxx>
30 #include <TColStd_HSequenceOfTransient.hxx>
31 class Interface_InterfaceModel;
32 class Interface_EntityIterator;
33
34
35 class IFSelect_PacketList;
36 DEFINE_STANDARD_HANDLE(IFSelect_PacketList, Standard_Transient)
37
38 //! This class gives a simple way to return then consult a
39 //! list of packets, determined from the content of a Model,
40 //! by various criteria.
41 //!
42 //! It allows to describe several lists with entities from a
43 //! given model, possibly more than one list knowing every entity,
44 //! and to determine the remaining list (entities in no lists) and
45 //! the duplications (with their count).
46 class IFSelect_PacketList : public Standard_Transient
47 {
48
49 public:
50
51   
52   //! Creates a PackList, empty, ready to receive entities from a
53   //! given Model
54   Standard_EXPORT IFSelect_PacketList(const Handle(Interface_InterfaceModel)& model);
55   
56   //! Sets a name to a packet list : this makes easier a general
57   //! routine to print it. Default is "Packets"
58   Standard_EXPORT void SetName (const Standard_CString name);
59   
60   //! Returns the recorded name for a packet list
61   Standard_EXPORT Standard_CString Name() const;
62   
63   //! Returns the Model of reference
64   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
65   
66   //! Declares a new Packet, ready to be filled
67   //! The entities to be added will be added to this Packet
68   Standard_EXPORT void AddPacket();
69   
70   //! Adds an entity from the Model into the current packet for Add
71   Standard_EXPORT void Add (const Handle(Standard_Transient)& ent);
72   
73   //! Adds an list of entities into the current packet for Add
74   Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list);
75   
76   //! Returns the count of non-empty packets
77   Standard_EXPORT Standard_Integer NbPackets() const;
78   
79   //! Returns the count of entities in a Packet given its rank, or 0
80   Standard_EXPORT Standard_Integer NbEntities (const Standard_Integer numpack) const;
81   
82   //! Returns the content of a Packet given its rank
83   //! Null Handle if <numpack> is out of range
84   Standard_EXPORT Interface_EntityIterator Entities (const Standard_Integer numpack) const;
85   
86   //! Returns the highest number of packets which know a same entity
87   //! For no duplication, should be one
88   Standard_EXPORT Standard_Integer HighestDuplicationCount() const;
89   
90   //! Returns the count of entities duplicated :
91   //! <count> times, if <andmore> is False, or
92   //! <count> or more times, if <andmore> is True
93   //! See Duplicated for more details
94   Standard_EXPORT Standard_Integer NbDuplicated (const Standard_Integer count, const Standard_Boolean andmore) const;
95   
96   //! Returns a list of entities duplicated :
97   //! <count> times, if <andmore> is False, or
98   //! <count> or more times, if <andmore> is True
99   //! Hence, count=2 & andmore=True gives all duplicated entities
100   //! count=1 gives non-duplicated entities (in only one packet)
101   //! count=0 gives remaining entities (in no packet at all)
102   Standard_EXPORT Interface_EntityIterator Duplicated (const Standard_Integer count, const Standard_Boolean andmore) const;
103
104
105
106
107   DEFINE_STANDARD_RTTIEXT(IFSelect_PacketList,Standard_Transient)
108
109 protected:
110
111
112
113
114 private:
115
116
117   Handle(Interface_InterfaceModel) themodel;
118   TColStd_Array1OfInteger thedupls;
119   Interface_IntList thepacks;
120   TColStd_Array1OfInteger theflags;
121   Standard_Integer thelast;
122   Standard_Boolean thebegin;
123   TCollection_AsciiString thename;
124
125
126 };
127
128
129
130
131
132
133
134 #endif // _IFSelect_PacketList_HeaderFile