Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:29:32

0001 // Created on: 1994-05-31
0002 // Created by: Modelistation
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESSelect_CounterOfLevelNumber_HeaderFile
0018 #define _IGESSelect_CounterOfLevelNumber_HeaderFile
0019 
0020 #include <TColStd_HArray1OfInteger.hxx>
0021 #include <IFSelect_SignCounter.hxx>
0022 #include <TColStd_HSequenceOfInteger.hxx>
0023 
0024 class Interface_InterfaceModel;
0025 class TCollection_HAsciiString;
0026 
0027 class IGESSelect_CounterOfLevelNumber;
0028 DEFINE_STANDARD_HANDLE(IGESSelect_CounterOfLevelNumber, IFSelect_SignCounter)
0029 
0030 //! This class gives information about Level Number. It counts
0031 //! entities according level number, considering also the
0032 //! multiple level (see the class LevelList) for which an entity
0033 //! is attached to each of the listed levels.
0034 //!
0035 //! Data are available, as level number, or as their alphanumeric
0036 //! counterparts ("LEVEL nnnnnnn", " NO LEVEL", " LEVEL LIST")
0037 class IGESSelect_CounterOfLevelNumber : public IFSelect_SignCounter
0038 {
0039 
0040 public:
0041   //! Creates a CounterOfLevelNumber, clear, ready to work
0042   //! <withmap> and <withlist> are transmitted to SignCounter
0043   Standard_EXPORT IGESSelect_CounterOfLevelNumber(const Standard_Boolean withmap  = Standard_True,
0044                                                   const Standard_Boolean withlist = Standard_False);
0045 
0046   //! Resets already memorized information : also numeric data
0047   Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
0048 
0049   //! Adds an entity by considering its lrvrl number(s)
0050   //! A level is added both in numeric and alphanumeric form,
0051   //! i.e. LevelList gives "LEVEL LIST", others (no level or
0052   //! positive level) displays level number on 7 digits (C : %7d)
0053   //! Remark : an entity attached to a Level List is added for
0054   //! " LEVEL LIST", and for each of its constituent levels
0055   Standard_EXPORT virtual void AddSign(const Handle(Standard_Transient)&       ent,
0056                                        const Handle(Interface_InterfaceModel)& model)
0057     Standard_OVERRIDE;
0058 
0059   //! The internal action to record a new level number, positive,
0060   //! null (no level) or negative (level list)
0061   Standard_EXPORT void AddLevel(const Handle(Standard_Transient)& ent,
0062                                 const Standard_Integer            level);
0063 
0064   //! Returns the highest value found for a level number
0065   Standard_EXPORT Standard_Integer HighestLevel() const;
0066 
0067   //! Returns the number of times a level is used,
0068   //! 0 if it has not been recorded at all
0069   //! <level> = 0 counts entities attached to no level
0070   //! <level> < 0 counts entities attached to a LevelList
0071   Standard_EXPORT Standard_Integer NbTimesLevel(const Standard_Integer level) const;
0072 
0073   //! Returns the ordered list of used positive Level numbers
0074   Standard_EXPORT Handle(TColStd_HSequenceOfInteger) Levels() const;
0075 
0076   //! Determines and returns the value of the signature for an
0077   //! entity as an HAsciiString. Redefined, gives the same result
0078   //! as AddSign, see this method ("LEVEL LIST" or "nnnnnnn")
0079   Standard_EXPORT virtual Handle(TCollection_HAsciiString) Sign(
0080     const Handle(Standard_Transient)&       ent,
0081     const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
0082 
0083   //! Prints the counts of items (not the list) then the Highest
0084   //! Level Number recorded
0085   Standard_EXPORT virtual void PrintCount(Standard_OStream& S) const Standard_OVERRIDE;
0086 
0087   DEFINE_STANDARD_RTTIEXT(IGESSelect_CounterOfLevelNumber, IFSelect_SignCounter)
0088 
0089 protected:
0090 private:
0091   Standard_Integer                 thehigh;
0092   Standard_Integer                 thenblists;
0093   Handle(TColStd_HArray1OfInteger) thelevels;
0094 };
0095 
0096 #endif // _IGESSelect_CounterOfLevelNumber_HeaderFile