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 |
Gets the page width in IU. | |
int | GetHeightIU (double aIUScale) const |
Gets 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 78 of file page_info.h.
PAGE_INFO::PAGE_INFO | ( | PAGE_SIZE_TYPE | aType = PAGE_SIZE_TYPE::A3, |
bool | IsPortrait = false ) |
Definition at line 96 of file page_info.cpp.
References m_paper_id, m_size, s_user_height, s_user_width, and SetType().
Referenced by SetType().
|
protected |
Definition at line 81 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 255 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 202 of file page_info.h.
References s_user_height.
Referenced by BOARD::operator==(), and PL_EDITOR_FRAME::SaveSettings().
|
inlinestatic |
Definition at line 197 of file page_info.h.
References s_user_width.
Referenced by BOARD::operator==(), and PL_EDITOR_FRAME::SaveSettings().
|
inline |
Gets 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 168 of file page_info.h.
References GetHeightMils().
Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SCH_EDIT_FRAME::GetDocumentExtents(), GetSizeIU(), SCH_IO_ALTIUM::ParseSheet(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), and plotPdfBackground().
|
inline |
Definition at line 147 of file page_info.h.
References m_size.
Referenced by SCH_PLOTTER::createPSFiles(), KIGFX::DS_PAINTER::DrawBorder(), Format(), SCH_IO_KICAD_LEGACY::Format(), GetHeightIU(), DIALOG_PRINT_GENERIC::initPrintData(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), SCH_PLOTTER::plotOneSheetSVG(), SCH_PLOTTER::setupPlotPagePDF(), PL_EDITOR_FRAME::ToPrinter(), DIALOG_PRINT::TransferDataFromWindow(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Definition at line 148 of file page_info.h.
References m_size.
|
inline |
Definition at line 105 of file page_info.h.
References m_description.
|
static |
Definition at line 276 of file page_info.cpp.
References standardPageSizes.
Referenced by DIALOG_PAGES_SETTINGS::TransferDataToWindow().
|
inline |
Definition at line 138 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 177 of file page_info.h.
References GetHeightIU(), and GetWidthIU().
Referenced by GENDRILL_WRITER_BASE::genDrillMapFile(), GERBVIEW_FRAME::GetPageSizeIU(), SCH_BASE_FRAME::GetPageSizeIU(), initializePlotter(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_IO_EAGLE::loadSheet(), SCH_IO_LTSPICE_PARSER::Parse(), SCH_PRINTOUT::PrintPage(), GERBVIEW_FRAME::SetPageSettings(), PCB_BASE_FRAME::SetPageSettings(), PL_EDITOR_FRAME::SetPageSettings(), and PL_EDITOR_FRAME::UpdateMsgPanelInfo().
|
inline |
Definition at line 150 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 102 of file page_info.h.
References m_type.
Referenced by Format(), 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 155 of file page_info.cpp.
References m_type.
Referenced by DS_DRAW_ITEM_LIST::BuildDrawItemsList(), SCH_IO_KICAD_LEGACY::Format(), DIALOG_INSPECTOR::ReCreateDesignList(), GERBVIEW_FRAME::SaveSettings(), and PL_EDITOR_FRAME::SaveSettings().
|
inline |
Gets 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 159 of file page_info.h.
References GetWidthMils().
Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SCH_EDIT_FRAME::GetDocumentExtents(), GetSizeIU(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), SCH_PLOTTER::plotOneSheetSVG(), and plotPdfBackground().
|
inline |
Definition at line 142 of file page_info.h.
References m_size.
Referenced by 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(), 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.
|
inline |
Definition at line 133 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 162 of file page_info.cpp.
Referenced by Format(), SCH_IO_KICAD_LEGACY::Format(), DIALOG_PRINT_GENERIC::initPrintData(), PL_EDITOR_FRAME::ToPrinter(), and DIALOG_PRINT::TransferDataToWindow().
|
inline |
Definition at line 110 of file page_info.h.
References A3, m_portrait, and m_type.
|
inline |
Definition at line 128 of file page_info.h.
References m_portrait.
Referenced by SCH_PLOTTER::createPSFiles(), Format(), SCH_IO_KICAD_LEGACY::Format(), GetWxOrientation(), DIALOG_PRINT_GENERIC::initPrintData(), 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 221 of file page_info.cpp.
References clampHeight(), and s_user_height.
Referenced by 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 215 of file page_info.cpp.
References clampWidth(), and s_user_width.
Referenced by PL_EDITOR_FRAME::LoadSettings(), SCH_IO_ALTIUM::ParseSheet(), and DIALOG_PAGES_SETTINGS::SavePageSettings().
void PAGE_INFO::SetHeightMils | ( | double | aHeightInMils | ) |
Definition at line 241 of file page_info.cpp.
References clampHeight(), m_paper_id, m_size, m_type, updatePortrait(), and User.
Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_IO_KICAD_LEGACY::loadPageSettings(), PCB_IO_KICAD_LEGACY::loadSHEET(), SCH_IO_EAGLE::loadSheet(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), PCB_PLOTTER::Plot(), SetHeightMM(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
|
inline |
Definition at line 145 of file page_info.h.
References SetHeightMils().
Referenced by 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 168 of file page_info.cpp.
References m_portrait, and m_size.
Referenced by 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::plotOneSheetSVG(), and SCH_PLOTTER::setupPlotPagePDF().
bool PAGE_INFO::SetType | ( | const wxString & | aPageSize, |
bool | aIsPortrait = false ) |
Definition at line 104 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.
aStandardPageDescriptionName | is a wxString 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 115 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 GERBVIEW_FRAME::CommonSettingsChanged(), SCH_PLOTTER::createPSFiles(), DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog(), SCH_IO_KICAD_LEGACY::loadPageSettings(), 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::plotOneSheetSVG(), SetType(), SCH_PLOTTER::setupPlotPagePDF(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
void PAGE_INFO::SetWidthMils | ( | double | aWidthInMils | ) |
Definition at line 227 of file page_info.cpp.
References clampWidth(), m_paper_id, m_size, m_type, updatePortrait(), and User.
Referenced by EESCHEMA_JOBS_HANDLER::doSymExportSvg(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_IO_KICAD_LEGACY::loadPageSettings(), PCB_IO_KICAD_LEGACY::loadSHEET(), SCH_IO_EAGLE::loadSheet(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), PCB_PLOTTER::Plot(), SetWidthMM(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
|
inline |
Definition at line 140 of file page_info.h.
References SetWidthMils().
Referenced by PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), and SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO().
|
inlineprotected |
Definition at line 74 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 232 of file page_info.h.
Referenced by GetPageFormatDescription(), and PAGE_INFO().
|
private |
wx' style paper id.
Definition at line 231 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 229 of file page_info.h.
Referenced by IsDefault(), IsPortrait(), SetPortrait(), and updatePortrait().
|
private |
mils
Definition at line 227 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 226 of file page_info.h.
Referenced by GetType(), GetTypeAsString(), IsCustom(), IsDefault(), PAGE_INFO(), SetHeightMils(), SetType(), and SetWidthMils().
|
staticprivate |
Definition at line 234 of file page_info.h.
Referenced by GetCustomHeightMils(), PAGE_INFO(), SetCustomHeightMils(), and SetType().
|
staticprivate |
Definition at line 235 of file page_info.h.
Referenced by GetCustomWidthMils(), PAGE_INFO(), SetCustomWidthMils(), and SetType().
|
staticprivate |
Definition at line 46 of file page_info.h.
Referenced by GetPageFormatsList(), and SetType().