55 using namespace std::placeholders;
142 const wxPoint& aPosition,
const wxSize& aSize,
185 auto zones = aBoard->
Zones();
186 std::atomic<size_t>
next( 0 );
187 std::atomic<size_t> count_done( 0 );
188 size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
190 for(
size_t ii = 0; ii < parallelThreadCount; ++ii )
192 std::thread t = std::thread( [ &count_done, &
next, &zones ]( )
194 for(
size_t i =
next.fetch_add( 1 ); i < zones.size(); i =
next.fetch_add( 1 ) )
195 zones[i]->CacheTriangulation();
223 while( count_done < parallelThreadCount )
228 std::this_thread::sleep_for( std::chrono::milliseconds( 30 ) );
265 cs =
Pgm().GetSettingsManager().GetColorSettings();
268 wxCHECK_RET( cs, wxT(
"null COLOR_SETTINGS" ) );
271 rs->LoadColors( cs );
307 for(
unsigned int i : layers )
316 else if( aLayer ==
F_Cu )
334 const std::vector<LAYER_NUM> layers = {
345 for(
auto layer : layers )
349 const std::vector<LAYER_NUM> frontLayers = {
354 const std::vector<LAYER_NUM> backLayers = {
359 const std::vector<LAYER_NUM>* extraLayers =
nullptr;
363 extraLayers = &frontLayers;
365 extraLayers = &backLayers;
369 for(
auto layer : *extraLayers )
446 std::vector<MSG_PANEL_ITEM>& aList )
451 int trackSegmentCount = 0;
452 std::set<int> netCodes;
462 if( item->GetNetCode() > 0 )
463 netCodes.insert( item->GetNetCode() );
468 for(
PAD*
pad : footprint->Pads() )
472 if(
pad->GetNetCode() > 0 )
473 netCodes.insert(
pad->GetNetCode() );
479 aList.emplace_back(
_(
"Track Segments" ),
wxString::Format( wxT(
"%d" ), trackSegmentCount ) );
480 aList.emplace_back(
_(
"Nets" ),
wxString::Format( wxT(
"%d" ), (
int) netCodes.size() ) );
481 aList.emplace_back(
_(
"Unrouted" ),
wxString::Format( wxT(
"%d" ), unconnected ) );
497 catch(
const std::runtime_error& e )
515 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
643 return static_cast<KIGFX::PCB_VIEW*>(
m_view );
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
currently selected items overlay
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
layer for drc markers with SEVERITY_ERROR
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
GAL_TYPE m_backend
Currently used GAL.
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Meta control for all pads opacity/visibility (color ignored)
An implementation of class VIEW_CONTROLS for wxWidgets library.
show footprints values (when texts are visible)
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
A progress reporter interface for use in multi-threaded environments.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Class that computes missing connections on a PCB.
Additional netnames layers (not associated with a PCB layer)
static constexpr GAL_TYPE GAL_FALLBACK
anchor of items having an anchor point (texts, footprints)
int LAYER_NUM
This can be replaced with int and removed.
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
#define ZONE_LAYER_FOR(copperLayer)
Macro for getting the zone layer for a given copper layer.
The base class for create windows for drawing purpose.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
const wxString & GetFileName() const
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
virtual void EnableTopLayer(bool aEnable)
Enable or disable display of the top layer.
to draw via holes (pad holes do not use this layer)
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
WX_VIEW_CONTROLS class definition.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
const LAYER_NUM GAL_LAYER_ORDER[]
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
This file contains miscellaneous commonly used macros and functions.
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Classes used in Pcbnew, CvPcb and GerbView.
to draw usual through hole vias
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
virtual COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
virtual PCB_LAYER_ID GetActiveLayer() const
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Ratsnest view item.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Contains all the knowledge about how to draw graphical object onto any particular output device.
handle color for not plated holes (holes, not pads)
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
Meta control for all vias opacity/visibility.
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
void Clear()
Remove all items from the view.
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
FOOTPRINTS & Footprints()
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
#define ZOOM_MAX_LIMIT_PCBNEW
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
Virtual layers for stacking zones and tracks on a given copper layer.
Items that may change while the view stays the same (noncached)
void SetLayerIsHighContrast(int aLayerId, bool aEnabled=true)
Set the specified layer as high-contrast.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Handle a list of polygons defining a copper zone.
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
drawingsheet frame and titleblock
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void UpdateColors()
Update the color settings in the painter and GAL.
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
show footprints references (when texts are visible)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
COLOR4D GetColor(int aLayer) const
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
multilayer pads, usually with holes
Main rendering target (cached)
to draw blind/buried vias
layer for drc markers which have been individually excluded
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Information pertinent to a Pcbnew printed circuit board.
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
PCB_LAYER_ID
A quick note on layer IDs:
#define ZOOM_MIN_LIMIT_PCBNEW
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
EDA_DRAW_FRAME * GetParentEDAFrame() const
Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
layer for drc markers with SEVERITY_WARNING
void ClearHighContrastLayers()
Clear the list of active layers.
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Color settings are a bit different than most of the settings objects in that there can be more than o...
to draw pad holes (plated)
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
class PCB_VIA, a via (like a track segment on a copper layer)
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void SetTopLayer(int aLayer) override
SetTopLayer(), with some extra smarts for PCB.
bool IsDialogPreview() const
void OnShow() override
Called when the window is shown for the first time.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
std::unique_ptr< RATSNEST_VIEW_ITEM > m_ratsnest
void SetActiveLayer(PCB_LAYER_ID aLayer)
void SetGAL(GAL *aGal)
Assign a rendering device for the VIEW.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual ~PCB_DRAW_PANEL_GAL()
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
wxString m_ColorTheme
Active color theme name.