summaryrefslogtreecommitdiff
path: root/inc/XSControl_WorkSession.hxx
blob: 0ca8664ba93a75761ae2a025a61b57e5c002e867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _XSControl_WorkSession_HeaderFile
#define _XSControl_WorkSession_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_XSControl_WorkSession_HeaderFile
#include <Handle_XSControl_WorkSession.hxx>
#endif

#ifndef _Handle_XSControl_Controller_HeaderFile
#include <Handle_XSControl_Controller.hxx>
#endif
#ifndef _Handle_XSControl_TransferReader_HeaderFile
#include <Handle_XSControl_TransferReader.hxx>
#endif
#ifndef _Handle_XSControl_TransferWriter_HeaderFile
#include <Handle_XSControl_TransferWriter.hxx>
#endif
#ifndef _Handle_Dico_DictionaryOfTransient_HeaderFile
#include <Handle_Dico_DictionaryOfTransient.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_XSControl_Vars_HeaderFile
#include <Handle_XSControl_Vars.hxx>
#endif
#ifndef _IFSelect_WorkSession_HeaderFile
#include <IFSelect_WorkSession.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_Message_Messenger_HeaderFile
#include <Handle_Message_Messenger.hxx>
#endif
#ifndef _Handle_Transfer_TransientProcess_HeaderFile
#include <Handle_Transfer_TransientProcess.hxx>
#endif
#ifndef _Handle_Standard_Transient_HeaderFile
#include <Handle_Standard_Transient.hxx>
#endif
#ifndef _Handle_Interface_InterfaceModel_HeaderFile
#include <Handle_Interface_InterfaceModel.hxx>
#endif
#ifndef _Handle_Transfer_FinderProcess_HeaderFile
#include <Handle_Transfer_FinderProcess.hxx>
#endif
#ifndef _IFSelect_ReturnStatus_HeaderFile
#include <IFSelect_ReturnStatus.hxx>
#endif
class XSControl_Controller;
class XSControl_TransferReader;
class XSControl_TransferWriter;
class Dico_DictionaryOfTransient;
class XSControl_Vars;
class Message_Messenger;
class Transfer_TransientProcess;
class Standard_Transient;
class Interface_InterfaceModel;
class Transfer_FinderProcess;
class TopoDS_Shape;
class Interface_CheckIterator;


