ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DL_Dxf Class Reference

#include <dl_dxf.h>

Public Member Functions

 DL_Dxf ()
 
 ~DL_Dxf ()
 
bool in (const std::string &file, DL_CreationInterface *creationInterface)
 Reads the given file and calls the appropriate functions in the given creation interface for every entity found in the file. More...
 
bool readDxfGroups (FILE *fp, DL_CreationInterface *creationInterface)
 Reads a group couplet from a DXF file. Calls another function to process it. More...
 
bool readDxfGroups (std::stringstream &stream, DL_CreationInterface *creationInterface)
 
bool in (std::stringstream &stream, DL_CreationInterface *creationInterface)
 
bool processDXFGroup (DL_CreationInterface *creationInterface, int groupCode, const std::string &groupValue)
 
void addSetting (DL_CreationInterface *creationInterface)
 
void addLayer (DL_CreationInterface *creationInterface)
 
void addLinetype (DL_CreationInterface *creationInterface)
 
void addBlock (DL_CreationInterface *creationInterface)
 
void endBlock (DL_CreationInterface *creationInterface)
 
void addTextStyle (DL_CreationInterface *creationInterface)
 
void addPoint (DL_CreationInterface *creationInterface)
 
void addLine (DL_CreationInterface *creationInterface)
 
void addXLine (DL_CreationInterface *creationInterface)
 
void addRay (DL_CreationInterface *creationInterface)
 
void addPolyline (DL_CreationInterface *creationInterface)
 
void addVertex (DL_CreationInterface *creationInterface)
 
void addSpline (DL_CreationInterface *creationInterface)
 
void addArc (DL_CreationInterface *creationInterface)
 
void addCircle (DL_CreationInterface *creationInterface)
 
void addEllipse (DL_CreationInterface *creationInterface)
 
void addInsert (DL_CreationInterface *creationInterface)
 
void addTrace (DL_CreationInterface *creationInterface)
 
void add3dFace (DL_CreationInterface *creationInterface)
 
void addSolid (DL_CreationInterface *creationInterface)
 
void addMText (DL_CreationInterface *creationInterface)
 
void addText (DL_CreationInterface *creationInterface)
 
void addArcAlignedText (DL_CreationInterface *creationInterface)
 
void addAttribute (DL_CreationInterface *creationInterface)
 
DL_DimensionData getDimData ()
 
void addDimLinear (DL_CreationInterface *creationInterface)
 
void addDimAligned (DL_CreationInterface *creationInterface)
 
void addDimRadial (DL_CreationInterface *creationInterface)
 
void addDimDiametric (DL_CreationInterface *creationInterface)
 
void addDimAngular (DL_CreationInterface *creationInterface)
 
void addDimAngular3P (DL_CreationInterface *creationInterface)
 
void addDimOrdinate (DL_CreationInterface *creationInterface)
 
void addLeader (DL_CreationInterface *creationInterface)
 
void addHatch (DL_CreationInterface *creationInterface)
 
void addHatchLoop ()
 
void addHatchEdge ()
 
bool handleHatchData (DL_CreationInterface *creationInterface)
 
void addImage (DL_CreationInterface *creationInterface)
 
void addImageDef (DL_CreationInterface *creationInterface)
 
void addComment (DL_CreationInterface *creationInterface, const std::string &comment)
 
void addDictionary (DL_CreationInterface *creationInterface)
 
void addDictionaryEntry (DL_CreationInterface *creationInterface)
 
bool handleXRecordData (DL_CreationInterface *creationInterface)
 
bool handleDictionaryData (DL_CreationInterface *creationInterface)
 
bool handleXData (DL_CreationInterface *creationInterface)
 
bool handleMTextData (DL_CreationInterface *creationInterface)
 
bool handleLWPolylineData (DL_CreationInterface *creationInterface)
 
bool handleSplineData (DL_CreationInterface *creationInterface)
 
bool handleLeaderData (DL_CreationInterface *creationInterface)
 
bool handleLinetypeData (DL_CreationInterface *creationInterface)
 
void endEntity (DL_CreationInterface *creationInterface)
 
void endSequence (DL_CreationInterface *creationInterface)
 
DL_WriterAout (const char *file, DL_Codes::version version=DL_Codes::AC1015)
 Opens the given file for writing and returns a pointer to the dxf writer. This pointer needs to be passed on to other writing functions. More...
 
void writeHeader (DL_WriterA &dw)
 Writes a DXF header to the file currently opened by the given DXF writer object. More...
 
void writePoint (DL_WriterA &dw, const DL_PointData &data, const DL_Attributes &attrib)
 
void writeLine (DL_WriterA &dw, const DL_LineData &data, const DL_Attributes &attrib)
 
void writeXLine (DL_WriterA &dw, const DL_XLineData &data, const DL_Attributes &attrib)
 
void writeRay (DL_WriterA &dw, const DL_RayData &data, const DL_Attributes &attrib)
 
void writePolyline (DL_WriterA &dw, const DL_PolylineData &data, const DL_Attributes &attrib)
 
void writeVertex (DL_WriterA &dw, const DL_VertexData &data)
 
void writePolylineEnd (DL_WriterA &dw)
 
void writeSpline (DL_WriterA &dw, const DL_SplineData &data, const DL_Attributes &attrib)
 
void writeControlPoint (DL_WriterA &dw, const DL_ControlPointData &data)
 
void writeFitPoint (DL_WriterA &dw, const DL_FitPointData &data)
 
void writeKnot (DL_WriterA &dw, const DL_KnotData &data)
 
void writeCircle (DL_WriterA &dw, const DL_CircleData &data, const DL_Attributes &attrib)
 
void writeArc (DL_WriterA &dw, const DL_ArcData &data, const DL_Attributes &attrib)
 
void writeEllipse (DL_WriterA &dw, const DL_EllipseData &data, const DL_Attributes &attrib)
 
void writeSolid (DL_WriterA &dw, const DL_SolidData &data, const DL_Attributes &attrib)
 
void writeTrace (DL_WriterA &dw, const DL_TraceData &data, const DL_Attributes &attrib)
 
void write3dFace (DL_WriterA &dw, const DL_3dFaceData &data, const DL_Attributes &attrib)
 
void writeInsert (DL_WriterA &dw, const DL_InsertData &data, const DL_Attributes &attrib)
 
void writeMText (DL_WriterA &dw, const DL_MTextData &data, const DL_Attributes &attrib)
 
void writeText (DL_WriterA &dw, const DL_TextData &data, const DL_Attributes &attrib)
 
void writeAttribute (DL_WriterA &dw, const DL_AttributeData &data, const DL_Attributes &attrib)
 
void writeDimStyleOverrides (DL_WriterA &dw, const DL_DimensionData &data)
 
