QCAD
Open Source 2D CAD
DL_WriterA Class Reference

Implements functions defined in DL_Writer for writing low level DXF constructs to an ASCII format DXF file. More...

#include <dl_writer_ascii.h>

Inheritance diagram for DL_WriterA:
DL_Writer

Public Member Functions

void close () const
 Closes the output file. More...
 
 DL_WriterA (const char *fname, DL_Codes::version version=DL_VERSION_2000)
 
void dxfHex (int gc, int value) const
 Writes a hex int variable to the DXF file. More...
 
void dxfInt (int gc, int value) const
 Writes an int variable to the DXF file. More...
 
void dxfReal (int gc, double value) const
 Writes a real (double) variable to the DXF file. More...
 
void dxfString (int gc, const char *value) const
 Writes a string variable to the DXF file. More...
 
void dxfString (int gc, const std::string &value) const
 Must be overwritten by the implementing class to write a string to the file. More...
 
bool openFailed () const
 
virtual ~DL_WriterA ()
 
- Public Member Functions inherited from DL_Writer
void color (int col=256) const
 
void comment (const char *text) const
 Comment. More...
 
void coord (int gc, double x, double y, double z=0) const
 
void coordTriplet (int gc, const double *value) const
 
 DL_Writer (DL_Codes::version version)
 
virtual void dxfBool (int gc, bool value) const
 Can be overwritten by the implementing class to write a bool value to the file. More...
 
void dxfEOF () const
 End of the DXF file. More...
 
void entity (const char *entTypeName) const
 Entity. More...
 
void entityAttributes (const DL_Attributes &attrib) const
 Attributes of an entity. More...
 
unsigned long getNextHandle () const
 
unsigned long handle (int gc=5) const
 Writes a unique handle and returns it. More...
 
void linetype (const char *lt) const
 
void linetypeScale (double scale) const
 
void lineWeight (int lw) const
 
void resetHandle () const
 
void section (const char *name) const
 Generic section for section 'name'. More...
 
void sectionBlockEntry (unsigned long int h=0) const
 Block (must be in the section BLOCKS). More...
 
void sectionBlockEntryEnd (unsigned long int h=0) const
 End of Block (must be in the section BLOCKS). More...
 
void sectionBlocks () const
 Section BLOCKS. More...
 
void sectionClasses () const
 Section CLASSES. More...
 
void sectionEnd () const
 End of a section. More...
 
void sectionEntities () const
 Section ENTITIES. More...
 
void sectionHeader () const
 Section HEADER. More...
 
void sectionObjects () const
 Section OBJECTS. More...
 
void sectionTables () const
 Section TABLES. More...
 
void subClass (const char *sub) const
 Subclass. More...
 
void table (const char *name, int num, int h=0) const
 Generic table for table 'name' with 'num' entries: More...
 
void tableAppid (int num) const
 Table for application id. More...
 
void tableAppidEntry (unsigned long int h=0) const
 Appid (must be in the TABLES section APPID). More...
 
void tableEnd () const
 End of a table. More...
 
void tableLayerEntry (unsigned long int h=0) const
 Layer (must be in the TABLES section LAYER). More...
 
void tableLayers (int num) const
 Table for layers. More...
 
void tableLinetypeEntry (unsigned long int h=0) const
 Line type (must be in the TABLES section LTYPE). More...
 
void tableLinetypes (int num) const
 Table for line types. More...
 
void tableStyle (int num) const
 Table for text style. More...
 
virtual ~DL_Writer ()
 

Static Public Member Functions

static void strReplace (char *str, char src, char dest)
 Replaces every occurence of src with dest in the null terminated str. More...
 

Private Attributes

std::ofstream m_ofile
 DXF file to be created. More...
 

Additional Inherited Members

- Protected Attributes inherited from DL_Writer
unsigned long m_handle
 
unsigned long modelSpaceHandle
 
unsigned long paperSpace0Handle
 
unsigned long paperSpaceHandle
 
DL_Codes::version version
 DXF version to be created. More...
 

Detailed Description

Implements functions defined in DL_Writer for writing low level DXF constructs to an ASCII format DXF file.

@para fname File name of the file to be created. @para version DXF version. Defaults to DL_VERSION_2002.

Todo:
What if fname is NULL? Or fname can't be opened for another reason?

Constructor & Destructor Documentation

◆ DL_WriterA()

DL_WriterA::DL_WriterA ( const char *  fname,
DL_Codes::version  version = DL_VERSION_2000 
)
inline

◆ ~DL_WriterA()

virtual DL_WriterA::~DL_WriterA ( )
inlinevirtual

Member Function Documentation

◆ close()

void DL_WriterA::close ( ) const

Closes the output file.

◆ dxfHex()

void DL_WriterA::dxfHex ( int  gc,
int  value 
) const
virtual

Writes a hex int variable to the DXF file.

Parameters
gcGroup code.
valueInt value

Implements DL_Writer.

◆ dxfInt()

void DL_WriterA::dxfInt ( int  gc,
int  value 
) const
virtual

Writes an int variable to the DXF file.

Parameters
gcGroup code.
valueInt value

Implements DL_Writer.

◆ dxfReal()

void DL_WriterA::dxfReal ( int  gc,
double  value 
) const
virtual

Writes a real (double) variable to the DXF file.

Parameters
gcGroup code.
valueDouble value

Implements DL_Writer.

◆ dxfString() [1/2]

void DL_WriterA::dxfString ( int  gc,
const char *  value 
) const
virtual

Writes a string variable to the DXF file.

Parameters
gcGroup code.
valueString

Implements DL_Writer.

◆ dxfString() [2/2]

void DL_WriterA::dxfString ( int  gc,
const std::string &  value 
) const
virtual

Must be overwritten by the implementing class to write a string to the file.

Parameters
gcGroup code.
valueThe string.

Implements DL_Writer.

◆ openFailed()

bool DL_WriterA::openFailed ( ) const
Return values
trueOpening file has failed.
falseOtherwise.

◆ strReplace()

void DL_WriterA::strReplace ( char *  str,
char  src,
char  dest 
)
static

Replaces every occurence of src with dest in the null terminated str.

Member Data Documentation

◆ m_ofile

std::ofstream DL_WriterA::m_ofile
mutableprivate

DXF file to be created.


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