41#include <wx/stattext.h>
45 std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> aOpts,
47 PCB_DRAW_PANEL_GAL( aParent, -1, wxPoint( 0, 0 ), wxSize( 200, 200 ), *aOpts, aGalType ),
49 m_displayOptions(
std::
move( aOpts ) ),
50 m_currentFootprint( nullptr )
53 ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
54 EnableScrolling(
false,
false );
108 [&](
EDA_ITEM* descendant,
void* aTestData )
111 return INSPECT_RESULT::CONTINUE;
187 std::shared_ptr<FOOTPRINT> aFootprintB )
228 return static_cast<wxWindow*
>( this );
246 std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> gal_opts;
248 gal_opts = std::make_unique<KIGFX::GAL_DISPLAY_OPTIONS>();
249 gal_opts->ReadConfig( *
Pgm().GetCommonSettings(), cfg->
m_Window, aParent );
254 panel->UpdateColors();
258 panel->GetGAL()->SetGridVisibility( gridCfg.
show );
261 int gridIdx = std::max( 0, std::min( gridCfg.
last_size_idx, (
int) gridCfg.
sizes.size() - 1 ) );
263 gridCfg.
sizes[ gridIdx ] );
264 panel->GetGAL()->SetGridSize(
VECTOR2D( gridSize, gridSize ) );
269 settings->SetNetColorMode( NET_COLOR_MODE::OFF );
constexpr EDA_IU_SCALE pcbIUScale
const std::vector< wxString > DefaultGridSizeList() const
const Vec & GetOrigin() const
const Vec & GetSize() const
void ForceRefresh()
Force a redraw.
void StartDrawing()
Begin drawing if it was stopped previously.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
A base class for most all the KiCad significant classes used in schematics and boards.
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
A color representation with 4 components: red, green, blue, alpha.
Contains all the knowledge about how to draw graphical object onto any particular output device.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Contains methods for drawing PCB-specific items.
PCB specific render settings.
const COLOR4D & GetBackgroundColor() const override
Return current background color settings.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
void Clear()
Remove all items from the view.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
A mix in class which holds the location of a wxWindow's KIWAY.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
std::function< INSPECT_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T...
double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
@ REPAINT
Item needs to be redrawn.
@ ALL
All except INITIAL_ADD.
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Common grid settings, available to every frame.
std::vector< wxString > sizes
std::vector< double > zoom_factors
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
VECTOR2< double > VECTOR2D