42cf5bc1 |
1 | // Created on: 2000-06-23 |
2 | // Created by: Sergey MOZOKHIN |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _StlAPI_Writer_HeaderFile |
17 | #define _StlAPI_Writer_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <Standard_Boolean.hxx> |
24 | #include <StlAPI_ErrorStatus.hxx> |
25 | #include <Standard_CString.hxx> |
26 | class StlMesh_Mesh; |
27 | class TopoDS_Shape; |
28 | |
29 | |
30 | //! This class creates and writes |
31 | //! STL files from Open CASCADE shapes. An STL file can be |
32 | //! written to an existing STL file or to a new one.. |
33 | class StlAPI_Writer |
34 | { |
35 | public: |
36 | |
37 | DEFINE_STANDARD_ALLOC |
38 | |
39 | |
40 | //! Creates a writer object with |
41 | //! default parameters: ASCIIMode. |
42 | Standard_EXPORT StlAPI_Writer(); |
43 | |
44 | //! Returns the address to the |
45 | //! flag defining the mode for writing the file. This address |
46 | //! may be used to either read or change the flag. |
47 | //! If the mode returns True (default value) the generated |
48 | //! file is an ASCII file. If the mode returns False, the |
49 | //! generated file is a binary file. |
50 | Standard_EXPORT Standard_Boolean& ASCIIMode(); |
51 | |
52 | //! Converts a given shape to STL format and writes it to file with a given filename. |
53 | //! \return the error state. |
54 | Standard_EXPORT StlAPI_ErrorStatus Write (const TopoDS_Shape& aShape, const Standard_CString aFileName); |
55 | |
56 | |
57 | |
58 | |
59 | protected: |
60 | |
61 | |
62 | |
63 | |
64 | |
65 | private: |
66 | |
67 | |
68 | |
69 | Standard_Boolean theASCIIMode; |
70 | Handle(StlMesh_Mesh) theStlMesh; |
71 | |
72 | |
73 | }; |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | #endif // _StlAPI_Writer_HeaderFile |