0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / IGESCAFControl / IGESCAFControl_Writer.cdl
1 -- Created on: 2000-08-17
2 -- Created by: Andrey BETENEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
4 --
5 -- This file is part of Open CASCADE Technology software library.
6 --
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.
12 --
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
15
16 class Writer from IGESCAFControl inherits Writer from IGESControl
17
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.
28         --   Colors
29         -- writer.SetColorMode(colormode);
30         -- Standard_Boolean colormode = writer.GetColorMode();
31         --   Layers
32         -- writer.SetLayerMode(layermode);
33         -- Standard_Boolean layermode = writer.GetLayerMode();
34         -- Names
35         -- writer.SetNameMode(namemode);
36         -- Standard_Boolean namemode = writer.GetNameMode();
37     
38 uses
39     AsciiString from TCollection,
40     Shape from TopoDS,
41     MapOfShape from TopTools,
42     WorkSession from XSControl,
43     Document from TDocStd,
44     LabelSequence from TDF,
45     Style from XCAFPrs,
46     DataMapOfShapeStyle from XCAFPrs,
47     DataMapOfStyleTransient from XCAFPrs
48 is
49
50     Create returns Writer;
51         ---Purpose: Creates a writer with an empty
52         -- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
53
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
58
59     Transfer (me : in out; doc : Document from TDocStd)
60     returns Boolean;
61         ---Purpose: Transfers a document to a IGES model
62         --          Returns True if translation is OK
63
64     Perform (me : in out; doc : Document from TDocStd;
65                           filename: AsciiString from TCollection)
66     returns Boolean;
67
68     Perform (me : in out; doc : Document from TDocStd; filename: CString)
69     returns Boolean;
70     ---Purpose : Transfers a document and writes it to a IGES file
71     --           Returns True if translation is OK
72
73     ---Scope: Internal methods
74
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
79
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
84
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)
91
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
96
97     WriteNames (me: in out; labels: LabelSequence from TDF)
98     returns Boolean is protected;
99         ---Purpose: Recursivile iterates on subshapes and assign names 
100         --          to IGES entity
101
102     --- Work with fileds for different mode of writing IGES file.
103
104     SetColorMode(me: in out; colormode: Boolean from Standard);
105         ---Purpose: Set ColorMode for indicate write Colors or not.
106
107     GetColorMode(me) returns Boolean;
108
109     SetNameMode(me: in out; namemode: Boolean from Standard);
110         ---Purpose: Set NameMode for indicate write Name or not.
111     
112     GetNameMode(me) returns Boolean;
113
114     SetLayerMode(me: in out; layermode: Boolean from Standard);
115         ---Purpose: Set LayerMode for indicate write Layers or not.
116
117     GetLayerMode(me) returns Boolean; 
118
119 fields
120
121     myColorMode: Boolean;
122     myNameMode:  Boolean;
123     myLayerMode: Boolean;
124
125 end Writer;