dime
0.9.1
Portable DXF file library
|
The dimeOutput class handles writing of DXF and DXB files. More...
#include <dime/Output.h>
Public Member Functions | |
dimeOutput () | |
~dimeOutput () | |
int | getUniqueHandleId () |
bool | isBinary () const |
void | setBinary (const bool state=true) |
void | setCallback (const int numrecords, int(*cb)(float, void *), void *cbdata) |
bool | setFileHandle (FILE *fp) |
bool | setFilename (const char *const filename) |
bool | writeDouble (const dxfdouble val) |
bool | writeFloat (const float val) |
bool | writeGroupCode (const int groupcode) |
bool | writeHeader () |
bool | writeInt16 (const int16 val) |
bool | writeInt32 (const int32 val) |
bool | writeInt8 (const int8 val) |
bool | writeString (const char *const str) |
The dimeOutput class handles writing of DXF and DXB files.
dimeOutput::dimeOutput | ( | ) |
Constructor.
dimeOutput::~dimeOutput | ( | ) |
Destructor.
bool dimeOutput::isBinary | ( | ) | const |
Returns if binary or ASCII will be used when writing.
void dimeOutput::setBinary | ( | const bool | state = true | ) |
Sets binary (DXB) or ASCII (DXF) format. Currently only ASCII is supported.
void dimeOutput::setCallback | ( | const int | num_records, |
int(*)(float, void *) | cb, | ||
void * | cbdata ) |
This method sets a callback function that is called with progress information. The first argument of the callback is a float in the range between 0 and 1. The second argument of the callback is the void * cbdata argument.
bool dimeOutput::setFileHandle | ( | FILE * | fp | ) |
Sets the output stream. fp should be a valid file/stream, and it will not be closed in the destructor.
bool dimeOutput::setFilename | ( | const char *const | filename | ) |
Sets the filename for the output file. The file will be opened, and true is returned if all was OK. The file is closed in the destructor.
bool dimeOutput::writeDouble | ( | const dxfdouble | val | ) |
Writes a double precision floating point number to the file.
bool dimeOutput::writeFloat | ( | const float | val | ) |
Writes a single precision floating point number to the file.
bool dimeOutput::writeGroupCode | ( | const int | groupcode | ) |
Writes a record group code to the file.
|
inline |
This method does nothing now, but if binary files are supported in the future, it must be called.
bool dimeOutput::writeInt16 | ( | const int16 | val | ) |
Writes a 16 bit integer to the file.
bool dimeOutput::writeInt32 | ( | const int32 | val | ) |
Writes a 32 bit integer to the file.
bool dimeOutput::writeInt8 | ( | const int8 | val | ) |
Writes an 8 bit integer to the file.
bool dimeOutput::writeString | ( | const char *const | str | ) |
Writes a null-terminated string to the file.