Integration of OCCT 6.5.0 from SVN
[occt.git] / src / XSControl / XSControl_Writer.cxx
CommitLineData
7fd59977 1//:i1 gka 03.04.99 BUC60301
2
3#include <XSControl_Writer.ixx>
4#include <XSControl_Controller.hxx>
5#include <XSControl_TransferWriter.hxx>
6#include <Interface_InterfaceModel.hxx>
7#include <Interface_Macros.hxx>
8
9
10 XSControl_Writer::XSControl_Writer ()
11{
12 SetWS (new XSControl_WorkSession);
13}
14
15 XSControl_Writer::XSControl_Writer (const Standard_CString norm)
16{
17 SetNorm (norm);
18}
19
20 XSControl_Writer::XSControl_Writer
21 (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch)
22{
23 SetWS (WS,scratch);
24}
25
26 Standard_Boolean XSControl_Writer::SetNorm (const Standard_CString norm)
27{
28 if (thesession.IsNull()) SetWS (new XSControl_WorkSession);
29 Standard_Boolean sess = thesession->SelectNorm (norm);
30 Handle(Interface_InterfaceModel) model = Model (); //:i1 gka 03.04.99 BUC60301
31 return sess;
32}
33
34 void XSControl_Writer::SetWS
35 (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch)
36{
37 thesession = WS;
38// Un controller doit etre defini ...
39 thesession->InitTransferReader(0);
40 Handle(Interface_InterfaceModel) model = Model (scratch);
41}
42
43 Handle(XSControl_WorkSession) XSControl_Writer::WS () const
44 { return thesession; }
45
46 Handle(Interface_InterfaceModel) XSControl_Writer::Model
47 (const Standard_Boolean newone)
48{
49 Handle(Interface_InterfaceModel) model = thesession->Model();
50 if (newone || model.IsNull()) model = thesession->NewModel();
51 return model;
52}
53
54 IFSelect_ReturnStatus XSControl_Writer::TransferShape
55 (const TopoDS_Shape& sh, const Standard_Integer mode)
56{
57 thesession->SetModeWriteShape (mode);
58 return thesession->TransferWriteShape (sh);
59}
60
61 IFSelect_ReturnStatus XSControl_Writer::WriteFile
62 (const Standard_CString filename)
63 { return thesession->SendAll(filename); }
64
65 void XSControl_Writer::PrintStatsTransfer
66 (const Standard_Integer what, const Standard_Integer mode) const
67 { thesession->TransferWriter()->PrintStats (what,mode); }