void writeDimAligned (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimAlignedData &edata, const DL_Attributes &attrib)
 
void writeDimLinear (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimLinearData &edata, const DL_Attributes &attrib)
 
void writeDimRadial (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimRadialData &edata, const DL_Attributes &attrib)
 
void writeDimDiametric (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimDiametricData &edata, const DL_Attributes &attrib)
 
void writeDimAngular (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimAngularData &edata, const DL_Attributes &attrib)
 
void writeDimAngular3P (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimAngular3PData &edata, const DL_Attributes &attrib)
 
void writeDimOrdinate (DL_WriterA &dw, const DL_DimensionData &data, const DL_DimOrdinateData &edata, const DL_Attributes &attrib)
 
void writeLeader (DL_WriterA &dw, const DL_LeaderData &data, const DL_Attributes &attrib)
 
void writeLeaderVertex (DL_WriterA &dw, const DL_LeaderVertexData &data)
 
void writeHatch1 (DL_WriterA &dw, const DL_HatchData &data, const DL_Attributes &attrib)
 
void writeHatch2 (DL_WriterA &dw, const DL_HatchData &data, const DL_Attributes &attrib)
 
void writeHatchLoop1 (DL_WriterA &dw, const DL_HatchLoopData &data)
 
void writeHatchLoop2 (DL_WriterA &dw, const DL_HatchLoopData &data)
 
void writeHatchEdge (DL_WriterA &dw, const DL_HatchEdgeData &data)
 
int writeImage (DL_WriterA &dw, const DL_ImageData &data, const DL_Attributes &attrib)
 
void writeImageDef (DL_WriterA &dw, int handle, const DL_ImageData &data)
 
void writeLayer (DL_WriterA &dw, const DL_LayerData &data, const DL_Attributes &attrib)
 
void writeLinetype (DL_WriterA &dw, const DL_LinetypeData &data)
 
void writeAppid (DL_WriterA &dw, const std::string &name)
 
void writeBlock (DL_WriterA &dw, const DL_BlockData &data)
 
void writeEndBlock (DL_WriterA &dw, const std::string &name)
 
void writeVPort (DL_WriterA &dw)
 
void writeStyle (DL_WriterA &dw, const DL_StyleData &style)
 
void writeView (DL_WriterA &dw)
 
void writeUcs (DL_WriterA &dw)
 
void writeDimStyle (DL_WriterA &dw, double dimasz, double dimexe, double dimexo, double dimgap, double dimtxt)
 
void writeBlockRecord (DL_WriterA &dw)
 
void writeBlockRecord (DL_WriterA &dw, const std::string &name)
 
void writeObjects (DL_WriterA &dw, const std::string &appDictionaryName="")
 
void writeAppDictionary (DL_WriterA &dw)
 
int writeDictionaryEntry (DL_WriterA &dw, const std::string &name)
 
void writeXRecord (DL_WriterA &dw, int handle, int value)
 
void writeXRecord (DL_WriterA &dw, int handle, double value)
 
void writeXRecord (DL_WriterA &dw, int handle, bool value)
 
void writeXRecord (DL_WriterA &dw, int handle, const std::string &value)
 
void writeObjectsEnd (DL_WriterA &dw)
 
void writeComment (DL_WriterA &dw, const std::string &comment)
 
DL_Codes::version getVersion ()
 
int getLibVersion (const std::string &str)
 
bool hasValue (int code)
 
int getIntValue (int code, int def)
 
int toInt (const std::string &str)
 
int getInt16Value (int code, int def)
 
int toInt16 (const std::string &str)
 
bool toBool (const std::string &str)
 
std::string getStringValue (int code, const std::string &def)
 
double getRealValue (int code, double def)
 
double toReal (const std::string &str)
 

Static Public Member Functions

static bool getStrippedLine (std::string &s, unsigned int size, FILE *stream, bool stripSpace=true)
 Reads line from file & strips whitespace at start and newline at end. More...
 
static bool getStrippedLine (std::string &s, unsigned int size, std::stringstream &stream, bool stripSpace=true)
 
static bool stripWhiteSpace (char **s, bool stripSpaces=true)
 Strips leading whitespace and trailing Carriage Return (CR) and Line Feed (LF) from NULL terminated string. More...
 
static bool checkVariable (const char *var, DL_Codes::version version)
 
static void test ()
 

Detailed Description

Reading and writing of DXF files.

This class can read in a DXF file and calls methods from the interface DL_EntityContainer to add the entities to the contianer provided by the user of the library.

It can also be used to write DXF files to a certain extent.

When saving entities, special values for colors and linetypes can be used:

Special colors are 0 (=BYBLOCK) and 256 (=BYLAYER). Special linetypes are "BYLAYER" and "BYBLOCK".

Author
Andrew Mustun

Definition at line 120 of file dl_dxf.h.

Constructor & Destructor Documentation

◆ DL_Dxf()

DL_Dxf::DL_Dxf ( )

Default constructor.

Definition at line 42 of file dl_dxf.cpp.

References DL_VERSION_2000, and NULL.

◆ ~DL_Dxf()

DL_Dxf::~DL_Dxf ( )

Destructor.

Definition at line 72 of file dl_dxf.cpp.

References NULL.

Member Function Documentation

◆ add3dFace()

void DL_Dxf::add3dFace ( DL_CreationInterface creationInterface)

Adds a 3dface entity that was read from the file via the creation interface.

Definition at line 1138 of file dl_dxf.cpp.

References DL_CreationInterface::add3dFace(), getRealValue(), DL_TraceData::x, DL_TraceData::y, and DL_TraceData::z.

Referenced by processDXFGroup().

◆ addArc()

void DL_Dxf::addArc ( DL_CreationInterface creationInterface)

Adds an arc entity that was read from the file via the creation interface.

Definition at line 1055 of file dl_dxf.cpp.

References DL_CreationInterface::addArc(), and getRealValue().

Referenced by processDXFGroup().

◆ addArcAlignedText()

◆ addAttribute()

void DL_Dxf::addAttribute ( DL_CreationInterface creationInterface)

Adds an attrib entity that was read from the file via the creation interface.

Todo:
add attrib instead of normal text

Definition at line 1599 of file dl_dxf.cpp.

References DL_CreationInterface::addAttribute(), getIntValue(), getRealValue(), getStringValue(), and M_PI.

Referenced by processDXFGroup().

◆ addBlock()

void DL_Dxf::addBlock ( DL_CreationInterface creationInterface)

Adds a block that was read from the file via the creation interface.

Definition at line 880 of file dl_dxf.cpp.

References DL_CreationInterface::addBlock(), getIntValue(), getRealValue(), getStringValue(), and name.

Referenced by processDXFGroup().

◆ addCircle()

