ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DL_Writer Class Referenceabstract

#include <dl_writer.h>

Inheritance diagram for DL_Writer:

Public Member Functions

 DL_Writer (DL_Codes::version version)
 
virtual ~DL_Writer ()
 
void section (const char *name) const
 
void sectionHeader () const
 
void sectionTables () const
 
void sectionBlocks () const
 
void sectionEntities () const
 
void sectionClasses () const
 
void sectionObjects () const
 
void sectionEnd () const
 
void table (const char *name, int num, int h=0) const
 
void tableLayers (int num) const
 
void tableLinetypes (int num) const
 
void tableAppid (int num) const
 
void tableStyle (int num) const
 
void tableEnd () const
 
void dxfEOF () const
 
void comment (const char *text) const
 
void entity (const char *entTypeName) const
 
void entityAttributes (const DL_Attributes &attrib) const
 
void subClass (const char *sub) const
 
void tableLayerEntry (unsigned long int h=0) const
 
void tableLinetypeEntry (unsigned long int h=0) const
 
void tableAppidEntry (unsigned long int h=0) const
 
void sectionBlockEntry (unsigned long int h=0) const
 
void sectionBlockEntryEnd (unsigned long int h=0) const
 
void color (int col=256) const
 
void linetype (const char *lt) const
 
void linetypeScale (double scale) const
 
void lineWeight (int lw) const
 
void coord (int gc, double x, double y, double z=0) const
 
void coordTriplet (int gc, const double *value) const
 
void resetHandle () const
 
unsigned long handle (int gc=5) const
 
unsigned long getNextHandle () const
 
unsigned long incHandle () const
 
void setModelSpaceHandle (unsigned long h)
 
unsigned long getModelSpaceHandle ()
 
void setPaperSpaceHandle (unsigned long h)
 
unsigned long getPaperSpaceHandle ()
 
void setPaperSpace0Handle (unsigned long h)
 
unsigned long getPaperSpace0Handle ()
 
virtual void dxfReal (int gc, double value) const =0
 
virtual void dxfInt (int gc, int value) const =0
 
virtual void dxfBool (int gc, bool value) const
 
virtual void dxfHex (int gc, int value) const =0
 
virtual void dxfString (int gc, const char *value) const =0
 
virtual void dxfString (int gc, const std::string &value) const =0
 

Protected Attributes

unsigned long m_handle
 
unsigned long modelSpaceHandle
 
unsigned long paperSpaceHandle
 
unsigned long paperSpace0Handle
 
DL_Codes::version version
 

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.

Definition at line 55 of file dl_writer.h.

Constructor & Destructor Documentation

◆ DL_Writer()

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

Definition at line 60 of file dl_writer.h.

References version.

◆ ~DL_Writer()

virtual DL_Writer::~DL_Writer ( )
inlinevirtual

Definition at line 67 of file dl_writer.h.

Member Function Documentation

◆ color()

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

Definition at line 463 of file dl_writer.h.

◆ comment()

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

Comment.

 999
 text

Definition at line 282 of file dl_writer.h.

Referenced by DL_Dxf::writeHeader().

◆ coord()

◆ coordTriplet()

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

Definition at line 474 of file dl_writer.h.

◆ 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.

Definition at line 552 of file dl_writer.h.

Referenced by DL_Dxf::writeHatchEdge(), and DL_Dxf::writeXRecord().

◆ dxfEOF()

void DL_Writer::dxfEOF ( ) const
inline

◆ 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()

◆ entityAttributes()

◆ getModelSpaceHandle()

unsigned long DL_Writer::getModelSpaceHandle ( )
inline

Definition at line 509 of file dl_writer.h.

◆ getNextHandle()

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

Definition at line 496 of file dl_writer.h.

Referenced by DL_Dxf::writeDictionaryEntry(), and DL_Dxf::writeObjects().

◆ getPaperSpace0Handle()

unsigned long DL_Writer::getPaperSpace0Handle ( )
inline

Definition at line 525 of file dl_writer.h.

◆ getPaperSpaceHandle()

unsigned long DL_Writer::getPaperSpaceHandle ( )
inline

Definition at line 517 of file dl_writer.h.

◆ handle()

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

Writes a unique handle and returns it.

Definition at line 487 of file dl_writer.h.

Referenced by DL_Dxf::writeBlockRecord(), DL_Dxf::writeObjects(), DL_Dxf::writeStyle(), and DL_Dxf::writeVPort().

◆ incHandle()

unsigned long DL_Writer::incHandle ( ) const
inline

Increases handle, so that the handle returned remains available.

Definition at line 501 of file dl_writer.h.

Referenced by DL_Dxf::writeDictionaryEntry(), and DL_Dxf::writeImage().

◆ linetype()

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

Definition at line 464 of file dl_writer.h.

◆ linetypeScale()

void DL_Writer::linetypeScale ( double  scale) const
inline

Definition at line 465 of file dl_writer.h.

◆ lineWeight()

void DL_Writer::lineWeight ( int  lw) const
inline

Definition at line 466 of file dl_writer.h.

◆ resetHandle()

