1 -- Created on: 1994-03-14
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1994-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 StepDumper from StepData
19 ---Purpose : Provides a way to dump entities processed through STEP, with
21 -- - same form as for writing a STEP File (because it is clear
22 -- and compact enough, even if the names of the fields do not
23 -- appear) : thus, no additionnal resource is required
24 -- - possibility to look for an entity itself (only its Type or
25 -- with its content), an entity and it shared items (one level)
26 -- or all the entities its refers to, directly or recursively.
28 uses Messenger from Message, Transient, Protocol from StepData, StepModel,
29 GeneralLib, StepWriter, WriterLib
31 raises InterfaceMismatch
35 Create (amodel : StepModel; protocol : Protocol from StepData; mode : Integer = 0)
37 ---Purpose : Creates a StepDumper, able to work on a given StepModel
38 -- (which defines the total scope for dumping entities) and
39 -- a given Protocol from Step (which defines the authorized
40 -- types to be dumped)
41 -- <mode> commands what is to be displayed (number or label)
42 -- 0 for number (and corresponding labels are displayed apart)
43 -- 1 for label (and corresponding numbers are displayed apart)
44 -- 2 for label without anymore
46 StepWriter (me : in out) returns StepWriter is static;
47 ---Purpose : Gives an access to the tool which is used to work : this allow
48 -- to acts on some parameters : Floating Format, Scopes ...
51 Dump (me : in out; S : Messenger from Message; ent : Transient; level : Integer)
53 ---Purpose : Dumps a Entity on an Messenger. Returns True if
54 -- sucess, False, if the entity to dump has not been recognized
55 -- by the Protocol. <level> can have one of these values :
56 -- - 0 : prints the TYPE only, as known in STEP Files (StepType)
57 -- If <ent> has not been regognized by the Protocol, or if its
58 -- type is Complex, the StepType is replaced by the display of
59 -- the cdl type. Complex Type are well processed by level 1.
60 -- - 1 : dumps the entity, completely (whatever it has simple or
61 -- complex type) but alone.
62 -- - 2 : dumps the entity completely, plus the item its refers to
63 -- at first level (a header message designates the starting
64 -- entity of the dump) <Lists Shared and Implied>
65 -- - 3 : dumps the entity and its refered items at any levels
67 -- For levels 1,2,3, the numbers displayed (form #nnn) are the
68 -- numbers of the corresponding entities in the Model
69 raises InterfaceMismatch;
70 -- Errors come from StepWriter, they especially occur when an
71 -- entity does not come from the starting Model.
72 -- Level 0 accepts an entity which does not come from the Model.
74 Dump (me : in out; S : Messenger from Message; num : Integer; level : Integer)
76 ---Purpose : Works as Dump with a Transient, but directly takes the
77 -- entity designated by its number in the Model
78 -- Returns False, also if <num> is out of range
79 raises InterfaceMismatch;
80 -- Errors : same as above
87 thewriter : StepWriter;