Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:17:17

0001 // Created on: 1997-05-09
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1997-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 _StepData_ESDescr_HeaderFile
0018 #define _StepData_ESDescr_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <StepData_EDescr.hxx>
0027 #include <Standard_CString.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <NCollection_DataMap.hxx>
0030 #include <TCollection_AsciiString.hxx>
0031 class StepData_PDescr;
0032 class StepData_Described;
0033 
0034 //! This class is intended to describe the authorized form for a
0035 //! Simple (not Plex) Entity, as a list of fields
0036 class StepData_ESDescr : public StepData_EDescr
0037 {
0038 
0039 public:
0040   //! Creates an ESDescr with a type name
0041   Standard_EXPORT StepData_ESDescr(const char* const name);
0042 
0043   //! Sets a new count of fields
0044   //! Each one is described by a PDescr
0045   Standard_EXPORT void SetNbFields(const int nb);
0046 
0047   //! Sets a PDescr to describe a field
0048   //! A Field is designated by its rank and name
0049   Standard_EXPORT void SetField(const int                           num,
0050                                 const char* const                   name,
0051                                 const occ::handle<StepData_PDescr>& descr);
0052 
0053   //! Sets an ESDescr as based on another one
0054   //! Hence, if there are inherited fields, the derived ESDescr
0055   //! cumulates all them, while the base just records its own ones
0056   Standard_EXPORT void SetBase(const occ::handle<StepData_ESDescr>& base);
0057 
0058   //! Sets an ESDescr as "super-type". Applies an a base (non
0059   //! derived) ESDescr
0060   Standard_EXPORT void SetSuper(const occ::handle<StepData_ESDescr>& super);
0061 
0062   //! Returns the type name given at creation time
0063   Standard_EXPORT const char* TypeName() const;
0064 
0065   //! Returns the type name as an AsciiString
0066   Standard_EXPORT const TCollection_AsciiString& StepType() const;
0067 
0068   //! Returns the basic ESDescr, null if <me> is not derived
0069   Standard_EXPORT occ::handle<StepData_ESDescr> Base() const;
0070 
0071   //! Returns the super-type ESDescr, null if <me> is root
0072   Standard_EXPORT occ::handle<StepData_ESDescr> Super() const;
0073 
0074   //! Tells if <me> is sub-type of (or equal to) another one
0075   Standard_EXPORT bool IsSub(const occ::handle<StepData_ESDescr>& other) const;
0076 
0077   //! Returns the count of fields
0078   Standard_EXPORT int NbFields() const;
0079 
0080   //! Returns the rank of a field from its name. 0 if unknown
0081   Standard_EXPORT int Rank(const char* const name) const;
0082 
0083   //! Returns the name of a field from its rank. empty if outofrange
0084   Standard_EXPORT const char* Name(const int num) const;
0085 
0086   //! Returns the PDescr for the field <num> (or Null)
0087   Standard_EXPORT occ::handle<StepData_PDescr> Field(const int num) const;
0088 
0089   //! Returns the PDescr for the field named <name> (or Null)
0090   Standard_EXPORT occ::handle<StepData_PDescr> NamedField(const char* const name) const;
0091 
0092   //! Tells if a ESDescr matches a step type : exact or super type
0093   Standard_EXPORT bool Matches(const char* const steptype) const override;
0094 
0095   //! Returns False
0096   Standard_EXPORT bool IsComplex() const override;
0097 
0098   //! Creates a described entity (i.e. a simple one)
0099   Standard_EXPORT occ::handle<StepData_Described> NewEntity() const override;
0100 
0101   DEFINE_STANDARD_RTTIEXT(StepData_ESDescr, StepData_EDescr)
0102 
0103 private:
0104   TCollection_AsciiString                                           thenom;
0105   occ::handle<NCollection_HArray1<occ::handle<Standard_Transient>>> thedescr;
0106   NCollection_DataMap<TCollection_AsciiString, int>                 thenames;
0107   occ::handle<StepData_ESDescr>                                     thebase;
0108   occ::handle<StepData_ESDescr>                                     thesuper;
0109 };
0110 
0111 #endif // _StepData_ESDescr_HeaderFile