QCAD
Open Source 2D CAD
DL_Writer Class Referenceabstract

Defines interface for writing low level DXF constructs to a file. More...

#include <dl_writer.h>

Inheritance diagram for DL_Writer:
DL_WriterA

Public Member Functions

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...
 
virtual void dxfHex (int gc, int value) const =0
 Must be overwritten by the implementing class to write an int value (hex) to the file. More...
 
virtual void dxfInt (int gc, int value) const =0
 Must be overwritten by the implementing class to write an int value to the file. More...
 
virtual void dxfReal (int gc, double value) const =0
 Must be overwritten by the implementing class to write a real value to the file. More...
 
virtual void dxfString (int gc, const char *value) const =0
 Must be overwritten by the implementing class to write a string to the file. More...
 
virtual void dxfString (int gc, const std::string &value) const =0
 Must be overwritten by the implementing class to write a string to the 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 ()
 

Protected Attributes

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

Defines interface for writing low level DXF constructs to a file.

Implementation is defined in derived classes that write to binary or ASCII files.

Implements functions that write higher level constructs in terms of the low level ones.

Todo:
Add error checking for string/entry length.

Constructor & Destructor Documentation

◆ DL_Writer()

DL_Writer::DL_Writer ( DL_Codes::version  version)
inline
Parameters
versionDXF version. Defaults to DL_VERSION_2002.

◆ ~DL_Writer()

virtual DL_Writer::~DL_Writer ( )
inlinevirtual

Member Function Documentation

◆ color()

void DL_Writer::color ( int  col = 256) const
inline

◆ comment()

void DL_Writer::comment ( const char *  text) const
inline

Comment.

 999
 text

◆ coord()

void DL_Writer::coord ( int  gc,
double  x,
double  y,
double  z = 0 
) const
inline

◆ coordTriplet()

void DL_Writer::coordTriplet ( int  gc,
const double *  value 
) const
inline

◆ dxfBool()

virtual void DL_Writer::dxfBool ( int  gc,
bool  value 
) const
inlinevirtual

Can be overwritten by the implementing class to write a bool value to the file.

Parameters
gcGroup code.
valueThe bool value.

◆ dxfEOF()

void DL_Writer::dxfEOF ( ) const
inline

End of the DXF file.

  0
 EOF

◆ dxfHex()

virtual void DL_Writer::dxfHex ( int  gc,
int  value 
) const
pure virtual

Must be overwritten by the implementing class to write an int value (hex) to the file.

Parameters
gcGroup code.
valueThe int value.

Implemented in DL_WriterA.

◆ dxfInt()

virtual void DL_Writer::dxfInt ( int  gc,
int  value 
) const
pure virtual

Must be overwritten by the implementing class to write an int value to the file.

Parameters
gcGroup code.
valueThe int value.

Implemented in DL_WriterA.

◆ dxfReal()

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

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

Parameters
gcGroup code.
valueThe real value.

Implemented in DL_WriterA.

◆ dxfString() [1/2]

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

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

Parameters
gcGroup code.
valueThe string.

Implemented in DL_WriterA.

◆ dxfString() [2/2]

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

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

Parameters
gcGroup code.
valueThe string.

Implemented in DL_WriterA.

◆ entity()

void DL_Writer::entity ( const char *  entTypeName) const
inline

Entity.

  0
 entTypeName
Returns
Unique handle or 0.

◆ entityAttributes()

void DL_Writer::entityAttributes ( const DL_Attributes attrib) const
inline

Attributes of an entity.

  8
 layer
 62
 color
 39
 width
  6
 linetype

◆ getNextHandle()

unsigned long DL_Writer::getNextHandle ( ) const
inline
Returns
Next handle that will be written.

◆ handle()

unsigned long DL_Writer::handle ( int  gc = 5) const
inline

Writes a unique handle and returns it.

◆ linetype()

void DL_Writer::linetype ( const char *  lt) const
inline

◆ linetypeScale()

void DL_Writer::linetypeScale ( double  scale) const
inline

◆ lineWeight()

void DL_Writer::lineWeight ( int  lw) const
inline

