0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- prepar...
[occt.git] / src / IGESData / IGESData_IGESModel.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-04-06
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 _IGESData_IGESModel_HeaderFile
18#define _IGESData_IGESModel_HeaderFile
19
42cf5bc1 20#include <TColStd_HSequenceOfHAsciiString.hxx>
21#include <IGESData_GlobalSection.hxx>
22#include <Interface_InterfaceModel.hxx>
0ebe5b0a 23
42cf5bc1 24class Interface_InterfaceError;
42cf5bc1 25class IGESData_GlobalSection;
26class IGESData_IGESEntity;
27class Interface_InterfaceModel;
28class Interface_Check;
29class Standard_Transient;
30class TCollection_HAsciiString;
31
32
33class IGESData_IGESModel;
34DEFINE_STANDARD_HANDLE(IGESData_IGESModel, Interface_InterfaceModel)
35
36//! Defines the file header and
37//! entities for IGES files. These headers and entities result from
38//! a complete data translation using the IGES data exchange processor.
39//! Each entity is contained in a single model only and has a
40//! unique identifier. You can access this identifier using the method Number.
41//! Gives an access to the general data in the Start and the Global
42//! sections of an IGES file.
43//! The IGES file includes the following sections:
44//! -Start,
45//! -Global,
46//! -Directory Entry,
47//! -Parameter Data,
48//! -Terminate
49class IGESData_IGESModel : public Interface_InterfaceModel
50{
51
52public:
53
54
55 Standard_EXPORT IGESData_IGESModel();
56
57 //! Erases all data specific to IGES file Header (Start + Global)
79104795 58 Standard_EXPORT void ClearHeader() Standard_OVERRIDE;
42cf5bc1 59
60 //! Prints the IGES file header
61 //! (Start and Global Sections) to the log file. The integer
62 //! parameter is intended to be used as a level indicator but is not used at present.
0ebe5b0a 63 Standard_EXPORT void DumpHeader (Standard_OStream& S, const Standard_Integer level = 0) const Standard_OVERRIDE;
42cf5bc1 64
65 //! Returns Model's Start Section (list of comment lines)
66 Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) StartSection() const;
67
68 //! Returns the count of recorded Start Lines
69 Standard_EXPORT Standard_Integer NbStartLines() const;
70
71 //! Returns a line from the IGES file
72 //! Start section by specifying its number. An empty string is
73 //! returned if the number given is out of range, the range being
74 //! from 1 to NbStartLines.
75 Standard_EXPORT Standard_CString StartLine (const Standard_Integer num) const;
76
77 //! Clears the IGES file Start Section
78 Standard_EXPORT void ClearStartSection();
79
80 //! Sets a new Start section from a list of strings.
81 //! If copy is false, the Start section will be shared. Any
82 //! modifications made to the strings later on, will have an effect on
83 //! the Start section. If copy is true (default value),
84 //! an independent copy of the strings is created and used as
85 //! the Start section. Any modifications made to the strings
86 //! later on, will have no effect on the Start section.
87 Standard_EXPORT void SetStartSection (const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean copy = Standard_True);
88
89 //! Adds a new string to the existing
90 //! Start section at the end if atnum is 0 or not given, or before
91 //! atnumth line.
92 Standard_EXPORT void AddStartLine (const Standard_CString line, const Standard_Integer atnum = 0);
93
94 //! Returns the Global section of the IGES file.
95 Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const;
96
97 //! Sets the Global section of the IGES file.
98 Standard_EXPORT void SetGlobalSection (const IGESData_GlobalSection& header);
99
100 //! Sets some of the Global section
101 //! parameters with the values defined by the translation
102 //! parameters. param may be:
103 //! - receiver (value read in XSTEP.iges.header.receiver),
104 //! - author (value read in XSTEP.iges.header.author),
105 //! - company (value read in XSTEP.iges.header.company).
106 //! The default value for param is an empty string.
107 //! Returns True when done and if param is given, False if param is
108 //! unknown or empty. Note: Set the unit in the IGES
109 //! file Global section via IGESData_BasicEditor class.
110 Standard_EXPORT Standard_Boolean ApplyStatic (const Standard_CString param = "");
111
112 //! Returns an IGES entity given by its rank number.
113 Standard_EXPORT Handle(IGESData_IGESEntity) Entity (const Standard_Integer num) const;
114
115 //! Returns the equivalent DE Number for an Entity, i.e.
116 //! 2*Number(ent)-1 , or 0 if <ent> is unknown from <me>
117 //! This DE Number is used for File Writing for instance
118 Standard_EXPORT Standard_Integer DNum (const Handle(IGESData_IGESEntity)& ent) const;
119
120 //! gets Header (GlobalSection) from another Model
79104795 121 Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
42cf5bc1 122
123 //! Returns a New Empty Model, same type as <me> i.e. IGESModel
79104795 124 Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
42cf5bc1 125
126 //! Checks that the IGES file Global
127 //! section contains valid data that conforms to the IGES specifications.
128 Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
129
130 //! Sets LineWeights of contained Entities according header data
131 //! (MaxLineWeight and LineWeightGrad) or to a default value for
132 //! undefined weights
133 Standard_EXPORT void SetLineWeights (const Standard_Real defw);
134
135 //! erases specific labels, i.e. does nothing
79104795 136 Standard_EXPORT void ClearLabels() Standard_OVERRIDE;
42cf5bc1 137
138 //! Prints label specific to IGES norm for a given entity, i.e.
139 //! its directory entry number (2*Number-1)
0ebe5b0a 140 Standard_EXPORT void PrintLabel (const Handle(Standard_Transient)& ent, Standard_OStream& S) const Standard_OVERRIDE;
42cf5bc1 141
142 //! Prints label specific to IGES norm for a given -- --
143 //! entity, i.e. its directory entry number (2*Number-1)
144 //! in the log file format.
0ebe5b0a 145 Standard_EXPORT virtual void PrintToLog (const Handle(Standard_Transient)& ent, Standard_OStream& S) const Standard_OVERRIDE;
42cf5bc1 146
147 //! Prints label specific to IGES norm for a given entity, i.e.
148 //! its directory entry number (2*Number-1)
0ebe5b0a 149 Standard_EXPORT void PrintInfo (const Handle(Standard_Transient)& ent, Standard_OStream& S) const;
42cf5bc1 150
151 //! Returns a string with the label attached to a given entity,
152 //! i.e. a string "Dnn" with nn = directory entry number (2*N-1)
79104795 153 Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
42cf5bc1 154
155
156
157
92efcf78 158 DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel,Interface_InterfaceModel)
42cf5bc1 159
160protected:
161
162
163
164
165private:
166
167
168 Handle(TColStd_HSequenceOfHAsciiString) thestart;
169 IGESData_GlobalSection theheader;
170
171
172};
173
174
175
176
177
178
179
180#endif // _IGESData_IGESModel_HeaderFile