void DL_Dxf::addCircle ( DL_CreationInterface creationInterface)

Adds a circle entity that was read from the file via the creation interface.

Definition at line 1066 of file dl_dxf.cpp.

References DL_CreationInterface::addCircle(), and getRealValue().

Referenced by processDXFGroup().

◆ addComment()

void DL_Dxf::addComment ( DL_CreationInterface creationInterface,
const std::string &  comment 
)

Adds a comment from the DXF file.

Definition at line 741 of file dl_dxf.cpp.

References DL_CreationInterface::addComment().

Referenced by processDXFGroup().

◆ addDictionary()

void DL_Dxf::addDictionary ( DL_CreationInterface creationInterface)

Definition at line 746 of file dl_dxf.cpp.

References DL_CreationInterface::addDictionary(), and getStringValue().

◆ addDictionaryEntry()

void DL_Dxf::addDictionaryEntry ( DL_CreationInterface creationInterface)

Definition at line 750 of file dl_dxf.cpp.

References DL_CreationInterface::addDictionaryEntry(), and getStringValue().

◆ addDimAligned()

void DL_Dxf::addDimAligned ( DL_CreationInterface creationInterface)

Adds an aligned dimension entity that was read from the file via the creation interface.

Definition at line 1677 of file dl_dxf.cpp.

