0025279: OCCT fails to read VRML file created by OCCT
[occt.git] / src / VrmlAPI / VrmlAPI_Writer.cdl
CommitLineData
b311480e 1-- Created on: 2000-06-20
2-- Created by: Sergey MOZOKHIN
973c2be1 3-- Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4--
973c2be1 5-- This file is part of Open CASCADE Technology software library.
b311480e 6--
d5f74e42 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
973c2be1 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.
b311480e 12--
973c2be1 13-- Alternatively, this file may be used under the terms of Open CASCADE
14-- commercial license or contractual agreement.
7fd59977 15
16class Writer from VrmlAPI
17
18 ---Purpose: Creates and writes VRML files from Open
19 -- CASCADE shapes. A VRML file can be written to
20 -- an existing VRML file or to a new one.
21
22uses
23 Shape from TopoDS,
24 Drawer from VrmlConverter,
25 Projector from VrmlConverter,
26 Material from Vrml,
27 Length from Quantity,
28 HArray1OfColor from Quantity,
29 RepresentationOfShape from VrmlAPI
30is
31 Create returns Writer from VrmlAPI;
32 ---Purpose: Creates a writer object with default parameters.
33 ResetToDefaults(me : in out);
34 ---Purpose: Resets all parameters (representation, deflection)
35 -- to their default values..
36
37 Drawer(me) returns Drawer from VrmlConverter;
38 ---Purpose: Returns drawer object
39
40 SetDeflection(me : in out; aDef : Real from Standard);
41 ---Purpose: Sets the deflection aDef of
42 -- the mesh algorithm which is used to compute the shaded
43 -- representation of the translated shape. The default
44 -- value is -1. When the deflection value is less than
45 -- 0, the deflection is calculated from the relative
46 -- size of the shaped.
47
48 SetRepresentation(me : in out; aRep : RepresentationOfShape from VrmlAPI);
49 ---Purpose: Sets the representation of the
50 -- shape aRep which is written to the VRML file. The three options are :
51 -- - shaded
52 -- - wireframe
53 -- - both shaded and wireframe (default)
54 -- defined through the VrmlAPI_RepresentationOfShape enumeration.
55
56 SetTransparencyToMaterial(me : in out; aMaterial : in out Material from Vrml;
57 aTransparency : Real from Standard);
58 ---Purpose: Set transparency to given material
59
60 SetShininessToMaterial(me : in out; aMaterial : in out Material from Vrml;
61 aShininess : Real from Standard);
62 SetAmbientColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
63 Color : HArray1OfColor from Quantity);
64 SetDiffuseColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
65 Color : HArray1OfColor from Quantity);
66 SetSpecularColorToMaterial(me : in out; aMaterial : in out Material from Vrml;
67 Color : HArray1OfColor from Quantity);
68 SetEmissiveColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
69 Color : HArray1OfColor from Quantity);
70 ----------------- Returns fields of class --------------------------------------
71 GetRepresentation(me) returns RepresentationOfShape from VrmlAPI;
72 ---Purpose: Returns the representation of the shape which is
73 -- written to the VRML file. Types of representation are set through the
74 -- VrmlAPI_RepresentationOfShape enumeration.
75 GetFrontMaterial(me) returns Material from Vrml;
76 GetPointsMaterial(me) returns Material from Vrml;
77 GetUisoMaterial(me) returns Material from Vrml;
78 GetVisoMaterial(me) returns Material from Vrml;
79 GetLineMaterial(me) returns Material from Vrml;
80 GetWireMaterial(me) returns Material from Vrml;
81 GetFreeBoundsMaterial(me) returns Material from Vrml;
82 GetUnfreeBoundsMaterial(me) returns Material from Vrml;
83
f5fa6b33 84 Write(me; aShape : Shape from TopoDS; aFile : CString from Standard; aVersion: Integer = 2);
7fd59977 85 ---Purpose: Converts the shape aShape to
f5fa6b33 86 -- VRML format of the passed version and writes it to the file identified by aFile.
87
88 write_v1(me; aShape: Shape from TopoDS; aFileName: CString from Standard)
89 is protected;
90 ---Purpose: Converts the shape aShape to VRML format of version 1.0 and writes it
91 -- to the file identified by aFileName using default parameters.
92
93 write_v2(me; aShape: Shape from TopoDS; aFileName: CString from Standard)
94 is protected;
95 ---Purpose: Converts the shape aShape to VRML format of version 2.0 and writes it
96 -- to the file identified by aFileName using default parameters.
7fd59977 97
98fields
99 myRepresentation : RepresentationOfShape from VrmlAPI;
100 myDrawer : Drawer from VrmlConverter;
101 myDeflection : Real from Standard;
102 myPerespectiveCamera : Projector from VrmlConverter;
103 myOrthographicCamera : Projector from VrmlConverter;
104 myTransparency : Real;
105 myShininess : Real;
106 myFrontMaterial : Material from Vrml;
107 myPointsMaterial : Material from Vrml;
108 myUisoMaterial : Material from Vrml;
109 myVisoMaterial : Material from Vrml;
110 myLineMaterial : Material from Vrml;
111 myWireMaterial : Material from Vrml;
112 myFreeBoundsMaterial : Material from Vrml;
113 myUnfreeBoundsMaterial : Material from Vrml;
114 --Projection Vector
115 DX : Length from Quantity;
116 DY : Length from Quantity;
117 DZ : Length from Quantity;
118 --High Point Direction
119 XUp : Length from Quantity;
120 YUp : Length from Quantity;
121 ZUp : Length from Quantity;
122 --Focus
123 Focus : Length from Quantity;
124end Writer;