1 -- Created on: 2000-08-17
2 -- Created by: Andrey BETENEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class Writer from IGESCAFControl inherits Writer from IGESControl
18 ---Purpose: Provides a tool to write DECAF document to the
19 -- IGES file. Besides transfer of shapes (including
20 -- assemblies) provided by IGESControl, supports also
21 -- colors and part names
22 -- IGESCAFControl_Writer writer();
23 -- Methods for writing IGES file:
24 -- writer.Transfer (Document);
25 -- writer.Write("filename") or writer.Write(OStream) or
26 -- writer.Perform(Document,"filename");
27 -- Methods for managing the writing of attributes.
29 -- writer.SetColorMode(colormode);
30 -- Standard_Boolean colormode = writer.GetColorMode();
32 -- writer.SetLayerMode(layermode);
33 -- Standard_Boolean layermode = writer.GetLayerMode();
35 -- writer.SetNameMode(namemode);
36 -- Standard_Boolean namemode = writer.GetNameMode();
39 AsciiString from TCollection,
41 MapOfShape from TopTools,
42 WorkSession from XSControl,
43 Document from TDocStd,
44 LabelSequence from TDF,
46 DataMapOfShapeStyle from XCAFPrs,
47 DataMapOfStyleTransient from XCAFPrs
50 Create returns Writer;
51 ---Purpose: Creates a writer with an empty
52 -- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
54 Create (WS : WorkSession from XSControl;
55 scratch : Boolean = Standard_True) returns Writer;
56 ---Purpose: Creates a reader tool and attaches it to an already existing Session
57 -- Clears the session if it was not yet set for IGES
59 Transfer (me : in out; doc : Document from TDocStd)
61 ---Purpose: Transfers a document to a IGES model
62 -- Returns True if translation is OK
64 Perform (me : in out; doc : Document from TDocStd;
65 filename: AsciiString from TCollection)
68 Perform (me : in out; doc : Document from TDocStd; filename: CString)
70 ---Purpose : Transfers a document and writes it to a IGES file
71 -- Returns True if translation is OK
73 ---Scope: Internal methods
75 Transfer (me : in out; labels: LabelSequence from TDF)
76 returns Boolean is protected;
77 ---Purpose: Transfers labels to a IGES model
78 -- Returns True if translation is OK
80 WriteAttributes (me: in out; labels: LabelSequence from TDF)
81 returns Boolean is protected;
82 ---Purpose: Reads colors from DECAF document and assigns them
83 -- to corresponding IGES entities
85 MakeColors (me: in out; S: Shape from TopoDS; settings: DataMapOfShapeStyle from XCAFPrs;
86 colors: in out DataMapOfStyleTransient from XCAFPrs;
87 Map: in out MapOfShape from TopTools;
88 inherit: Style from XCAFPrs) is private;
89 ---Purpose: Recursively iterates on subshapes and assigns colors
90 -- to faces and edges (if set)
92 WriteLayers (me: in out; labels: LabelSequence from TDF)
93 returns Boolean is protected;
94 ---Purpose: Reads layers from DECAF document and assigns them
95 -- to corresponding IGES entities
97 WriteNames (me: in out; labels: LabelSequence from TDF)
98 returns Boolean is protected;
99 ---Purpose: Recursivile iterates on subshapes and assign names
102 --- Work with fileds for different mode of writing IGES file.
104 SetColorMode(me: in out; colormode: Boolean from Standard);
105 ---Purpose: Set ColorMode for indicate write Colors or not.
107 GetColorMode(me) returns Boolean;
109 SetNameMode(me: in out; namemode: Boolean from Standard);
110 ---Purpose: Set NameMode for indicate write Name or not.
112 GetNameMode(me) returns Boolean;
114 SetLayerMode(me: in out; layermode: Boolean from Standard);
115 ---Purpose: Set LayerMode for indicate write Layers or not.
117 GetLayerMode(me) returns Boolean;
121 myColorMode: Boolean;
123 myLayerMode: Boolean;