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