QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

List of all members.

Public Member Functions

void close () const
 Closes the output file.
 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.
void dxfInt (int gc, int value) const
 Writes an int variable to the DXF file.
void dxfReal (int gc, double value) const
 Writes a real (double) variable to the DXF file.
void dxfString (int gc, const char *value) const
 Writes a string variable to the DXF file.
void dxfString (int gc, const std::string &value) const
 Must be overwritten by the implementing class to write a string to the file.
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.
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.
void dxfEOF () const
 End of the DXF file.
void entity (const char *entTypeName) const
 Entity.
void entityAttributes (const DL_Attributes &attrib) const
 Attributes of an entity.
unsigned long getModelSpaceHandle ()
unsigned long getNextHandle () const
unsigned long getPaperSpace0Handle ()
unsigned long getPaperSpaceHandle ()
unsigned long handle (int gc=5) const
 Writes a unique handle and returns it.
unsigned long incHandle () const
 Increases handle, so that the handle returned remains available.
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'.
void sectionBlockEntry (unsigned long int h=0) const
 Block (must be in the section BLOCKS).
void sectionBlockEntryEnd (unsigned long int h=0) const
 End of Block (must be in the section BLOCKS).
void sectionBlocks () const
 Section BLOCKS.
void sectionClasses () const
 Section CLASSES.
void sectionEnd () const
 End of a section.
void sectionEntities () const
 Section ENTITIES.
void sectionHeader () const
 Section HEADER.
void sectionObjects () const
 Section OBJECTS.
void sectionTables () const
 Section TABLES.
void setModelSpaceHandle (unsigned long h)
 Sets the handle of the model space.
void setPaperSpace0Handle (unsigned long h)
 Sets the handle of the paper space 0.
void setPaperSpaceHandle (unsigned long h)
 Sets the handle of the paper space.
void subClass (const char *sub) const
 Subclass.
void table (const char *name, int num, int h=0) const
 Generic table for table 'name' with 'num' entries:
void tableAppid (int num) const
 Table for application id.
void tableAppidEntry (unsigned long int h=0) const
 Appid (must be in the TABLES section APPID).
void tableEnd () const
 End of a table.
void tableLayerEntry (unsigned long int h=0) const
 Layer (must be in the TABLES section LAYER).
void tableLayers (int num) const
 Table for layers.
void tableLinetypeEntry (unsigned long int h=0) const
 Line type (must be in the TABLES section LTYPE).
void tableLinetypes (int num) const
 Table for line types.
void tableStyle (int num) const
 Table for text style.
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.

Private Attributes

std::ofstream m_ofile
 DXF file to be created.

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.

Detailed Description

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

fname File name of the file to be created. 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 ( const char *  fname,
DL_Codes::version  version = DL_VERSION_2000 
)
inline
virtual DL_WriterA::~DL_WriterA ( )
inlinevirtual

Member Function Documentation

void DL_WriterA::close ( ) const

Closes the output file.

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.

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.

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.

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.

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.

bool DL_WriterA::openFailed ( ) const
Return values:
trueOpening file has failed.
falseOtherwise.
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

std::ofstream DL_WriterA::m_ofile
mutableprivate

DXF file to be created.


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