0026715: Problems in reading STEP short names in complex entities
[occt.git] / src / StepData / StepData_ESDescr.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _StepData_ESDescr_HeaderFile
18#define _StepData_ESDescr_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
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>
29class Dico_DictionaryOfInteger;
30class StepData_PDescr;
31class TCollection_AsciiString;
32class StepData_Described;
33
34
35class StepData_ESDescr;
36DEFINE_STANDARD_HANDLE(StepData_ESDescr, StepData_EDescr)
37
38//! This class is intended to describe the authorized form for a
39//! Simple (not Plex) Entity, as a list of fields
40class StepData_ESDescr : public StepData_EDescr
41{
42
43public:
44
45
46 //! Creates an ESDescr with a type name
47 Standard_EXPORT StepData_ESDescr(const Standard_CString name);
48
49 //! Sets a new count of fields
50 //! Each one is described by a PDescr
51 Standard_EXPORT void SetNbFields (const Standard_Integer nb);
52
53 //! Sets a PDescr to describe a field
54 //! A Field is designated by its rank and name
55 Standard_EXPORT void SetField (const Standard_Integer num, const Standard_CString name, const Handle(StepData_PDescr)& descr);
56
57 //! Sets an ESDescr as based on another one
58 //! Hence, if there are inherited fields, the derived ESDescr
59 //! cumulates all them, while the base just records its own ones
60 Standard_EXPORT void SetBase (const Handle(StepData_ESDescr)& base);
61
62 //! Sets an ESDescr as "super-type". Applies an a base (non
63 //! derived) ESDescr
64 Standard_EXPORT void SetSuper (const Handle(StepData_ESDescr)& super);
65
66 //! Returns the type name given at creation time
67 Standard_EXPORT Standard_CString TypeName() const;
68
69 //! Returns the type name as an AsciiString
70 Standard_EXPORT const TCollection_AsciiString& StepType() const;
71
72 //! Returns the basic ESDescr, null if <me> is not derived
73 Standard_EXPORT Handle(StepData_ESDescr) Base() const;
74
75 //! Returns the super-type ESDescr, null if <me> is root
76 Standard_EXPORT Handle(StepData_ESDescr) Super() const;
77
78 //! Tells if <me> is sub-type of (or equal to) another one
79 Standard_EXPORT Standard_Boolean IsSub (const Handle(StepData_ESDescr)& other) const;
80
81 //! Returns the count of fields
82 Standard_EXPORT Standard_Integer NbFields() const;
83
84 //! Returns the rank of a field from its name. 0 if unknown
85 Standard_EXPORT Standard_Integer Rank (const Standard_CString name) const;
86
87 //! Returns the name of a field from its rank. empty if outofrange
88 Standard_EXPORT Standard_CString Name (const Standard_Integer num) const;
89
90 //! Returns the PDescr for the field <num> (or Null)
91 Standard_EXPORT Handle(StepData_PDescr) Field (const Standard_Integer num) const;
92
93 //! Returns the PDescr for the field named <name> (or Null)
94 Standard_EXPORT Handle(StepData_PDescr) NamedField (const Standard_CString name) const;
95
96 //! Tells if a ESDescr matches a step type : exact or super type
97 Standard_EXPORT Standard_Boolean Matches (const Standard_CString steptype) const;
98
99 //! Returns False
100 Standard_EXPORT Standard_Boolean IsComplex() const;
101
102 //! Creates a described entity (i.e. a simple one)
103 Standard_EXPORT Handle(StepData_Described) NewEntity() const;
104
105
106
107
108 DEFINE_STANDARD_RTTI(StepData_ESDescr,StepData_EDescr)
109
110protected:
111
112
113
114
115private:
116
117
118 TCollection_AsciiString thenom;
119 Handle(TColStd_HArray1OfTransient) thedescr;
120 Handle(Dico_DictionaryOfInteger) thenames;
121 Handle(StepData_ESDescr) thebase;
122 Handle(StepData_ESDescr) thesuper;
123
124
125};
126
127
128
129
130
131
132
133#endif // _StepData_ESDescr_HeaderFile