0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / XSControl / XSControl_Writer.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _XSControl_Writer_HeaderFile
18 #define _XSControl_Writer_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
30 class TopoDS_Shape;
31
32
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 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
43   //! Creates a Writer from scratch
44   Standard_EXPORT XSControl_Writer();
45   
46   //! Creates a Writer from scratch, with a norm name which
47   //! identifie a Controller
48   Standard_EXPORT XSControl_Writer(const Standard_CString norm);
49   
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);
53   
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);
57   
58   //! Sets a specific session to <me>
59   Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
60   
61   //! Returns the session used in <me>
62   Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
63   
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);
69   
70   //! Transfers a Shape according to the mode
71   Standard_EXPORT IFSelect_ReturnStatus TransferShape (const TopoDS_Shape& sh, const Standard_Integer mode = 0);
72   
73   //! Writes the produced model
74   Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename);
75   
76   //! Prints Statistics about Transfer
77   Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
78
79
80
81
82 protected:
83
84
85
86
87
88 private:
89
90
91
92   Handle(XSControl_WorkSession) thesession;
93
94
95 };
96
97
98
99
100
101
102
103 #endif // _XSControl_Writer_HeaderFile