References DL_CreationInterface::addDimAlign(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimAngular()

void DL_Dxf::addDimAngular ( DL_CreationInterface creationInterface)

Adds an angular dimension entity that was read from the file via the creation interface.

Definition at line 1725 of file dl_dxf.cpp.

References DL_CreationInterface::addDimAngular(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimAngular3P()

void DL_Dxf::addDimAngular3P ( DL_CreationInterface creationInterface)

Adds an angular dimension entity that was read from the file via the creation interface.

Definition at line 1746 of file dl_dxf.cpp.

References DL_CreationInterface::addDimAngular3P(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimDiametric()

void DL_Dxf::addDimDiametric ( DL_CreationInterface creationInterface)

Adds a diametric dimension entity that was read from the file via the creation interface.

Definition at line 1709 of file dl_dxf.cpp.

References DL_CreationInterface::addDimDiametric(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimLinear()

void DL_Dxf::addDimLinear ( DL_CreationInterface creationInterface)

Adds a linear dimension entity that was read from the file via the creation interface.

Definition at line 1657 of file dl_dxf.cpp.

References DL_CreationInterface::addDimLinear(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimOrdinate()

void DL_Dxf::addDimOrdinate ( DL_CreationInterface creationInterface)

Adds an ordinate dimension entity that was read from the file via the creation interface.

Definition at line 1765 of file dl_dxf.cpp.

References DL_CreationInterface::addDimOrdinate(), getDimData(), getIntValue(), and getRealValue().

Referenced by processDXFGroup().

◆ addDimRadial()

void DL_Dxf::addDimRadial ( DL_CreationInterface creationInterface)

Adds a radial dimension entity that was read from the file via the creation interface.

Definition at line 1694 of file dl_dxf.cpp.

References DL_CreationInterface::addDimRadial(), getDimData(), and getRealValue().

Referenced by processDXFGroup().

◆ addEllipse()

void DL_Dxf::addEllipse ( DL_CreationInterface creationInterface)

Adds an ellipse entity that was read from the file via the creation interface.

Definition at line 1077 of file dl_dxf.cpp.

References DL_CreationInterface::addEllipse(), getRealValue(), and M_PI.

Referenced by processDXFGroup().

◆ addHatch()

void DL_Dxf::addHatch ( DL_CreationInterface creationInterface)

Adds a hatch entity that was read from the file via the creation interface.

Definition at line 1815 of file dl_dxf.cpp.

References DL_CreationInterface::addHatch(), DL_CreationInterface::addHatchEdge(), DL_CreationInterface::addHatchLoop(), DL_CreationInterface::endEntity(), getIntValue(), getRealValue(), getStringValue(), and size.

Referenced by handleHatchData().

◆ addHatchEdge()

void DL_Dxf::addHatchEdge ( )

Definition at line 1838 of file dl_dxf.cpp.

References DL_HatchEdgeData::defined.

Referenced by addHatchLoop(), and handleHatchData().

◆ addHatchLoop()

void DL_Dxf::addHatchLoop ( )

Definition at line 1833 of file dl_dxf.cpp.

References addHatchEdge().

Referenced by handleHatchData().

◆ addImage()

void DL_Dxf::addImage ( DL_CreationInterface creationInterface)

Adds an image entity that was read from the file via the creation interface.

Definition at line 2063 of file dl_dxf.cpp.

References DL_CreationInterface::addImage(), DL_UNKNOWN, DL_CreationInterface::endEntity(), getIntValue(), getRealValue(), and getStringValue().

Referenced by processDXFGroup().

◆ addImageDef()

void DL_Dxf::addImageDef ( DL_CreationInterface creationInterface)

Adds an image definition that was read from the file via the creation interface.

Definition at line 2086 of file dl_dxf.cpp.

References DL_UNKNOWN, DL_CreationInterface::endEntity(), getStringValue(), and DL_CreationInterface::linkImage().

Referenced by processDXFGroup().

◆ addInsert()

void DL_Dxf::addInsert ( DL_CreationInterface creationInterface)

Adds an insert entity that was read from the file via the creation interface.

Definition at line 1090 of file dl_dxf.cpp.

References DL_CreationInterface::addInsert(), getIntValue(), getRealValue(), getStringValue(), and name.

Referenced by processDXFGroup().

◆ addLayer()

◆ addLeader()

void DL_Dxf::addLeader ( DL_CreationInterface creationInterface)

Adds a leader entity that was read from the file via the creation interface.

Definition at line 1782 of file dl_dxf.cpp.

References DL_CreationInterface::addLeader(), DL_CreationInterface::addLeaderVertex(), DL_CreationInterface::endEntity(), getIntValue(), and getRealValue().

Referenced by processDXFGroup().

◆ addLine()

void DL_Dxf::addLine ( DL_CreationInterface creationInterface)

Adds a line entity that was read from the file via the creation interface.

Definition at line 945 of file dl_dxf.cpp.

References DL_CreationInterface::addLine(), and getRealValue().

Referenced by processDXFGroup().

◆ addLinetype()

void DL_Dxf::addLinetype ( DL_CreationInterface creationInterface)

Adds a linetype that was read from the file via the creation interface.

Definition at line 836 of file dl_dxf.cpp.

References DL_CreationInterface::addLinetype(), getIntValue(), getRealValue(), getStringValue(), and name.

Referenced by processDXFGroup().

◆ addMText()

void DL_Dxf::addMText ( DL_CreationInterface creationInterface)

Adds an MText entity that was read from the file via the creation interface.

Definition at line 1169 of file dl_dxf.cpp.

References DL_CreationInterface::addMText(), getIntValue(), getRealValue(), getStringValue(), hasValue(), M_PI, x, and y.

Referenced by processDXFGroup().

◆ addPoint()

void DL_Dxf::addPoint ( DL_CreationInterface creationInterface)

Adds a point entity that was read from the file via the creation interface.

Definition at line 936 of file dl_dxf.cpp.

References DL_CreationInterface::addPoint(), and getRealValue().

Referenced by processDXFGroup().

◆ addPolyline()

void DL_Dxf::addPolyline ( DL_CreationInterface creationInterface)

Adds a polyline entity that was read from the file via the creation interface.

Definition at line 979 of file dl_dxf.cpp.

References DL_CreationInterface::addPolyline(), DL_CreationInterface::addVertex(), DL_ENTITY_LWPOLYLINE, DL_CreationInterface::endEntity(), getIntValue(), and getRealValue().

Referenced by processDXFGroup().

◆ addRay()

void DL_Dxf::addRay ( DL_CreationInterface creationInterface)

Adds a ray entity that was read from the file via the creation interface.

Definition at line 967 of file dl_dxf.cpp.

References DL_CreationInterface::addRay(), and getRealValue().

Referenced by processDXFGroup().

◆ addSetting()

◆ addSolid()

void DL_Dxf::addSolid ( DL_CreationInterface creationInterface)

Adds a solid entity (filled trace) that was read from the file via the creation interface.

Author
AHM

Definition at line 1155 of file dl_dxf.cpp.

References DL_CreationInterface::addSolid(), getRealValue(), DL_TraceData::x, DL_TraceData::y, and DL_TraceData::z.

Referenced by processDXFGroup().

◆ addSpline()

◆ addText()

void DL_Dxf::addText ( DL_CreationInterface creationInterface)

Adds an text entity that was read from the file via the creation interface.

Definition at line 1531 of file dl_dxf.cpp.

References DL_CreationInterface::addText(), DL_NANDOUBLE, getIntValue(), getRealValue(), getStringValue(), and M_PI.

Referenced by processDXFGroup().

◆ addTextStyle()

void DL_Dxf::addTextStyle ( DL_CreationInterface creationInterface)

◆ addTrace()

void DL_Dxf::addTrace ( DL_CreationInterface creationInterface)

Adds a trace entity (4 edge closed polyline) that was read from the file via the creation interface.

Author
AHM

Definition at line 1124 of file dl_dxf.cpp.

References DL_CreationInterface::addTrace(), getRealValue(), DL_TraceData::x, DL_TraceData::y, and DL_TraceData::z.

Referenced by processDXFGroup().

◆ addVertex()

void DL_Dxf::addVertex ( DL_CreationInterface creationInterface)

Adds a polyline vertex entity that was read from the file via the creation interface.

Definition at line 1001 of file dl_dxf.cpp.

References DL_CreationInterface::addVertex(), getIntValue(), and getRealValue().

Referenced by processDXFGroup().

◆ addXLine()

void DL_Dxf::addXLine ( DL_CreationInterface creationInterface)

Adds an xline entity that was read from the file via the creation interface.

Definition at line 956 of file dl_dxf.cpp.

References DL_CreationInterface::addXLine(), and getRealValue().

Referenced by processDXFGroup().

◆ checkVariable()

bool DL_Dxf::checkVariable ( const char *  var,
DL_Codes::version  version 
)
static

Converts the given string into a double or returns the given default valud (def) if value is NULL or empty. Converts the given string into an int or returns the given default valud (def) if value is NULL or empty. Converts the given string into a string or returns the given default valud (def) if value is NULL or empty.

Checks if the given variable is known by the given DXF version.

Definition at line 4467 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_VERSION_R12, and version.

◆ endBlock()

void DL_Dxf::endBlock ( DL_CreationInterface creationInterface)

Ends a block that was read from the file via the creation interface.

Definition at line 901 of file dl_dxf.cpp.

References DL_CreationInterface::endBlock().

Referenced by processDXFGroup().

◆ endEntity()

void DL_Dxf::endEntity ( DL_CreationInterface creationInterface)

Ends some special entities like hatches or old style polylines.

Definition at line 2098 of file dl_dxf.cpp.

References DL_CreationInterface::endEntity().

Referenced by processDXFGroup().

◆ endSequence()

void DL_Dxf::endSequence ( DL_CreationInterface creationInterface)

Ends a sequence and notifies the creation interface.

Definition at line 2105 of file dl_dxf.cpp.

References DL_CreationInterface::endSequence().

Referenced by processDXFGroup().

◆ getDimData()

DL_DimensionData DL_Dxf::getDimData ( )
Returns
dimension data from current values.

Definition at line 1630 of file dl_dxf.cpp.

References getIntValue(), getRealValue(), and getStringValue().

Referenced by addDimAligned(), addDimAngular(), addDimAngular3P(), addDimDiametric(), addDimLinear(), addDimOrdinate(), and addDimRadial().

◆ getInt16Value()

int DL_Dxf::getInt16Value ( int  code,
int  def 
)
inline

Definition at line 412 of file dl_dxf.h.

Referenced by processDXFGroup().

◆ getIntValue()

◆ getLibVersion()

int DL_Dxf::getLibVersion ( const std::string &  str)
Returns
the library version as int (4 bytes, each byte one version number). e.g. if str = "2.0.2.0" getLibVersion returns 0x02000200

Definition at line 4905 of file dl_dxf.cpp.

Referenced by processDXFGroup().

◆ getRealValue()

◆ getStringValue()

std::string DL_Dxf::getStringValue ( int  code,
const std::string &  def 
)
inline

◆ getStrippedLine() [1/2]

bool DL_Dxf::getStrippedLine ( std::string &  s,
unsigned int  size,
FILE *  fp,
bool  stripSpace = true 
)
static

Reads line from file & strips whitespace at start and newline at end.

Parameters
sOutput
Pointer to character array that chopped line will be returned in.
sizeSize of s. (Including space for NULL.)
fpInput
Handle of input file.
Return values
trueif line could be read
falseif fp is already at end of file
Todo:

Change function to use safer FreeBSD strl* functions

Is it a problem if line is blank (i.e., newline only)? Then, when function returns, (s==NULL).

Definition at line 220 of file dl_dxf.cpp.

References NULL, size, and stripWhiteSpace().

Referenced by readDxfGroups().

◆ getStrippedLine() [2/2]

bool DL_Dxf::getStrippedLine ( std::string &  s,
unsigned int  size,
std::stringstream &  stream,
bool  stripSpace = true 
)
static

Same as above but for stringstreams.

Definition at line 255 of file dl_dxf.cpp.

References size, and stripWhiteSpace().

◆ getVersion()

DL_Codes::version DL_Dxf::getVersion ( )
inline

Definition at line 392 of file dl_dxf.h.

References version.

◆ handleDictionaryData()

bool DL_Dxf::handleDictionaryData ( DL_CreationInterface creationInterface)

Handles all dictionary data.

Definition at line 1278 of file dl_dxf.cpp.

References DL_CreationInterface::addDictionary(), DL_CreationInterface::addDictionaryEntry(), and getStringValue().

Referenced by processDXFGroup().

◆ handleHatchData()

◆ handleLeaderData()

bool DL_Dxf::handleLeaderData ( DL_CreationInterface creationInterface)

Handles additional leader data.

Definition at line 1490 of file dl_dxf.cpp.

References NULL, toInt(), and toReal().

Referenced by processDXFGroup().

◆ handleLinetypeData()

bool DL_Dxf::handleLinetypeData ( DL_CreationInterface creationInterface)

Handles all dashes in linetype pattern.

Definition at line 868 of file dl_dxf.cpp.

References DL_CreationInterface::addLinetypeDash(), and toReal().

Referenced by processDXFGroup().

◆ handleLWPolylineData()

bool DL_Dxf::handleLWPolylineData ( DL_CreationInterface creationInterface)

Handles additional polyline data.

Definition at line 1336 of file dl_dxf.cpp.

References NULL, toInt(), and toReal().

Referenced by processDXFGroup().

◆ handleMTextData()

bool DL_Dxf::handleMTextData ( DL_CreationInterface creationInterface)

Handles additional MText data.

Definition at line 1323 of file dl_dxf.cpp.

References DL_CreationInterface::addMTextChunk().

Referenced by processDXFGroup().

◆ handleSplineData()

bool DL_Dxf::handleSplineData ( DL_CreationInterface creationInterface)

Handles additional spline data.

Definition at line 1379 of file dl_dxf.cpp.

References NULL, toInt(), and toReal().

Referenced by processDXFGroup().

◆ handleXData()

bool DL_Dxf::handleXData ( DL_CreationInterface creationInterface)

◆ handleXRecordData()

◆ hasValue()

bool DL_Dxf::hasValue ( int  code)
inline

Definition at line 398 of file dl_dxf.h.

Referenced by addMText(), and processDXFGroup().

◆ in() [1/2]

bool DL_Dxf::in ( const std::string &  file,
DL_CreationInterface creationInterface 
)

Reads the given file and calls the appropriate functions in the given creation interface for every entity found in the file.

Parameters
fileInput Path and name of file to read
creationInterfacePointer to the class which takes care of the entities in the file.
Return values
trueIf file could be opened.
falseIf file could not be opened.

Definition at line 105 of file dl_dxf.cpp.

References DL_UNKNOWN, and readDxfGroups().

Referenced by testReading().

◆ in() [2/2]

bool DL_Dxf::in ( std::stringstream &  stream,
DL_CreationInterface creationInterface 
)

Reads a DXF file from an existing stream.

Parameters
streamThe string stream.
creationInterfacePointer to the class which takes care of the entities in the file.
Return values
trueIf file could be opened.
falseIf file could not be opened.

Definition at line 135 of file dl_dxf.cpp.

References DL_UNKNOWN, and readDxfGroups().

◆ out()

DL_WriterA * DL_Dxf::out ( const char *  file,
DL_Codes::version  version = DL_Codes::AC1015 
)

Opens the given file for writing and returns a pointer to the dxf writer. This pointer needs to be passed on to other writing functions.

Converts the given string into an int. ok is set to false if there was an error.

Parameters
fileFull path of the file to open.
Returns
Pointer to an ascii dxf writer object.

Definition at line 2149 of file dl_dxf.cpp.

References NULL, DL_WriterA::openFailed(), and version.

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

◆ processDXFGroup()

bool DL_Dxf::processDXFGroup ( DL_CreationInterface creationInterface,
int  groupCode,
const std::string &  groupValue 
)

Processes a group (pair of group code and value).

Parameters
creationInterfaceHandle to class that creates entities and other CAD data from DXF group codes
groupCodeConstant indicating the data type of the group.
groupValueThe data value.
Return values
trueif done processing current entity and new entity begun
falseif not done processing current entity

Definition at line 320 of file dl_dxf.cpp.

References add3dFace(), addArc(), addArcAlignedText(), addAttribute(), addBlock(), addCircle(), addComment(), addDimAligned(), addDimAngular(), addDimAngular3P(), addDimDiametric(), addDimLinear(), addDimOrdinate(), addDimRadial(), addEllipse(), addImage(), addImageDef(), addInsert(), addLayer(), addLeader(), addLine(), addLinetype(), addMText(), addPoint(), addPolyline(), addRay(), addSetting(), addSolid(), addSpline(), addText(), addTextStyle(), addTrace(), addVertex(), addXLine(), color, DL_BLOCK, DL_DICTIONARY, DL_DXF_MAXGROUPCODE, DL_ENDBLK, DL_ENTITY_3DFACE, DL_ENTITY_ARC, DL_ENTITY_ARCALIGNEDTEXT, DL_ENTITY_ATTRIB, DL_ENTITY_CIRCLE, DL_ENTITY_DIMENSION, DL_ENTITY_ELLIPSE, DL_ENTITY_HATCH, DL_ENTITY_IMAGE, DL_ENTITY_IMAGEDEF, DL_ENTITY_INSERT, DL_ENTITY_LEADER, DL_ENTITY_LINE, DL_ENTITY_LWPOLYLINE, DL_ENTITY_MTEXT, DL_ENTITY_POINT, DL_ENTITY_POLYLINE, DL_ENTITY_RAY, DL_ENTITY_SEQEND, DL_ENTITY_SOLID, DL_ENTITY_SPLINE, DL_ENTITY_TEXT, DL_ENTITY_TRACE, DL_ENTITY_VERTEX, DL_ENTITY_XLINE, DL_LAYER, DL_LINETYPE, DL_SETTING, DL_STYLE, DL_UNKNOWN, DL_XRECORD, endBlock(), endEntity(), DL_CreationInterface::endSection(), endSequence(), getInt16Value(), getIntValue(), getLibVersion(), getRealValue(), getStringValue(), handleDictionaryData(), handleHatchData(), handleLeaderData(), handleLinetypeData(), handleLWPolylineData(), handleMTextData(), handleSplineData(), handleXData(), handleXRecordData(), hasValue(), DL_CreationInterface::setAttributes(), DL_CreationInterface::setExtrusion(), DL_Attributes::setInPaperSpace(), DL_Attributes::setLinetypeScale(), type, and width.

Referenced by readDxfGroups().

◆ readDxfGroups() [1/2]

bool DL_Dxf::readDxfGroups ( FILE *  fp,
DL_CreationInterface creationInterface 
)

Reads a group couplet from a DXF file. Calls another function to process it.

A group couplet consists of two lines that represent a single piece of data. An integer constant on the first line indicates the type of data. The value is on the next line.
This function reads a couplet, determines the type of data, and passes the value to the the appropriate handler function of creationInterface.
fp is advanced so that the next call to readDXFGroups() reads the next couplet in the file.

Parameters
fpHandle of input file
creationInterfaceHandle of class which processes entities in the file
Return values
trueIf EOF not reached.
falseIf EOF reached.

Definition at line 169 of file dl_dxf.cpp.

References DL_DXF_MAXLINE, getStrippedLine(), DL_CreationInterface::processCodeValuePair(), processDXFGroup(), and toInt().

Referenced by in().

◆ readDxfGroups() [2/2]

bool DL_Dxf::readDxfGroups ( std::stringstream &  stream,
DL_CreationInterface creationInterface 
)

Same as above but for stringstreams.

Definition at line 188 of file dl_dxf.cpp.

References DL_DXF_MAXLINE, getStrippedLine(), processDXFGroup(), and toInt().

◆ stripWhiteSpace()

bool DL_Dxf::stripWhiteSpace ( char **  s,
bool  stripSpace = true 
)
static

Strips leading whitespace and trailing Carriage Return (CR) and Line Feed (LF) from NULL terminated string.

Parameters
sInput and output. NULL terminates string.
Return values
trueif s is non-NULL
falseif s is NULL

Definition at line 285 of file dl_dxf.cpp.

Referenced by getStrippedLine(), and test().

◆ test()

void DL_Dxf::test ( )
static

Converts the given string into a double or returns the given default valud (def) if value is NULL or empty. Some test routines.

Definition at line 4974 of file dl_dxf.cpp.

References stripWhiteSpace().

◆ toBool()

bool DL_Dxf::toBool ( const std::string &  str)
inline

Definition at line 424 of file dl_dxf.h.

Referenced by handleHatchData(), and handleXRecordData().

◆ toInt()

int DL_Dxf::toInt ( const std::string &  str)
inline

◆ toInt16()

int DL_Dxf::toInt16 ( const std::string &  str)
inline

Definition at line 419 of file dl_dxf.h.

◆ toReal()

double DL_Dxf::toReal ( const std::string &  str)
inline

◆ write3dFace()

void DL_Dxf::write3dFace ( DL_WriterA dw,
const DL_3dFaceData data,
const DL_Attributes attrib 
)

Writes a 3d face entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2550 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

Referenced by DxfFilter::saveToFile().

◆ writeAppDictionary()

void DL_Dxf::writeAppDictionary ( DL_WriterA dw)

Definition at line 4396 of file dl_dxf.cpp.

References DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().

◆ writeAppid()

void DL_Dxf::writeAppid ( DL_WriterA dw,
const std::string &  name 
)

Writes the APPID section to the DXF file.

Parameters
nameApplication name

Definition at line 3630 of file dl_dxf.cpp.

References DL_WriterA::dxfInt(), DL_WriterA::dxfString(), name, and DL_Writer::tableAppidEntry().

Referenced by main(), and testWriting().

◆ writeArc()

void DL_Dxf::writeArc ( DL_WriterA dw,
const DL_ArcData data,
const DL_Attributes attrib 
)

Writes an arc entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2446 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeAttribute()

void DL_Dxf::writeAttribute ( DL_WriterA dw,
const DL_AttributeData data,
const DL_Attributes attrib 
)

◆ writeBlock()

void DL_Dxf::writeBlock ( DL_WriterA dw,
const DL_BlockData data 
)

◆ writeBlockRecord() [1/2]

void DL_Dxf::writeBlockRecord ( DL_WriterA dw)

Writes a blockrecord section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked BLOCKRECORD section to make the file readable by Aut*cad.

Definition at line 3982 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().

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

◆ writeBlockRecord() [2/2]

void DL_Dxf::writeBlockRecord ( DL_WriterA dw,
const std::string &  name 
)

Writes a single block record with the given name.

Definition at line 4042 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfString(), DL_Writer::handle(), and name.

◆ writeCircle()

void DL_Dxf::writeCircle ( DL_WriterA dw,
const DL_CircleData data,
const DL_Attributes attrib 
)

Writes a circle entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2424 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

Referenced by DxfProfilesExporter::SaveHorizontalProfiles().

◆ writeComment()

void DL_Dxf::writeComment ( DL_WriterA dw,
const std::string &  comment 
)

Writes a comment to the DXF file.

Definition at line 4460 of file dl_dxf.cpp.

References DL_WriterA::dxfString().

Referenced by DxfFilter::saveToFile().

◆ writeControlPoint()

void DL_Dxf::writeControlPoint ( DL_WriterA dw,
const DL_ControlPointData data 
)

Writes a single control point of a spline to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2386 of file dl_dxf.cpp.

References data, and DL_WriterA::dxfReal().

◆ writeDictionaryEntry()

int DL_Dxf::writeDictionaryEntry ( DL_WriterA dw,
const std::string &  name 
)

◆ writeDimAligned()

void DL_Dxf::writeDimAligned ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimAlignedData edata,
const DL_Attributes attrib 
)

Writes an aligned dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific aligned dimension data from the file
attribAttributes

Definition at line 2765 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), DL_DimAlignedData::epx1, DL_DimAlignedData::epx2, DL_DimAlignedData::epy1, DL_DimAlignedData::epy2, and writeDimStyleOverrides().

Referenced by main().

◆ writeDimAngular()

void DL_Dxf::writeDimAngular ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimAngularData edata,
const DL_Attributes attrib 
)

Writes an angular dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific angular dimension data from the file
attribAttributes

Definition at line 2999 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_DimAngularData::dpx1, DL_DimAngularData::dpx2, DL_DimAngularData::dpx3, DL_DimAngularData::dpx4, DL_DimAngularData::dpy1, DL_DimAngularData::dpy2, DL_DimAngularData::dpy3, DL_DimAngularData::dpy4, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeDimAngular3P()

void DL_Dxf::writeDimAngular3P ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimAngular3PData edata,
const DL_Attributes attrib 
)

Writes an angular dimension entity (3 points version) to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific angular dimension data from the file
attribAttributes

Definition at line 3063 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_DimAngular3PData::dpx1, DL_DimAngular3PData::dpx2, DL_DimAngular3PData::dpx3, DL_DimAngular3PData::dpy1, DL_DimAngular3PData::dpy2, DL_DimAngular3PData::dpy3, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeDimDiametric()

void DL_Dxf::writeDimDiametric ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimDiametricData edata,
const DL_Attributes attrib 
)

