7fd59977 |
1 | -- File: XSControl_TransferWriter.cdl |
2 | -- Created: Wed Mar 13 09:49:23 1996 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@fidox> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | |
8 | class TransferWriter from XSControl inherits TShared |
9 | |
10 | ---Purpose : TransferWriter gives help to control transfer to write a file |
11 | -- after having converted data from Cascade/Imagine |
12 | -- |
13 | -- It works with a Controller (which itself can work with an |
14 | -- Actor to Write) and a FinderProcess. It records results and |
15 | -- checks |
16 | |
17 | uses Transient, |
18 | Shape from TopoDS, |
19 | CheckIterator from Interface, |
20 | InterfaceModel from Interface, |
21 | FinderProcess, Controller, ReturnStatus |
22 | |
23 | is |
24 | |
25 | Create returns mutable TransferWriter; |
26 | ---Purpose : Creates a TransferWriter, empty, ready to run |
27 | -- with an empty FinderProcess (but no controller, etc) |
28 | |
29 | FinderProcess (me) returns mutable FinderProcess; |
30 | ---Purpose : Returns the FinderProcess itself |
31 | |
32 | SetFinderProcess (me : mutable; FP : mutable FinderProcess); |
33 | ---Purpose : Sets a new FinderProcess and forgets the former one |
34 | |
35 | Controller (me) returns Controller; |
36 | ---Purpose : Returns the currently used Controller |
37 | |
38 | SetController (me : mutable; ctl : Controller); |
39 | ---Purpose : Sets a new Controller, also sets a new FinderProcess |
40 | |
41 | Clear (me : mutable; mode : Integer); |
42 | ---Purpose : Clears recorded data according a mode |
43 | -- 0 clears FinderProcess (results, checks) |
44 | -- -1 create a new FinderProcess |
45 | |
46 | TransferMode (me) returns Integer; |
47 | ---Purpose : Returns the current Transfer Mode (an Integer) |
48 | -- It will be interpreted by the Controller to run Transfers |
49 | -- This call form could be later replaced by more specific ones |
50 | -- (parameters suited for each norm / transfer case) |
51 | |
52 | SetTransferMode (me : mutable; mode : Integer); |
53 | ---Purpose : Changes the Transfer Mode |
54 | |
55 | PrintStats (me; what : Integer; mode : Integer = 0); |
56 | ---Purpose : Prints statistics on current Trace File, according what,mode |
57 | -- See PrintStatsProcess for details |
58 | |
59 | -- Operations themselves |
60 | |
61 | RecognizeTransient (me : mutable; obj : Transient) returns Boolean; |
62 | ---Purpose : Tells if a transient object (from an application) is a valid |
63 | -- candidate for a transfer to a model |
64 | -- Asks the Controller (RecognizeWriteTransient) |
65 | -- If <obj> is a HShape, calls RecognizeShape |
66 | |
67 | TransferWriteTransient (me : mutable; model : mutable InterfaceModel; |
68 | obj : Transient) |
69 | returns ReturnStatus; |
70 | ---Purpose : Transfers a Transient object (from an application) to a model |
71 | -- of current norm, according to the last call to SetTransferMode |
72 | -- Works by calling the Controller |
73 | -- Returns status : =0 if OK, >0 if error during transfer, <0 if |
74 | -- transfer badly initialised |
75 | |
76 | RecognizeShape (me : mutable; shape : Shape from TopoDS) returns Boolean; |
77 | ---Purpose : Tells if a Shape is valid for a transfer to a model |
78 | -- Asks the Controller (RecognizeWriteShape) |
79 | |
80 | TransferWriteShape (me : mutable; model : mutable InterfaceModel; |
81 | shape : Shape from TopoDS) |
82 | returns ReturnStatus; |
83 | ---Purpose : Transfers a Shape from CasCade to a model of current norm, |
84 | -- according to the last call to SetTransferMode |
85 | -- Works by calling the Controller |
86 | -- Returns status : =0 if OK, >0 if error during transfer, <0 if |
87 | -- transfer badly initialised |
88 | |
89 | CheckList (me) returns CheckIterator; |
90 | ---Purpose : Returns the check-list of last transfer (write), i.e. the |
91 | -- check-list currently recorded in the FinderProcess |
92 | |
93 | ResultCheckList (me; model : InterfaceModel) returns CheckIterator; |
94 | ---Purpose : Returns the check-list of last transfer (write), but tries |
95 | -- to bind to each check, the resulting entity in the model |
96 | -- instead of keeping the original Mapper, whenever known |
97 | |
98 | PrintStatsProcess (myclass; TP : FinderProcess; |
99 | what : Integer; mode : Integer = 0); |
100 | ---Purpose : Forecast to print statitics about a FinderProcess |
101 | |
102 | fields |
103 | |
104 | theController : Controller; |
105 | theTransferWrite : FinderProcess; |
106 | theTransferMode : Integer; |
107 | |
108 | end TransferWriter; |