1 // Created on: 1997-05-09
2 // Created by: Christian CAILLET
3 // Copyright (c) 1997-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 _StepData_ESDescr_HeaderFile
18 #define _StepData_ESDescr_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <TColStd_HArray1OfTransient.hxx>
25 #include <StepData_EDescr.hxx>
26 #include <Standard_CString.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <NCollection_DataMap.hxx>
30 #include <TCollection_AsciiString.hxx>
31 #include <Standard_Transient.hxx>
32 class StepData_PDescr;
33 class StepData_Described;
36 class StepData_ESDescr;
37 DEFINE_STANDARD_HANDLE(StepData_ESDescr, StepData_EDescr)
39 //! This class is intended to describe the authorized form for a
40 //! Simple (not Plex) Entity, as a list of fields
41 class StepData_ESDescr : public StepData_EDescr
47 //! Creates an ESDescr with a type name
48 Standard_EXPORT StepData_ESDescr(const Standard_CString name);
50 //! Sets a new count of fields
51 //! Each one is described by a PDescr
52 Standard_EXPORT void SetNbFields (const Standard_Integer nb);
54 //! Sets a PDescr to describe a field
55 //! A Field is designated by its rank and name
56 Standard_EXPORT void SetField (const Standard_Integer num, const Standard_CString name, const Handle(StepData_PDescr)& descr);
58 //! Sets an ESDescr as based on another one
59 //! Hence, if there are inherited fields, the derived ESDescr
60 //! cumulates all them, while the base just records its own ones
61 Standard_EXPORT void SetBase (const Handle(StepData_ESDescr)& base);
63 //! Sets an ESDescr as "super-type". Applies an a base (non
65 Standard_EXPORT void SetSuper (const Handle(StepData_ESDescr)& super);
67 //! Returns the type name given at creation time
68 Standard_EXPORT Standard_CString TypeName() const;
70 //! Returns the type name as an AsciiString
71 Standard_EXPORT const TCollection_AsciiString& StepType() const;
73 //! Returns the basic ESDescr, null if <me> is not derived
74 Standard_EXPORT Handle(StepData_ESDescr) Base() const;
76 //! Returns the super-type ESDescr, null if <me> is root
77 Standard_EXPORT Handle(StepData_ESDescr) Super() const;
79 //! Tells if <me> is sub-type of (or equal to) another one
80 Standard_EXPORT Standard_Boolean IsSub (const Handle(StepData_ESDescr)& other) const;
82 //! Returns the count of fields
83 Standard_EXPORT Standard_Integer NbFields() const;
85 //! Returns the rank of a field from its name. 0 if unknown
86 Standard_EXPORT Standard_Integer Rank (const Standard_CString name) const;
88 //! Returns the name of a field from its rank. empty if outofrange
89 Standard_EXPORT Standard_CString Name (const Standard_Integer num) const;
91 //! Returns the PDescr for the field <num> (or Null)
92 Standard_EXPORT Handle(StepData_PDescr) Field (const Standard_Integer num) const;
94 //! Returns the PDescr for the field named <name> (or Null)
95 Standard_EXPORT Handle(StepData_PDescr) NamedField (const Standard_CString name) const;
97 //! Tells if a ESDescr matches a step type : exact or super type
98 Standard_EXPORT Standard_Boolean Matches (const Standard_CString steptype) const Standard_OVERRIDE;
101 Standard_EXPORT Standard_Boolean IsComplex() const Standard_OVERRIDE;
103 //! Creates a described entity (i.e. a simple one)
104 Standard_EXPORT Handle(StepData_Described) NewEntity() const Standard_OVERRIDE;
109 DEFINE_STANDARD_RTTIEXT(StepData_ESDescr,StepData_EDescr)
119 TCollection_AsciiString thenom;
120 Handle(TColStd_HArray1OfTransient) thedescr;
121 NCollection_DataMap<TCollection_AsciiString, Standard_Integer> thenames;
122 Handle(StepData_ESDescr) thebase;
123 Handle(StepData_ESDescr) thesuper;
134 #endif // _StepData_ESDescr_HeaderFile