void DL_Writer::resetHandle ( ) const
inline

Definition at line 482 of file dl_writer.h.

◆ section()

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

Generic section for section 'name'.

  0
 SECTION
  2
 name

Definition at line 78 of file dl_writer.h.

References name.

◆ sectionBlockEntry()

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

Block (must be in the section BLOCKS).

  0
 BLOCK

Definition at line 419 of file dl_writer.h.

References DL_VERSION_2000, and version.

Referenced by DL_Dxf::writeBlock().

◆ sectionBlockEntryEnd()

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

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

  0
 ENDBLK

Definition at line 445 of file dl_writer.h.

References DL_VERSION_2000, and version.

Referenced by DL_Dxf::writeEndBlock().

◆ sectionBlocks()

void DL_Writer::sectionBlocks ( ) const
inline

◆ sectionClasses()

void DL_Writer::sectionClasses ( ) const
inline

Section CLASSES

  0
 SECTION
  2
 CLASSES

Definition at line 141 of file dl_writer.h.

◆ sectionEnd()

void DL_Writer::sectionEnd ( ) const
inline

◆ sectionEntities()

void DL_Writer::sectionEntities ( ) const
inline

Section ENTITIES

  0
 SECTION
  2
 ENTITIES

Definition at line 129 of file dl_writer.h.

Referenced by main(), DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and testWriting().

◆ sectionHeader()

void DL_Writer::sectionHeader ( ) const
inline

Section HEADER

  0
 SECTION
  2
 HEADER

Definition at line 93 of file dl_writer.h.

Referenced by DL_Dxf::writeHeader().

◆ sectionObjects()

void DL_Writer::sectionObjects ( ) const
inline

Section OBJECTS

  0
 SECTION
  2
 OBJECTS

Definition at line 153 of file dl_writer.h.

◆ sectionTables()

void DL_Writer::sectionTables ( ) const
inline

◆ setModelSpaceHandle()

void DL_Writer::setModelSpaceHandle ( unsigned long  h)
inline

Sets the handle of the model space. Entities refer to this handle.

Definition at line 507 of file dl_writer.h.

◆ setPaperSpace0Handle()

void DL_Writer::setPaperSpace0Handle ( unsigned long  h)
inline

Sets the handle of the paper space 0. Some special blocks refer to this handle.

Definition at line 523 of file dl_writer.h.

◆ setPaperSpaceHandle()

void DL_Writer::setPaperSpaceHandle ( unsigned long  h)
inline

Sets the handle of the paper space. Some special blocks refer to this handle.

Definition at line 515 of file dl_writer.h.

◆ subClass()

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

Subclass.

Definition at line 344 of file dl_writer.h.

◆ 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

Definition at line 177 of file dl_writer.h.

References DL_VERSION_2000, name, and version.

◆ 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

Definition at line 237 of file dl_writer.h.

Referenced by main(), DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and testWriting().

◆ tableAppidEntry()

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

Appid (must be in the TABLES section APPID).

  0
 APPID

Definition at line 397 of file dl_writer.h.

References DL_VERSION_2000, and version.

Referenced by DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and DL_Dxf::writeAppid().

◆ tableEnd()

void DL_Writer::tableEnd ( ) const
inline

◆ tableLayerEntry()

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

Layer (must be in the TABLES section LAYER).

  0
 LAYER

Definition at line 354 of file dl_writer.h.

References DL_VERSION_2000, and version.

Referenced by DL_Dxf::writeLayer().

◆ tableLayers()

void DL_Writer::tableLayers ( int  num) const
inline

Table for layers.

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

Definition at line 204 of file dl_writer.h.

Referenced by main(), DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and testWriting().

◆ tableLinetypeEntry()

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

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

  0
 LTYPE

Definition at line 375 of file dl_writer.h.

References DL_VERSION_2000, and version.

Referenced by DL_Dxf::writeLinetype().

◆ 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

Definition at line 219 of file dl_writer.h.

Referenced by main(), DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and testWriting().

◆ tableStyle()

void DL_Writer::tableStyle ( int  num) const
inline

Table for text style.

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

Definition at line 252 of file dl_writer.h.

Referenced by main(), DxfProfilesExporter::SaveHorizontalProfiles(), DxfFilter::saveToFile(), DxfProfilesExporter::SaveVerticalProfiles(), and testWriting().

Member Data Documentation

◆ m_handle

unsigned long DL_Writer::m_handle
mutableprotected

Definition at line 582 of file dl_writer.h.

◆ modelSpaceHandle

unsigned long DL_Writer::modelSpaceHandle
mutableprotected

Definition at line 583 of file dl_writer.h.

◆ paperSpace0Handle

unsigned long DL_Writer::paperSpace0Handle
mutableprotected

Definition at line 585 of file dl_writer.h.

◆ paperSpaceHandle

unsigned long DL_Writer::paperSpaceHandle
mutableprotected

Definition at line 584 of file dl_writer.h.

◆ version

DL_Codes::version DL_Writer::version
protected

DXF version to be created.

Definition at line 590 of file dl_writer.h.

Referenced by DL_WriterA::dxfReal().


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