Writes a diametric dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific diametric dimension data from the file
attribAttributes

Definition at line 2943 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_DimDiametricData::dpx, DL_DimDiametricData::dpy, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), DL_DimDiametricData::leader, and writeDimStyleOverrides().

◆ writeDimLinear()

void DL_Dxf::writeDimLinear ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimLinearData edata,
const DL_Attributes attrib 
)

Writes a linear dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific linear dimension data from the file
attribAttributes

Definition at line 2823 of file dl_dxf.cpp.

References DL_DimLinearData::angle, data, DL_VERSION_2000, DL_VERSION_R12, DL_DimLinearData::dpx1, DL_DimLinearData::dpx2, DL_DimLinearData::dpy1, DL_DimLinearData::dpy2, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), M_PI, and writeDimStyleOverrides().

◆ writeDimOrdinate()

void DL_Dxf::writeDimOrdinate ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimOrdinateData edata,
const DL_Attributes attrib 
)

Writes an ordinate dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific ordinate dimension data from the file
attribAttributes

Definition at line 3123 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_DimOrdinateData::dpx1, DL_DimOrdinateData::dpx2, DL_DimOrdinateData::dpy1, DL_DimOrdinateData::dpy2, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), type, and DL_DimOrdinateData::xtype.

◆ writeDimRadial()

