0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / StepData / StepData_StepModel.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-02-11
2// Created by: Christian CAILLET
3// Copyright (c) 1992-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_StepModel_HeaderFile
18#define _StepData_StepModel_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Interface_EntityList.hxx>
24#include <TColStd_HArray1OfInteger.hxx>
25#include <Interface_InterfaceModel.hxx>
26#include <Standard_Integer.hxx>
27#include <Standard_Boolean.hxx>
28#include <Standard_Type.hxx>
29class Standard_NoSuchObject;
30class Standard_Transient;
31class Interface_InterfaceModel;
32class Interface_EntityIterator;
33class Interface_Check;
34class Message_Messenger;
35class TCollection_HAsciiString;
36
37
38class StepData_StepModel;
39DEFINE_STANDARD_HANDLE(StepData_StepModel, Interface_InterfaceModel)
40
41//! Gives access to
42//! - entities in a STEP file,
43//! - the STEP file header.
44class StepData_StepModel : public Interface_InterfaceModel
45{
46
47public:
48
49
50 //! Creates an empty STEP model with an empty header.
51 Standard_EXPORT StepData_StepModel();
52
53 //! returns entity given its rank.
54 //! Same as InterfaceEntity, but with a shorter name
55 Standard_EXPORT Handle(Standard_Transient) Entity (const Standard_Integer num) const;
56
57 //! gets header from another Model (uses Header Protocol)
79104795 58 Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
42cf5bc1 59
60 //! Returns a New Empty Model, same type as <me>, i.e. StepModel
79104795 61 Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
42cf5bc1 62
63 //! returns Header entities under the form of an iterator
64 Standard_EXPORT Interface_EntityIterator Header() const;
65
66 //! says if a Header entity has a specifed type
67 Standard_EXPORT Standard_Boolean HasHeaderEntity (const Handle(Standard_Type)& atype) const;
68
69 //! Returns Header entity with specified type, if there is
70 Standard_EXPORT Handle(Standard_Transient) HeaderEntity (const Handle(Standard_Type)& atype) const;
71
72 //! Clears the Header
79104795 73 Standard_EXPORT void ClearHeader() Standard_OVERRIDE;
42cf5bc1 74
75 //! Adds an Entity to the Header
76 Standard_EXPORT void AddHeaderEntity (const Handle(Standard_Transient)& ent);
77
78 //! Specific Check, checks Header Items with HeaderProtocol
79 Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
80
81 //! Dumps the Header, with the Header Protocol of StepData.
82 //! If the Header Protocol is not defined, for each Header Entity,
83 //! prints its Type. Else sends the Header under the form of
84 //! HEADER Section of an Ascii Step File
85 //! <level> is not used because Header is not so big
79104795 86 Standard_EXPORT void DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer level = 0) const Standard_OVERRIDE;
42cf5bc1 87
88 //! erases specific labels, i.e. clears the map (entity-ident)
79104795 89 Standard_EXPORT void ClearLabels() Standard_OVERRIDE;
42cf5bc1 90
91 //! Attaches an ident to an entity to produce a label
92 //! (does nothing if <ent> is not in <me>)
93 Standard_EXPORT void SetIdentLabel (const Handle(Standard_Transient)& ent, const Standard_Integer ident);
94
95 //! returns the label ident attached to an entity, 0 if not in me
96 Standard_EXPORT Standard_Integer IdentLabel (const Handle(Standard_Transient)& ent) const;
97
98 //! Prints label specific to STEP norm for a given entity, i.e.
99 //! if a LabelIdent has been recorded, its value with '#', else
100 //! the number in the model with '#' and between ()
79104795 101 Standard_EXPORT void PrintLabel (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const Standard_OVERRIDE;
42cf5bc1 102
103 //! Returns a string with the label attached to a given entity,
104 //! same form as for PrintLabel
79104795 105 Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
42cf5bc1 106
107
108
109
92efcf78 110 DEFINE_STANDARD_RTTIEXT(StepData_StepModel,Interface_InterfaceModel)
42cf5bc1 111
112protected:
113
114
115
116
117private:
118
119
120 Interface_EntityList theheader;
121 Handle(TColStd_HArray1OfInteger) theidnums;
122
123
124};
125
126
127
128
129
130
131
132#endif // _StepData_StepModel_HeaderFile