b311480e |
1 | -- Created on: 2000-06-23 |
2 | -- Created by: Sergey MOZOKHIN |
3 | -- Copyright (c) 2000-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | |
22 | class Writer from StlAPI |
23 | |
24 | ---Purpose: This class creates and writes |
25 | -- STL files from Open CASCADE shapes. An STL file can be |
26 | -- written to an existing STL file or to a new one.. |
27 | |
28 | uses |
29 | Shape from TopoDS, |
30 | Mesh from StlMesh |
31 | is |
32 | Create; |
33 | ---Purpose: Creates a writer object with |
34 | -- default parameters: ASCIIMode, RelativeMode, SetCoefficent, |
35 | -- SetDeflection. These parameters may be modified. |
36 | |
37 | SetDeflection(me: in out; aDeflection : in Real from Standard); |
38 | ---Purpose: Sets the deflection of the meshing algorithm. |
39 | -- Deflection is used, only if relative mode is false |
40 | |
41 | SetCoefficient(me: in out; aCoefficient : in Real from Standard); |
42 | ---Purpose: Sets the coeffiecient for computation of deflection through |
43 | -- relative size of shape. Default value = 0.001 |
44 | |
45 | RelativeMode(me: in out) returns Boolean; |
46 | ---C++: return & |
47 | ---Purpose: Returns the address to the |
48 | -- flag defining the relative mode for writing the file. |
49 | -- This address may be used to either read or change the flag. |
50 | -- If the mode returns True (default value), the |
51 | -- deflection is calculated from the relative size of the |
52 | -- shape. If the mode returns False, the user defined deflection is used. |
53 | -- Example |
54 | -- Read: |
55 | -- Standard_Boolean val = Writer.RelativeMode( ); |
56 | -- Modify: |
57 | -- Writer.RelativeMode( ) = Standard_True; |
58 | |
59 | ASCIIMode(me: in out) returns Boolean; |
60 | ---C++: return & |
61 | ---Purpose: Returns the address to the |
62 | -- flag defining the mode for writing the file. This address |
63 | -- may be used to either read or change the flag. |
64 | -- If the mode returns True (default value) the generated |
65 | -- file is an ASCII file. If the mode returns False, the |
66 | -- generated file is a binary file. |
67 | |
416d4426 |
68 | Write(me : in out; |
69 | aShape : Shape from TopoDS; |
70 | aFileName : CString from Standard; |
71 | InParallel : Boolean from Standard = Standard_False); |
7fd59977 |
72 | ---Purpose: Converts a given shape to STL format and writes it to file with a given filename. |
73 | |
74 | fields |
75 | theRelativeMode : Boolean from Standard; |
76 | theASCIIMode : Boolean from Standard; |
77 | theDeflection : Real from Standard; |
78 | theCoefficient : Real from Standard; |
79 | theStlMesh : Mesh from StlMesh; |
80 | end Writer; |