KiCad PCB EDA Suite
gerber_file_image.cpp File Reference

a GERBER class handle for a given layer info about used D_CODES and how the layer is drawn More...

#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
#include <macros.h>
#include <convert_to_biu.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerber_file_image.h>
#include <X2_gerber_attributes.h>
#include <algorithm>
#include <map>

Go to the source code of this file.

Functions

int scaletoIU (double aCoord, bool isMetric)
 Function scaletoIU converts a distance given in floating point to our internal units. More...
 

Detailed Description

a GERBER class handle for a given layer info about used D_CODES and how the layer is drawn

Definition in file gerber_file_image.cpp.

Function Documentation

int scaletoIU ( double  aCoord,
bool  isMetric 
)

Function scaletoIU converts a distance given in floating point to our internal units.

Definition at line 59 of file rs274_read_XY_and_IJ_coordinates.cpp.

References IU_PER_MILS, and KiROUND().

Referenced by GERBER_FILE_IMAGE::StepAndRepeatItem().

60 {
61  int ret;
62 
63  if( isMetric ) // gerber are units in mm
64  ret = KiROUND( aCoord * IU_PER_MM );
65  else // gerber are units in inches
66  ret = KiROUND( aCoord * IU_PER_MILS * 1000.0 );
67 
68  return ret;
69 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
#define IU_PER_MILS
Definition: plotter.cpp:134