void DL_Dxf::writeDimRadial ( DL_WriterA dw,
const DL_DimensionData data,
const DL_DimRadialData edata,
const DL_Attributes attrib 
)

Writes a radial dimension entity to the file.

Parameters
dwDXF writer
dataGeneric dimension data for from the file
dataSpecific radial dimension data from the file
attribAttributes

Definition at line 2887 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_DimRadialData::dpx, DL_DimRadialData::dpy, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), DL_DimRadialData::leader, and writeDimStyleOverrides().

◆ writeDimStyle()

void DL_Dxf::writeDimStyle ( DL_WriterA dw,
double  dimasz,
double  dimexe,
double  dimexo,
double  dimgap,
double  dimtxt 
)

Writes a dimstyle section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked DIMSTYLE section to make the file readable by Aut*cad.

Definition at line 3877 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_VERSION_R12, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), and DL_WriterA::dxfString().

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

◆ writeDimStyleOverrides()

void DL_Dxf::writeDimStyleOverrides ( DL_WriterA dw,
const DL_DimensionData data 
)

◆ writeEllipse()

void DL_Dxf::writeEllipse ( DL_WriterA dw,
const DL_EllipseData data,
const DL_Attributes attrib 
)

Writes an ellipse entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2473 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_VERSION_R12, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeEndBlock()

