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
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 _IGESData_IGESModel_HeaderFile
18 #define _IGESData_IGESModel_HeaderFile
20 #include <TColStd_HSequenceOfHAsciiString.hxx>
21 #include <IGESData_GlobalSection.hxx>
22 #include <Interface_InterfaceModel.hxx>
24 class Interface_InterfaceError;
25 class IGESData_GlobalSection;
26 class IGESData_IGESEntity;
27 class Interface_InterfaceModel;
28 class Interface_Check;
29 class Standard_Transient;
30 class TCollection_HAsciiString;
33 class IGESData_IGESModel;
34 DEFINE_STANDARD_HANDLE(IGESData_IGESModel, Interface_InterfaceModel)
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:
49 class IGESData_IGESModel : public Interface_InterfaceModel
55 Standard_EXPORT IGESData_IGESModel();
57 //! Erases all data specific to IGES file Header (Start + Global)
58 Standard_EXPORT void ClearHeader() Standard_OVERRIDE;
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.
63 Standard_EXPORT void DumpHeader (Standard_OStream& S, const Standard_Integer level = 0) const Standard_OVERRIDE;
65 //! Returns Model's Start Section (list of comment lines)
66 Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) StartSection() const;
68 //! Returns the count of recorded Start Lines
69 Standard_EXPORT Standard_Integer NbStartLines() const;
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;
77 //! Clears the IGES file Start Section
78 Standard_EXPORT void ClearStartSection();
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);
89 //! Adds a new string to the existing
90 //! Start section at the end if atnum is 0 or not given, or before
92 Standard_EXPORT void AddStartLine (const Standard_CString line, const Standard_Integer atnum = 0);
94 //! Returns the Global section of the IGES file.
95 Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const;
97 //! Sets the Global section of the IGES file.
98 Standard_EXPORT void SetGlobalSection (const IGESData_GlobalSection& header);
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 = "");
112 //! Returns an IGES entity given by its rank number.
113 Standard_EXPORT Handle(IGESData_IGESEntity) Entity (const Standard_Integer num) const;
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;
120 //! gets Header (GlobalSection) from another Model
121 Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
123 //! Returns a New Empty Model, same type as <me> i.e. IGESModel
124 Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
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;
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);
135 //! erases specific labels, i.e. does nothing
136 Standard_EXPORT void ClearLabels() Standard_OVERRIDE;
138 //! Prints label specific to IGES norm for a given entity, i.e.
139 //! its directory entry number (2*Number-1)
140 Standard_EXPORT void PrintLabel (const Handle(Standard_Transient)& ent, Standard_OStream& S) const Standard_OVERRIDE;
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.
145 Standard_EXPORT virtual void PrintToLog (const Handle(Standard_Transient)& ent, Standard_OStream& S) const Standard_OVERRIDE;
147 //! Prints label specific to IGES norm for a given entity, i.e.
148 //! its directory entry number (2*Number-1)
149 Standard_EXPORT void PrintInfo (const Handle(Standard_Transient)& ent, Standard_OStream& S) const;
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)
153 Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
158 DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel,Interface_InterfaceModel)
168 Handle(TColStd_HSequenceOfHAsciiString) thestart;
169 IGESData_GlobalSection theheader;
180 #endif // _IGESData_IGESModel_HeaderFile