Hide menu
Loading...
Searching...
No Matches

Base class for writer classes. More...

#include <cadex/Base_Writer.hxx>

Inheritance diagram for cadex::Base_Writer:
cadex::ACIS_Writer cadex::BRep_Writer cadex::Collada_Writer cadex::DXF_Writer cadex::FBX_Writer cadex::GLTF_Writer cadex::IFC_Writer cadex::IGES_Writer cadex::Image_Writer cadex::JT_Writer cadex::OBJ_Writer cadex::Para_Writer cadex::Rhino_Writer cadex::STEP_Writer cadex::STL_Writer cadex::U3D_Writer cadex::USD_Writer cadex::VRML_Writer cadex::X3DPDF_Writer cadex::X3D_Writer

Public Member Functions

 ~Base_Writer ()
 Destructor.
 
bool Transfer (const ModelData_Model &theModel)
 Converts source model into memory representation of the target file.
 
bool Transfer (const ModelData_BIMModel &theModel)
 Converts source model into memory representation of the target file.
 
bool Transfer (const TopoDS_Shape &theShape)
 Converts source shape into memory representation of the target file.
 
bool WriteFile (const Base_UTF16String &theFileName)
 Writes contents to a target file.
 
bool WriteFile (std::ostream &theStream)
 Writes contents to a target stream.
 
Base_ProgressStatusProgressStatus () const
 Returns a progress status.
 
Base_WriterStatistics Statistics () const
 Returns an object containing information about export process.
 
internal::Base_Writer_Private * Impl () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 

Protected Member Functions

 Base_Writer (internal::Base_Writer_Private *theImpl)
 Constructor.
 

Detailed Description

Base class for writer classes.

Base_Writer subclasses (e.g. IGES_Writer) must be used following the same pattern:

#include <cadex/IGES_Writer.hxx>
using namespace cadex;
IGES_Writer aWriter;
if (aWriter.Transfer (aModel) && aWriter.WriteFile ("myfile.igs")) {
//OK
} else {
//error during writing the IGES file
}
bool WriteFile(const Base_UTF16String &theFileName)
Writes contents to a target file.
Definition: Base_Writer.cxx:265
bool Transfer(const ModelData_Model &theModel)
Converts source model into memory representation of the target file.
Definition: Base_Writer.cxx:117
Writes IGES files.
Definition: IGES_Writer.hxx:29
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22
See also
Base_Reader.

Member Function Documentation

◆ Impl()

internal::Base_Writer_Private * cadex::Base_Writer::Impl ( ) const
inline

Returns the pointer to the implementation object.

Warning
This function is not part of CAD Exchanger API and should not be used.

◆ Transfer() [1/3]

bool cadex::Base_Writer::Transfer ( const ModelData_BIMModel theModel)

Converts source model into memory representation of the target file.

Returns true if conversion has been successful and false otherwise.

◆ Transfer() [2/3]

bool cadex::Base_Writer::Transfer ( const ModelData_Model theModel)

Converts source model into memory representation of the target file.

Returns true if conversion has been successful and false otherwise.

Examples
conversion/export/Program.cs, conversion/export/main.cxx, conversion/screenshot/Program.cs, and conversion/screenshot/main.cxx.

◆ Transfer() [3/3]

bool cadex::Base_Writer::Transfer ( const TopoDS_Shape &  theShape)

Converts source shape into memory representation of the target file.

Returns true if conversion has been successful and false otherwise.

◆ WriteFile() [1/2]

bool cadex::Base_Writer::WriteFile ( const Base_UTF16String theFileName)

Writes contents to a target file.

Returns True if the conversion has been successful and False otherwise.

Exceptions
BaseError_EvaluationLimit

Initialize number of conversions for SDK (for GUI and CLI number of conversions initialized in ExchangerLib)

Examples
conversion/export/Program.cs, conversion/export/main.cxx, conversion/screenshot/Program.cs, and conversion/screenshot/main.cxx.

◆ WriteFile() [2/2]

bool cadex::Base_Writer::WriteFile ( std::ostream &  theStream)

Writes contents to a target stream.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If theStream must be opened and use binary format (the ios::binary flag).

Not all subclasses support this syntax (e.g. STEP_Writer or IGES_Writer do not). In this case the method returns False and asserts in debug mode.

Returns True if the conversion has been successful and False otherwise.

Exceptions
BaseError_EvaluationLimit

Initialize number of conversions for SDK (for GUI and CLI number of conversions initialized in ExchangerLib)