//! This WorkSession completes the basic one, by adding : <br>
//!           - use of Controller, with norm selection... <br>
//!           - management of transfers (both ways) with auxiliary classes <br>
//!             TransferReader and TransferWriter <br>
//!            -> these transfers may work with a Context List : its items <br>
//!               are given by the user, according to the transfer to be <br>
//!               i.e. it is interpreted by the Actors <br>
//!               Each item is accessed by a Name <br>
class XSControl_WorkSession : public IFSelect_WorkSession {

public:

  
  Standard_EXPORT   XSControl_WorkSession();
  //! In addition to basic ClearData, clears Transfer and Management <br>
//!           for interactive use, for mode = 0,1,2 and over 4 <br>
//!           Plus : mode = 5 to clear Transfers (both ways) only <br>
//!                  mode = 6 to clear enforced results <br>
//!                  mode = 7 to clear transfers, results <br>
  Standard_EXPORT   virtual  void ClearData(const Standard_Integer mode) ;
  //! Selects a Norm defined by its name. <br>
//!           A Norm is described and handled by a Controller <br>
//!           Returns True if done, False if <normname> is unknown <br>
//! <br>
//!           A Profile may be set too. If no Profile is provided, the <br>
//!           current Profile for this Norm is taken <br>
//!           If the asked Profile is not defined for this Norm, it remains <br>
//!           in current Profile, returned value is True <br>
  Standard_EXPORT     Standard_Boolean SelectNorm(const Standard_CString normname,const Standard_CString profile = "") ;
  //! Sets a Profile as current for the current Norm <br>
//!           Returns True if done, False if <profile> is unknown for this norm <br>
//! <br>
//!           For more infos on Profile, query the Profile of the Controller <br>
  Standard_EXPORT     Standard_Boolean SelectProfile(const Standard_CString profile) ;
  //! Selects a Norm defined by its Controller itself <br>
  Standard_EXPORT     void SetController(const Handle(XSControl_Controller)& ctl) ;
  //! This method is called once a new norm has been successfully <br>
//!           selected. It can be redefined, default does nothing <br>
  Standard_EXPORT   virtual  void AdaptNorm() ;
  //! Returns the name of the last Selected Norm. If none is <br>
//!           defined, returns an empty string <br>
//!           By default, returns the complete name of the norm <br>
//!           If <rsc> is True, returns the short name used for resource <br>
  Standard_EXPORT     Standard_CString SelectedNorm(const Standard_Boolean rsc = Standard_False) const;
  //! Returns the norm controller itself <br>
  Standard_EXPORT     Handle_XSControl_Controller NormAdaptor() const;
  //! Returns the current Context List, Null if not defined <br>
//!           The Context is given to the TransientProcess for TransferRead <br>
  Standard_EXPORT     Handle_Dico_DictionaryOfTransient Context() const;
  //! Sets the current Context List, as a whole <br>
//!           Sets it to the TransferReader <br>
  Standard_EXPORT     void SetAllContext(const Handle(Dico_DictionaryOfTransient)& context) ;
  //! Clears the whole current Context (nullifies it) <br>
  Standard_EXPORT     void ClearContext() ;
  //! Prints the transfer status of a transferred item, as beeing <br>
//!           the Mapped n0 <num>, from MapWriter if <wri> is True, or <br>
//!           from MapReader if <wri> is False <br>
//!           Returns True when done, False else (i.e. num out of range) <br>
  Standard_EXPORT     Standard_Boolean PrintTransferStatus(const Standard_Integer num,const Standard_Boolean wri,const Handle(Message_Messenger)& S) const;
  //! Sets a Transfer Reader, by internal ways, according mode : <br>
//!           0 recreates it clear,  1 clears it (does not recreate) <br>
//!           2 aligns Roots of TransientProcess from final Results <br>
//!           3 aligns final Results from Roots of TransientProcess <br>
//!           4 begins a new transfer (by BeginTransfer) <br>
//!           5 recreates TransferReader then begins a new transfer <br>
  Standard_EXPORT     void InitTransferReader(const Standard_Integer mode) ;
  //! Sets a Transfer Reader, which manages transfers on reading <br>
  Standard_EXPORT     void SetTransferReader(const Handle(XSControl_TransferReader)& TR) ;
  //! Returns the Transfer Reader, Null if not set <br>
  Standard_EXPORT     Handle_XSControl_TransferReader TransferReader() const;
  //! Returns the TransientProcess(internal data for TransferReader) <br>
  Standard_EXPORT     Handle_Transfer_TransientProcess MapReader() const;
  //! Changes the Map Reader, i.e. considers that the new one <br>
//!           defines the relevant read results (forgets the former ones) <br>
//!           Returns True when done, False in case of bad definition, i.e. <br>
//!           if Model from TP differs from that of Session <br>
  Standard_EXPORT     Standard_Boolean SetMapReader(const Handle(Transfer_TransientProcess)& TP) ;
  //! Returns the result attached to a starting entity <br>
//!           If <mode> = 0, returns Final Result <br>
//!           If <mode> = 1, considers Last Result <br>
//!           If <mode> = 2, considers Final, else if absent, Last <br>
//!             returns it as Transient, if result is not transient returns <br>
//!             the Binder <br>
//!           <mode> = 10,11,12 idem but returns the Binder itself <br>
//!             (if it is not, e.g. Shape, returns the Binder) <br>
//!           <mode> = 20, returns the ResultFromModel <br>
  Standard_EXPORT     Handle_Standard_Transient Result(const Handle(Standard_Transient)& ent,const Standard_Integer mode) const;
  //! Commands the transfer of, either one entity, or a list <br>
//!           I.E. calls the TransferReader after having analysed <ents> <br>
//!           It is cumulated from the last BeginTransfer <br>
//!           <ents> is processed by GiveList, hence : <br>
//!           - <ents> a Selection : its SelectionResult <br>
//!           - <ents> a HSequenceOfTransient : this list <br>
//!           - <ents> the Model : in this specific case, all the roots, <br>
//!             with no cumulation of former transfers (TransferReadRoots) <br>
  Standard_EXPORT     Standard_Integer TransferReadOne(const Handle(Standard_Transient)& ents) ;
  //! Commands the transfer of all the root entities of the model <br>
//!           i.e. calls TransferRoot from the TransferReader with the Graph <br>
//!           No cumulation with former calls to TransferReadOne <br>
  Standard_EXPORT     Standard_Integer TransferReadRoots() ;
  //! produces and returns a new Model well conditionned <br>
//!           It is produced by the Norm Controller <br>
//!           It can be Null (if this function is not implemented) <br>
  Standard_EXPORT     Handle_Interface_InterfaceModel NewModel() ;
  //! Returns the Transfer Reader, Null if not set <br>
  Standard_EXPORT     Handle_XSControl_TransferWriter TransferWriter() const;
  //! Returns the FinderProcess (internal data for TransferWriter) <br>
  Standard_EXPORT     Handle_Transfer_FinderProcess MapWriter() const;
  //! Changes the Map Reader, i.e. considers that the new one <br>
//!           defines the relevant read results (forgets the former ones) <br>
//!           Returns True when done, False if <FP> is Null <br>
  Standard_EXPORT     Standard_Boolean SetMapWriter(const Handle(Transfer_FinderProcess)& FP) ;
  //! Sets a mode to transfer Shapes from CasCade to entities of the <br>
//!           current norm, which interprets it (see various Controllers) <br>
//!           This call form could be later replaced by a more general one <br>
  Standard_EXPORT     void SetModeWriteShape(const Standard_Integer mode) ;
  //! Records the current Mode to Write Shapes <br>
  Standard_EXPORT     Standard_Integer ModeWriteShape() const;
  //! Transfers a Shape from CasCade to a model of current norm, <br>
//!           according to the last call to SetModeWriteShape <br>
//!           Returns status :Done if OK, Fail if error during transfer, <br>
//!             Error if transfer badly initialised <br>
  Standard_EXPORT     IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Standard_Boolean compgraph = Standard_True) ;
  //! Returns the check-list of last transfer (write) <br>
//!           It is recorded in the FinderProcess, but it must be bound with <br>
//!           resulting entities (in the resulting file model) rather than <br>
//!           with original objects (in fact, their mappers) <br>
  Standard_EXPORT     Interface_CheckIterator TransferWriteCheckList() const;
  
  Standard_EXPORT     Handle_XSControl_Vars Vars() const;
  
  Standard_EXPORT     void SetVars(const Handle(XSControl_Vars)& newvars) ;
  //! Clears binders <br>
  Standard_EXPORT     void ClearBinders() ;
  
  Standard_EXPORT     void Destroy() ;
~XSControl_WorkSession()
{
  Destroy();
}



  DEFINE_STANDARD_RTTI(XSControl_WorkSession)

protected:




private: 


Handle_XSControl_Controller theController;
Handle_XSControl_TransferReader theTransferRead;
Handle_XSControl_TransferWriter theTransferWrite;
Handle_Dico_DictionaryOfTransient theContext;
Standard_Integer theModeWriteShape;
Handle_XSControl_Vars theVars;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif