0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
[occt.git] / src / XSControl / XSControl_Functions.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
7fd59977 14
7fd59977 15#include <IFSelect_Act.hxx>
42cf5bc1 16#include <IFSelect_CheckCounter.hxx>
7fd59977 17#include <IFSelect_Functions.hxx>
42cf5bc1 18#include <IFSelect_SessionPilot.hxx>
19#include <Interface_CheckIterator.hxx>
20#include <Interface_InterfaceModel.hxx>
21#include <Interface_Macros.hxx>
22#include <Interface_Static.hxx>
23#include <Message.hxx>
24#include <Message_Messenger.hxx>
7fd59977 25#include <TColStd_HSequenceOfHAsciiString.hxx>
42cf5bc1 26#include <TColStd_HSequenceOfTransient.hxx>
7fd59977 27#include <Transfer_Binder.hxx>
42cf5bc1 28#include <Transfer_FinderProcess.hxx>
7fd59977 29#include <Transfer_IteratorOfProcessForTransient.hxx>
42cf5bc1 30#include <Transfer_ResultFromModel.hxx>
31#include <Transfer_TransferIterator.hxx>
32#include <Transfer_TransientProcess.hxx>
33#include <XSControl.hxx>
34#include <XSControl_Controller.hxx>
35#include <XSControl_Functions.hxx>
36#include <XSControl_SelectForTransfer.hxx>
37#include <XSControl_TransferReader.hxx>
38#include <XSControl_TransferWriter.hxx>
39#include <XSControl_WorkSession.hxx>
7fd59977 40
7fd59977 41// #######################################################################
42// ## ##
43// ## ##
44// ## FUNCTIONS ##
45// ## ##
46// ## ##
47// #######################################################################
7fd59977 48//=======================================================================
49//function : xinit
50//=======================================================================
51static IFSelect_ReturnStatus XSControl_xinit(const Handle(IFSelect_SessionPilot)& pilot)
52{
53 Standard_Integer argc = pilot->NbWords();
54 const Standard_CString arg1 = pilot->Arg(1);
55 // **** xinit ****
56 if (argc > 1) return (XSControl::Session(pilot)->SelectNorm(arg1) ?
57 IFSelect_RetDone : IFSelect_RetFail);
58 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 59 sout<<"Selected Norm:"<<XSControl::Session(pilot)->SelectedNorm()<<Message_EndLine;
7fd59977 60 return IFSelect_RetVoid;
61}
62
63
64//=======================================================================
65//function : xnorm
66//=======================================================================
67static IFSelect_ReturnStatus XSControl_xnorm(const Handle(IFSelect_SessionPilot)& pilot)
68{
69 Standard_Integer argc = pilot->NbWords();
70 const Standard_CString arg1 = pilot->Arg(1);
71 // **** xnorm ****
72 Handle(XSControl_WorkSession) WS = XSControl::Session(pilot);
73 Handle(XSControl_Controller) control = WS->NormAdaptor();
74 Handle(Message_Messenger) sout = Message::DefaultMessenger();
75 if (argc == 1)
04232180 76 sout<<"Current Norm. xnorm newnorm to change"<<Message_EndLine;
77 else sout<<"Current Norm :"<<Message_EndLine;
78 if (control.IsNull()) sout<<"no norm currently defined"<<Message_EndLine;
7fd59977 79 else
04232180 80 sout<<" Long Name (complete) : "<<control->Name(Standard_False)<<Message_EndLine
81 << " Short name (resource) : "<<control->Name(Standard_True)<<Message_EndLine;
7fd59977 82 if (argc == 1) return IFSelect_RetVoid;
83
7fd59977 84 control = XSControl_Controller::Recorded(arg1);
7f56eba8 85 if (control.IsNull()) {
04232180 86 sout<<" No norm named : "<<arg1<<Message_EndLine;
7f56eba8 87 return IFSelect_RetError;
7fd59977 88 }
89
7f56eba8 90 WS->SetController(control);
04232180 91 sout<<"new norm : "<<control->Name()<<Message_EndLine;
7f56eba8 92 return IFSelect_RetDone;
7fd59977 93}
94
95
96//=======================================================================
97//function : newmodel
98//=======================================================================
99static IFSelect_ReturnStatus XSControl_newmodel(const Handle(IFSelect_SessionPilot)& pilot)
100{
101 // **** newmodel ****
102 if (!XSControl::Session(pilot)->NewModel().IsNull()) return IFSelect_RetDone;
103 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 104 sout<<"No new Model produced"<<Message_EndLine;
7fd59977 105 return IFSelect_RetFail;
106}
107
108
109//=======================================================================
110//function : tpclear
111//=======================================================================
112static IFSelect_ReturnStatus XSControl_tpclear(const Handle(IFSelect_SessionPilot)& pilot)
113{
114 // **** tpclear/twclear ****
7f56eba8 115 const Standard_Boolean modew = (pilot->Word(0).Value(2) == 'w');
116 const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess();
117 const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
7fd59977 118 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 119 if (modew) { if(!FP.IsNull()) FP->Clear(); else sout<<"No Transfer Write"<<Message_EndLine; }
120 else { if(!TP.IsNull()) TP->Clear(); else sout<<"No Transfer Read"<<Message_EndLine; }
7fd59977 121 return IFSelect_RetDone;
122}
123
124
125//=======================================================================
126//function : tpstat
127//=======================================================================
128static IFSelect_ReturnStatus XSControl_tpstat(const Handle(IFSelect_SessionPilot)& pilot)
129{
130 Standard_Integer argc = pilot->NbWords();
131 const Standard_CString arg1 = pilot->Arg(1);
132 //const Standard_CString arg2 = pilot->Arg(2);
7f56eba8 133 const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
7fd59977 134 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 135 if (TP.IsNull()) { sout<<"No Transfer Read"<<Message_EndLine; return IFSelect_RetError;}
7fd59977 136 // **** tpstat ****
137
138 Standard_Integer mod1 = -1;
139 Standard_Integer mod2 = 0;
140 // g : general c : check (compte) C (liste) f : fails(compte) F (liste)
141 // resultats racines : n : n0s entites s : status b : binders
142 // t : compte par type r : compte par resultat l : liste(type-resultat)
143 // *n *s *b *t *r *l : idem sur tout
144 // ?n etc.. : idem sur resultats anormaux
145 // ? tout court pour help
146
147 if (argc > 1) {
148 char a2 = arg1[1]; if (a2 == '\0') a2 = '!';
149 switch (arg1[0]) {
150 case 'g' : mod1 = 0; break;
151 case 'c' : mod1 = 4; mod2 = 4; break;
152 case 'C' : mod1 = 4; mod2 = 2; break;
153 case 'f' : mod1 = 5; mod2 = 4; break;
154 case 'F' : mod1 = 5; mod2 = 2; break;
155 case '*' : mod1 = 2; break;
156 case '?' : mod1 = 3; break;
157 default : mod1 = 1; if (argc > 2) mod1 = 2; a2 = arg1[0]; break;
158 }
159 if (mod1 < 1 || mod1 > 3) a2 = '!';
160 switch (a2) {
161 case 'n' : mod2 = 0; break;
162 case 's' : mod2 = 1; break;
163 case 'b' : mod2 = 2; break;
164 case 't' : mod2 = 3; break;
165 case 'r' : mod2 = 4; break;
166 case 'l' : mod2 = 5; break;
167 case 'L' : mod2 = 6; break;
168 case '!' : break;
169 case '?' : mod1 = -1; break;
170 default : mod1 = -2; break;
171 }
172 }
173 // A present help eventuel
04232180 174 if (mod1 < -1) sout<<"Unknown Mode"<<Message_EndLine;
7fd59977 175 if (mod1 < 0) {
176 sout<<"Modes available :\n"
586db386 177 <<"g : general c : checks (count) C (list)\n"
178 <<" f : fails (count) F (list)\n"
179 <<" n : numbers of transferred entities (on TRANSFER ROOTS)\n"
180 <<" s : their status (type entity-result , presence checks)\n"
181 <<" b : detail of binders\n"
182 <<" t : count per entity type r : per type/status result\n"
183 <<" l : count per couple type entity/result\n"
184 <<" L : list per couple type entity/result\n"
185 <<" *n *s *b *t *r *l *L : idem on ALL recorded items\n"
186 <<" ?n ?s ?b ?t ... : idem on abnormal items\n"
04232180 187 <<" n select : n applied on a selection idem for s b t r l"<<Message_EndLine;
7fd59977 188 if (mod1 < -1) return IFSelect_RetError;
189 return IFSelect_RetVoid;
190 }
191
192 if (!TP.IsNull()) {
193 sout<<"TransferRead :";
194 if (TP->Model() != pilot->Session()->Model()) sout<<"Model differs from the session";
195 Handle(TColStd_HSequenceOfTransient) list =
196 IFSelect_Functions::GiveList(pilot->Session(),pilot->CommandPart(2));
197 XSControl_TransferReader::PrintStatsOnList (TP,list,mod1,mod2);
198// TP->PrintStats (1,sout);
199 }
04232180 200 else sout<<"TransferRead : not defined"<<Message_EndLine;
7fd59977 201 return IFSelect_RetVoid;
202}
203
204
205//=======================================================================
206//function : tpent
207//=======================================================================
208static IFSelect_ReturnStatus XSControl_tpent(const Handle(IFSelect_SessionPilot)& pilot)
209{
210 Standard_Integer argc = pilot->NbWords();
211 const Standard_CString arg1 = pilot->Arg(1);
7f56eba8 212 const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
7fd59977 213 // **** tpent ****
214 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 215 if (TP.IsNull()) { sout<<"No Transfer Read"<<Message_EndLine; return IFSelect_RetError;}
7fd59977 216 Handle(Interface_InterfaceModel) model = TP->Model();
217 if (model.IsNull()) return IFSelect_RetFail;
218
04232180 219 if (argc < 2) { sout<<"Give ENTITY NUMBER (IN MODEL TransferProcess)"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 220 Standard_Integer num = atoi(arg1);
04232180 221 if (num <= 0 || num > model->NbEntities()) { sout<<"Number not in [1 - "<<model->NbEntities()<<"]"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 222 Handle(Standard_Transient) ent = model->Value(num);
223 Standard_Integer index = TP->MapIndex (ent);
04232180 224 if (index == 0) sout<<"Entity "<<num<<" not recorded in transfer"<<Message_EndLine;
7fd59977 225 else XSControl::Session(pilot)->PrintTransferStatus (index,Standard_False,sout);
226 return IFSelect_RetVoid;
227}
228
229
230//=======================================================================
231//function : tpitem
232//=======================================================================
233static IFSelect_ReturnStatus XSControl_tpitem(const Handle(IFSelect_SessionPilot)& pilot)
234{
235 Standard_Integer argc = pilot->NbWords();
236 const Standard_CString arg1 = pilot->Arg(1);
237// **** tpitem/tproot/twitem/twroot ****
238 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 239 if (argc < 2) { sout<<"Give ITEM NUMBER (in TransferProcess)"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 240 Standard_Integer num = atoi(arg1);
241 if (pilot->Word(0).Value(3) == 'r') num = -num;
242 Standard_Boolean modew = Standard_False;
243 if (pilot->Word(0).Value(2) == 'w') modew = Standard_True;
244 Handle(Transfer_Binder) binder;
245 Handle(Transfer_Finder) finder;
246 Handle(Standard_Transient) ent;
247 if (!XSControl::Session(pilot)->PrintTransferStatus(num,modew,sout))
04232180 248 sout<<" - Num="<<num<<" incorrect"<<Message_EndLine;
7fd59977 249 return IFSelect_RetVoid;
250}
251
252
7fd59977 253//=======================================================================
254//function : trecord
255//=======================================================================
256static IFSelect_ReturnStatus XSControl_trecord(const Handle(IFSelect_SessionPilot)& pilot)
257{
258 Standard_Integer argc = pilot->NbWords();
259 const Standard_CString arg1 = pilot->Arg(1);
7f56eba8 260 const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
7fd59977 261// **** trecord : TransferReader ****
262 Standard_Boolean tous = (argc == 1);
263 Standard_Integer num = -1;
7f56eba8 264 const Handle(Interface_InterfaceModel) &mdl = XSControl::Session(pilot)->Model();
265 const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
7fd59977 266 Handle(Standard_Transient) ent;
267 Handle(Message_Messenger) sout = Message::DefaultMessenger();
268 if (mdl.IsNull() || TR.IsNull() || TP.IsNull())
04232180 269 { sout<<" init not done"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 270 if (!tous) num = atoi(arg1);
271 // Enregistrer les racines
272 if (tous) {
273 Standard_Integer nb = TP->NbRoots();
04232180 274 sout<<" Recording "<<nb<<" Roots"<<Message_EndLine;
7fd59977 275 for (Standard_Integer i = 1; i <= nb; i ++) {
276 ent = TP->Root(i);
04232180 277 if (TR->RecordResult (ent)) sout<<" Root n0."<<i<<Message_EndLine;
278 else sout<<" Root n0."<<i<<" not recorded"<<Message_EndLine;
7fd59977 279 }
280 } else {
04232180 281 if (num < 1 || num > mdl->NbEntities()) sout<<"incorrect number:"<<num<<Message_EndLine;
282 else if (TR->RecordResult(mdl->Value(num))) sout<<" Entity n0."<<num<<Message_EndLine;
283 else sout<<" Entity n0."<<num<<" not recorded"<<Message_EndLine;
7fd59977 284 }
285 return IFSelect_RetDone;
286}
287
288
289//=======================================================================
290//function : trstat
291//=======================================================================
292static IFSelect_ReturnStatus XSControl_trstat(const Handle(IFSelect_SessionPilot)& pilot)
293{
294 Standard_Integer argc = pilot->NbWords();
295 const Standard_CString arg1 = pilot->Arg(1);
296 Handle(Message_Messenger) sout = Message::DefaultMessenger();
297// **** trstat : TransferReader ****
7f56eba8 298 const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
04232180 299 if (TR.IsNull()) { sout<<" init not done"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 300 Handle(Interface_InterfaceModel) mdl = TR->Model();
04232180 301 if (mdl.IsNull()) { sout<<" No model"<<Message_EndLine; return IFSelect_RetError; }
302 sout<<" Statistics : FileName : "<<TR->FileName()<<Message_EndLine;
7fd59977 303 if (argc == 1) {
304 // stats generales
305 TR->PrintStats(10,0);
306 } else {
307 // stats unitaires
308 Standard_Integer num = atoi(arg1);
04232180 309 if (num < 1 || num > mdl->NbEntities()) { sout<<" incorrect number:"<<arg1<<Message_EndLine; return IFSelect_RetError; }
7fd59977 310 Handle(Standard_Transient) ent = mdl->Value(num);
04232180 311 if (!TR->IsRecorded(ent)) { sout<<" Entity "<<num<<" not recorded"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 312 Handle(Transfer_ResultFromModel) RM = TR->FinalResult(ent);
313 Handle(TColStd_HSequenceOfTransient) list = TR->CheckedList(ent);
314 Standard_Integer i, nb = list->Length();
315 if (nb > 0) sout<<" Entities implied by Check/Result :"<<nb<<" i.e.:";
316 for (i = 1; i <= nb; i ++) { sout<<" "; mdl->Print(list->Value(i),sout); }
04232180 317 sout<<Message_EndLine;
318 if (RM.IsNull()) { sout<<" no other info"<<Message_EndLine; return IFSelect_RetVoid; }
7fd59977 319 Interface_CheckIterator chl = RM->CheckList(Standard_False);
320 pilot->Session()->PrintCheckList(chl,Standard_False,IFSelect_EntitiesByItem);
321 }
322 return IFSelect_RetVoid;
323}
324
325
326//=======================================================================
327//function : trbegin
328//=======================================================================
329static IFSelect_ReturnStatus XSControl_trbegin(const Handle(IFSelect_SessionPilot)& pilot)
330{
331 // **** trbegin : TransferReader ****
7f56eba8 332 Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
7fd59977 333 Standard_Boolean init = TR.IsNull();
334 if (pilot->NbWords() > 1) { if (pilot->Arg(1)[0] == 'i') init = Standard_True; }
335 if (init) {
336 XSControl::Session(pilot)->InitTransferReader (0);
7f56eba8 337 TR = XSControl::Session(pilot)->TransferReader();
c48e2889 338 if (TR.IsNull()) {
7fd59977 339 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 340 sout<<" init not done or failed"<<Message_EndLine;
c48e2889 341 return IFSelect_RetError;
7fd59977 342 }
343 }
344 TR->BeginTransfer();
345 return IFSelect_RetDone;
346}
347
348
349//=======================================================================
350//function : tread
351//=======================================================================
352static IFSelect_ReturnStatus XSControl_tread(const Handle(IFSelect_SessionPilot)& pilot)
353{
354 Standard_Integer argc = pilot->NbWords();
355 //const Standard_CString arg1 = pilot->Arg(1);
356 // **** tread : TransferReader ****
357 Handle(Message_Messenger) sout = Message::DefaultMessenger();
7f56eba8 358 const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
04232180 359 if (TR.IsNull()) { sout<<" init not done"<<Message_EndLine; return IFSelect_RetError; }
7f56eba8 360 const Handle(Interface_InterfaceModel) &mdl = TR->Model();
04232180 361 if (mdl.IsNull()) { sout<<" No model"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 362 if (argc < 2) {
363// DeclareAndCast(IFSelect_Selection,sel,pilot->Session()->NamedItem("xst-model-roots"));
364 Handle(Standard_Transient) sel = pilot->Session()->NamedItem("xst-model-roots");
04232180 365 if (sel.IsNull()) { sout<<"Select Roots absent"<<Message_EndLine; return IFSelect_RetError; }
7fd59977 366 Handle(TColStd_HSequenceOfTransient) list = pilot->Session()->GiveList(sel);
04232180 367 sout<<" Transferring all roots i.e. : "<<TR->TransferList(list)<<Message_EndLine;
7fd59977 368 } else {
369 Handle(TColStd_HSequenceOfTransient) list =
370 IFSelect_Functions::GiveList(pilot->Session(),pilot->CommandPart(1));
04232180 371 sout<<" Transfer of "<<list->Length()<<" entities"<<Message_EndLine;
7fd59977 372 Standard_Integer nb = TR->TransferList(list);
04232180 373 sout<<" Gives "<<nb<<" results"<<Message_EndLine;
7fd59977 374 }
375 return IFSelect_RetDone;
376}
377
378
379//=======================================================================
380//function : trtp
381//=======================================================================
382static IFSelect_ReturnStatus XSControl_trtp(const Handle(IFSelect_SessionPilot)& pilot)
383{
384 // **** TReader -> TProcess ****
7f56eba8 385 const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
7fd59977 386 Handle(Message_Messenger) sout = Message::DefaultMessenger();
04232180 387 if (TR.IsNull()) sout<<" No TransferReader"<<Message_EndLine;
388 else if (TR->TransientProcess().IsNull()) sout<<" Transfer Reader without Process"<<Message_EndLine;
7fd59977 389 return IFSelect_RetVoid;
390}
391
392
393//=======================================================================
394//function : tptr
395//=======================================================================
396static IFSelect_ReturnStatus XSControl_tptr(const Handle(IFSelect_SessionPilot)& pilot)
397{
398 // **** TProcess -> TReader ****
399 XSControl::Session(pilot)->InitTransferReader (3);
400 return IFSelect_RetDone;
401}
402
403
404//=======================================================================
405//function : twmode
406//=======================================================================
407static IFSelect_ReturnStatus XSControl_twmode(const Handle(IFSelect_SessionPilot)& pilot)
408{
409 Standard_Integer argc = pilot->NbWords();
410 const Standard_CString arg1 = pilot->Arg(1);
411 // **** twmode ****
412 Handle(XSControl_TransferWriter) TW = XSControl::Session(pilot)->TransferWriter();
413 Handle(XSControl_Controller) control = XSControl::Session(pilot)->NormAdaptor();
414 Standard_Integer modemin,modemax;
415 Handle(Message_Messenger) sout = Message::DefaultMessenger();
416 if (control->ModeWriteBounds (modemin,modemax)) {
04232180 417 sout<<"Write Mode : allowed values "<<modemin<<" to "<<modemax<<Message_EndLine;
7fd59977 418 for (Standard_Integer modd = modemin; modd <= modemax; modd ++) {
04232180 419 sout<<modd<<" : "<<control->ModeWriteHelp (modd)<<Message_EndLine;;
7fd59977 420 }
421 }
04232180 422 sout<<"Write Mode : actual = "<<TW->TransferMode()<<Message_EndLine;
7fd59977 423 if (argc <= 1) return IFSelect_RetVoid;
424 Standard_Integer mod = atoi(arg1);
04232180 425 sout<<"New value -> "<<arg1<<Message_EndLine;
7fd59977 426 TW->SetTransferMode(mod);
04232180 427 if (!control->IsModeWrite (mod)) sout<<"Warning : this new value is not supported"<<Message_EndLine;
7fd59977 428 return IFSelect_RetDone;
429}
430
431
432//=======================================================================
433//function : twstat
434//=======================================================================
435static IFSelect_ReturnStatus XSControl_twstat(const Handle(IFSelect_SessionPilot)& pilot)
436{
437 //Standard_Integer argc = pilot->NbWords();
438 //const Standard_CString arg1 = pilot->Arg(1);
439 //const Standard_CString arg2 = pilot->Arg(2);
7f56eba8 440 const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess();
7fd59977 441 // **** twstat ****
442 // Pour Write
443 Handle(Message_Messenger) sout = Message::DefaultMessenger();
444 if (!FP.IsNull()) {
445 sout<<"TransferWrite:";
446 // XSControl_TransferWriter::PrintStatsProcess (FP,mod1,mod2);
447 FP->PrintStats (1,sout);
448 }
04232180 449 else sout<<"TransferWrite: not defined"<<Message_EndLine;
7fd59977 450 return IFSelect_RetVoid;
451}
452
453
454//=======================================================================
455//function : settransfert
456//=======================================================================
457static IFSelect_ReturnStatus XSControl_settransfert(const Handle(IFSelect_SessionPilot)& pilot)
458{
459 // **** SelectForTransfer ****
460 return pilot->RecordItem(new XSControl_SelectForTransfer(XSControl::Session(pilot)->TransferReader()));
461}
462
463
464
c48e2889 465static int THE_XSControl_Functions_initactor = 0;
7fd59977 466
467//=======================================================================
468//function : Init
c48e2889 469//purpose :
7fd59977 470//=======================================================================
471
472void XSControl_Functions::Init ()
473{
c48e2889 474 if (THE_XSControl_Functions_initactor)
475 {
476 return;
477 }
478
479 THE_XSControl_Functions_initactor = 1;
7fd59977 480 IFSelect_Act::SetGroup("DE: General");
481
482 IFSelect_Act::AddFunc ("xinit","[norm:string to change norme] reinitialises according to the norm",XSControl_xinit);
483 IFSelect_Act::AddFunc ("xnorm","displays current norm +norm : changes it",XSControl_xnorm);
7fd59977 484
485 IFSelect_Act::AddFunc ("newmodel","produces a new empty model, for the session",XSControl_newmodel);
486
487 IFSelect_Act::AddFunc ("tpclear","Clears TransferProcess (READ)",XSControl_tpclear);
488 IFSelect_Act::AddFunc ("twclear","Clears TransferProcess (WRITE)",XSControl_tpclear);
489
490 IFSelect_Act::AddFunc ("tpstat","Statistics on TransferProcess (READ)",XSControl_tpstat);
491
492 IFSelect_Act::AddFunc ("tpent","[num:integer] Statistics on an entity of the model (READ)",XSControl_tpent);
493
494 IFSelect_Act::AddFunc ("tpitem","[num:integer] Statistics on ITEM of transfer (READ)" ,XSControl_tpitem);
495 IFSelect_Act::AddFunc ("tproot","[num:integer] Statistics on a ROOT of transfert (READ)" ,XSControl_tpitem);
496 IFSelect_Act::AddFunc ("twitem","[num:integer] Statistics on an ITEM of transfer (WRITE)" ,XSControl_tpitem);
497 IFSelect_Act::AddFunc ("twroot","[num:integer] Statistics on a ROOT of transfer (WRITE)",XSControl_tpitem);
7fd59977 498
499 IFSelect_Act::AddFunc ("trecord","record : all root results; or num : for entity n0.num",XSControl_trecord);
500 IFSelect_Act::AddFunc ("trstat","general statistics; or num : stats on entity n0 num",XSControl_trstat);
501 IFSelect_Act::AddFunc ("trbegin","begin-transfer-reader [init]",XSControl_trbegin);
502 IFSelect_Act::AddFunc ("tread","transfers all roots, or num|sel|sel num : entity list, by transfer-reader",XSControl_tread);
503
504 IFSelect_Act::AddFunc ("trtp","feeds commands tp... with results from tr...",XSControl_trtp);
505 IFSelect_Act::AddFunc ("tptr","feeds tr... from tp... (may be incomplete)",XSControl_tptr);
506
507 IFSelect_Act::AddFunc ("twmode","displays mode transfer write, + num changes it",XSControl_twmode);
508 IFSelect_Act::AddFunc ("twstat","Statistics on TransferProcess (WRITE)",XSControl_twstat);
509
510 IFSelect_Act::AddFSet ("selecttransfer","selection (recognize from transfer actor)",XSControl_settransfert);
511}