1 -- Created on: 1994-05-31
2 -- Created by: Modelistation
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 CounterOfLevelNumber from IGESSelect inherits SignCounter
19 ---Purpose : This class gives information about Level Number. It counts
20 -- entities according level number, considering also the
21 -- multiple level (see the class LevelList) for which an entity
22 -- is attached to each of the listed levels.
24 -- Data are available, as level number, or as their alphanumeric
25 -- counterparts ("LEVEL nnnnnnn", " NO LEVEL", " LEVEL LIST")
27 uses Integer, Transient, MapOfTransient, HAsciiString from TCollection,
28 HArray1OfInteger from TColStd, HSequenceOfInteger from TColStd,
29 Messenger from Message,
30 HSequenceOfTransient, InterfaceModel
34 Create (withmap : Boolean = Standard_True;
35 withlist : Boolean = Standard_False)
36 returns CounterOfLevelNumber;
37 ---Purpose : Creates a CounterOfLevelNumber, clear, ready to work
38 -- <withmap> and <withlist> are transmitted to SignCounter
40 Clear (me : mutable) is redefined;
41 ---Purpose : Resets already memorized informations : also numeric data
43 AddSign (me : mutable; ent : Transient; model : InterfaceModel)
45 ---Purpose : Adds an entity by considering its lrvrl number(s)
46 -- A level is added both in numeric and alphanumeric form,
47 -- i.e. LevelList gives "LEVEL LIST", others (no level or
48 -- positive level) displays level number on 7 digits (C : %7d)
49 -- Remark : an entity attached to a Level List is added for
50 -- " LEVEL LIST", and for each of its constituant levels
52 AddLevel (me : mutable; ent : Transient; level : Integer);
53 ---Purpose : The internal action to record a new level number, positive,
54 -- null (no level) or negative (level list)
56 HighestLevel (me) returns Integer;
57 ---Purpose : Returns the highest value found for a level number
59 NbTimesLevel (me; level : Integer) returns Integer;
60 ---Purpose : Returns the number of times a level is used,
61 -- 0 if it has not been recorded at all
62 -- <level> = 0 counts entities attached to no level
63 -- <level> < 0 counts entities attached to a LevelList
65 Levels (me) returns HSequenceOfInteger;
66 ---Purpose : Returns the ordered list of used positive Level numbers
68 Sign (me; ent : Transient; model : InterfaceModel) returns HAsciiString is redefined;
69 ---Purpose : Determines and returns the value of the signature for an
70 -- entity as an HAsciiString. Redefined, gives the same result
71 -- as AddSign, see this method ("LEVEL LIST" or "nnnnnnn")
73 PrintCount (me; S : Messenger from Message) is redefined;
74 ---Purpose : Prints the counts of items (not the list) then the Highest
75 -- Level Number recorded
81 thelevels : HArray1OfInteger;
83 end CounterOfLevelNumber;