42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _StepData_StepDumper_HeaderFile |
18 | #define _StepData_StepDumper_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Interface_GeneralLib.hxx> |
25 | #include <StepData_WriterLib.hxx> |
26 | #include <StepData_StepWriter.hxx> |
27 | #include <Standard_Integer.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | class StepData_StepModel; |
30 | class Interface_InterfaceMismatch; |
31 | class StepData_Protocol; |
32 | class StepData_StepWriter; |
33 | class Message_Messenger; |
34 | class Standard_Transient; |
35 | |
36 | |
37 | //! Provides a way to dump entities processed through STEP, with |
38 | //! these features : |
39 | //! - same form as for writing a STEP File (because it is clear |
40 | //! and compact enough, even if the names of the fields do not |
41 | //! appear) : thus, no additionnal resource is required |
42 | //! - possibility to look for an entity itself (only its Type or |
43 | //! with its content), an entity and it shared items (one level) |
44 | //! or all the entities its refers to, directly or recursively. |
45 | class StepData_StepDumper |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | //! Creates a StepDumper, able to work on a given StepModel |
53 | //! (which defines the total scope for dumping entities) and |
54 | //! a given Protocol from Step (which defines the authorized |
55 | //! types to be dumped) |
56 | //! <mode> commands what is to be displayed (number or label) |
57 | //! 0 for number (and corresponding labels are displayed apart) |
58 | //! 1 for label (and corresponding numbers are displayed apart) |
59 | //! 2 for label without anymore |
60 | Standard_EXPORT StepData_StepDumper(const Handle(StepData_StepModel)& amodel, const Handle(StepData_Protocol)& protocol, const Standard_Integer mode = 0); |
61 | |
62 | //! Gives an access to the tool which is used to work : this allow |
63 | //! to acts on some parameters : Floating Format, Scopes ... |
64 | Standard_EXPORT StepData_StepWriter& StepWriter(); |
65 | |
66 | //! Dumps a Entity on an Messenger. Returns True if |
67 | //! sucess, False, if the entity to dump has not been recognized |
68 | //! by the Protocol. <level> can have one of these values : |
69 | //! - 0 : prints the TYPE only, as known in STEP Files (StepType) |
70 | //! If <ent> has not been regognized by the Protocol, or if its |
71 | //! type is Complex, the StepType is replaced by the display of |
72 | //! the cdl type. Complex Type are well processed by level 1. |
73 | //! - 1 : dumps the entity, completely (whatever it has simple or |
74 | //! complex type) but alone. |
75 | //! - 2 : dumps the entity completely, plus the item its refers to |
76 | //! at first level (a header message designates the starting |
77 | //! entity of the dump) <Lists Shared and Implied> |
78 | //! - 3 : dumps the entity and its refered items at any levels |
79 | //! |
80 | //! For levels 1,2,3, the numbers displayed (form #nnn) are the |
81 | //! numbers of the corresponding entities in the Model |
82 | Standard_EXPORT Standard_Boolean Dump (const Handle(Message_Messenger)& S, const Handle(Standard_Transient)& ent, const Standard_Integer level); |
83 | |
84 | //! Works as Dump with a Transient, but directly takes the |
85 | //! entity designated by its number in the Model |
86 | //! Returns False, also if <num> is out of range |
87 | Standard_EXPORT Standard_Boolean Dump (const Handle(Message_Messenger)& S, const Standard_Integer num, const Standard_Integer level); |
88 | |
89 | |
90 | |
91 | |
92 | protected: |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | private: |
99 | |
100 | |
101 | |
102 | Handle(StepData_StepModel) themodel; |
103 | Interface_GeneralLib theslib; |
104 | StepData_WriterLib thewlib; |
105 | StepData_StepWriter thewriter; |
106 | |
107 | |
108 | }; |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | #endif // _StepData_StepDumper_HeaderFile |