29 #include <boost/version.hpp> 31 #if BOOST_VERSION >= 106700 32 #include <boost/uuid/entropy_error.hpp> 66 const wxString& aTitle,
const wxPoint& aPos,
const wxSize& aSize,
67 long aStyle,
const wxString & aFrameName ) :
68 EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
70 m_originTransforms( *this )
98 draw3DFrame->SetTitle( *aTitle );
131 tbl->
Load( projectFpLibTableFileName );
146 if(
m_pcb != aBoard )
151 wxCommandEvent e( BOARD_CHANGED );
152 ProcessEventLocally( e );
192 #if BOOST_VERSION >= 106700 197 catch(
const boost::uuids::entropy_error& )
199 wxLogError(
"A Boost UUID entropy exception was thrown in %s:%s.", __FILE__, __FUNCTION__ );
211 static_cast<FOOTPRINT*>( lastItem )->RunOnChildren(
219 static_cast<PCB_GROUP*>( lastItem )->RunOnChildren(
227 lastBrightenedItemID =
niluuid;
237 static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
245 static_cast<PCB_GROUP*>( aItem )->RunOnChildren(
253 lastBrightenedItemID = aItem->
m_Uuid;
305 wxPoint origin( 0, 0 );
307 switch( displ_opts.m_DisplayOrigin )
312 default: wxASSERT(
false );
break;
384 area.
SetEnd( pageSize.x, pageSize.y );
388 area.
SetOrigin( -pageSize.x / 2, -pageSize.y / 2 );
389 area.
SetEnd( pageSize.x / 2, pageSize.y / 2 );
425 if( draw3DFrame->IsIconized() )
426 draw3DFrame->Iconize(
false );
428 draw3DFrame->Raise();
429 draw3DFrame->Show(
true );
432 if( wxWindow::FindFocus() != draw3DFrame )
433 draw3DFrame->SetFocus();
446 if( layer == preslayer )
514 line.Printf(
"grid X %s Y %s",
518 SetStatusText( line, 4 );
541 double theta =
RAD2DEG( atan2( -dy, dx ) );
542 double ro = hypot( dx, dy );
544 line.Printf( wxT(
"r %s theta %.3f" ),
547 SetStatusText( line, 3 );
555 line.Printf( wxT(
"X %s Y %s" ),
558 SetStatusText( line, 2 );
570 line.Printf( wxT(
"dx %s dy %s dist %s" ),
574 SetStatusText( line, 3 );
723 auto painter = static_cast<KIGFX::PCB_PAINTER*>( canvas->
GetView()->
GetPainter() );
724 auto settings = painter->GetSettings();
753 if(
VIA* via = dynamic_cast<VIA*>( aItem ) )
BOARD_ITEM * GetItem(const KIID &aID) const
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
virtual void SetBoard(BOARD *aBoard)
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
virtual void ShowChangedLanguage() override
Redraw the menus and what not in current language.
const PAGE_INFO & GetPageSettings() const
virtual void SetHighContrastLayer(int aLayer)
Take care of display settings for the given layer to be displayed in high contrast mode.
void DisplayGridMsg() override
Display the current grid pane on the status bar.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
const PCB_PLOT_PARAMS & GetPlotOptions() const
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
wxDEFINE_EVENT(BOARD_CHANGED, wxCommandEvent)
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
wxPoint m_GridOrigin
origin for grid offsets
FP_LIB_TABLE GFootprintTable
!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void SetGridOrigin(const wxPoint &aPoint) override
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
EDA_ITEM * GetItem(const KIID &aId) override
Fetch an item by KIID.
multilayer pads, usually with holes
virtual void OnDisplayOptionsChanged()
Implementation of conversion functions that require both schematic and board internal units.
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...
class PCB_GROUP, a set of BOARD_ITEMs
void SetDefaultZoneSettings(const ZONE_SETTINGS &aSettings)
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
const EDA_RECT GetBoardEdgesBoundingBox() const
Returns the board bounding box calculated using exclusively the board edges (graphics on Edge....
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
virtual void Update3DView(bool aReloadRequest, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetPageSettings(const PAGE_INFO &aPageSettings)
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual const wxPoint GetFocusPosition() const
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
void RecacheAllItems()
Rebuild GAL display lists.
double RAD2DEG(double rad)
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
const wxPoint & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of check tools.
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings Returns a bit-mask of all t...
void SetOrigin(const wxPoint &pos)
const wxPoint GetUserOrigin() const
show footprints values (when texts are visibles)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
void SetDrawBgColor(COLOR4D aColor) override
virtual MAGNETIC_SETTINGS * GetMagneticItemsSettings()
virtual _ELEM * GetElem(ELEM_T aIndex)
Get and set the elements for this project.
An abstract base class for deriving all objects that can be added to a VIEW.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
PCB_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
The base class for create windows for drawing purpose.
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Return the PCB_PLOT_PARAMS for the BOARD owned by this frame.
PCBNEW_SETTINGS * m_settings
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
Hold the information shown in the lower right corner of a plot, printout, or editing view.
float high_contrast_factor
How much to darken inactive layers by.
std::vector< double > zoom_factors
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
SEVERITY GetSeverity(int aErrorCode) const override
bool ShowPageLimits() const
virtual void SetElem(ELEM_T aIndex, _ELEM *aElem)
Classes used in Pcbnew, CvPcb and GerbView.
virtual COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
virtual PCB_LAYER_ID GetActiveLayer() const
void UpdateGridSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
PCB_DISPLAY_OPTIONS m_displayOptions
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
Container for display options like enable/disable some optional drawings.
PCB_LAYER_ID
A quick note on layer IDs:
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...
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
void SetHighContrastFactor(float aFactor)
Item needs to be redrawn.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
std::vector< wxString > sizes
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
void SetFlags(STATUS_FLAGS aMask)
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
virtual const wxString What() const
A composite of Problem() and Where()
EDA_3D_VIEWER * CreateAndShow3D_Frame()
Shows the 3D view frame.
static DELETED_BOARD_ITEM * GetInstance()
Describe the page size and margins of a paper page on which to eventually print or plot.
bool m_showBorderAndTitleBlock
Handles how to draw a screen (a board, a schematic ...)
void SetEnd(int x, int y)
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
const ZONE_SETTINGS & GetZoneSettings() const
Non-active layers are shown normally (no high-contrast mode)
Helper dialog and control classes.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
float select_factor
How much to brighten selected objects by.
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
virtual void ActivateGalCanvas()
Use to start up the GAL drawing canvas.
void SetIgnoreMTextsMarkedNoShow(bool ignore)
virtual void ReCreateMenuBar() override
Recreates the menu bar.
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
void IncrementTimeStamp()
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void StartDrawing()
Begin drawing if it was stopped previously.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
class FOOTPRINT, a footprint
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
virtual void SwitchLayer(wxDC *DC, PCB_LAYER_ID layer)
ZONE_SETTINGS handles zones parameters.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
const TITLE_BLOCK & GetTitleBlock() const override
virtual void OnModify()
Must be called after a change in order to set the "modify" flag of the current screen and update the ...
virtual void UpdateStatusBar() override
Update the status bar information.
float highlight_factor
How much to brighten highlighted objects by.
TITLE_BLOCK & GetTitleBlock()
Declaration of the eda_3d_viewer class.
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
Meta control for all vias opacity/visibility.
Information pertinent to a Pcbnew printed circuit board.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
ORIGIN_TRANSFORMS & GetOriginTransforms() override
Return a reference to the default ORIGIN_TRANSFORMS object.
std::map< int, SEVERITY > m_DRCSeverities
int GetCopperLayerCount() const
Handle the component boundary box.
void SetSelectFactor(float aFactor)
PCBNEW_SETTINGS * GetPcbNewSettings() const
const PAGE_INFO & GetPageSettings() const override
void SetHighlightFactor(float aFactor)
EDA_UNITS m_userUnits
Map containing the UI update handlers registered with wx for each action.
virtual void AddFootprintToBoard(FOOTPRINT *aFootprint)
Add the given footprint to the board.
A base class for most all the KiCad significant classes used in schematics and boards.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void SetZoneSettings(const ZONE_SETTINGS &aSettings)
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void UpdateStatusBar() override
Update the status bar information.
ZONE_SETTINGS & GetDefaultZoneSettings()
A general implementation of a COLLECTORS_GUIDE.
MAGNETIC_SETTINGS m_MagneticItems
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
Message panel definition file.
void FocusOnLocation(const wxPoint &aPos)
Useful to focus on a particular location, in find functions.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification that common settings are updated.
PCB_DISPLAY_OPTIONS m_Display
EDA_3D_VIEWER * Get3DViewerFrame()
virtual void ShowChangedLanguage()
Redraw the menus and what not in current language.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
void FocusOnItem(BOARD_ITEM *aItem)
#define IS_NEW
New item, just created.
wxPoint m_AuxOrigin
origin for plot exports
virtual const wxString FootprintLibTblName() const
Returns the path and filename of this project's footprint library table.
show footprints references (when texts are visibles)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual const std::vector< wxString > DefaultGridSizeList() const
By default, this returns the list of grids available in PcbNew-based applications.
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
void ReloadRequest()
Request reloading the 3D view.
PCB_ORIGIN_TRANSFORMS m_originTransforms
KICAD_T Type() const
Returns the type of object.
virtual void UpdateMsgPanel()
Redraw the message panel.
Container for design settings for a BOARD object.
A color representation with 4 components: red, green, blue, alpha.
const wxPoint & GetAuxOrigin() const