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 #ifndef _IGESSelect_CounterOfLevelNumber_HeaderFile
18 #define _IGESSelect_CounterOfLevelNumber_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <TColStd_HArray1OfInteger.hxx>
25 #include <IFSelect_SignCounter.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TColStd_HSequenceOfInteger.hxx>
28 class Standard_Transient;
29 class Interface_InterfaceModel;
30 class TCollection_HAsciiString;
31 class Message_Messenger;
34 class IGESSelect_CounterOfLevelNumber;
35 DEFINE_STANDARD_HANDLE(IGESSelect_CounterOfLevelNumber, IFSelect_SignCounter)
37 //! This class gives information about Level Number. It counts
38 //! entities according level number, considering also the
39 //! multiple level (see the class LevelList) for which an entity
40 //! is attached to each of the listed levels.
42 //! Data are available, as level number, or as their alphanumeric
43 //! counterparts ("LEVEL nnnnnnn", " NO LEVEL", " LEVEL LIST")
44 class IGESSelect_CounterOfLevelNumber : public IFSelect_SignCounter
50 //! Creates a CounterOfLevelNumber, clear, ready to work
51 //! <withmap> and <withlist> are transmitted to SignCounter
52 Standard_EXPORT IGESSelect_CounterOfLevelNumber(const Standard_Boolean withmap = Standard_True, const Standard_Boolean withlist = Standard_False);
54 //! Resets already memorized informations : also numeric data
55 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
57 //! Adds an entity by considering its lrvrl number(s)
58 //! A level is added both in numeric and alphanumeric form,
59 //! i.e. LevelList gives "LEVEL LIST", others (no level or
60 //! positive level) displays level number on 7 digits (C : %7d)
61 //! Remark : an entity attached to a Level List is added for
62 //! " LEVEL LIST", and for each of its constituant levels
63 Standard_EXPORT virtual void AddSign (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) Standard_OVERRIDE;
65 //! The internal action to record a new level number, positive,
66 //! null (no level) or negative (level list)
67 Standard_EXPORT void AddLevel (const Handle(Standard_Transient)& ent, const Standard_Integer level);
69 //! Returns the highest value found for a level number
70 Standard_EXPORT Standard_Integer HighestLevel() const;
72 //! Returns the number of times a level is used,
73 //! 0 if it has not been recorded at all
74 //! <level> = 0 counts entities attached to no level
75 //! <level> < 0 counts entities attached to a LevelList
76 Standard_EXPORT Standard_Integer NbTimesLevel (const Standard_Integer level) const;
78 //! Returns the ordered list of used positive Level numbers
79 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) Levels() const;
81 //! Determines and returns the value of the signature for an
82 //! entity as an HAsciiString. Redefined, gives the same result
83 //! as AddSign, see this method ("LEVEL LIST" or "nnnnnnn")
84 Standard_EXPORT virtual Handle(TCollection_HAsciiString) Sign (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
86 //! Prints the counts of items (not the list) then the Highest
87 //! Level Number recorded
88 Standard_EXPORT virtual void PrintCount (const Handle(Message_Messenger)& S) const Standard_OVERRIDE;
93 DEFINE_STANDARD_RTTIEXT(IGESSelect_CounterOfLevelNumber,IFSelect_SignCounter)
103 Standard_Integer thehigh;
104 Standard_Integer thenblists;
105 Handle(TColStd_HArray1OfInteger) thelevels;
116 #endif // _IGESSelect_CounterOfLevelNumber_HeaderFile