KiCad PCB EDA Suite
macros.h File Reference

This file contains miscellaneous commonly used macros and functions. More...

#include <wx/wx.h>
#include <vector>
#include <map>
#include <set>
#include <memory>

Go to the source code of this file.

Macros

#define TO_UTF8(wxstring)   ( (const char*) (wxstring).utf8_str() )
 Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes. More...
 
#define DIM(x)   unsigned( sizeof(x) / sizeof( (x)[0] ) )
 

of elements in an array

More...
 
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)   typedef std::vector<MemberType> TypeName;
 Declare a std::vector but no swig template. More...
 
#define DECL_MAP_FOR_SWIG(TypeName, KeyType, ValueType)   typedef std::map<KeyType, ValueType> TypeName;
 
#define DECL_SPTR_FOR_SWIG(TypeName, MemberType)   typedef std::shared_ptr<MemberType> TypeName;
 
#define DECL_SET_FOR_SWIG(TypeName, MemberType)   typedef std::set<MemberType> TypeName;
 

Functions

static wxString FROM_UTF8 (const char *cstring)
 function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes. More...
 
void AccumulateDescription (wxString &aDesc, const wxString &aItem)
 Utility to build comma separated lists in messages. More...
 
static const wxChar * GetChars (const wxString &s)
 Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for passing strings to wxString::Printf() and wxString::Format(). More...
 
template<typename T >
Mirror (T aPoint, T aMirrorRef)
 Function MIRROR Mirror aPoint in aMirrorRef. More...
 
template<typename T >
void MIRROR (T &aPoint, const T &aMirrorRef)
 
template<typename T >
const T & Clamp (const T &lower, const T &value, const T &upper)
 Function Clamp limits value within the range lower <= value <= upper. More...
 

Detailed Description

This file contains miscellaneous commonly used macros and functions.

Definition in file macros.h.

Macro Definition Documentation

#define DECL_MAP_FOR_SWIG (   TypeName,
  KeyType,
  ValueType 
)    typedef std::map<KeyType, ValueType> TypeName;

Definition at line 147 of file macros.h.

Referenced by NETCLASS::SetDiffPairViaGap().

#define DECL_SET_FOR_SWIG (   TypeName,
  MemberType 
)    typedef std::set<MemberType> TypeName;

Definition at line 149 of file macros.h.

#define DECL_SPTR_FOR_SWIG (   TypeName,
  MemberType 
)    typedef std::shared_ptr<MemberType> TypeName;

Definition at line 148 of file macros.h.

Referenced by NETCLASS::SetDiffPairViaGap().

#define DECL_VEC_FOR_SWIG (   TypeName,
  MemberType 
)    typedef std::vector<MemberType> TypeName;

Declare a std::vector but no swig template.

Definition at line 146 of file macros.h.

Referenced by HIGH_LIGHT_INFO::HIGH_LIGHT_INFO().

#define DIM (   x)    unsigned( sizeof(x) / sizeof( (x)[0] ) )

of elements in an array

Definition at line 98 of file macros.h.