void DL_Dxf::writeEndBlock ( DL_WriterA dw,
const std::string &  name 
)

Writes a block end.

Parameters
nameBlock name

Definition at line 3683 of file dl_dxf.cpp.

References name, and DL_Writer::sectionBlockEntryEnd().

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

◆ writeFitPoint()

void DL_Dxf::writeFitPoint ( DL_WriterA dw,
const DL_FitPointData data 
)

Writes a single fit point of a spline to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2400 of file dl_dxf.cpp.

References data, and DL_WriterA::dxfReal().

◆ writeHatch1()

void DL_Dxf::writeHatch1 ( DL_WriterA dw,
const DL_HatchData data,
const DL_Attributes attrib 
)

Writes the beginning of a hatch entity to the file. This must be followed by one or more writeHatchLoop() calls and a writeHatch2() call.

Parameters
dwDXF writer
dataEntity data.
attribAttributes

Definition at line 3229 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

Referenced by main().

◆ writeHatch2()

void DL_Dxf::writeHatch2 ( DL_WriterA dw,
const DL_HatchData data,
const DL_Attributes attrib 
)

Writes the end of a hatch entity to the file.

Parameters
dwDXF writer
dataEntity data.
attribAttributes

Definition at line 3263 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), and DL_WriterA::dxfString().

Referenced by main().

◆ writeHatchEdge()

void DL_Dxf::writeHatchEdge ( DL_WriterA dw,
const DL_HatchEdgeData data 
)

Writes the beginning of a hatch entity to the file.

Parameters
dwDXF writer
dataEntity data.
attribAttributes

Definition at line 3323 of file dl_dxf.cpp.

References data, DL_Writer::dxfBool(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), and M_PI.

Referenced by main().

◆ writeHatchLoop1()

void DL_Dxf::writeHatchLoop1 ( DL_WriterA dw,
const DL_HatchLoopData data 
)

Writes the beginning of a hatch loop to the file. This must happen after writing the beginning of a hatch entity.

Parameters
dwDXF writer
dataEntity data.
attribAttributes

Definition at line 3299 of file dl_dxf.cpp.

References data, and DL_WriterA::dxfInt().

Referenced by main().

◆ writeHatchLoop2()

void DL_Dxf::writeHatchLoop2 ( DL_WriterA dw,
const DL_HatchLoopData data 
)

Writes the end of a hatch loop to the file.

Parameters
dwDXF writer
dataEntity data.
attribAttributes

Definition at line 3312 of file dl_dxf.cpp.

References DL_WriterA::dxfInt().

Referenced by main().

◆ writeHeader()

◆ writeImage()

int DL_Dxf::writeImage ( DL_WriterA dw,
const DL_ImageData data,
const DL_Attributes attrib 
)

Writes an image entity.

Returns
IMAGEDEF handle. Needed for the IMAGEDEF counterpart.

Definition at line 3407 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), and DL_Writer::incHandle().

◆ writeImageDef()

void DL_Dxf::writeImageDef ( DL_WriterA dw,
int  handle,
const DL_ImageData data 
)

Writes an image definiition entity.

Definition at line 3466 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), and DL_WriterA::dxfString().

◆ writeInsert()

void DL_Dxf::writeInsert ( DL_WriterA dw,
const DL_InsertData data,
const DL_Attributes attrib 
)

Writes an insert to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2574 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeKnot()

void DL_Dxf::writeKnot ( DL_WriterA dw,
const DL_KnotData data 
)

Writes a single knot of a spline to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2413 of file dl_dxf.cpp.

References data, and DL_WriterA::dxfReal().

◆ writeLayer()

void DL_Dxf::writeLayer ( DL_WriterA dw,
const DL_LayerData data,
const DL_Attributes attrib 
)

Writes a layer to the file. Layers are stored in the tables section of a DXF file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 3508 of file dl_dxf.cpp.

References color, data, DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfString(), DL_Attributes::getColor(), DL_Attributes::getColor24(), DL_Attributes::getLinetype(), DL_Attributes::getWidth(), and DL_Writer::tableLayerEntry().

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

