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
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 class StepReaderTool from StepData inherits FileReaderTool
19 ---Purpose : Specific FileReaderTool for Step; works with FileReaderData
20 -- provides references evaluation, plus access to litteral data
21 -- and specific methods defined by FileReaderTool
22 -- Remarks : works with a ReaderLib to load Entities
24 uses Integer, Boolean, Transient,
25 InterfaceModel, Check, GeneralLib, ReaderLib,
26 StepReaderData, FileRecognizer, Protocol from StepData
30 -- -- File data storing and access (specific) -- --
32 Create (reader : StepReaderData; protocol : Protocol from StepData)
33 returns StepReaderTool;
34 ---Purpose : creates StepReaderTool to work with a StepReaderData according
35 -- to a Step Protocol. Defines the ReaderLib at this time
37 -- -- setting empty entities before loading model -- --
39 Prepare (me : in out; optimize : Boolean = Standard_True);
40 ---Purpose : Bounds empty entities to records, uses default Recognition
41 -- provided by ReaderLib and ReaderModule. Also calls computation
42 -- of references (SetEntityNumbers from StepReaderData)
43 -- Works only on data entities (skips header)
44 -- <optimize> given False allows to test some internal algorithms
45 -- which are normally avoided (see also StepReaderData)
47 Prepare (me : in out; reco : FileRecognizer;
48 optimize : Boolean = Standard_True);
49 ---Purpose : Bounds empty entities to records, works with a specific
50 -- FileRecognizer, stored and later used in Recognize
51 -- Works only on data entities (skips header)
52 -- <optimize : same as above
54 Recognize (me : in out; num : Integer;
55 ach : in out Check; ent : out Transient)
57 ---Purpose : recognizes records, by asking either ReaderLib (default) or
58 -- FileRecognizer (if defined) to do so. <ach> is to call
61 -- -- managing Header -- --
62 -- Header is defined as a list of StepEntities (without ident)
64 PrepareHeader (me : in out; reco : FileRecognizer);
65 ---Purpose : bounds empty entities and sub-lists to header records
66 -- works like Prepare + SetEntityNumbers, but for header
67 -- (N.B.: in Header, no Ident and no reference)
68 -- FileRecognizer is to specify Entities which are allowed to be
69 -- defined in the Header (not every type can be)
71 -- -- loading entities into the model -- --
73 BeginRead (me : in out; amodel : InterfaceModel);
74 ---Purpose : fills model's header; that is, gives to it Header entities
75 -- and commands their loading. Also fills StepModel's Global
76 -- Check from StepReaderData's GlobalCheck
78 AnalyseRecord (me : in out;
79 num : Integer; anent : Transient; acheck : in out Check)
81 ---Purpose : fills an entity, given record no; works by using a ReaderLib
82 -- to load each entity, which must be a Transient
83 -- Actually, returned value is True if no fail, False else
85 EndRead (me : in out; amodel : InterfaceModel) is redefined;
86 ---Purpose : Ends file reading after reading all the entities
87 -- Here, it binds in the model, Idents to Entities (for checks)
91 thereco : FileRecognizer;