dime  0.9.1
Portable DXF file library
Loading...
Searching...
No Matches
dxfConverter Class Reference

The dxfConverter class offers a simple interface for DXF converting. It makes it possible to extract all geometry from DXF files, and store it in internal geometry structures, which again can be exported as VRML. More...

#include <convert.h>

Public Member Functions

 dxfConverter ()
 
 ~dxfConverter ()
 
bool doConvert (dimeModel &model)
 
void findHeaderVariables (dimeModel &model)
 
int getColorIndex (const dimeEntity *entity)
 
int getCurrentInsertColorIndex () const
 
bool getFillmode () const
 
bool getLayercol () const
 
dxfLayerData ** getLayerData ()
 
dxfLayerDatagetLayerData (const dimeEntity *entity)
 
dxfLayerDatagetLayerData (const int colidx)
 
dxfdouble getMaxerr () const
 
int getNumSub () const
 
void setFillmode (const bool fill)
 
void setLayercol (const bool v)
 
void setMaxerr (const dxfdouble maxerr)
 
void setNumSub (const int num)
 
bool writeVrml (const char *filename, const bool vrml1=false, const bool only2d=false)
 
bool writeVrml (FILE *out, const bool vrml1=false, const bool only2d=false)
 

Detailed Description

The dxfConverter class offers a simple interface for DXF converting. It makes it possible to extract all geometry from DXF files, and store it in internal geometry structures, which again can be exported as VRML.

Constructor & Destructor Documentation

◆ dxfConverter()

dxfConverter::dxfConverter ( )

Constructor

◆ ~dxfConverter()

dxfConverter::~dxfConverter ( )

Destructor

Member Function Documentation

◆ doConvert()

bool dxfConverter::doConvert ( dimeModel & model)

Converts model to the internal geometry structures.

See also
dxfConverter::writeWrl()

◆ findHeaderVariables()

void dxfConverter::findHeaderVariables ( dimeModel & model)

Finds the state of supported header variables in model. This method should be called before dxfxConverter::doConvert()

◆ getColorIndex()

int dxfConverter::getColorIndex ( const dimeEntity * entity)

Finds the correct color index for entity. Handles the BYLAYER case.

◆ getCurrentInsertColorIndex()

int dxfConverter::getCurrentInsertColorIndex ( ) const
inline

Returns the color index of the current INSERT entity. If no INSERT entity is current, the color index 7 (white) will be returned.

◆ getFillmode()

bool dxfConverter::getFillmode ( ) const
inline

Returns whether polylines with width and SOLID and TRACE should be filled.

◆ getLayercol()

bool dxfConverter::getLayercol ( ) const
inline

Returns whether only layers should be used (and not color index) when converting.

◆ getLayerData() [1/3]

dxfLayerData ** dxfConverter::getLayerData ( )

Returns a pointer to the dxfLayerData array.

◆ getLayerData() [2/3]

dxfLayerData * dxfConverter::getLayerData ( const dimeEntity * entity)

Finds the color index for entity, and returns the dxfLayerData for it.

◆ getLayerData() [3/3]

dxfLayerData * dxfConverter::getLayerData ( const int colidx)

Returns a dxfLayerData instance for the color with color index colidx.

◆ getMaxerr()

dxfdouble dxfConverter::getMaxerr ( ) const
inline

Returns the maximum allowed error when converting circles, arcs ellipses.

◆ getNumSub()

int dxfConverter::getNumSub ( ) const
inline

Returns the number of subdivisions set by dxfConverter::setNumSub()

◆ setFillmode()

void dxfConverter::setFillmode ( const bool fill)
inline

Sets whether polylines with width and SOLID and TRACE should be filled.

◆ setLayercol()

void dxfConverter::setLayercol ( const bool v)
inline

Sets whether only layer (and not color index) should be used when converting. This method should normally no be used.

◆ setMaxerr()

void dxfConverter::setMaxerr ( const dxfdouble maxerr)
inline

Sets the maximum error allowed when converting circles, arcs and ellipses into lines/polygons.

◆ setNumSub()

void dxfConverter::setNumSub ( const int num)
inline

Sets the number of subdivisions for a circle or ellipse. This overrides the value set in dxfConverter::setMaxerr() and should normally not be used.

See also
dxfConverter::getNumSub()

◆ writeVrml() [1/2]

bool dxfConverter::writeVrml ( const char * filename,
const bool vrml1 = false,
const bool only2d = false )

Writes the internal geometry structures to filename.

◆ writeVrml() [2/2]

bool dxfConverter::writeVrml ( FILE * out,
const bool vrml1 = false,
const bool only2d = false )

Writes the internal geometry structures to out. Warning: This function is not CRT safe.


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