0031939: Coding - correction of spelling errors in comments [part 4]
[occt.git] / src / IFSelect / IFSelect_PacketList.hxx
CommitLineData
42cf5bc1 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>
25e59720 28#include <Standard_Transient.hxx>
42cf5bc1 29#include <Standard_CString.hxx>
30#include <TColStd_HSequenceOfTransient.hxx>
31class Interface_InterfaceModel;
32class Interface_InterfaceError;
33class Standard_Transient;
34class Interface_EntityIterator;
35
36
37class IFSelect_PacketList;
25e59720 38DEFINE_STANDARD_HANDLE(IFSelect_PacketList, Standard_Transient)
42cf5bc1 39
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.
43//!
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).
25e59720 48class IFSelect_PacketList : public Standard_Transient
42cf5bc1 49{
50
51public:
52
53
54 //! Creates a PackList, empty, ready to receive entities from a
55 //! given Model
56 Standard_EXPORT IFSelect_PacketList(const Handle(Interface_InterfaceModel)& model);
57
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);
61
62 //! Returns the recorded name for a packet list
63 Standard_EXPORT Standard_CString Name() const;
64
65 //! Returns the Model of reference
66 Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
67
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();
71
72 //! Adds an entity from the Model into the current packet for Add
73 Standard_EXPORT void Add (const Handle(Standard_Transient)& ent);
74
75 //! Adds an list of entities into the current packet for Add
76 Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list);
77
78 //! Returns the count of non-empty packets
79 Standard_EXPORT Standard_Integer NbPackets() const;
80
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;
83
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;
87
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;
91
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;
97
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;
105
106
107
108
25e59720 109 DEFINE_STANDARD_RTTIEXT(IFSelect_PacketList,Standard_Transient)
42cf5bc1 110
111protected:
112
113
114
115
116private:
117
118
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;
126
127
128};
129
130
131
132
133
134
135
136#endif // _IFSelect_PacketList_HeaderFile