99 aVars->push_back( wxT(
"KICAD_VERSION" ) );
100 aVars->push_back( wxT(
"#" ) );
101 aVars->push_back( wxT(
"##" ) );
102 aVars->push_back( wxT(
"SHEETNAME" ) );
103 aVars->push_back( wxT(
"SHEETPATH" ) );
104 aVars->push_back( wxT(
"FILENAME" ) );
105 aVars->push_back( wxT(
"FILEPATH" ) );
106 aVars->push_back( wxT(
"PROJECTNAME" ) );
107 aVars->push_back( wxT(
"PAPER" ) );
108 aVars->push_back( wxT(
"LAYER" ) );
115 std::function<bool( wxString* )> wsResolver =
116 [&]( wxString* token ) ->
bool
118 bool tokenUpdated =
false;
120 if( token->IsSameAs( wxT(
"KICAD_VERSION" ) ) &&
PgmOrNull() )
125 else if( token->IsSameAs( wxT(
"#" ) ) )
130 else if( token->IsSameAs( wxT(
"##" ) ) )
135 else if( token->IsSameAs( wxT(
"SHEETNAME" ) ) )
140 else if( token->IsSameAs( wxT(
"SHEETPATH" ) ) )
145 else if( token->IsSameAs( wxT(
"FILENAME" ) ) )
148 *token = fn.GetFullName();
151 else if( token->IsSameAs( wxT(
"FILEPATH" ) ) )
154 *token = fn.GetFullPath();
157 else if( token->IsSameAs( wxT(
"PAPER" ) ) )
162 else if( token->IsSameAs( wxT(
"LAYER" ) ) )
212 auto item =
dynamic_cast<const EDA_ITEM*
>( aItem );
217 switch( item->Type() )
225 default:
return false;
234 m_gal->SetIsStroke(
true );
235 m_gal->SetIsFill(
false );
244 m_gal->SetIsStroke(
true );
245 m_gal->SetIsFill(
false );
255 m_gal->SetIsFill(
true );
256 m_gal->SetIsStroke(
false );
260 for(
int idx = 0; idx < item->
GetPolygons().OutlineCount(); ++idx )
263 m_gal->DrawPolygon( outline );
298 m_gal->Translate( position );
301 if( !( bitmap && bitmap->m_ImageBitmap
302 && bitmap->m_ImageBitmap->GetImageData() ) )
309 double img_scale = bitmap->m_ImageBitmap->GetScale();
311 if( img_scale != 1.0 )
314 m_gal->DrawBitmap( *bitmap->m_ImageBitmap );
318 m_gal->SetIsFill(
true );
319 m_gal->SetIsStroke(
true );
323 if( img_scale != 1.0 )
340 m_gal->SetIsStroke(
true );
344 m_gal->SetIsFill(
false );
347 m_gal->DrawRectangle( origin,
end );
356 m_gal->DrawCircle( pos, marker_size );
358 VECTOR2D( pos.
x + marker_size, pos.
y + marker_size ) );
360 VECTOR2D( pos.
x - marker_size, pos.
y + marker_size ) );
370 m_gal->SetIsStroke(
true );
374 m_gal->SetIsFill(
false );
376 m_gal->DrawRectangle( origin,
end );
BASE_SCREEN class implementation.
wxString GetBaseVersion()
Get the KiCad version string without the information added by the packagers.
constexpr const Vec GetEnd() const
constexpr const Vec & GetOrigin() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
virtual int GetPenWidth() const
DS_DATA_ITEM * GetPeer() const
const KIFONT::METRICS & GetFontMetrics() const
VECTOR2I GetPosition() const override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
int m_sheetCount
The number of sheets.
static void GetTextVars(wxArrayString *aVars)
const std::map< wxString, wxString > * m_properties
wxString BuildFullText(const wxString &aTextbase)
const TITLE_BLOCK * m_titleBlock
const PROJECT * m_project
wxString m_pageNumber
The actual page number displayed in the title block.
A rectangle with thick segment showing the page limits and a marker showing the coordinate origin.
const VECTOR2I & GetMarkerPos() const
double GetMarkerSize() const
VECTOR2I GetPageSize() const
SHAPE_POLY_SET & GetPolygons()
Non filled rectangle with thick segment.
const VECTOR2I & GetEnd() const
const VECTOR2I & GetStart() const
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
bool IsBrightened() const
const VECTOR2I & GetTextPos() const
KIFONT::FONT * GetFont() const
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
void Draw(KIGFX::GAL *aGal, const wxString &aText, const VECTOR2I &aPosition, const VECTOR2I &aCursor, const TEXT_ATTRIBUTES &aAttributes, const METRICS &aFontMetrics) const
Draw a string.
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
void DrawBorder(const PAGE_INFO *aPageInfo, int aScaleFactor) const
DS_RENDER_SETTINGS m_renderSettings
void draw(const DS_DRAW_ITEM_LINE *aItem, int aLayer) const
virtual bool Draw(const VIEW_ITEM *, int) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
COLOR4D m_pageBorderColor
void LoadColors(const COLOR_SETTINGS *aSettings) override
virtual COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const override
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
COLOR4D m_brightenedColor
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
COLOR4D m_backgroundColor
virtual void update()
Precalculates extra colors for layers (e.g.
std::map< int, COLOR4D > m_layerColors
An abstract base class for deriving all objects that can be added to a VIEW.
Describe the page size and margins of a paper page on which to eventually print or plot.
double GetHeightMils() const
double GetWidthMils() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
static void GetContextualTextVars(wxArrayString *aVars)
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
static const wxString productName
@ LAYER_SCHEMATIC_DRAWINGSHEET
@ LAYER_SCHEMATIC_BACKGROUND
The Cairo implementation of the graphics abstraction layer.
PGM_BASE * PgmOrNull()
Return a reference that can be nullptr when running a shared lib from a script, not from a kicad app.
VECTOR2< double > VECTOR2D