b311480e |
1 | -- Created on: 1994-03-14 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class StepDumper from StepData |
18 | |
19 | ---Purpose : Provides a way to dump entities processed through STEP, with |
20 | -- these features : |
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. |
27 | |
28 | uses Messenger from Message, Transient, Protocol from StepData, StepModel, |
29 | GeneralLib, StepWriter, WriterLib |
30 | |
31 | raises InterfaceMismatch |
32 | |
33 | is |
34 | |
35 | Create (amodel : StepModel; protocol : Protocol from StepData; mode : Integer = 0) |
36 | returns StepDumper; |
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 |
45 | |
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 ... |
49 | ---C++ : return & |
50 | |
51 | Dump (me : in out; S : Messenger from Message; ent : Transient; level : Integer) |
52 | returns Boolean |
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 |
66 | -- |
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. |
73 | |
74 | Dump (me : in out; S : Messenger from Message; num : Integer; level : Integer) |
75 | returns Boolean |
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 |
81 | |
82 | fields |
83 | |
84 | themodel : StepModel; |
85 | theslib : GeneralLib; |
86 | thewlib : WriterLib; |
87 | thewriter : StepWriter; |
88 | |
89 | end StepDumper; |