Public Member Functions | List of all members
MyDXFFile Class Reference

DXF file class. More...

#include <mydxffile.hpp>

Public Member Functions

 MyDXFFile ()
 Construct empty DXF file. More...
 
 MyDXFFile (const std::string &filename)
 Construct by reading a DXF file. More...
 
 ~MyDXFFile ()
 Destructor. More...
 
void read (const std::string &filename)
 Read DXF file. More...
 
void write (const std::string &filename)
 Write DXF file. More...
 
void set_warning_level (int wlevel)
 Set the level of warning messages. More...
 
int wlevel (void)
 Get the level of warning messages. More...
 
void write_group (int code, const char *data)
 Write string group to output file. More...
 
void write_group (int code, double data)
 Write double group to output file. More...
 
void write_group (int code, bool data)
 Write bool group to output file. More...
 
void write_group (int code, int8_t data)
 Write int8_t group to output file. More...
 
void write_group (int code, int16_t data)
 Write int16_t group to output file. More...
 
void write_group (int code, int32_t data)
 Write int32_t group to output file. More...
 
void write_group (int code, int64_t data)
 Write int64_t group to output file. More...
 
int read_group (void)
 Read next group from open file and return group code. More...
 
int group_get_code (void) const
 Get code of the last group read. More...
 
std::string group_get_string (void) const
 Get the value of the last group read assuming it is a string. More...
 
double group_get_double (void) const
 Get the value of the last group read assuming it is a double. More...
 
bool group_get_bool (void) const
 Get the value of the last group read assuming it is a bool. More...
 
int8_t group_get_int8 (void) const
 Get the value of the last group read assuming it is a int8. More...
 
int16_t group_get_int16 (void) const
 Get the value of the last group read assuming it is a int16. More...
 
int32_t group_get_int32 (void) const
 Get the value of the last group read assuming it is a int32. More...
 
int64_t group_get_int64 (void) const
 Get the value of the last group read assuming it is a int64. More...
 
int linec (void) const
 Get the current line number in DXF file during read. More...
 
class MyDXFEntitiesget_entities (void)
 Get a pointer to the entities of DXF file. More...
 
const class MyDXFEntitiesget_entities (void) const
 Get a const pointer to the entities of DXF file. More...
 
class MyDXFBlocksget_blocks (void)
 Get a pointer to the blocks of DXF file. More...
 
const class MyDXFBlocksget_blocks (void) const
 Get a const pointer to the blocks of DXF file. More...
 
class MyDXFTablesget_tables (void)
 Get a pointer to the tables of DXF file. More...
 
const class MyDXFTablesget_tables (void) const
 Get a const pointer to the tables of DXF file. More...
 
void debug_print (std::ostream &os) const
 Print debugging information to os. More...
 

Detailed Description

DXF file class.

This class is a memory representation of a dxf file read from the disc. The class can be used to read a dxf file. All supported features are saved to the hierarchy, all others are silently ignored.

Constructor & Destructor Documentation

MyDXFFile::MyDXFFile ( )

Construct empty DXF file.

MyDXFFile::MyDXFFile ( const std::string &  filename)

Construct by reading a DXF file.

MyDXFFile::~MyDXFFile ( )

Destructor.

Member Function Documentation

void MyDXFFile::debug_print ( std::ostream &  os) const

Print debugging information to os.

class MyDXFBlocks* MyDXFFile::get_blocks ( void  )
inline

Get a pointer to the blocks of DXF file.

const class MyDXFBlocks* MyDXFFile::get_blocks ( void  ) const
inline

Get a const pointer to the blocks of DXF file.

class MyDXFEntities* MyDXFFile::get_entities ( void  )
inline

Get a pointer to the entities of DXF file.

const class MyDXFEntities* MyDXFFile::get_entities ( void  ) const
inline

Get a const pointer to the entities of DXF file.

class MyDXFTables* MyDXFFile::get_tables ( void  )
inline

Get a pointer to the tables of DXF file.

const class MyDXFTables* MyDXFFile::get_tables ( void  ) const
inline

Get a const pointer to the tables of DXF file.

bool MyDXFFile::group_get_bool ( void  ) const

Get the value of the last group read assuming it is a bool.

An error is thrown if group type does not match.

int MyDXFFile::group_get_code ( void  ) const

Get code of the last group read.

double MyDXFFile::group_get_double ( void  ) const

Get the value of the last group read assuming it is a double.

An error is thrown if group type does not match.

int16_t MyDXFFile::group_get_int16 ( void  ) const

Get the value of the last group read assuming it is a int16.

An error is thrown if group type does not match.

int32_t MyDXFFile::group_get_int32 ( void  ) const

Get the value of the last group read assuming it is a int32.

An error is thrown if group type does not match.

int64_t MyDXFFile::group_get_int64 ( void  ) const

Get the value of the last group read assuming it is a int64.

An error is thrown if group type does not match.

int8_t MyDXFFile::group_get_int8 ( void  ) const

Get the value of the last group read assuming it is a int8.

An error is thrown if group type does not match.

std::string MyDXFFile::group_get_string ( void  ) const

Get the value of the last group read assuming it is a string.

An error is thrown if group type does not match.

int MyDXFFile::linec ( void  ) const
inline

Get the current line number in DXF file during read.

void MyDXFFile::read ( const std::string &  filename)

Read DXF file.

int MyDXFFile::read_group ( void  )

Read next group from open file and return group code.

Returns the group code read or -1 on EOF. An error is thrown on all other errors.

void MyDXFFile::set_warning_level ( int  wlevel)
inline

Set the level of warning messages.

If wlevel is set to zero, no warnings will be printed. With increasing wlevel more warning messages are printed to standard output. With wlevel >= 1 problems handling entities are reported. With wlevel >= 2 all unsupported features are reported.

int MyDXFFile::wlevel ( void  )
inline

Get the level of warning messages.

void MyDXFFile::write ( const std::string &  filename)

Write DXF file.

void MyDXFFile::write_group ( int  code,
const char *  data 
)

Write string group to output file.

void MyDXFFile::write_group ( int  code,
double  data 
)

Write double group to output file.

void MyDXFFile::write_group ( int  code,
bool  data 
)

Write bool group to output file.

void MyDXFFile::write_group ( int  code,
int8_t  data 
)

Write int8_t group to output file.

void MyDXFFile::write_group ( int  code,
int16_t  data 
)

Write int16_t group to output file.

void MyDXFFile::write_group ( int  code,
int32_t  data 
)

Write int32_t group to output file.

void MyDXFFile::write_group ( int  code,
int64_t  data 
)

Write int64_t group to output file.


The documentation for this class was generated from the following file: