b311480e |
1 | -- Created on: 1994-10-27 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class SignatureList from IFSelect inherits TShared |
18 | |
19 | ---Purpose : A SignatureList is given as result from a Counter (any kind) |
20 | -- It gives access to a list of signatures, with counts, and |
21 | -- optionally with list of corresponding entities |
22 | -- |
23 | -- It can also be used only to give a signature, through SignOnly |
24 | -- Mode. This can be useful for a specific counter (used in a |
25 | -- Selection), while it remains better to use a Signature |
26 | -- whenever possible |
27 | |
28 | uses CString, HSequenceOfTransient, |
29 | DictionaryOfInteger, DictionaryOfTransient, |
30 | AsciiString from TCollection, |
31 | HAsciiString from TCollection, |
32 | HSequenceOfHAsciiString from TColStd, |
33 | Messenger from Message, |
34 | InterfaceModel, PrintCount |
35 | |
36 | is |
37 | |
6e33d3ce |
38 | Create (withlist : Boolean = Standard_False) returns SignatureList; |
7fd59977 |
39 | ---Purpose : Creates a SignatureList. If <withlist> is True, entities will |
40 | -- be not only counted per signature, but also listed. |
41 | |
42 | SetList (me : mutable; withlist : Boolean); |
43 | ---Purpose : Changes the record-list status. The list is not cleared but |
44 | -- its use changes |
45 | |
46 | ModeSignOnly (me : mutable) returns Boolean; |
47 | ---Purpose : Returns modifiable the SignOnly Mode |
48 | -- If False (D), the counter normally counts |
49 | -- If True, the counting work is turned off, Add only fills the |
50 | -- LastValue, which can be used as signature, when a counter |
51 | -- works from data which are not available from a Signature |
52 | ---C++ : return & |
53 | |
54 | Clear (me : mutable) is virtual; |
55 | |
56 | Add (me : mutable; ent : Transient; sign : CString); |
57 | ---Purpose : Adds an entity with its signature, i.e. : |
58 | -- - counts an item more for <sign> |
59 | -- - if record-list status is set, records the entity |
60 | -- Accepts a null entity (the signature is then for the global |
61 | -- model). But if the string is empty, counts a Null item. |
62 | -- |
63 | -- If SignOnly Mode is set, this work is replaced by just |
64 | -- setting LastValue |
65 | |
66 | LastValue (me) returns CString; |
67 | ---Purpose : Returns the last value recorded by Add (only if SignMode set) |
68 | -- Cleared by Clear or Init |
69 | |
70 | Init (me : mutable; |
71 | name : CString; |
72 | count : DictionaryOfInteger; |
73 | list : DictionaryOfTransient; |
74 | nbnuls : Integer); |
75 | ---Purpose : Aknowledges the list in once. Name identifies the Signature |
76 | |
77 | List (me; root : CString = "") returns HSequenceOfHAsciiString; |
78 | ---Purpose : Returns the list of signatures, as a sequence of strings |
79 | -- (but without their respective counts). It is ordered. |
80 | -- By default, for all the signatures. |
81 | -- If <root> is given non empty, for the signatures which |
82 | -- begin by <root> |
83 | |
84 | HasEntities (me) returns Boolean; |
85 | ---Purpose : Returns True if the list of Entities is aknowledged, else |
86 | -- the method Entities will always return a Null Handle |
87 | |
88 | NbNulls (me) returns Integer; |
89 | ---Purpose : Returns the count of null entities |
90 | |
91 | NbTimes (me; sign : CString) returns Integer; |
92 | ---Purpose : Returns the number of times a signature was counted, |
93 | -- 0 if it has not been recorded at all |
94 | |
95 | Entities (me; sign : CString) returns HSequenceOfTransient; |
96 | ---Purpose : Returns the list of entities attached to a signature |
97 | -- It is empty if <sign> has not been recorded |
98 | -- It is a Null Handle if the list of entities is not known |
99 | |
100 | SetName (me : mutable; name : CString); |
101 | ---Purpose : Defines a name for a SignatureList (used to print it) |
102 | |
103 | Name (me) returns CString is virtual; |
104 | ---Purpose : Returns the recorded Name. |
105 | -- Remark : default is "..." (no SetName called) |
106 | |
107 | PrintCount (me; S : Messenger from Message) is virtual; |
108 | ---Purpose : Prints the counts of items (not the list) |
109 | |
110 | PrintList (me; S : Messenger from Message; model : InterfaceModel; |
111 | mod : PrintCount = IFSelect_ListByItem) is virtual; |
112 | ---Purpose : Prints the lists of items, if they are present (else, prints |
113 | -- a message "no list available") |
114 | -- Uses <model> to determine for each entity to be listed, its |
115 | -- number, and its specific identifier (by PrintLabel) |
116 | -- <mod> gives a mode for printing : |
117 | -- - CountByItem : just count (as PrintCount) |
118 | -- - ShortByItem : minimum i.e. count plus 5 first entity numbers |
119 | -- - ShortByItem(D) complete list of entity numbers (0: "Global") |
120 | -- - EntitiesByItem : list of (entity number/PrintLabel from the model) |
121 | -- other modes are ignored |
122 | |
123 | PrintSum (me; S : Messenger from Message) is virtual; |
124 | ---Purpose : Prints a summary |
125 | -- Item which has the greatest count of entities |
126 | -- For items which are numeric values : their count, maximum, |
127 | -- minimum values, cumul, average |
128 | |
129 | fields |
130 | |
131 | thesignonly : Boolean; |
132 | thelistat : Boolean; |
133 | thenbnuls : Integer; |
134 | thename : HAsciiString; |
135 | thelastval : AsciiString; |
136 | thedicount : DictionaryOfInteger; |
137 | thediclist : DictionaryOfTransient; |
138 | |
139 | end SignatureList; |