summaryrefslogtreecommitdiff
path: root/inc/IGESControl_Writer.hxx
blob: 7649384696f49ef24e46ce81d8c502b116b99288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _IGESControl_Writer_HeaderFile
#define _IGESControl_Writer_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Handle_Transfer_FinderProcess_HeaderFile
#include <Handle_Transfer_FinderProcess.hxx>
#endif
#ifndef _Handle_IGESData_IGESModel_HeaderFile
#include <Handle_IGESData_IGESModel.hxx>
#endif
#ifndef _IGESData_BasicEditor_HeaderFile
#include <IGESData_BasicEditor.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_Standard_Transient_HeaderFile
#include <Handle_Standard_Transient.hxx>
#endif
#ifndef _Handle_IGESData_IGESEntity_HeaderFile
#include <Handle_IGESData_IGESEntity.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
class Transfer_FinderProcess;
class IGESData_IGESModel;
class TopoDS_Shape;
class Standard_Transient;
class IGESData_IGESEntity;


//! This class creates and writes <br>
//! IGES files from CAS.CADE models. An IGES file can be written to <br>
//! an existing IGES file or to a new one. <br>
//! The translation can be performed in one or several <br>
//! operations. Each translation operation <br>
//! outputs a distinct root entity in the IGES file. <br>
//!   To write an IGES file it is possible to use the following sequence: <br>
//! To modify the IGES file header or to change translation <br>
//! parameters it is necessary to use class Interface_Static (see <br>
//! IGESParameters and GeneralParameters). <br>
class IGESControl_Writer  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Creates a writer object with the <br>
//! default unit (millimeters) and write mode (Face). <br>
//! IGESControl_Writer (const Standard_CString unit, <br>
//! const Standard_Integer modecr = 0); <br>
  Standard_EXPORT   IGESControl_Writer();
  //! Creates a writer with given <br>
//! values for units and for write mode. <br>
//! unit may be any unit that is accepted by the IGES standard. <br>
//! By default, it is the millimeter. <br>
//! modecr defines the write mode and may be: <br>
//! - 0: Faces (default) <br>
//! - 1: BRep. <br>
  Standard_EXPORT   IGESControl_Writer(const Standard_CString unit,const Standard_Integer modecr = 0);
  //! Creates a writer object with the <br>
//! prepared IGES model model in write mode. <br>
//! modecr defines the write mode and may be: <br>
//! - 0: Faces (default) <br>
//! - 1: BRep. <br>
  Standard_EXPORT   IGESControl_Writer(const Handle(IGESData_IGESModel)& model,const Standard_Integer modecr = 0);
  //! Returns the IGES model to be written in output. <br>
  Standard_EXPORT     Handle_IGESData_IGESModel Model() const;
  
  Standard_EXPORT     Handle_Transfer_FinderProcess TransferProcess() const;
  //! Returns/Sets the TransferProcess : it contains final results <br>
//!           and if some, check messages <br>
  Standard_EXPORT     void SetTransferProcess(const Handle(Transfer_FinderProcess)& TP) ;
  //! Translates a Shape to IGES Entities and adds them to the model <br>
//!           Returns True if done, False if Shape not suitable for IGES or null <br>
  Standard_EXPORT     Standard_Boolean AddShape(const TopoDS_Shape& sh) ;
  //! Translates a Geometry (Surface or Curve) to IGES Entities and <br>
//!           adds them to the model <br>
//!           Returns True if done, False if geom is neither a Surface or <br>
//!           a Curve suitable for IGES or is null <br>
  Standard_EXPORT     Standard_Boolean AddGeom(const Handle(Standard_Transient)& geom) ;
  //! Adds an IGES entity (and the ones it references) to the model <br>
  Standard_EXPORT     Standard_Boolean AddEntity(const Handle(IGESData_IGESEntity)& ent) ;
  //! Computes the entities found in <br>
//! the model, which is ready to be written. <br>
//! This contrasts with the default computation of headers only. <br>
  Standard_EXPORT     void ComputeModel() ;
  //! Computes then writes the model to an OStream <br>
//!           Returns True when done, false in case of error <br>
  Standard_EXPORT     Standard_Boolean Write(Standard_OStream& S,const Standard_Boolean fnes = Standard_False) ;
  //! Prepares and writes an IGES model <br>
//! either to an OStream, S or to a file name,CString. <br>
//! Returns True if the operation was performed correctly and <br>
//! False if an error occurred (for instance, <br>
//! if the processor could not create the file). <br>
  Standard_EXPORT     Standard_Boolean Write(const Standard_CString file,const Standard_Boolean fnes = Standard_False) ;
  //! Prints Statistics about Transfer <br>
  Standard_EXPORT     void PrintStatsTransfer(const Standard_Integer what,const Standard_Integer mode = 0) const;





protected:





private:



Handle_Transfer_FinderProcess theTP;
Handle_IGESData_IGESModel themod;
IGESData_BasicEditor thedit;
Standard_Integer thecr;
Standard_Boolean thest;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif