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 class PacketList from IFSelect inherits TShared
19 ---Purpose : This class gives a simple way to return then consult a
20 -- list of packets, determined from the content of a Model,
21 -- by various criteria.
23 -- It allows to describe several lists with entities from a
24 -- given model, possibly more than one list knowing every entity,
25 -- and to determine the remaining list (entities in no lists) and
26 -- the duplications (with their count).
28 uses Array1OfInteger, IntList, HSequenceOfTransient, AsciiString,
29 EntityIterator, InterfaceModel
35 Create (model : InterfaceModel) returns PacketList;
36 ---Purpose : Creates a PackList, empty, ready to receive entities from a
39 SetName (me : mutable; name : CString) is static;
40 ---Purpose : Sets a name to a packet list : this makes easier a general
41 -- routine to print it. Default is "Packets"
43 Name (me) returns CString is static;
44 ---Purpose : Returns the recorded name for a packet list
46 Model (me) returns InterfaceModel;
47 ---Purpose : Returns the Model of reference
49 AddPacket (me : mutable);
50 ---Purpose : Declares a new Packet, ready to be filled
51 -- The entities to be added will be added to this Packet
53 Add (me : mutable; ent : Transient)
54 ---Purpose : Adds an entity from the Model into the current packet for Add
55 raises InterfaceError;
56 -- Error if <ent> is not from the Model, or if no AddPacket was
59 AddList (me : mutable; list : HSequenceOfTransient)
60 ---Purpose : Adds an list of entities into the current packet for Add
61 raises InterfaceError;
62 -- Error if on of the items of <list> is not from the Model, or
63 -- if no AddPacket was yet called
65 NbPackets (me) returns Integer;
66 ---Purpose : Returns the count of non-empty packets
68 NbEntities (me; numpack : Integer) returns Integer;
69 ---Purpose : Returns the count of entities in a Packet given its rank, or 0
71 Entities (me; numpack : Integer) returns EntityIterator;
72 ---Purpose : Returns the content of a Packet given its rank
73 -- Null Handle if <numpack> is out of range
75 HighestDuplicationCount (me) returns Integer;
76 ---Purpose : Returns the highest number of packets which know a same entity
77 -- For no duplication, should be one
79 NbDuplicated (me; count : Integer; andmore : Boolean) returns Integer;
80 ---Purpose : Returns the count of entities duplicated :
81 -- <count> times, if <andmore> is False, or
82 -- <count> or more times, if <andmore> is True
83 -- See Duplicated for more details
85 Duplicated (me; count : Integer; andmore : Boolean) returns EntityIterator;
86 ---Purpose : Returns a list of entities duplicated :
87 -- <count> times, if <andmore> is False, or
88 -- <count> or more times, if <andmore> is True
89 -- Hence, count=2 & andmore=True gives all duplicated entities
90 -- count=1 gives non-duplicated entities (in only one packet)
91 -- count=0 gives remaining entities (in no packet at all)
95 themodel : InterfaceModel;
96 thedupls : Array1OfInteger;
98 theflags : Array1OfInteger; -- for only once par packet !
101 thename : AsciiString;