KiCad PCB EDA Suite
EDA_IU_SCALE Struct Reference

#include <base_units.h>

Public Member Functions

constexpr EDA_IU_SCALE (double aIUPerMM)
 
constexpr double IUTomm (int iu) const
 
constexpr int mmToIU (double mm) const
 
constexpr int MilsToIU (int mils) const
 
constexpr int IUToMils (int iu) const
 

Public Attributes

const double IU_PER_MM
 
const double IU_PER_MILS
 
const double MM_PER_IU
 

Detailed Description

Definition at line 75 of file base_units.h.

Constructor & Destructor Documentation

◆ EDA_IU_SCALE()

constexpr EDA_IU_SCALE::EDA_IU_SCALE ( double  aIUPerMM)
inlineconstexpr

Definition at line 82 of file base_units.h.

82 :
83 IU_PER_MM( aIUPerMM ), IU_PER_MILS( aIUPerMM * 0.0254 ), MM_PER_IU( 1 / IU_PER_MM )
84 {
85 }
const double IU_PER_MM
Definition: base_units.h:77
const double IU_PER_MILS
Definition: base_units.h:78
const double MM_PER_IU
Definition: base_units.h:79

Member Function Documentation

◆ IUToMils()

◆ IUTomm()

◆ MilsToIU()

constexpr int EDA_IU_SCALE::MilsToIU ( int  mils) const
inlineconstexpr

Definition at line 94 of file base_units.h.

95 {
96 double x = mils * IU_PER_MILS;
97 return int( x < 0 ? x - 0.5 : x + 0.5 );
98 }

