|
KiCad PCB EDA Suite
|
Describe the page size and margins of a paper page on which to eventually print or plot. More...
#include <page_info.h>
Public Member Functions | |
| PAGE_INFO (PAGE_SIZE_TYPE aType=PAGE_SIZE_TYPE::A3, bool IsPortrait=false) | |
| bool | SetType (PAGE_SIZE_TYPE aPageSize, bool aIsPortrait=false) |
| Set the name of the page type and also the sizes and margins commonly associated with that type name. | |
| bool | SetType (const wxString &aPageSize, bool aIsPortrait=false) |
| const PAGE_SIZE_TYPE & | GetType () const |
| wxString | GetTypeAsString () const |
| const wxString & | GetPageFormatDescription () const |
| bool | IsDefault () const |
| bool | IsCustom () const |
| void | SetPortrait (bool aIsPortrait) |
| Rotate the paper page 90 degrees. | |
| bool | IsPortrait () const |
| wxPrintOrientation | GetWxOrientation () const |
| wxPaperSize | GetPaperId () const |
| void | SetWidthMM (double aWidthInMM) |
| void | SetWidthMils (double aWidthInMils) |
| double | GetWidthMils () const |
| double | GetWidthMM () const |
| void | SetHeightMM (double aHeightInMM) |
| void | SetHeightMils (double aHeightInMils) |
| double | GetHeightMils () const |
| double | GetHeightMM () const |
| const VECTOR2D & | GetSizeMils () const |
| int | GetWidthIU (double aIUScale) const |
| Get the page width in IU. | |
| int | GetHeightIU (double aIUScale) const |
| Get the page height in IU. | |
| const VECTOR2D | GetSizeIU (double aIUScale) const |
| Gets the page size in internal units. | |
| void | Format (OUTPUTFORMATTER *aFormatter) const |
| Output the page class to aFormatter in s-expression form. | |
Static Public Member Functions | |
| static void | SetCustomWidthMils (double aWidthInMils) |
| Set the width of Custom page in mils for any custom page constructed or made via SetType() after making this call. | |
| static void | SetCustomHeightMils (double aHeightInMils) |
| Set the height of Custom page in mils for any custom page constructed or made via SetType() after making this call. | |
| static double | GetCustomWidthMils () |
| static double | GetCustomHeightMils () |
| static const std::vector< PAGE_INFO > & | GetPageFormatsList () |
Protected Member Functions | |
| PAGE_INFO (const VECTOR2D &aSizeMils, const PAGE_SIZE_TYPE &aType, wxPaperSize aPaperId, const wxString &aDescription=wxEmptyString) | |
| void | updatePortrait () |
Private Attributes | |
| PAGE_SIZE_TYPE | m_type |
| paper type: A4, A3, etc. | |
| VECTOR2D | m_size |
| mils | |
| bool | m_portrait |
| true if portrait, false if landscape | |
| wxPaperSize | m_paper_id |
| wx' style paper id. | |
| wxString | m_description |
| more human friendly description of page size | |
Static Private Attributes | |
| static std::vector< PAGE_INFO > | standardPageSizes |
| static double | s_user_height = 11000 |
| static double | s_user_width = 17000 |
Describe the page size and margins of a paper page on which to eventually print or plot.
Paper sizes are often described in inches. Here paper is described in 1/1000th of an inch (mils). For convenience there are some read only accessors for internal units which is a compile time calculation, not runtime.
Definition at line 74 of file page_info.h.
| PAGE_INFO::PAGE_INFO | ( | PAGE_SIZE_TYPE | aType = PAGE_SIZE_TYPE::A3, |
| bool | IsPortrait = false ) |
Definition at line 92 of file page_info.cpp.
References A4, m_paper_id, m_portrait, m_size, m_type, s_user_height, s_user_width, and SetType().
Referenced by SetType().
|
protected |
Definition at line 77 of file page_info.cpp.
References m_description, m_paper_id, m_size, m_type, and updatePortrait().
| void PAGE_INFO::Format | ( | OUTPUTFORMATTER * | aFormatter | ) | const |
Output the page class to aFormatter in s-expression form.
| aFormatter | The OUTPUTFORMATTER object to write to. |
| IO_ERROR | on write error. |
Definition at line 234 of file page_info.cpp.
References FormatDouble2Str(), GetHeightMils(), GetType(), GetWidthMils(), IsCustom(), IsPortrait(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and User.
Referenced by SCH_IO_KICAD_SEXPR::Format(), and PCB_IO_KICAD_SEXPR::formatGeneral().
|
inlinestatic |
Definition at line 197 of file page_info.h.
References s_user_height.
Referenced by BOARD::operator==(), and PL_EDITOR_FRAME::SaveSettings().
|
inlinestatic |
Definition at line 192 of file page_info.h.
References s_user_width.
Referenced by BOARD::operator==(), and PL_EDITOR_FRAME::SaveSettings().
|
inline |
Get the page height in IU.
| aIUScale | The IU scale, this is most likely always going to be IU_PER_MILS variable being passed. Note, this constexpr variable changes depending on application, hence why it is passed. |
Definition at line 163 of file page_info.h.
References GetHeightMils().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::GetDocumentExtents(), AUTOPLACER::getDrawableArea(), GetSizeIU(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_ALTIUM::ParseSheet(), plotBackgroundColor(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetPS(), and SCH_PLOTTER::plotOneSheetSVG().
|
inline |
Definition at line 142 of file page_info.h.
References m_size.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_PLOTTER::createPSFiles(), KIGFX::DS_PAINTER::DrawBorder(), Format(), SCH_IO_KICAD_LEGACY::Format(), GetHeightIU(), DIALOG_PRINT_GENERIC::initPrintData(), PCB_IO_EASYEDA::loadBoard(), SCH_IO_PCAD::LoadSchematicFile(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_V3_PARSER::ParseBoard(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetSVG(), SCH_PLOTTER::setupPlotPagePDF(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Definition at line 143 of file page_info.h.
References m_size.
Referenced by ORCAD_CONVERTER::applyPageSettings(), BOOST_AUTO_TEST_CASE(), and EASYPC::PageForExtents().
|
inline |
Definition at line 100 of file page_info.h.
References m_description.
|
static |
Definition at line 255 of file page_info.cpp.
References standardPageSizes.
Referenced by DIALOG_PAGES_SETTINGS::TransferDataToWindow().
|
inline |
Definition at line 133 of file page_info.h.
References m_paper_id.
Referenced by DIALOG_PRINT_GENERIC::initPrintData(), BOARD::operator==(), PL_EDITOR_FRAME::ToPrinter(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Gets the page size in internal units.
| aIUScale | The IU scale, this is most likely always going to be IU_PER_MILS variable being passed. Note, this constexpr variable changes depending on application, hence why it is passed. |
Definition at line 172 of file page_info.h.
References GetHeightIU(), and GetWidthIU().
Referenced by BOOST_AUTO_TEST_CASE(), SPRINT_LAYOUT_PARSER::CreateBoard(), SCH_IO_GEDA::fitPageToContent(), GENDRILL_WRITER_BASE::genDrillMapFile(), GERBVIEW_FRAME::GetPageSizeIU(), SCH_BASE_FRAME::GetPageSizeIU(), API_HANDLER_EDITOR::handleGetPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), initializePlotter(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_IO_EAGLE::loadSchematic(), SCH_IO_EAGLE::loadSheet(), SCH_IO_LTSPICE_PARSER::Parse(), SCH_PRINTOUT::PrintPage(), GERBVIEW_FRAME::SetPageSettings(), PCB_BASE_FRAME::SetPageSettings(), PL_EDITOR_FRAME::SetPageSettings(), StartPlotBoard(), and PL_EDITOR_FRAME::UpdateMsgPanelInfo().
|
inline |
Definition at line 145 of file page_info.h.
References m_size.
Referenced by DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog(), BOARD::operator==(), and DS_DATA_MODEL::SetupDrawEnvironment().
|
inline |
Definition at line 97 of file page_info.h.
References m_type.
Referenced by KICAD_DIFF::AppendPaperDeltas(), KICAD_DIFF::PCB_MERGE_APPLIER::Apply(), KICAD_DIFF::SCH_MERGE_APPLIER::Apply(), ORCAD_CONVERTER::applyPageSettings(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), Format(), API_HANDLER_EDITOR::handleGetPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), SCH_IO_KICAD_LEGACY::loadPageSettings(), PCB_IO_KICAD_LEGACY::loadSHEET(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), and SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO().
| wxString PAGE_INFO::GetTypeAsString | ( | ) | const |
Definition at line 149 of file page_info.cpp.
References m_type.
Referenced by KICAD_DIFF::AppendPaperDeltas(), BOOST_AUTO_TEST_CASE(), DS_DRAW_ITEM_LIST::BuildDrawItemsList(), SCH_IO_KICAD_LEGACY::Format(), DIALOG_INSPECTOR::ReCreateDesignList(), GERBVIEW_FRAME::SaveSettings(), and PL_EDITOR_FRAME::SaveSettings().
|
inline |
Get the page width in IU.
| aIUScale | The IU scale, this is most likely always going to be IU_PER_MILS variable being passed. Note, this constexpr variable changes depending on application, hence why it is passed. |
Definition at line 154 of file page_info.h.
References GetWidthMils().
Referenced by SCH_EDIT_FRAME::GetDocumentExtents(), AUTOPLACER::getDrawableArea(), GetSizeIU(), plotBackgroundColor(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetPS(), and SCH_PLOTTER::plotOneSheetSVG().
|
inline |
Definition at line 137 of file page_info.h.
References m_size.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_PLOTTER::createPSFiles(), KIGFX::DS_PAINTER::DrawBorder(), Format(), SCH_IO_KICAD_LEGACY::Format(), GetWidthIU(), DIALOG_PRINT_GENERIC::initPrintData(), PCB_IO_EASYEDA::loadBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_V3_PARSER::ParseBoard(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetSVG(), SCH_PLOTTER::setupPlotPagePDF(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Definition at line 138 of file page_info.h.
References m_size.
Referenced by ORCAD_CONVERTER::applyPageSettings(), BOOST_AUTO_TEST_CASE(), and EASYPC::PageForExtents().
|
inline |
Definition at line 128 of file page_info.h.
References IsPortrait().
Referenced by DIALOG_PRINT_GENERIC::initPrintData(), BOARD::operator==(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
| bool PAGE_INFO::IsCustom | ( | ) | const |
Definition at line 156 of file page_info.cpp.
Referenced by Format(), SCH_IO_KICAD_LEGACY::Format(), API_HANDLER_EDITOR::handleGetPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), DIALOG_PRINT_GENERIC::initPrintData(), PL_EDITOR_FRAME::ToPrinter(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Definition at line 105 of file page_info.h.
References A3, m_portrait, and m_type.
|
inline |
Definition at line 123 of file page_info.h.
References m_portrait.
Referenced by KICAD_DIFF::AppendPaperDeltas(), KICAD_DIFF::PCB_MERGE_APPLIER::Apply(), KICAD_DIFF::SCH_MERGE_APPLIER::Apply(), SCH_PLOTTER::createPSFiles(), Format(), SCH_IO_KICAD_LEGACY::Format(), GetWxOrientation(), API_HANDLER_EDITOR::handleGetPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), DIALOG_PRINT_GENERIC::initPrintData(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetSVG(), PL_EDITOR_FRAME::SaveSettings(), SCH_PLOTTER::setupPlotPagePDF(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
|
static |
Set the height of Custom page in mils for any custom page constructed or made via SetType() after making this call.
Definition at line 200 of file page_info.cpp.
References clampHeight(), and s_user_height.
Referenced by ORCAD_CONVERTER::applyPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), PL_EDITOR_FRAME::LoadSettings(), SCH_IO_ALTIUM::ParseSheet(), and DIALOG_PAGES_SETTINGS::SavePageSettings().
|
static |
Set the width of Custom page in mils for any custom page constructed or made via SetType() after making this call.
Definition at line 194 of file page_info.cpp.
References clampWidth(), and s_user_width.
Referenced by ORCAD_CONVERTER::applyPageSettings(), API_HANDLER_EDITOR::handleSetPageSettings(), PL_EDITOR_FRAME::LoadSettings(), SCH_IO_ALTIUM::ParseSheet(), and DIALOG_PAGES_SETTINGS::SavePageSettings().
| void PAGE_INFO::SetHeightMils | ( | double | aHeightInMils | ) |
Definition at line 220 of file page_info.cpp.
References clampHeight(), m_paper_id, m_size, m_type, updatePortrait(), and User.
Referenced by SCH_IO_GEDA::fitPageToContent(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), PCB_IO_GEDA::loadBoard(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_PCAD::LoadSchematicFile(), PCB_IO_KICAD_LEGACY::loadSHEET(), SCH_IO_EAGLE::loadSheet(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDAPRO_V3_PARSER::ParseSchematic(), PCB_PLOTTER::Plot(), PlotSymbolToSVG(), SetHeightMM(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
|
inline |
Definition at line 140 of file page_info.h.
References SetHeightMils().
Referenced by DIPTRACE::SCH_PARSER::createKiCadObjects(), EASYPC::PageForExtents(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), and SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO().
| void PAGE_INFO::SetPortrait | ( | bool | aIsPortrait | ) |
Rotate the paper page 90 degrees.
This PAGE_INFO may either be in portrait or landscape mode. Use this function to change from one mode to the other mode.
| aIsPortrait | if true and not already in portrait mode, will change this PAGE_INFO to portrait mode. Or if false and not already in landscape mode, will change this PAGE_INFO to landscape mode. |
Definition at line 162 of file page_info.cpp.
References m_portrait, and m_size.
Referenced by KICAD_DIFF::PCB_MERGE_APPLIER::Apply(), KICAD_DIFF::SCH_MERGE_APPLIER::Apply(), SCH_PLOTTER::createPSFiles(), SCH_IO_KICAD_LEGACY::loadPageSettings(), PCB_IO_KICAD_LEGACY::loadSHEET(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetSVG(), and SCH_PLOTTER::setupPlotPagePDF().
| bool PAGE_INFO::SetType | ( | const wxString & | aPageSize, |
| bool | aIsPortrait = false ) |
Definition at line 102 of file page_info.cpp.
References SetType().
| bool PAGE_INFO::SetType | ( | PAGE_SIZE_TYPE | aPageSize, |
| bool | aIsPortrait = false ) |
Set the name of the page type and also the sizes and margins commonly associated with that type name.
| aPageSize | is a PAGE_SIZE_TYPE constant giving one of "A5" "A4" "A3" "A2" "A1" "A0" "A" "B" "C" "D" "E" "GERBER", "USLetter", "USLegal", "USLedger", or "User". If "User" then the width and height are custom, and will be set according to previous calls to static PAGE_INFO::SetUserWidthMils() and static PAGE_INFO::SetUserHeightMils(); |
| aIsPortrait | Set to true to set page orientation to portrait mode. |
Definition at line 113 of file page_info.cpp.
References m_paper_id, m_size, m_type, PAGE_INFO(), result, s_user_height, s_user_width, standardPageSizes, updatePortrait(), and User.
Referenced by KICAD_DIFF::PCB_MERGE_APPLIER::Apply(), KICAD_DIFF::SCH_MERGE_APPLIER::Apply(), ORCAD_CONVERTER::applyPageSettings(), GERBVIEW_FRAME::CommonSettingsChanged(), SCH_PLOTTER::createPSFiles(), DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog(), API_HANDLER_EDITOR::handleSetPageSettings(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_PCAD::LoadSchematicFile(), GERBVIEW_FRAME::LoadSettings(), PL_EDITOR_FRAME::LoadSettings(), PCB_IO_KICAD_LEGACY::loadSHEET(), PAGE_INFO(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), SCH_IO_ALTIUM::ParseSheet(), SCH_PLOTTER::plotOneSheetPNG(), SCH_PLOTTER::plotOneSheetSVG(), SetType(), SCH_PLOTTER::setupPlotPagePDF(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
| void PAGE_INFO::SetWidthMils | ( | double | aWidthInMils | ) |
Definition at line 206 of file page_info.cpp.
References clampWidth(), m_paper_id, m_size, m_type, updatePortrait(), and User.
Referenced by SCH_IO_GEDA::fitPageToContent(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), PCB_IO_GEDA::loadBoard(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_PCAD::LoadSchematicFile(), PCB_IO_KICAD_LEGACY::loadSHEET(), SCH_IO_EAGLE::loadSheet(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDAPRO_V3_PARSER::ParseSchematic(), PCB_PLOTTER::Plot(), PlotSymbolToSVG(), SetWidthMM(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
|
inline |
Definition at line 135 of file page_info.h.
References SetWidthMils().
Referenced by DIPTRACE::SCH_PARSER::createKiCadObjects(), EASYPC::PageForExtents(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), and SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO().
|
inlineprotected |
Definition at line 70 of file page_info.cpp.
References m_portrait, and m_size.
Referenced by PAGE_INFO(), SetHeightMils(), SetType(), and SetWidthMils().
|
private |
more human friendly description of page size
Definition at line 227 of file page_info.h.
Referenced by GetPageFormatDescription(), and PAGE_INFO().
|
private |
wx' style paper id.
Definition at line 226 of file page_info.h.
Referenced by GetPaperId(), PAGE_INFO(), PAGE_INFO(), SetHeightMils(), SetType(), and SetWidthMils().
|
private |
true if portrait, false if landscape
Definition at line 224 of file page_info.h.
Referenced by IsDefault(), IsPortrait(), PAGE_INFO(), SetPortrait(), and updatePortrait().
|
private |
mils
Definition at line 222 of file page_info.h.
Referenced by GetHeightMils(), GetHeightMM(), GetSizeMils(), GetWidthMils(), GetWidthMM(), PAGE_INFO(), PAGE_INFO(), SetHeightMils(), SetPortrait(), SetType(), SetWidthMils(), and updatePortrait().
|
private |
paper type: A4, A3, etc.
Definition at line 221 of file page_info.h.
Referenced by GetType(), GetTypeAsString(), IsCustom(), IsDefault(), PAGE_INFO(), PAGE_INFO(), SetHeightMils(), SetType(), and SetWidthMils().
|
staticprivate |
Definition at line 229 of file page_info.h.
Referenced by GetCustomHeightMils(), PAGE_INFO(), SetCustomHeightMils(), and SetType().
|
staticprivate |
Definition at line 230 of file page_info.h.
Referenced by GetCustomWidthMils(), PAGE_INFO(), SetCustomWidthMils(), and SetType().
|
staticprivate |
Definition at line 42 of file page_info.h.
Referenced by GetPageFormatsList(), and SetType().