◆ resetHandle()

void DL_Writer::resetHandle ( ) const
inline

◆ section()

void DL_Writer::section ( const char *  name) const
inline

Generic section for section 'name'.

  0
 SECTION
  2
 name

◆ sectionBlockEntry()

void DL_Writer::sectionBlockEntry ( unsigned long int  h = 0) const
inline

Block (must be in the section BLOCKS).

  0
 BLOCK

◆ sectionBlockEntryEnd()

void DL_Writer::sectionBlockEntryEnd ( unsigned long int  h = 0) const
inline

End of Block (must be in the section BLOCKS).

  0
 ENDBLK

◆ sectionBlocks()

void DL_Writer::sectionBlocks ( ) const
inline

Section BLOCKS.

  0
 SECTION
  2
 BLOCKS

◆ sectionClasses()

void DL_Writer::sectionClasses ( ) const
inline

Section CLASSES.

  0
 SECTION
  2
 CLASSES

◆ sectionEnd()

void DL_Writer::sectionEnd ( ) const
inline

End of a section.

  0
 ENDSEC

◆ sectionEntities()

void DL_Writer::sectionEntities ( ) const
inline

Section ENTITIES.

  0
 SECTION
  2
 ENTITIES

◆ sectionHeader()

void DL_Writer::sectionHeader ( ) const
inline

Section HEADER.

  0
 SECTION
  2
 HEADER

◆ sectionObjects()

void DL_Writer::sectionObjects ( ) const
inline

Section OBJECTS.

  0
 SECTION
  2
 OBJECTS

◆ sectionTables()

void DL_Writer::sectionTables ( ) const
inline

Section TABLES.

  0
 SECTION
  2
 TABLES

◆ subClass()

void DL_Writer::subClass ( const char *  sub) const
inline

Subclass.

◆ table()

void DL_Writer::table ( const char *  name,
int  num,
int  h = 0 
) const
inline

Generic table for table 'name' with 'num' entries:

  0
 TABLE
  2
 name
 70
  num

◆ tableAppid()

void DL_Writer::tableAppid ( int  num) const
inline

Table for application id.

Parameters
numNumber of registered applications in total.
  0
 TABLE
  2
 APPID
  70
     num

◆ tableAppidEntry()

void DL_Writer::tableAppidEntry ( unsigned long int  h = 0) const
inline

Appid (must be in the TABLES section APPID).

  0
 APPID

◆ tableEnd()

void DL_Writer::tableEnd ( ) const
inline

End of a table.

  0
 ENDTAB

◆ tableLayerEntry()

void DL_Writer::tableLayerEntry ( unsigned long int  h = 0) const
inline

Layer (must be in the TABLES section LAYER).

  0
 LAYER

◆ tableLayers()

void DL_Writer::tableLayers ( int  num) const
inline

Table for layers.

Parameters
numNumber of layers in total.
  0
 TABLE
  2
 LAYER
  70
     num

◆ tableLinetypeEntry()

void DL_Writer::tableLinetypeEntry ( unsigned long int  h = 0) const
inline

Line type (must be in the TABLES section LTYPE).

  0
 LTYPE

◆ tableLinetypes()

void DL_Writer::tableLinetypes ( int  num) const
inline

Table for line types.

Parameters
numNumber of line types in total.
  0
 TABLE
  2
 LTYPE
  70
     num

◆ tableStyle()

void DL_Writer::tableStyle ( int  num) const
inline

Table for text style.

Parameters
numNumber of text styles.
  0
 TABLE
  2
 STYLE
  70
     num

Member Data Documentation

◆ m_handle

unsigned long DL_Writer::m_handle
mutableprotected

◆ modelSpaceHandle

unsigned long DL_Writer::modelSpaceHandle
mutableprotected

◆ paperSpace0Handle

unsigned long DL_Writer::paperSpace0Handle
mutableprotected

◆ paperSpaceHandle

unsigned long DL_Writer::paperSpaceHandle
mutableprotected

◆ version

DL_Codes::version DL_Writer::version
protected

DXF version to be created.


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