0023687: Two opposite conditions. The second condition is always false in ifselect_sh...
[occt.git] / src / IFSelect / IFSelect_PacketList.cdl
CommitLineData
b311480e 1-- Created on: 1994-09-02
2-- Created by: Christian CAILLET
3-- Copyright (c) 1994-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23class PacketList from IFSelect inherits TShared
24
25 ---Purpose : This class gives a simple way to return then consult a
26 -- list of packets, determined from the content of a Model,
27 -- by various criteria.
28 --
29 -- It allows to describe several lists with entities from a
30 -- given model, possibly more than one list knowing every entity,
31 -- and to determine the remaining list (entities in no lists) and
32 -- the duplications (with their count).
33
34uses Array1OfInteger, IntList, HSequenceOfTransient, AsciiString,
35 EntityIterator, InterfaceModel
36
37raises InterfaceError
38
39is
40
41 Create (model : InterfaceModel) returns mutable PacketList;
42 ---Purpose : Creates a PackList, empty, ready to receive entities from a
43 -- given Model
44
45 SetName (me : mutable; name : CString) is static;
46 ---Purpose : Sets a name to a packet list : this makes easier a general
47 -- routine to print it. Default is "Packets"
48
49 Name (me) returns CString is static;
50 ---Purpose : Returns the recorded name for a packet list
51
52 Model (me) returns InterfaceModel;
53 ---Purpose : Returns the Model of reference
54
55 AddPacket (me : mutable);
56 ---Purpose : Declares a new Packet, ready to be filled
57 -- The entities to be added will be added to this Packet
58
59 Add (me : mutable; ent : Transient)
60 ---Purpose : Adds an entity from the Model into the current packet for Add
61 raises InterfaceError;
62 -- Error if <ent> is not from the Model, or if no AddPacket was
63 -- yet called
64
65 AddList (me : mutable; list : HSequenceOfTransient)
66 ---Purpose : Adds an list of entities into the current packet for Add
67 raises InterfaceError;
68 -- Error if on of the items of <list> is not from the Model, or
69 -- if no AddPacket was yet called
70
71 NbPackets (me) returns Integer;
72 ---Purpose : Returns the count of non-empty packets
73
74 NbEntities (me; numpack : Integer) returns Integer;
75 ---Purpose : Returns the count of entities in a Packet given its rank, or 0
76
77 Entities (me; numpack : Integer) returns EntityIterator;
78 ---Purpose : Returns the content of a Packet given its rank
79 -- Null Handle if <numpack> is out of range
80
81 HighestDuplicationCount (me) returns Integer;
82 ---Purpose : Returns the highest number of packets which know a same entity
83 -- For no duplication, should be one
84
85 NbDuplicated (me; count : Integer; andmore : Boolean) returns Integer;
86 ---Purpose : Returns the count of entities duplicated :
87 -- <count> times, if <andmore> is False, or
88 -- <count> or more times, if <andmore> is True
89 -- See Duplicated for more details
90
91 Duplicated (me; count : Integer; andmore : Boolean) returns EntityIterator;
92 ---Purpose : Returns a list of entities duplicated :
93 -- <count> times, if <andmore> is False, or
94 -- <count> or more times, if <andmore> is True
95 -- Hence, count=2 & andmore=True gives all duplicated entities
96 -- count=1 gives non-duplicated entities (in only one packet)
97 -- count=0 gives remaining entities (in no packet at all)
98
99fields
100
101 themodel : InterfaceModel;
102 thedupls : Array1OfInteger;
103 thepacks : IntList;
104 theflags : Array1OfInteger; -- for only once par packet !
105 thelast : Integer;
106 thebegin : Boolean;
107 thename : AsciiString;
108
109end PacketList;