b311480e |
1 | -- Created on: 1992-02-11 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class StepReaderTool from StepData inherits FileReaderTool |
24 | |
25 | ---Purpose : Specific FileReaderTool for Step; works with FileReaderData |
26 | -- provides references evaluation, plus access to litteral data |
27 | -- and specific methods defined by FileReaderTool |
28 | -- Remarks : works with a ReaderLib to load Entities |
29 | |
30 | uses Integer, Boolean, Transient, |
31 | InterfaceModel, Check, GeneralLib, ReaderLib, |
32 | StepReaderData, FileRecognizer, Protocol from StepData |
33 | |
34 | is |
35 | |
36 | -- -- File data storing and access (specific) -- -- |
37 | |
38 | Create (reader : mutable StepReaderData; protocol : Protocol from StepData) |
39 | returns StepReaderTool; |
40 | ---Purpose : creates StepReaderTool to work with a StepReaderData according |
41 | -- to a Step Protocol. Defines the ReaderLib at this time |
42 | |
43 | -- -- setting empty entities before loading model -- -- |
44 | |
45 | Prepare (me : in out; optimize : Boolean = Standard_True); |
46 | ---Purpose : Bounds empty entities to records, uses default Recognition |
47 | -- provided by ReaderLib and ReaderModule. Also calls computation |
48 | -- of references (SetEntityNumbers from StepReaderData) |
49 | -- Works only on data entities (skips header) |
50 | -- <optimize> given False allows to test some internal algorithms |
51 | -- which are normally avoided (see also StepReaderData) |
52 | |
53 | Prepare (me : in out; reco : mutable FileRecognizer; |
54 | optimize : Boolean = Standard_True); |
55 | ---Purpose : Bounds empty entities to records, works with a specific |
56 | -- FileRecognizer, stored and later used in Recognize |
57 | -- Works only on data entities (skips header) |
58 | -- <optimize : same as above |
59 | |
60 | Recognize (me : in out; num : Integer; |
61 | ach : in out Check; ent : out mutable Transient) |
62 | returns Boolean; |
63 | ---Purpose : recognizes records, by asking either ReaderLib (default) or |
64 | -- FileRecognizer (if defined) to do so. <ach> is to call |
65 | -- RecognizeByLib |
66 | |
67 | -- -- managing Header -- -- |
68 | -- Header is defined as a list of StepEntities (without ident) |
69 | |
70 | PrepareHeader (me : in out; reco : mutable FileRecognizer); |
71 | ---Purpose : bounds empty entities and sub-lists to header records |
72 | -- works like Prepare + SetEntityNumbers, but for header |
73 | -- (N.B.: in Header, no Ident and no reference) |
74 | -- FileRecognizer is to specify Entities which are allowed to be |
75 | -- defined in the Header (not every type can be) |
76 | |
77 | -- -- loading entities into the model -- -- |
78 | |
79 | BeginRead (me : in out; amodel : mutable InterfaceModel); |
80 | ---Purpose : fills model's header; that is, gives to it Header entities |
81 | -- and commands their loading. Also fills StepModel's Global |
82 | -- Check from StepReaderData's GlobalCheck |
83 | |
84 | AnalyseRecord (me : in out; |
85 | num : Integer; anent : mutable Transient; acheck : in out Check) |
86 | returns Boolean; |
87 | ---Purpose : fills an entity, given record no; works by using a ReaderLib |
88 | -- to load each entity, which must be a Transient |
89 | -- Actually, returned value is True if no fail, False else |
90 | |
91 | EndRead (me : in out; amodel : mutable InterfaceModel) is redefined; |
92 | ---Purpose : Ends file reading after reading all the entities |
93 | -- Here, it binds in the model, Idents to Entities (for checks) |
94 | |
95 | fields |
96 | |
97 | thereco : FileRecognizer; |
98 | theglib : GeneralLib; |
99 | therlib : ReaderLib; |
100 | |
101 | end StepReaderTool; |