CAD Exchanger SDK
cadex::Base_Writer Class Reference

Base class for writer classes. More...

Inheritance diagram for cadex::Base_Writer:
cadex::ACIS_Writer cadex::BRep_Writer cadex::FBX_Writer cadex::IGES_Writer cadex::JT_Writer cadex::OBJ_Writer cadex::Para_Writer cadex::Rhino_Writer cadex::STEP_Writer cadex::STL_Writer cadex::VRML_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 TopoDS_Shape &theShape)
 Converts source shape into memory representation of the target file. More...
 
bool WriteFile (const Base_UTF16String &theFileName)
 Writes contents to a target file. More...
 
bool WriteFile (std::ostream &theStream)
 Writes contents to a target stream. More...
 
Base_ProgressStatusProgressStatus () const
 Returns a progress status.
 
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
}
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()

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.

Examples:
conversion/export/main.cxx, and conversion/transfer/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.