Referenced by PGM_BASE::AddMenuLanguageList(), AskLoadBoardFileName(), EAGLE_PLUGIN::clear_cu_map(), COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS(), CINFO3D_VISU::createLayers(), CreatePadsShapesSection(), CreateThermalReliefPadPolygon(), LSET::CuStack(), DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY(), dlg_layers(), EDA_3D_VIEWER::EDA_3D_VIEWER(), EDA_DRAW_FRAME::EDA_DRAW_FRAME(), PROJECT::ElemsClear(), PCB_EDIT_FRAME::enableGALSpecificMenus(), DIALOG_PRINT_PCBNEW::enableLayer(), FindKicadFile(), LSET::FmtHex(), PCB_IO::formatBoardLayers(), GBR_SCREEN::GBR_SCREEN(), DIALOG_GENDRILL::GenDrillAndMapFiles(), GERBER_FILE_IMAGE::GERBER_FILE_IMAGE(), AUTOPLACER::get_colliding_sides(), AUTOPLACER::get_preferred_sides(), GetAssociatedDocument(), DIALOG_EXPORT_SVG::getCheckBoxSelectedLayers(), GERBVIEW_FRAME::GetConfigurationSettings(), GERBER_FILE_IMAGE::GetDCODE(), GERBER_FILE_IMAGE::GetDCODEOrCreate(), GERBER_FILE_IMAGE::GetDcodesCount(), PROJECT::GetElem(), COLORS_DESIGN_SETTINGS::GetItemColor(), EDA_BASE_FRAME::GetKicadHelp(), COLORS_DESIGN_SETTINGS::GetLayerColor(), GetLayerColor(), MODEL_VRML::GetLayerZ(), DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog(), PROJECT::GetRString(), DIALOG_PAGES_SETTINGS::initDialog(), LSET::InternalCuMask(), PCB_LAYER_WIDGET::isAllowedInFpMode(), isKeySpecialCode(), DIALOG_PRINT_PCBNEW::isLayerEnabled(), EAGLE_PLUGIN::kicad_layer(), KicadDatasPath(), KIWAY::KiFACE(), EAGLE_PLUGIN::loadLayerDefs(), MODEL_VRML::MODEL_VRML(), DIALOG_PAD_PROPERTIES::onAddPrimitive(), KICAD_MANAGER_FRAME::OnArchiveFiles(), KIWAY::OnKiwayEnd(), PANEL_SETUP_LAYERS::OnPresetsChoice(), DIALOG_PAD_PROPERTIES::OnUpdateUI(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), KIGFX::PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS(), PCB_SCREEN::PCB_SCREEN(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), PL_EDITOR_SCREEN::PL_EDITOR_SCREEN(), PlotLayerOutlines(), EDA_DRAW_FRAME::Process_PageSettings(), PCB_LAYER_WIDGET::ReFill(), PCB_LAYER_WIDGET::ReFillRender(), GERBER_LAYER_WIDGET::ReFillRender(), SCH_SCREEN::SCH_SCREEN(), LSET::SeqStackupBottom2Top(), COLORS_DESIGN_SETTINGS::SetAllColorsAs(), PROJECT::SetElem(), COLORS_DESIGN_SETTINGS::SetItemColor(), PGM_BASE::SetLanguage(), PGM_BASE::SetLanguageIdentifier(), COLORS_DESIGN_SETTINGS::SetLayerColor(), SetLayerColor(), BOARD::SetLayerDescr(), DIALOG_PRINT_PCBNEW::setLayerSetFromList(), PROJECT::SetRString(), COLORS_DESIGN_SETTINGS::setupConfigParams(), PANEL_SETUP_LAYERS::showPresets(), LSET::TechAndUserUIOrder(), LSET::Technicals(), PANEL_GERBVIEW_SETTINGS::TransferDataToWindow(), LAYER_WIDGET::UpdateLayerIcons(), LSET::Users(), DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG(), and GERBER_FILE_IMAGE::~GERBER_FILE_IMAGE().

#define TO_UTF8 (   wxstring)    ( (const char*) (wxstring).utf8_str() )

Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.

wxstring is a wxString, not a wxT() or _(). The scope of the return value is very limited and volatile, but can be used with printf() style functions well. NOTE: Trying to convert it to a function is tricky because of the type of the parameter!

Definition at line 47 of file macros.h.

