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 #include <Message_ProgressRange.hxx>
30 class XSControl_WorkSession;
31 class Interface_InterfaceModel;
34 //! This class gives a simple way to create then write a
35 //! Model compliant to a given norm, from a Shape
36 //! The model can then be edited by tools by other appropriate tools
37 class XSControl_Writer
44 //! Creates a Writer from scratch
45 Standard_EXPORT XSControl_Writer();
47 //! Creates a Writer from scratch, with a norm name which
48 //! identifie a Controller
49 Standard_EXPORT XSControl_Writer(const Standard_CString norm);
51 //! Creates a Writer from an already existing Session
52 //! If <scratch> is True (D), clears already recorded data
53 Standard_EXPORT XSControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
55 //! Sets a specific norm to <me>
56 //! Returns True if done, False if <norm> is not available
57 Standard_EXPORT Standard_Boolean SetNorm (const Standard_CString norm);
59 //! Sets a specific session to <me>
60 Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
62 //! Returns the session used in <me>
63 Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
65 //! Returns the produced model. Produces a new one if not yet done
66 //! or if <newone> is True
67 //! This method allows for instance to edit product or header
68 //! data before writing
69 Standard_EXPORT Handle(Interface_InterfaceModel) Model (const Standard_Boolean newone = Standard_False);
71 //! Transfers a Shape according to the mode
72 Standard_EXPORT IFSelect_ReturnStatus TransferShape (const TopoDS_Shape& sh,
73 const Standard_Integer mode = 0,
74 const Message_ProgressRange& theProgress = Message_ProgressRange());
76 //! Writes the produced model
77 Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename);
79 //! Prints Statistics about Transfer
80 Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
95 Handle(XSControl_WorkSession) thesession;
106 #endif // _XSControl_Writer_HeaderFile