1 // Created on: 1997-05-14
2 // Created by: Christian CAILLET
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _XSControl_Writer_HeaderFile
18 #define _XSControl_Writer_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_CString.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <IFSelect_ReturnStatus.hxx>
27 #include <Standard_Integer.hxx>
28 class XSControl_WorkSession;
29 class Interface_InterfaceModel;
33 //! This class gives a simple way to create then write a
34 //! Model compliant to a given norm, from a Shape
35 //! The model can then be edited by tools by other appropriate tools
36 class XSControl_Writer
43 //! Creates a Writer from scratch
44 Standard_EXPORT XSControl_Writer();
46 //! Creates a Writer from scratch, with a norm name which
47 //! identifie a Controller
48 Standard_EXPORT XSControl_Writer(const Standard_CString norm);
50 //! Creates a Writer from an already existing Session
51 //! If <scratch> is True (D), clears already recorded data
52 Standard_EXPORT XSControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
54 //! Sets a specific norm to <me>
55 //! Returns True if done, False if <norm> is not available
56 Standard_EXPORT Standard_Boolean SetNorm (const Standard_CString norm);
58 //! Sets a specific session to <me>
59 Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
61 //! Returns the session used in <me>
62 Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
64 //! Returns the produced model. Produces a new one if not yet done
65 //! or if <newone> is True
66 //! This method allows for instance to edit product or header
67 //! data before writing
68 Standard_EXPORT Handle(Interface_InterfaceModel) Model (const Standard_Boolean newone = Standard_False);
70 //! Transfers a Shape according to the mode
71 Standard_EXPORT IFSelect_ReturnStatus TransferShape (const TopoDS_Shape& sh, const Standard_Integer mode = 0);
73 //! Writes the produced model
74 Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename);
76 //! Prints Statistics about Transfer
77 Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
92 Handle(XSControl_WorkSession) thesession;
103 #endif // _XSControl_Writer_HeaderFile