![]() |
KiCad PCB EDA Suite
|
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and frame references, and parameters to draw/plot them. More...
#include <ds_draw_item.h>
Public Member Functions | |
DS_DRAW_ITEM_LIST () | |
~DS_DRAW_ITEM_LIST () | |
void | SetProject (const PROJECT *aProject) |
void | SetTitleBlock (const TITLE_BLOCK *aTblock) |
Set the title block (mainly for drawing sheet editor) More... | |
void | SetPaperFormat (const wxString *aFormatName) |
Set the paper format name (mainly for drawing sheet editor) More... | |
void | SetFileName (const wxString &aFileName) |
Set the filename to draw/plot. More... | |
void | SetSheetName (const wxString &aSheetName) |
Set the sheet name to draw/plot. More... | |
void | SetSheetLayer (const wxString &aSheetLayer) |
Set the sheet layer to draw/plot. More... | |
void | SetDefaultPenSize (int aPenSize) |
int | GetDefaultPenSize () const |
void | SetMilsToIUfactor (double aMils2Iu) |
Set the scalar to convert pages units (mils) to draw/plot units. More... | |
double | GetMilsToIUfactor () |
Get the scalar to convert pages units (mils) to draw/plot units. More... | |
void | SetPageNumber (const wxString &aPageNumber) |
Set the value of the sheet number. More... | |
void | SetIsFirstPage (bool aIsFirstPage) |
Set if the page is the first page. More... | |
void | SetSheetCount (int aSheetCount) |
Set the value of the count of sheets, for basic inscriptions. More... | |
void | Append (DS_DRAW_ITEM_BASE *aItem) |
void | Remove (DS_DRAW_ITEM_BASE *aItem) |
DS_DRAW_ITEM_BASE * | GetFirst () |
DS_DRAW_ITEM_BASE * | GetNext () |
void | GetAllItems (std::vector< DS_DRAW_ITEM_BASE * > *aList) |
void | Print (const RENDER_SETTINGS *aSettings) |
Draws the item list created by BuildDrawItemsList. More... | |
void | BuildDrawItemsList (const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock) |
Drawing or plot the page layout. More... | |
wxString | BuildFullText (const wxString &aTextbase) |
Return the full text corresponding to the aTextbase, after replacing format symbols by the corresponding value. More... | |
Static Public Member Functions | |
static void | GetTextVars (wxArrayString *aVars) |
Protected Attributes | |
std::vector< DS_DRAW_ITEM_BASE * > | m_graphicList |
unsigned | m_idx |
double | m_milsToIu |
int | m_penSize |
bool | m_isFirstPage |
Is this the first page or not. More... | |
int | m_sheetCount |
The number of sheets. More... | |
const TITLE_BLOCK * | m_titleBlock |
const wxString * | m_paperFormat |
wxString | m_fileName |
wxString | m_sheetFullName |
wxString | m_pageNumber |
The actual page number displayed in the title block. More... | |
const wxString * | m_sheetLayer |
const PROJECT * | m_project |
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and frame references, and parameters to draw/plot them.
Definition at line 376 of file ds_draw_item.h.
|
inline |
Definition at line 379 of file ds_draw_item.h.
References m_idx, m_isFirstPage, m_milsToIu, m_pageNumber, m_paperFormat, m_penSize, m_project, m_sheetCount, m_sheetLayer, and m_titleBlock.
|
inline |
Definition at line 393 of file ds_draw_item.h.
|
inline |
Definition at line 473 of file ds_draw_item.h.
References m_graphicList.
Referenced by DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), and DS_DATA_ITEM_BITMAP::SyncDrawItems().
void DS_DRAW_ITEM_LIST::BuildDrawItemsList | ( | const PAGE_INFO & | aPageInfo, |
const TITLE_BLOCK & | aTitleBlock | ||
) |
Drawing or plot the page layout.
Before calling this function, some parameters should be initialized by calling: SetPenSize( aPenWidth ); SetMilsToIUfactor( aMils2Iu ); SetSheetNumber( aSheetNumber ); SetSheetCount( aSheetCount ); SetFileName( aFileName ); SetSheetName( aFullSheetName );
aPageInfo | The PAGE_INFO, for page size, margins... |
aTitleBlock | The sheet title block, for basic inscriptions. |
aColor | The color for drawing. |
aAltColor | The color for items which need to be "highlighted". |
Definition at line 499 of file ds_draw_item.cpp.
References FIRST_PAGE_ONLY, DS_DATA_MODEL::GetCount(), DS_DATA_MODEL::GetItems(), DS_DATA_MODEL::GetTheInstance(), PAGE_INFO::GetType(), DS_DATA_MODEL::LoadDrawingSheet(), m_isFirstPage, m_milsToIu, m_paperFormat, m_titleBlock, DS_DATA_MODEL::SetupDrawEnvironment(), SUBSEQUENT_PAGES, and DS_DATA_MODEL::VoidListAllowed().
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
wxString DS_DRAW_ITEM_LIST::BuildFullText | ( | const wxString & | aTextbase | ) |
Return the full text corresponding to the aTextbase, after replacing format symbols by the corresponding value.
Basic texts in Ki_WorkSheetData struct use format notation like "Title %T" to identify at run time the full text to display. Currently format identifier is % followed by a letter or 2 letters
%% = replaced by % K = Kicad version Z = paper format name (A4, USLetter) Y = company name D = date R = revision S = sheet number N = number of sheets Cx = comment (x = 0 to 9 to identify the comment) F = filename P = sheet path or sheet full name T = title Other fields like Developer, Verifier, Approver could use Cx and are seen as comments for format
aTextbase | = the text with format symbols |
Definition at line 104 of file ds_painter.cpp.
References ExpandTextVars(), Format(), GetBuildVersion(), Pgm(), PgmOrNull(), and productName.
Referenced by DS_DATA_ITEM_TEXT::SyncDrawItems().
|
inline |
Definition at line 504 of file ds_draw_item.h.
References m_graphicList.
|
inline |
Definition at line 437 of file ds_draw_item.h.
References m_penSize.
Referenced by DS_DATA_ITEM::SyncDrawItems(), and DS_DATA_ITEM_TEXT::SyncDrawItems().
|
inline |
Definition at line 484 of file ds_draw_item.h.
References m_graphicList, m_idx, and NULL.
Referenced by DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), PlotDrawingSheet(), Print(), DRC_TEST_PROVIDER_MISC::testTextVars(), ERC_TESTER::TestTextVars(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inline |
Get the scalar to convert pages units (mils) to draw/plot units.
Definition at line 450 of file ds_draw_item.h.
References m_milsToIu.
Referenced by DS_DATA_ITEM_BITMAP::SyncDrawItems().
|
inline |
Definition at line 494 of file ds_draw_item.h.
References m_graphicList, m_idx, and NULL.
Referenced by DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), PlotDrawingSheet(), Print(), DRC_TEST_PROVIDER_MISC::testTextVars(), ERC_TESTER::TestTextVars(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
static |
Definition at line 89 of file ds_painter.cpp.
References TITLE_BLOCK::GetContextualTextVars().
Referenced by PROPERTIES_FRAME::onScintillaCharAdded().
void DS_DRAW_ITEM_LIST::Print | ( | const RENDER_SETTINGS * | aSettings | ) |
Draws the item list created by BuildDrawItemsList.
Definition at line 532 of file ds_draw_item.cpp.
References GetFirst(), GetNext(), and WSG_BITMAP_T.
Referenced by PrintDrawingSheet().
|
inline |
Definition at line 478 of file ds_draw_item.h.
References m_graphicList.
Referenced by DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), and DS_DATA_ITEM_BITMAP::SyncDrawItems().
|
inline |
Definition at line 436 of file ds_draw_item.h.
References m_penSize.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), and PrintDrawingSheet().
|
inline |
Set the filename to draw/plot.
Definition at line 415 of file ds_draw_item.h.
References m_fileName.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set if the page is the first page.
Definition at line 463 of file ds_draw_item.h.
References m_isFirstPage.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), and PrintDrawingSheet().
|
inline |
Set the scalar to convert pages units (mils) to draw/plot units.
Definition at line 442 of file ds_draw_item.h.
References m_milsToIu.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the value of the sheet number.
Definition at line 455 of file ds_draw_item.h.
References m_pageNumber.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the paper format name (mainly for drawing sheet editor)
Definition at line 410 of file ds_draw_item.h.
References m_paperFormat.
|
inline |
Definition at line 400 of file ds_draw_item.h.
References m_project.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the value of the count of sheets, for basic inscriptions.
Definition at line 468 of file ds_draw_item.h.
References m_sheetCount.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the sheet layer to draw/plot.
Definition at line 431 of file ds_draw_item.h.
References m_sheetLayer.
Referenced by PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the sheet name to draw/plot.
Definition at line 423 of file ds_draw_item.h.
References m_sheetFullName.
Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), PlotDrawingSheet(), PrintDrawingSheet(), DRC_TEST_PROVIDER_MISC::testTextVars(), and ERC_TESTER::TestTextVars().
|
inline |
Set the title block (mainly for drawing sheet editor)
Definition at line 405 of file ds_draw_item.h.
References m_titleBlock.
|
protected |
Definition at line 575 of file ds_draw_item.h.
Referenced by SetFileName().
|
protected |
Definition at line 564 of file ds_draw_item.h.
Referenced by Append(), GetAllItems(), GetFirst(), GetNext(), and Remove().
|
protected |
Definition at line 565 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), GetFirst(), and GetNext().
|
protected |
Is this the first page or not.
Definition at line 570 of file ds_draw_item.h.
Referenced by BuildDrawItemsList(), DS_DRAW_ITEM_LIST(), and SetIsFirstPage().
|
protected |
Definition at line 566 of file ds_draw_item.h.
Referenced by BuildDrawItemsList(), DS_DRAW_ITEM_LIST(), GetMilsToIUfactor(), and SetMilsToIUfactor().
|
protected |
The actual page number displayed in the title block.
Definition at line 577 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), and SetPageNumber().
|
protected |
Definition at line 574 of file ds_draw_item.h.
Referenced by BuildDrawItemsList(), DS_DRAW_ITEM_LIST(), and SetPaperFormat().
|
protected |
Definition at line 568 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), GetDefaultPenSize(), and SetDefaultPenSize().
|
protected |
Definition at line 579 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), and SetProject().
|
protected |
The number of sheets.
Definition at line 571 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), and SetSheetCount().
|
protected |
Definition at line 576 of file ds_draw_item.h.
Referenced by SetSheetName().
|
protected |
Definition at line 578 of file ds_draw_item.h.
Referenced by DS_DRAW_ITEM_LIST(), and SetSheetLayer().
|
protected |
Definition at line 573 of file ds_draw_item.h.
Referenced by BuildDrawItemsList(), DS_DRAW_ITEM_LIST(), and SetTitleBlock().