Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:06

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