References IU_PER_MILS.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_EAGLE_PLUGIN::addImplicitConnections(), SCH_EAGLE_PLUGIN::adjustNetLabels(), Altium2KiCadUnit(), BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), BOOST_AUTO_TEST_CASE(), bumpToNextGrid(), CheckLibSymbol(), AUTOPLACER::computeFBoxSize(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), AUTOPLACER::DoAutoplace(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), KIGFX::dummy(), dummy(), AUTOPLACER::fieldVPlacement(), SCH_HIERLABEL::GetBodyBoundingBox(), LIB_PIN::GetBoundingBox(), SCH_JUNCTION::getEffectiveShape(), getInSchUnits(), GetLastPinLength(), GetLastPinNameSize(), GetLastPinNumSize(), CADSTAR_SCH_ARCHIVE_LOADER::getLineThickness(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_SHEET::GetMinHeight(), SCH_SHEET::GetMinWidth(), SCH_LINE::GetPenWidth(), SCH_SHAPE::GetPenWidth(), SCH_SHEET::GetPenWidth(), SCH_SHEET_PIN::GetPenWidth(), KIGFX::SCH_PAINTER::getShadowWidth(), HelperGeneratePowerPortGraphics(), LIB_SHAPE::HitTest(), LIB_TEXTBOX::HitTest(), DIALOG_PLOT_SCHEMATIC::initDlg(), SCH_SYMBOL::IsMovableFromAnchorPoint(), LIB_PIN::LIB_PIN(), LIB_SYMBOL::LIB_SYMBOL(), LIB_TEXT::LIB_TEXT(), LIB_TEXTBOX::LIB_TEXTBOX(), SCH_LEGACY_PLUGIN_CACHE::loadArc(), SCH_LEGACY_PLUGIN_CACHE::loadBezier(), SCH_LEGACY_PLUGIN::loadBitmap(), SCH_LEGACY_PLUGIN::loadBusEntry(), SCH_LEGACY_PLUGIN_CACHE::loadCircle(), PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings(), SCH_LEGACY_PLUGIN_CACHE::loadField(), SCH_EAGLE_PLUGIN::loadFrame(), SCH_LEGACY_PLUGIN::loadJunction(), SCH_LEGACY_PLUGIN::loadNoConnect(), SCH_LEGACY_PLUGIN_CACHE::LoadPart(), SCH_LEGACY_PLUGIN_CACHE::loadPin(), SCH_EAGLE_PLUGIN::loadPin(), SCH_LEGACY_PLUGIN_CACHE::loadPolyLine(), SCH_LEGACY_PLUGIN_CACHE::loadRect(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSegments(), SCH_LEGACY_PLUGIN::loadSheet(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_LEGACY_PLUGIN::loadSymbol(), PANEL_SYM_EDITING_OPTIONS::loadSymEditorSettings(), SCH_LEGACY_PLUGIN::loadText(), SCH_LEGACY_PLUGIN_CACHE::loadText(), SCH_LEGACY_PLUGIN::loadWire(), DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_LIB_SHAPE_PROPERTIES::onBorderChecked(), DIALOG_SHAPE_PROPERTIES::onBorderChecked(), DIALOG_LIB_TEXTBOX_PROPERTIES::onBorderChecked(), PCB_BITMAP::operator=(), SCH_SEXPR_PARSER::parseArc(), SCH_SEXPR_PARSER::parseBezier(), SCH_SEXPR_PARSER::parseBusEntry(), SCH_SEXPR_PARSER::parseCircle(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), SCH_SEXPR_PARSER::parseLine(), SCH_SEXPR_PARSER::parsePin(), SCH_SEXPR_PARSER::parsePolyLine(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_SEXPR_PARSER::parseRectangle(), SCH_SEXPR_PARSER::parseSchArc(), SCH_SEXPR_PARSER::parseSchBezier(), SCH_SEXPR_PARSER::parseSchCircle(), SCH_SEXPR_PARSER::parseSchPolyLine(), SCH_SEXPR_PARSER::parseSchRectangle(), SCH_SEXPR_PARSER::parseSchTextBox(), SCH_SEXPR_PARSER::parseSheet(), SCH_SEXPR_PARSER::parseTextBox(), PCB_BITMAP::PCB_BITMAP(), LIB_PIN::PlotPinTexts(), LIB_PIN::printPinTexts(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::SaveSymbol(), SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY(), SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE(), SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY(), SCH_DIRECTIVE_LABEL::SCH_DIRECTIVE_LABEL(), SCH_JUNCTION::SCH_JUNCTION(), SCH_LINE::SCH_LINE(), SCH_NO_CONNECT::SCH_NO_CONNECT(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), KIGFX::SCH_VIEW::SCH_VIEW(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), PIN_TABLE_DATA_MODEL::SetValue(), SCH_DRAWING_TOOLS::sizeSheet(), ERC_TESTER::TestOffGridEndpoints(), DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), PL_POINT_EDITOR::updateItem(), EE_POINT_EDITOR::updateParentItem(), and EE_SELECTION_TOOL::ZoomFitCrossProbeBBox().

◆ mmToIU()

constexpr int EDA_IU_SCALE::mmToIU ( double  mm) const
inlineconstexpr

Definition at line 89 of file base_units.h.

90 {
91 return (int) ( mm < 0 ? ( mm * IU_PER_MM - 0.5 ) : ( mm * IU_PER_MM + 0.5 ) );
92 }

References IU_PER_MM.

Referenced by DIALOG_COPPER_ZONE::AcceptOptions(), ZONE_FILLER::addHatchFillTypeOnZone(), AddRectCourtyard(), PCAD2KICAD::PCB_PAD::AddToFootprint(), AR_AUTOPLACER::AR_AUTOPLACER(), AR_AUTOPLACER::AutoplaceFootprints(), BOARD::BOARD(), BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), BOOST_AUTO_TEST_CASE(), buildBoardBoundingBoxPoly(), BuildBoardPolygonOutlines(), ZONE_FILLER::buildCopperItemClearances(), FOOTPRINT::BuildCourtyardCaches(), BOARD_STACKUP::BuildDefaultStackupList(), PAD::BuildEffectiveShapes(), EXPORTER_PCB_VRML::ComputeLayer3D_Zpos(), TEARDROP_MANAGER::computeTeardropPolygonPoints(), BOARD_ADAPTER::createBoardPolygon(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), TEARDROP_MANAGER::createTeardrop(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawBoardCharacteristics(), DRAWING_TOOL::DrawSpecificationStackup(), BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition(), EXPORTER_PCB_VRML::ExportVrmlPadHole(), EXPORTER_PCB_VRML::ExportVrmlViaHoles(), ZONE_FILLER::fillCopperZone(), ZONE_FILLER::fillNonCopperZone(), PCB_BASE_FRAME::FocusOnItems(), FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS(), FP_TEXT::FP_TEXT(), GENDRILL_WRITER_BASE::genDrillMapFile(), RENDER_3D_OPENGL::generate3dGrid(), ARC_DATA_MM::GenerateArc(), BOARD::GetBoardPolygonOutlines(), PCB_GROUP::GetBoundingBox(), LIB_PIN::GetBoundingBox(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), BOARD_STACKUP_ITEM::GetCopperDefaultThickness(), SYMBOL_EDIT_FRAME::GetDocumentExtents(), FOOTPRINT_EDIT_FRAME::GetDocumentExtents(), BOARD_DESIGN_SETTINGS::GetDRCEpsilon(), BOARD_DESIGN_SETTINGS::GetHolePlatingThickness(), getInPcbUnits(), ZONE::GetInteractingZones(), BOARD_STACKUP_ITEM::GetMaskDefaultThickness(), BOARD_ITEM::GetStroke(), GRAPHICS_IMPORTER_PCBNEW::GRAPHICS_IMPORTER_PCBNEW(), ZONE::HitTest(), GERBER_DRAW_ITEM::HitTest(), BOARD_ADAPTER::InitSettings(), initTextTable(), TEST_EE_ITEM_FIXTURE::Instantiate(), TEST_BOARD_ITEM_FIXTURE::Instantiate(), IterateOverPositionsAndReferences(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), MakeInvalidCourtyardTestFP(), DIALOG_EXPORT_STEP::onExportButton(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), EAGLE_PLUGIN::packageWire(), PCB_PARSER::parseFP_SHAPE(), PCB_PARSER::parsePAD(), PCB_PARSER::parsePCB_SHAPE(), PCB_PLOT_PARAMS::PCB_PLOT_PARAMS(), PCB_TARGET::PCB_TARGET(), PCB_TRACK::PCB_TRACK(), playground_main_func(), BRDITEMS_PLOTTER::PlotDrillMarks(), PlotLayerOutlines(), SCH_PLOTTER::plotOneSheetHpgl(), PlotSolderMaskLayer(), DIALOG_PAD_PROPERTIES::prepareCanvas(), LIB_PIN::printPinElectricalTypeName(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), ZONE::SetBorderDisplayStyle(), PANEL_SETUP_BOARD_STACKUP::setDefaultLayerWidths(), DIALOG_PLOT_SCHEMATIC::setHpglPenWidth(), TEARDROP_MANAGER::SetTeardrops(), PCBNEW_PRINTOUT::setupPainter(), shapesNeedUpdate(), StartPlotBoard(), PCAD2KICAD::StrToDoublePrecisionUnits(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), TEST_EE_ITEM_FIXTURE::TEST_EE_ITEM_FIXTURE(), DRC_TEST_PROVIDER_MISC::testOutline(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow(), DIALOG_RULE_AREA_PROPERTIES::TransferDataFromWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), GERBER_DRAW_ITEM::ViewGetLOD(), PAD::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), PCB_VIA::ViewGetLOD(), EXPORTER_PCB_VRML::writeLayers(), and PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox().

Member Data Documentation

◆ IU_PER_MILS

const double EDA_IU_SCALE::IU_PER_MILS

Definition at line 78 of file base_units.h.

Referenced by PL_EDITOR_FRAME::AddDrawingSheetItem(), DIALOG_PLOT::applyPlotSettings(), EE_GRID_HELPER::BestSnapAnchor(), ConfigureHPGLPenSizes(), GERBER_WRITER::createDrillFile(), SCH_PLOTTER::createHPGLFiles(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems(), diameter_in_inches(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), KIGFX::SCH_VIEW::DisplaySheet(), SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), BOARD_NETLIST_UPDATER::estimateFootprintInsertionPosition(), EVT_UPDATE_UI_RANGE(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME(), GENDRILL_WRITER_BASE::genDrillMapFile(), GERBVIEW_FRAME::GERBVIEW_FRAME(), SCH_EDIT_FRAME::GetDocumentExtents(), PL_EDITOR_FRAME::GetDocumentExtents(), SCH_BASE_FRAME::GetPageSizeIU(), GERBVIEW_FRAME::GetPageSizeIU(), PCB_BASE_FRAME::GetPageSizeIU(), PL_EDITOR_FRAME::GetPageSizeIU(), LEGACY_PLUGIN::init(), DIALOG_PLOT::init_Dialog(), initializePlotter(), iu_to_d356(), IUToMils(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), EAGLE_PLUGIN::loadPolygon(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_EAGLE_PLUGIN::loadSheet(), EDA_UNIT_UTILS::Mils2IU(), GERBVIEW_PRINTOUT::milsToIU(), PCBNEW_PRINTOUT::milsToIU(), MilsToIU(), BOARD_EDITOR_CONTROL::PageSettings(), PL_EDITOR_CONTROL::PageSetup(), ALTIUM_PCB::Parse(), GPCB_FPL_CACHE::parseFOOTPRINT(), SCH_ALTIUM_PLUGIN::ParseSheet(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), PCB_PLOT_SVG::Plot(), SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), SCH_EDIT_FRAME::PrintPage(), SYMBOL_EDIT_FRAME::PrintPage(), PL_EDITOR_FRAME::PrintPage(), PLEDITOR_PRINTOUT::PrintPage(), SCH_PRINTOUT::PrintPage(), FABMASTER::processScaleFactor(), MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr(), EXCELLON_IMAGE::readToolInformation(), KIGFX::SCH_VIEW::ResizeSheetWorkingArea(), KIGFX::SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS(), SCH_SCREEN::SCH_SCREEN(), SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS(), EXCELLON_WRITER::SetFormat(), PL_EDITOR_FRAME::SetPageSettings(), GERBVIEW_FRAME::SetPageSettings(), PCB_BASE_FRAME::SetPageSettings(), PCB_EDIT_FRAME::SetPageSettings(), SCH_PLOTTER::setupPlotPagePDF(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), PCAD2KICAD::StrToDoublePrecisionUnits(), SYMBOL_EDIT_FRAME::SVGPlotSymbol(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DRC_TEST_PROVIDER_MISC::testTextVars(), ERC_TESTER::TestTextVars(), GERBVIEW_FRAME::updateDCodeSelectBox(), PL_EDITOR_FRAME::UpdateMsgPanelInfo(), and PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview().

◆ IU_PER_MM

const double EDA_IU_SCALE::IU_PER_MM

Definition at line 77 of file base_units.h.

Referenced by BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), ZONE_FILLER::buildThermalSpokes(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), diameter_in_mm(), PANEL_PREVIEW_3D_MODEL::doIncrementOffset(), EDIT_TOOL::DragArcTrack(), PAD_TOOL::EnumeratePads(), FillNegativeKnockout(), PCB_PLUGIN::format(), EDA_UNIT_UTILS::FormatInternalUnits(), GENDRILL_WRITER_BASE::genDrillMapFile(), RENDER_3D_OPENGL::generate3dGrid(), GERBER_JOBFILE_WRITER::GERBER_JOBFILE_WRITER(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), DIALOG_PLOT_SCHEMATIC::getPlotOptions(), LEGACY_PLUGIN::init(), DIALOG_PLOT::init_Dialog(), DIALOG_PLOT_SCHEMATIC::initDlg(), DSN::IU2um(), IUTomm(), LEGACY_PLUGIN::loadGENERAL(), DSN::SPECCTRA_DB::makeVIA(), GBR_TO_PCB_EXPORTER::MapToPcbUnits(), mmToIU(), PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset(), PCB_PARSER::parseBoardUnits(), PCB_PARSER::parseEDA_TEXT(), PCB_PARSER::parseFP_SHAPE(), PCB_PARSER::parseFP_TEXTBOX(), SCH_SEXPR_PARSER::parseInternalUnits(), PCB_PARSER::parsePCB_SHAPE(), PCB_PARSER::parsePCB_TEXTBOX(), SCH_SEXPR_PARSER::parseStroke(), PCB_PARSER::parseZONE(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), PlotSolderMaskLayer(), DIALOG_PAD_PROPERTIES::prepareCanvas(), FABMASTER::processScaleFactor(), LP_CACHE::ReadAndVerifyHeader(), MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr(), DSN::scale(), KIGFX::SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS(), EXCELLON_WRITER::SetFormat(), GERBER_WRITER::SetFormat(), GERBVIEW_PRINTOUT::setupGal(), PCBNEW_PRINTOUT::setupGal(), RENDER_3D_RAYTRACE::setupMaterials(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), PL_DRAW_PANEL_GAL::SwitchBackend(), PANEL_SETUP_CONSTRAINTS::TransferDataFromWindow(), GERBVIEW_FRAME::updateDCodeSelectBox(), PANEL_PREVIEW_3D_MODEL::updateOrientation(), ZONE_SETTINGS::ZONE_SETTINGS(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().

◆ MM_PER_IU


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