Referenced by add_search_paths(), SCH_REFERENCE::Annotate(), DXF_PLOTTER::Arc(), DSN::SPECCTRA_DB::buildLayerMaps(), NETINFO_LIST::buildListOfNets(), DXF_PLOTTER::Circle(), copy_pro_file_template(), CreateComponentsSection(), CreateDevicesSection(), CreateHeaderInfoData(), CreateRoutesSection(), CreateShapesSection(), CreateSignalsSection(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), PCB_DRAW_PANEL_GAL::DisplayBoard(), KIGFX::SCH_VIEW::DisplaySheet(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::DoGenFootprintsReport(), EDA_FILE_SELECTOR(), EDA_LIST_DIALOG::EDA_LIST_DIALOG(), PDF_PLOTTER::EndPlot(), EscapedUTF8(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), GBR_TO_PCB_EXPORTER::export_flashed_copper_item(), PCB_EDIT_FRAME::Export_IDF3(), export_vrml_module(), DSN::SPECCTRA_DB::exportNETCLASS(), DSN::SPECCTRA_DB::ExportPCB(), PCB_EDIT_FRAME::ExportVRML_File(), TREE_PROJECT_FRAME::FileWatcherReset(), GITHUB_PLUGIN::FootprintDelete(), LEGACY_PLUGIN::FootprintLoad(), PCB_IO::FootprintSave(), GITHUB_PLUGIN::FootprintSave(), FootprintWriteShape(), WORKSHEET_LAYOUT_IO::format(), SCH_LEGACY_PLUGIN::Format(), NETLIST_EXPORTER_PSPICE::Format(), PCB_IO::format(), PCB_IO::formatLayer(), FormatProbeItem(), DSN::SPECCTRA_DB::FromBOARD(), GENDRILL_WRITER_BASE::GenDrillReportFile(), GPCB_PLUGIN::getFootprint(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_TEXT::GetMsgPanelInfo(), SCH_LEGACY_PLUGIN_CACHE::GetRealFile(), SCH_COMPONENT::GetScreenCoord(), SCH_SHEET_PIN::HitTest(), idf_export_module(), DXF2BRD_CONVERTER::ImportDxfFile(), PCB_PARSER::init(), DIALOG_BOM::installPluginsList(), IsBusLabel(), SCH_EDIT_FRAME::KiwayMailIn(), SEARCH_STACK::LastVisitedPath(), GPCB_FPL_CACHE::Load(), PART_LIBS::LoadAllLibraries(), SCH_EDIT_FRAME::LoadSettings(), LIB_EDIT_FRAME::LoadSettings(), main(), DSN::SPECCTRA_DB::makeIMAGE(), DIALOG_FP_PLUGIN_OPTIONS::onListBoxItemSelected(), SCH_SHEET::operator=(), PCB_IO::Parse(), DSN::PARSER::PARSER(), SYMBOL_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), DXF_PLOTTER::PenTo(), PythonPluginsReloadBase(), GERBER_JOBFILE_READER::ReadGerberJobFile(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), RecreateCmpFile(), GITHUB_GETLIBLIST::remoteGetJSON(), GITHUB_PLUGIN::remoteGetZip(), GPCB_FPL_CACHE::Remove(), PCB_EDIT_FRAME::Remove_One_Track(), SCH_LEGACY_PLUGIN::saveComponent(), SCH_LEGACY_PLUGIN_CACHE::saveDocFile(), SCH_LEGACY_PLUGIN::saveLine(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::saveSymbol(), SCH_LEGACY_PLUGIN::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), LIB_TABLE_ROW::SetOptions(), PROJECT::SetProjectFullName(), DIALOG_LABEL_EDITOR::SetTitle(), SCH_REFERENCE_LIST::SortByReferenceOnly(), PS_PLOTTER::StartPlot(), SVG_PLOTTER::StartPlot(), GERBER_PLOTTER::StartPlot(), BOARD::SynchronizeNetsAndNetClasses(), DXF_PLOTTER::Text(), toUTFTildaText(), DIALOG_FP_PLUGIN_OPTIONS::TransferDataFromWindow(), DIALOG_FP_PLUGIN_OPTIONS::TransferDataToWindow(), write_D356_records(), EXCELLON_WRITER::writeCoordinates(), GBR_TO_PCB_EXPORTER::writeCopperLineItem(), EXCELLON_WRITER::writeEXCELLONHeader(), GERBER_JOBFILE_WRITER::WriteJSONJobFile(), NETLIST_EXPORTER_CADSTAR::writeListOfNets(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), GBR_TO_PCB_EXPORTER::writePcbHeader(), GBR_TO_PCB_EXPORTER::writePcbLineItem(), GBR_TO_PCB_EXPORTER::writePcbPolygonItem(), and DIALOG_DRC_CONTROL::writeReport().

Function Documentation

void AccumulateDescription ( wxString &  aDesc,
const wxString &  aItem 
)
inline

Utility to build comma separated lists in messages.

Definition at line 65 of file macros.h.

Referenced by ZONE_CONTAINER::GetMsgPanelInfo().

66 {
67  if( !aDesc.IsEmpty() )
68  aDesc << wxT(", ");
69 
70  aDesc << aItem;
71 }
template<typename T >
const T& Clamp ( const T &  lower,
const T &  value,
const T &  upper 
)
inline

Function Clamp limits value within the range lower <= value <= upper.

It will work on temporary expressions, since they are evaluated only once, and it should work on most if not all numeric types, string types, or any type for which "operator < ()" is present. The arguments are accepted in this order so you can remember the expression as a memory aid:

result is: lower <= value <= upper

Definition at line 127 of file macros.h.

Referenced by LSET::AllCuMask(), DIALOG_PAGES_SETTINGS::GetCustomSizeMilsFromDialog(), BRDITEMS_PLOTTER::plotOneDrillMark(), BASE_SCREEN::SetScalingFactor(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

128 {
129  wxASSERT( lower <= upper );
130  if( value < lower )
131  return lower;
132  else if( upper < value )
133  return upper;
134  return value;
135 }
static wxString FROM_UTF8 ( const char *  cstring)
inlinestatic

function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.

Definition at line 53 of file macros.h.

Referenced by SCH_REFERENCE::Annotate(), SCH_EDIT_FRAME::backAnnotateFootprints(), CVPCB_MAINFRAME::BuildCmpListBox(), CVPCB_MAINFRAME::buildEquivalenceList(), GITHUB_PLUGIN::cacheLib(), detect_file_type(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), PCB_EDIT_FRAME::DoGenFootprintsReport(), EXCELLON_IMAGE::Execute_EXCELLON_G_Command(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportVRML_File(), GPCB_PLUGIN::FootprintEnumerate(), LEGACY_PLUGIN::FootprintEnumerate(), EAGLE_PLUGIN::FootprintEnumerate(), DSN::SPECCTRA_DB::FromSESSION(), GENDRILL_WRITER_BASE::genDrillMapFile(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), GetIllegalFileNameWxChars(), MODULE::GetMsgPanelInfo(), NETLIST_READER::GuessNetlistFileType(), EDA_3D_CANVAS::initializeOpenGL(), CMP_READER::Load(), LEGACY_NETLIST_READER::loadComponent(), LEGACY_PLUGIN::loadDIMENSION(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), EAGLE_PLUGIN::loadElements(), LEGACY_NETLIST_READER::loadFootprintFilters(), EAGLE_PLUGIN::loadLayerDefs(), LEGACY_PLUGIN::loadMODULE(), LEGACY_NETLIST_READER::loadNet(), LEGACY_PLUGIN::loadNETCLASS(), LEGACY_PLUGIN::loadNETINFO_ITEM(), LEGACY_PLUGIN::loadPAD(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), LEGACY_PLUGIN::loadSETUP(), LEGACY_PLUGIN::loadSHEET(), SCH_LEGACY_PLUGIN::loadText(), PCB_PARSER::lookUpLayer(), main(), EAGLE_PLUGIN::makeModule(), DSN::SPECCTRA_DB::makeTRACK(), DSN::SPECCTRA_DB::makeVIA(), DIALOG_BOM::OnHelp(), APP_SINGLE_TOP::OnInit(), APP_SINGLE_TOP::OnRun(), APP_KICAD::OnRun(), EAGLE_PLUGIN::orientModuleText(), EAGLE_PLUGIN::packageText(), PCB_PLOT_PARAMS_PARSER::Parse(), TEMPLATE_FIELDNAME::Parse(), KICAD_NETLIST_PARSER::parseComponent(), PCB_PARSER::parseLayer(), KICAD_NETLIST_PARSER::parseLibPartList(), KICAD_NETLIST_PARSER::parseNet(), parseQuotedString(), parseUnquotedString(), pcbnewRunPythonMethodWithReturnedString(), SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile(), PyArrayStringToWx(), PyStringToWx(), GERBER_FILE_IMAGE::ReadApertureMacro(), ReadDelimitedText(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), GITHUB_GETLIBLIST::remoteGetJSON(), REPORTER::Report(), SCH_EDIT_FRAME::SaveSettings(), CVPCB_MAINFRAME::SetNewPkg(), DIALOG_FP_PLUGIN_OPTIONS::TransferDataToWindow(), EAGLE_PLUGIN::transferPad(), FOOTPRINT_EDIT_FRAME::updateTitle(), DIALOG_BOM::~DIALOG_BOM(), and WORKSHEET_LAYOUT_STRINGIO::~WORKSHEET_LAYOUT_STRINGIO().

54 {
55  wxString line = wxString::FromUTF8( cstring );
56 
57  if( line.IsEmpty() ) // happens when cstring is not a valid UTF8 sequence
58  line = wxConvCurrent->cMB2WC( cstring ); // try to use locale conversion
59 
60  return line;
61 }
static const wxChar* GetChars ( const wxString &  s)
inlinestatic

Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for passing strings to wxString::Printf() and wxString::Format().

It can also be passed a UTF8 parameter which will be converted to wxString by the compiler.

Example: wxString::Format( wxT( "%s" ), GetChars( UTF( "some text" ) ) );

When wxWidgets is properly built for KiCad, a const wxChar* points to either:

  • 32 bit unicode characters on linux/OSX or
  • 16 bit UTF16 characters on windows.

Note that you cannot pass 8 bit strings to wxString::Format() or Printf() so this is a useful conversion function to wxChar*, which is needed by wxString::Format().

Returns
const wxChar* - a pointer to the UNICODE or UTF16 (on windows) text.

Definition at line 92 of file macros.h.

Referenced by AddGerberX2Header(), AddMenusForEditComponent(), PL_EDITOR_FRAME::AddPageLayoutItem(), SCH_EDIT_FRAME::AnnotateComponents(), Append_Track_Width_List(), PCBNEW_CONTROL::AppendBoard(), CVPCB_MAINFRAME::AutomaticFootprintMatching(), CVPCB_MAINFRAME::BuildCmpListBox(), CVPCB_MAINFRAME::buildEquivalenceList(), MODULE::BuildPolyCourtyard(), GITHUB_PLUGIN::cacheLib(), SCH_REFERENCE_LIST::CheckAnnotation(), EDA_BASE_FRAME::CheckForAutoSaveFile(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), copy_pro_file_template(), create_backup_file(), GERBER_WRITER::CreateDrillandMapFilesSet(), EXCELLON_WRITER::CreateDrillandMapFilesSet(), DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), DIALOG_GEN_FOOTPRINT_POSITION::CreateFiles(), CreateHeaderInfoData(), DIALOG_PLOT_SCHEMATIC::createHPGLFile(), GENDRILL_WRITER_BASE::CreateMapFilesSet(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::createPSFile(), CreateSignalsSection(), DIALOG_PLOT_SCHEMATIC::createSVGFile(), TREEPROJECT_ITEM::Delete(), PCB_EDIT_FRAME::Delete_Drawings_All_Layer(), Diagnose(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), CVPCB_MAINFRAME::DisplayStatus(), DRC::doNetClass(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EnsureFileDirectoryExists(), KICAD_MANAGER_FRAME::Execute(), ExecuteFile(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), DSNLEXER::Expecting(), FOOTPRINT_EDIT_FRAME::Export_Module(), export_vrml_module(), GBR_TO_PCB_EXPORTER::ExportPcb(), PCB_EDIT_FRAME::ExportToGenCAD(), PL_EDITOR_FRAME::Files_io(), FP_LIB_TABLE::FindRow(), SYMBOL_LIB_TABLE::FindRow(), GITHUB_PLUGIN::FootprintDelete(), GPCB_PLUGIN::FootprintEnumerate(), PCB_IO::FootprintSave(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), DIALOG_GENDRILL::GenDrillAndMapFiles(), PCB_EDIT_FRAME::GenFootprintsReport(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), GetAssociatedDocument(), GERBER_FILE_IMAGE_LIST::GetDisplayName(), GITHUB_GETLIBLIST::GetFootprintLibraryList(), GetGerberFileFunctionAttribute(), EDA_BASE_FRAME::GetKicadHelp(), GERBER_DRAW_ITEM::GetMsgPanelInfo(), MODULE::GetMsgPanelInfo(), SCH_TEXT::GetSelectMenuText(), FOOTPRINT_EDIT_FRAME::Import_Module(), PCB_EDIT_FRAME::importFile(), PGM_BASE::InitPgm(), EDA_BASE_FRAME::IsWritable(), KIWAY::KiFACE(), PART_LIBS::LibNamesAndPaths(), GERBVIEW_FRAME::Liste_D_Codes(), CMP_READER::Load(), PART_LIBS::LoadAllLibraries(), PGM_BASE::loadCommonSettings(), EAGLE_PLUGIN::loadElements(), GERBVIEW_FRAME::LoadExcellonFiles(), PCB_BASE_FRAME::loadFootprint(), PCB_BASE_FRAME::LoadFootprint(), LEGACY_NETLIST_READER::loadFootprintFilters(), PCB_EDIT_FRAME::LoadFootprints(), SYMBOL_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), SCH_LEGACY_PLUGIN::loadHeader(), EAGLE_PLUGIN::loadLibrary(), GERBVIEW_FRAME::loadListOfGerberFiles(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadMODULE_EDGE(), DIALOG_NETLIST::loadNetlist(), LEGACY_PLUGIN::loadPAD(), LIB_EDIT_FRAME::loadPart(), PCB_EDIT_FRAME::LoadProjectSettings(), PCB_PARSER::lookUpLayer(), DSN::SPECCTRA_DB::makeTRACK(), DSN::SPECCTRA_DB::makeVIA(), HTML_MESSAGE_BOX::MessageSet(), DIALOG_CONFIG_EQUFILES::OnAddFiles(), KICAD_MANAGER_FRAME::OnArchiveFiles(), NETLIST_DIALOG_ADD_PLUGIN::OnBrowsePlugins(), DIALOG_FIND::onButtonFindItemClick(), LIB_EDIT_FRAME::OnCheckComponent(), TREE_PROJECT_FRAME::OnCreateNewDirectory(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), PCB_EDIT_FRAME::OnExportVRML(), PL_EDITOR_FRAME::OnFileHistory(), DIALOG_GENDRILL::OnGenReportFile(), APP_SINGLE_TOP::OnInit(), DIALOG_DRC_CONTROL::OnListUnconnectedClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), TREE_PROJECT_FRAME::OnRenameFile(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), APP_SINGLE_TOP::OnRun(), APP_KICAD::OnRun(), GERBVIEW_FRAME::OnShowGerberSourceFile(), DIALOG_DRC_CONTROL::OnStartdrcClick(), KICAD_MANAGER_FRAME::TERMINATE_HANDLER::OnTerminate(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), PL_EDITOR_FRAME::OpenProjectFiles(), GERBVIEW_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), EDA_ITEM::operator<(), FP_LIB_TABLE::Parse(), SYMBOL_LIB_TABLE::Parse(), PCB_PARSER::Parse(), PCB_PARSER::parseBOARD_unchecked(), KICAD_NETLIST_PARSER::parseComponent(), PCB_PARSER::parseD_PAD(), PCB_PARSER::parseDouble(), PCB_PARSER::parseLayers(), GPCB_FPL_CACHE::parseMODULE(), PCB_PARSER::parseMODULE_unchecked(), KICAD_NETLIST_PARSER::parseNet(), PCB_PARSER::parsePAGE_INFO(), PCB_PARSER::parseTEXTE_MODULE(), PCB_PARSER::parseTRACK(), PCB_PARSER::parseVIA(), PCB_PARSER::parseZONE_CONTAINER(), SCH_FIND_COLLECTOR::PassedEnd(), SCH_EDIT_FRAME::PasteListOfItems(), DIALOG_PLOT::Plot(), PlotSilkScreen(), PlotStandardLayer(), KICAD_MANAGER_FRAME::PrintPrjInfo(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), GERBER_FILE_IMAGE::ReadApertureMacro(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::ReadPcbNetlist(), PL_EDITOR_FRAME::RebuildDesignTree(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), GITHUB_PLUGIN::remoteGetZip(), LIB_PART::RemoveAlias(), LIB_PART::RemoveDrawItem(), SCH_SHEET::RemovePin(), EDA_ITEM::Replace(), BOARD::ReplaceNetlist(), SCH_EDIT_FRAME::ReSizeSheet(), WIDGET_HOTKEY_LIST::ResolveKeyConflicts(), FOOTPRINT_EDIT_FRAME::RevertFootprint(), FP_CACHE::Save(), PGM_BASE::SaveCommonSettings(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), DIALOG_PAGES_SETTINGS::SavePageSettings(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), PCB_BASE_FRAME::SelectLibrary(), FOOTPRINTS_LISTBOX::SetFootprints(), PGM_BASE::SetLanguage(), PGM_BASE::SetLocalEnvVariable(), PGM_BASE::SetLocalEnvVariables(), CVPCB_MAINFRAME::SetNewPkg(), FOOTPRINTS_LISTBOX::SetSelectedFootprint(), SimilarLabelsDiagnose(), SCH_BITMAP::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SHEET::SwapData(), GERBVIEW_FRAME::unarchiveFiles(), DSNLEXER::Unexpected(), HIGHLIGHT_MENU::update(), FOOTPRINT_WIZARD_FRAME::Update3D_Frame(), SCH_EDIT_FRAME::updateFindReplaceView(), LIB_EDIT_FRAME::UpdatePartSelectList(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_NETLIST::verifyFootprints(), WriteDiagnosticERC(), EDA_BASE_FRAME::WriteHotkeyConfig(), NETLIST_EXPORTER_CADSTAR::writeListOfNets(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), LIB_ALIAS::~LIB_ALIAS(), LIB_PART::~LIB_PART(), and SCH_LEGACY_PLUGIN_CACHE::~SCH_LEGACY_PLUGIN_CACHE().

93 {
94  return (const wxChar*) s.c_str();
95 }
template<typename T >
T Mirror ( aPoint,
aMirrorRef 
)

Function MIRROR Mirror aPoint in aMirrorRef.

Definition at line 106 of file macros.h.

Referenced by MIRROR(), MirrorMarkedItems(), SCH_TEXT::MirrorX(), and SCH_TEXT::MirrorY().

107 {
108  return -( aPoint - aMirrorRef ) + aMirrorRef;
109 }