Start recording the precision of dxf imports

This commit is contained in:
Marek Roszko 2021-06-22 07:34:15 -04:00
parent 7802037495
commit b924c85f80
2 changed files with 17 additions and 1 deletions

View File

@ -99,6 +99,8 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter()
m_minX = m_minY = std::numeric_limits<double>::max();
m_maxX = m_maxY = std::numeric_limits<double>::min();
m_currentUnit = DXF_IMPORT_UNITS::DEFAULT;
m_importCoordinatePrecision = 4; // initial value per dxf spec
m_importAnglePrecision = 0; // initial value per dxf spec
// placeholder layer so we can fallback to something later
std::unique_ptr<DXF_IMPORT_LAYER> layer0 =
@ -943,6 +945,18 @@ void DXF_IMPORT_PLUGIN::setVariableInt( const std::string& key, int value, int c
return;
}
if( key == "$AUPREC" )
{
m_importAnglePrecision = value;
return;
}
if( key == "$LUPREC" )
{
m_importCoordinatePrecision = value;
return;
}
if( key == "$INSUNITS" ) // Drawing units
{
switch( value )

View File

@ -558,7 +558,9 @@ private:
double m_minX, m_maxX; // handles image size in mm
double m_minY, m_maxY; // handles image size in mm
DXF_IMPORT_UNITS m_currentUnit; // current unit during import
DXF_IMPORT_UNITS m_currentUnit; // current unit during import
int m_importCoordinatePrecision; // current precision for linear units (points)
int m_importAnglePrecision; // current precision for angles
GRAPHICS_IMPORTER_BUFFER m_internalImporter;