1 -- Created on: 1993-09-06
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1993-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 IGESDumper from IGESData
19 ---Purpose : Provides a way to obtain a clear Dump of an IGESEntity
20 -- (distinct from normalized output). It works with tools
21 -- attached to Entities, as for normalized Reade and Write
23 -- For each Entity, displaying data is splitted in own data
24 -- (specific to each type) and other attached data, which are
25 -- defined for all IGES Types (either from "Directory Entry" or
26 -- from Lists of Associativities and Properties)
28 uses Messenger from Message, Protocol from IGESData, IGESModel, IGESEntity, SpecificLib
34 Create (model : IGESModel; protocol : Protocol from IGESData)
36 ---Purpose : Returns an IGESDumper ready to work. The IGESModel provides
37 -- the numbering of Entities : as for any InterfaceModel, it
38 -- gives each Entity a number; but for IGESEntities, the "Number
39 -- of Directory Entry" according to the definition of IGES Files,
42 PrintDNum (me; ent : IGESEntity; S : Messenger from Message)
43 ---Purpose : Prints onto an output, the "Number of Directory Entry" which
44 -- corresponds to an IGESEntity in the IGESModel, under the form
45 -- "D#nnn" (a Null Handle gives D#0)
46 raises InterfaceError;
47 -- Error if <ent> is not contained in the IGESModel
49 PrintShort (me; ent : IGESEntity; S : Messenger from Message)
50 ---Purpose : Prints onto an output, the "Number of Directory Entry" (see
51 -- PrintDNum) plus IGES Type and Form Numbers, which gives
52 -- "D#nnn Type nnn Form nnn"
53 raises InterfaceError;
54 -- Error if <ent> is not contained in the IGESModel
56 Dump (me; ent : IGESEntity; S : Messenger from Message;
57 own : Integer; attached : Integer = -1)
58 -- <own> commands level for proper data :
59 -- 0 : Only DNum (PrintDNum)
60 -- 1 : DNum with IGES Type and Form N0s (PrintShort) & Type Name
61 -- 2 : idem plus (if defined) DNum of Transf and of View, and
62 -- (if defined) ShortLabel and Subscript Number
63 -- 3 : idem plus (if defined) Value of Transf, DNum or Value of
64 -- other Directory Data (Color, etc...)
65 -- 4 and over : idem plus calls method OwnDump
67 -- When Implementing OwnDump, Please use this convention :
68 -- Anyway, give true complete IGES Name for Entity
69 -- 4 : proper values as store in the fields of the Entity,
70 -- abbreviated if list is very long ...
71 -- 5 : idem but complete display of fields (even if long)
72 -- 6 : data under a comprehensive form if necessary, especially
73 -- taking in account Transf (e.g. for a Circle : give in 3D
74 -- Center, Radius, Axis ...)
75 -- In addition, for referenced Entities, simply display them by
76 -- call to PrintDNum above
78 -- <attached> commands level for Properties and Associativities
79 -- with same signification as <own>, except for value 0 :
80 -- if <own> = 0 or 1, these lists are NOT printed at all
81 -- if <own> = 2, for each attached entity, call to PrintDNum
82 -- if <own> over 2, for each attached entity, call to PrintShort
83 -- (DNum with Type and Form numbers)
84 -- In addition, -1 inhibits output (only DNum are printed)
85 raises InterfaceError;
86 -- Error if <ent> is not contained in the IGESModel
87 -- Remark : if <ent> is Null, the message "(Null)" is displayed
90 OwnDump (me; ent : IGESEntity; S : Messenger from Message; own : Integer);
91 ---Purpose : Specific Dump for each IGES Entity, call by Dump (just above)
92 -- <own> is the parameter <own> from Dump