◆ writeLeader()

void DL_Dxf::writeLeader ( DL_WriterA dw,
const DL_LeaderData data,
const DL_Attributes attrib 
)

Writes a leader entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes
See also
writeVertex

Definition at line 3182 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_VERSION_R12, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeLeaderVertex()

void DL_Dxf::writeLeaderVertex ( DL_WriterA dw,
const DL_LeaderVertexData data 
)

Writes a single vertex of a leader to the file.

Parameters
dwDXF writer
dataEntity data

Definition at line 3212 of file dl_dxf.cpp.

References data, DL_VERSION_R12, and DL_WriterA::dxfReal().

◆ writeLine()

void DL_Dxf::writeLine ( DL_WriterA dw,
const DL_LineData data,
const DL_Attributes attrib 
)

Writes a line entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2230 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_LINE_END_CODE, DL_LINE_START_CODE, DL_VERSION_2000, DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

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

◆ writeLinetype()

void DL_Dxf::writeLinetype ( DL_WriterA dw,
const DL_LinetypeData data 
)

◆ writeMText()

void DL_Dxf::writeMText ( DL_WriterA dw,
const DL_MTextData data,
const DL_Attributes attrib 
)

Writes a multi text entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2624 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), and M_PI.

◆ writeObjects()

void DL_Dxf::writeObjects ( DL_WriterA dw,
const std::string &  appDictionaryName = "" 
)

Writes a objects section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked OBJECTS section to make the file readable by Aut*cad.

Definition at line 4061 of file dl_dxf.cpp.

References DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::getNextHandle(), and DL_Writer::handle().

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

◆ writeObjectsEnd()

void DL_Dxf::writeObjectsEnd ( DL_WriterA dw)

Writes the end of the objects section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked OBJECTS section to make the file readable by Aut*cad.

Definition at line 4455 of file dl_dxf.cpp.

References DL_WriterA::dxfString().

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

◆ writePoint()

void DL_Dxf::writePoint ( DL_WriterA dw,
const DL_PointData data,
const DL_Attributes attrib 
)

Writes a point entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2209 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_POINT_COORD_CODE, DL_VERSION_2000, DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

Referenced by DxfFilter::saveToFile(), and testWriting().

◆ writePolyline()

void DL_Dxf::writePolyline ( DL_WriterA dw,
const DL_PolylineData data,
const DL_Attributes attrib 
)

Writes a polyline entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes
See also
writeVertex

Definition at line 2297 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_VERTEX_COORD_CODE, DL_WriterA::dxfInt(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), and DL_Attributes::getLayer().

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

◆ writePolylineEnd()

void DL_Dxf::writePolylineEnd ( DL_WriterA dw)

Writes the polyline end. Only needed for DXF R12.

Definition at line 2346 of file dl_dxf.cpp.

References DL_VERSION_2000, and DL_Writer::entity().

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

◆ writeRay()

void DL_Dxf::writeRay ( DL_WriterA dw,
const DL_RayData data,
const DL_Attributes attrib 
)

Writes a ray entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2274 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_LINE_END_CODE, DL_LINE_START_CODE, DL_VERSION_2000, DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeSolid()

void DL_Dxf::writeSolid ( DL_WriterA dw,
const DL_SolidData data,
const DL_Attributes attrib 
)

Writes a solid entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2500 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeSpline()

void DL_Dxf::writeSpline ( DL_WriterA dw,
const DL_SplineData data,
const DL_Attributes attrib 
)

Writes a spline entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes
See also
writeControlPoint

Definition at line 2361 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeStyle()

◆ writeText()

void DL_Dxf::writeText ( DL_WriterA dw,
const DL_TextData data,
const DL_Attributes attrib 
)

Writes a text entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2673 of file dl_dxf.cpp.

References data, DL_VERSION_2000, DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), DL_Writer::entityAttributes(), and M_PI.

Referenced by DxfProfilesExporter::SaveHorizontalProfiles(), and DxfProfilesExporter::SaveVerticalProfiles().

◆ writeTrace()

void DL_Dxf::writeTrace ( DL_WriterA dw,
const DL_TraceData data,
const DL_Attributes attrib 
)

Writes a trace entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2525 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeUcs()

void DL_Dxf::writeUcs ( DL_WriterA dw)

Writes a ucs section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked UCS section to make the file readable by Aut*cad.

Definition at line 3858 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().

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

◆ writeVertex()

void DL_Dxf::writeVertex ( DL_WriterA dw,
const DL_VertexData data 
)

Writes a single vertex of a polyline to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2324 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_VERSION_2000, DL_VERTEX_COORD_CODE, DL_WriterA::dxfReal(), DL_WriterA::dxfString(), and DL_Writer::entity().

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

◆ writeView()

void DL_Dxf::writeView ( DL_WriterA dw)

Writes a view section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked VIEW section to make the file readable by Aut*cad.

Definition at line 3839 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().

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

◆ writeVPort()

void DL_Dxf::writeVPort ( DL_WriterA dw)

Writes a viewport section. This section is needed in DL_VERSION_R13. Note that this method currently only writes a faked VPORT section to make the file readable by Aut*cad.

Definition at line 3703 of file dl_dxf.cpp.

References DL_VERSION_2000, DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), DL_WriterA::dxfReal(), DL_WriterA::dxfString(), and DL_Writer::handle().

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

◆ writeXLine()

void DL_Dxf::writeXLine ( DL_WriterA dw,
const DL_XLineData data,
const DL_Attributes attrib 
)

Writes an x line entity to the file.

Parameters
dwDXF writer
dataEntity data from the file
attribAttributes

Definition at line 2252 of file dl_dxf.cpp.

References DL_Writer::coord(), data, DL_LINE_END_CODE, DL_LINE_START_CODE, DL_VERSION_2000, DL_WriterA::dxfString(), DL_Writer::entity(), and DL_Writer::entityAttributes().

◆ writeXRecord() [1/4]

void DL_Dxf::writeXRecord ( DL_WriterA dw,
int  handle,
bool  value 
)

◆ writeXRecord() [2/4]

void DL_Dxf::writeXRecord ( DL_WriterA dw,
int  handle,
const std::string &  value 
)

Definition at line 4439 of file dl_dxf.cpp.

References DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().

◆ writeXRecord() [3/4]

void DL_Dxf::writeXRecord ( DL_WriterA dw,
int  handle,
double  value 
)

◆ writeXRecord() [4/4]

void DL_Dxf::writeXRecord ( DL_WriterA dw,
int  handle,
int  value 
)

Definition at line 4412 of file dl_dxf.cpp.

References DL_WriterA::dxfHex(), DL_WriterA::dxfInt(), and DL_WriterA::dxfString().


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