7fd59977 |
1 | -- File: IGESControl_Writer.cdl |
2 | -- Created: Tue Jan 30 18:57:48 1996 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@paris1> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | |
8 | class Writer from IGESControl |
9 | |
10 | ---Purpose : This class creates and writes |
11 | -- IGES files from CAS.CADE models. An IGES file can be written to |
12 | -- an existing IGES file or to a new one. |
13 | -- The translation can be performed in one or several |
14 | -- operations. Each translation operation |
15 | -- outputs a distinct root entity in the IGES file. |
16 | -- To write an IGES file it is possible to use the following sequence: |
17 | -- To modify the IGES file header or to change translation |
18 | -- parameters it is necessary to use class Interface_Static (see |
19 | -- IGESParameters and GeneralParameters). |
20 | |
21 | uses CString, OStream, Transient, Shape from TopoDS, |
22 | FinderProcess, BasicEditor from IGESData, IGESModel, IGESEntity |
23 | |
24 | is |
25 | |
26 | Create returns Writer; |
27 | ---Purpose : Creates a writer object with the |
28 | -- default unit (millimeters) and write mode (Face). |
29 | -- IGESControl_Writer (const Standard_CString unit, |
30 | -- const Standard_Integer modecr = 0); |
31 | |
32 | Create (unit : CString; modecr : Integer = 0) returns Writer; |
33 | ---Purpose : Creates a writer with given |
34 | -- values for units and for write mode. |
35 | -- unit may be any unit that is accepted by the IGES standard. |
36 | -- By default, it is the millimeter. |
37 | -- modecr defines the write mode and may be: |
38 | -- - 0: Faces (default) |
39 | -- - 1: BRep. |
40 | |
41 | Create (model : mutable IGESModel; modecr : Integer = 0) returns Writer; |
42 | ---Purpose : Creates a writer object with the |
43 | -- prepared IGES model model in write mode. |
44 | -- modecr defines the write mode and may be: |
45 | -- - 0: Faces (default) |
46 | -- - 1: BRep. |
47 | |
48 | Model (me) returns IGESModel; |
49 | ---Purpose : Returns the IGES model to be written in output. |
50 | |
51 | TransferProcess (me) returns mutable FinderProcess; |
52 | SetTransferProcess (me : in out; TP : mutable FinderProcess); |
53 | ---Purpose : Returns/Sets the TransferProcess : it contains final results |
54 | -- and if some, check messages |
55 | |
56 | AddShape (me : in out; sh : Shape) returns Boolean; |
57 | ---Purpose : Translates a Shape to IGES Entities and adds them to the model |
58 | -- Returns True if done, False if Shape not suitable for IGES or null |
59 | |
60 | AddGeom (me : in out; geom : Transient) returns Boolean; |
61 | ---Purpose : Translates a Geometry (Surface or Curve) to IGES Entities and |
62 | -- adds them to the model |
63 | -- Returns True if done, False if geom is neither a Surface or |
64 | -- a Curve suitable for IGES or is null |
65 | |
66 | AddEntity (me : in out; ent : IGESEntity) returns Boolean; |
67 | ---Purpose : Adds an IGES entity (and the ones it references) to the model |
68 | |
69 | ComputeModel (me : in out); |
70 | ---Purpose : Computes the entities found in |
71 | -- the model, which is ready to be written. |
72 | -- This contrasts with the default computation of headers only. |
73 | |
74 | Write (me : in out; S : in out OStream; fnes : Boolean = Standard_False) |
75 | returns Boolean; |
76 | ---Purpose : Computes then writes the model to an OStream |
77 | -- Returns True when done, false in case of error |
78 | |
79 | Write (me : in out; file : CString; fnes : Boolean = Standard_False) |
80 | returns Boolean; |
81 | ---Purpose : Prepares and writes an IGES model |
82 | -- either to an OStream, S or to a file name,CString. |
83 | -- Returns True if the operation was performed correctly and |
84 | -- False if an error occurred (for instance, |
85 | -- if the processor could not create the file). |
86 | |
87 | PrintStatsTransfer (me; what : Integer; mode : Integer = 0); |
88 | ---Purpose : Prints Statistics about Transfer |
89 | |
90 | fields |
91 | |
92 | theTP : FinderProcess; |
93 | themod : IGESModel; |
94 | thedit : BasicEditor from IGESData; |
95 | thecr : Integer; -- mode ecr |
96 | thest : Boolean; -- computed ? |
97 | |
98 | end Writer; |