52 using namespace std::placeholders;
140 const wxPoint& aPosition,
const wxSize& aSize,
183 auto zones = aBoard->
Zones();
184 std::atomic<size_t>
next( 0 );
185 std::atomic<size_t> count_done( 0 );
186 size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
188 for(
size_t ii = 0; ii < parallelThreadCount; ++ii )
190 std::thread t = std::thread( [ &count_done, &
next, &zones ]( )
192 for(
size_t i =
next.fetch_add( 1 ); i < zones.size(); i =
next.fetch_add( 1 ) )
193 zones[i]->CacheTriangulation();
221 while( count_done < parallelThreadCount )
222 std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
258 cs =
Pgm().GetSettingsManager().GetColorSettings();
261 wxCHECK_RET( cs,
"null COLOR_SETTINGS" );
264 rs->LoadColors( cs );
299 for(
unsigned int i : layers )
308 else if( aLayer ==
F_Cu )
326 const std::vector<LAYER_NUM> layers = {
336 for(
auto layer : layers )
340 const std::vector<LAYER_NUM> frontLayers = {
345 const std::vector<LAYER_NUM> backLayers = {
350 const std::vector<LAYER_NUM>* extraLayers =
NULL;
354 extraLayers = &frontLayers;
356 extraLayers = &backLayers;
360 for(
auto layer : *extraLayers )
437 std::vector<MSG_PANEL_ITEM>& aList )
442 int trackSegmentsCount = 0;
449 trackSegmentsCount++;
453 aList.emplace_back(
_(
"Pads" ), txt );
455 txt.Printf( wxT(
"%d" ), viasCount );
456 aList.emplace_back(
_(
"Vias" ), txt );
458 txt.Printf( wxT(
"%d" ), trackSegmentsCount );
459 aList.emplace_back(
_(
"Track Segments" ), txt );
462 aList.emplace_back(
_(
"Nodes" ), txt );
464 txt.Printf( wxT(
"%d" ), board->
GetNetCount() - 1 );
465 aList.emplace_back(
_(
"Nets" ), txt );
467 txt.Printf( wxT(
"%d" ), board->
GetConnectivity()->GetUnconnectedCount() );
468 aList.emplace_back(
_(
"Unrouted" ), txt );
484 catch(
const std::runtime_error& e )
502 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
628 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.
Virtual layers for stacking zones and tracks on a given copper layer.
to draw blind/buried vias
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
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.
to draw pad holes (plated)
multilayer pads, usually with holes
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
This file is part of the common library.
#define ZONE_LAYER_FOR(copperLayer)
Macro for getting the zone layer for a given copper layer.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
An implementation of class VIEW_CONTROLS for wxWidgets library.
to draw via holes (pad holes do not use this layer)
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
Class that computes missing connections on a PCB.
static constexpr GAL_TYPE GAL_FALLBACK
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
show footprints values (when texts are visibles)
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
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.
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 IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Classes used in Pcbnew, CvPcb and GerbView.
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.
unsigned GetNodesCount(int aNet=-1) const
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
PCB_LAYER_ID
A quick note on layer IDs:
Contains all the knowledge about how to draw graphical object onto any particular output device.
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
unsigned GetNetCount() const
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void Clear()
Remove all items from the view.
unsigned GetPadCount() const
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)
Meta control for all pads opacity/visibility (color ignored)
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
to draw usual through hole vias
#define ZOOM_MAX_LIMIT_PCBNEW
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
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)
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.
ZONE handles a list of polygons defining a copper zone.
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
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.
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.
int LAYER_NUM
This can be replaced with int and removed.
layer for drc markers which have been individually excluded
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.
layer for drc markers with SEVERITY_WARNING
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
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...
Meta control for all vias opacity/visibility.
Main rendering target (cached)
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Information pertinent to a Pcbnew printed circuit board.
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.
currently selected items overlay
void ClearHighContrastLayers()
Clear the list of active layers.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
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...
class 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.
drawingsheet frame and titleblock
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.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
virtual ~PCB_DRAW_PANEL_GAL()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR
Additional netnames layers (not associated with a PCB layer)
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 IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
wxString m_ColorTheme
Active color theme name.