KiCad PCB EDA Suite
EDA_3D_VIEWER Class Reference

Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard. More...

#include <eda_3d_viewer.h>

Inheritance diagram for EDA_3D_VIEWER:
EDA_3D_BOARD_HOLDER KIWAY_PLAYER EDA_BASE_FRAME TOOLS_HOLDER KIWAY_HOLDER

Public Types

enum  UNDO_REDO_LIST { UNDO_LIST, REDO_LIST }
 Function ClearUndoORRedoList (virtual). More...
 
enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 EDA_3D_VIEWER (KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxString &aTitle, long style=KICAD_DEFAULT_3D_DRAWFRAME_STYLE)
 
 ~EDA_3D_VIEWER ()
 
PCB_BASE_FRAMEParent () const
 
BOARDGetBoard ()
 
wxWindow * GetToolCanvas () const override
 Canvas access. More...
 
void ReloadRequest ()
 Request reloading the 3D view. More...
 
void NewDisplay (bool aForceImmediateRedraw=false)
 Reload and refresh (rebuild) the 3D scene. More...
 
BOARD_ADAPTERGetAdapter () override
 
CCAMERAGetCurrentCamera () override
 
EDA_3D_CANVASGetCanvas ()
 
bool Set3DColorFromUser (SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
 Get a SFVEC3D from a wx colour dialog. More...
 
bool Set3DSolderMaskColorFromUser ()
 Set the solder mask color from a set of colors. More...
 
bool Set3DSolderPasteColorFromUser ()
 Set the solder mask color from a set of colors. More...
 
bool Set3DCopperColorFromUser ()
 Set the copper color from a set of colors. More...
 
bool Set3DBoardBodyColorFromUser ()
 Set the copper color from a set of colors. More...
 
bool Set3DSilkScreenColorFromUser ()
 Set the silkscreen color from a set of colors. More...
 
void CommonSettingsChanged (bool aEnvVarsChanged, bool aTextVarsChanged) override
 Notification that common settings are updated. More...
 
void SynchroniseColoursWithBoard ()
 
virtual bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList. More...
 
virtual void ParseArgs (wxCmdLineParser &aParser)
 Handles command-line arguments in a frame-specific way. More...
 
virtual bool ShowModal (wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
 Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool IsModal () const
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
EDA_UNITS GetUserUnits () const
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS aUnits)
 
void ChangeUserUnits (EDA_UNITS aUnits)
 
virtual void ToggleUserUnits ()
 
SETTINGS_MANAGERGetSettingsManager () const
 
virtual int GetSeverity (int aErrorCode) const
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
virtual void OnCharHook (wxKeyEvent &event)
 Capture the key event before it is sent to the GUI. More...
 
void OnMenuEvent (wxMenuEvent &event)
 The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
virtual void OnMove (wxMoveEvent &aEvent)
 
void OnMaximize (wxMaximizeEvent &aEvent)
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 
void OnKicadAbout (wxCommandEvent &event)
 
void OnPreferences (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
WX_INFOBARGetInfoBar ()
 
virtual APP_SETTINGS_BASEconfig () const
 Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual void InstallPreferences (PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
 Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
void LoadWindowSettings (WINDOW_SETTINGS *aCfg)
 Loads window settings from the given settings object Normally called by LoadSettings unless the window in question is a child window that stores its settings somewhere other than APP_SETTINGS_BASE::m_Window. More...
 
void SaveWindowSettings (WINDOW_SETTINGS *aCfg)
 Saves window settings to the given settings object Normally called by SaveSettings unless the window in question is a child window that stores its settings somewhere other than APP_SETTINGS_BASE::m_Window. More...
 
virtual WINDOW_SETTINGSGetWindowSettings (APP_SETTINGS_BASE *aCfg)
 Returns a pointer to the window settings for this frame. More...
 
wxString ConfigBaseName () override
 
virtual void SaveProjectSettings ()
 Save changes to the project settings to the project (.pro) file. More...
 
void ImportHotkeyConfigFromFile (std::map< std::string, TOOL_ACTION * > aActionMap, const wxString &aDefaultShortname)
 Prompt the user for a hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
 Fetches the file name from the file history list. More...
 
void ClearFileHistory (FILE_HISTORY *aFileHistory=nullptr)
 Removes all files from the file history. More...
 
void UpdateFileHistory (const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
 Update the list of recently opened files. More...
 
FILE_HISTORYGetFileHistory ()
 Get the frame's main file history. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual wxString GetCurrentFileName () const
 Get the full filename + path of the currently opened file in the frame. More...
 
virtual void ReCreateMenuBar ()
 Recreates the menu bar. More...
 
void AddStandardHelpMenu (wxMenuBar *aMenuBar)
 Adds the standard KiCad help menu to the menubar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void UpdateStatusBar ()
 Update the status bar information. More...
 
virtual void ShowChangedLanguage ()
 Redraw the menus and what not in current language. More...
 
virtual void ProjectChanged ()
 Notification event that the project has changed. More...
 
const wxString & GetAboutTitle () const
 
void SetShutdownBlockReason (const wxString &reason)
 Sets the block reason why the window/application is preventing OS shutdown. More...
 
void RemoveShutdownBlockReason ()
 Removes any shutdown block reason set. More...
 
bool SupportsShutdownBlockReason ()
 Whether or not the window supports setting a shutdown block reason. More...
 
virtual bool IsContentModified ()
 Get if the contents of the frame have been modified since the last save. More...
 
wxSize GetWindowSize ()
 Get the undecorated window size that can be used for restoring the window size. More...
 
virtual void ClearUndoORRedoList (UNDO_REDO_LIST aList, int aItemCount=-1)
 
virtual void ClearUndoRedoList ()
 Function ClearUndoRedoList clear undo and redo list, using ClearUndoORRedoList() picked items are deleted by ClearUndoORRedoList() according to their status. More...
 
virtual void PushCommandToUndoList (PICKED_ITEMS_LIST *aItem)
 Function PushCommandToUndoList add a command to undo in undo list delete the very old commands when the max count of undo commands is reached ( using ClearUndoORRedoList) More...
 
virtual void PushCommandToRedoList (PICKED_ITEMS_LIST *aItem)
 Function PushCommandToRedoList add a command to redo in redo list delete the very old commands when the max count of redo commands is reached ( using ClearUndoORRedoList) More...
 
virtual PICKED_ITEMS_LISTPopCommandFromUndoList ()
 PopCommandFromUndoList return the last command to undo and remove it from list nothing is deleted. More...
 
virtual PICKED_ITEMS_LISTPopCommandFromRedoList ()
 PopCommandFromRedoList return the last command to undo and remove it from list nothing is deleted. More...
 
int GetUndoCommandCount () const
 
int GetRedoCommandCount () const
 
int GetMaxUndoItems () const
 
TOOL_MANAGERGetToolManager () const
 Return the MVC controller. More...
 
virtual void PushTool (const std::string &actionName)
 NB: the definition of "tool" is different at the user level. More...
 
virtual void PopTool (const std::string &actionName)
 
bool ToolStackIsEmpty ()
 
std::string CurrentToolName () const
 
bool IsCurrentTool (const TOOL_ACTION &aAction) const
 
virtual void DisplayToolMsg (const wxString &msg)
 
bool GetDoImmediateActions () const
 Indicates that hotkeys should perform an immediate action even if another tool is currently active. More...
 
bool GetDragSelects () const
 Indicates that a drag should draw a selection rectangle, even when started over an item. More...
 
bool GetMoveWarpsCursor () const
 Indicates that a move operation should warp the mouse pointer to the origin of the move object. More...
 
virtual void RefreshCanvas ()
 
HOLDER_TYPE GetType ()
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Member Functions

void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual void unitsChangeRefresh ()
 Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxPoint m_NormalFramePos
 
wxSize m_NormalFrameSize
 
wxString m_AboutTitle
 
wxAuiManager m_auimgr
 
wxString m_perspective
 
WX_INFOBARm_infoBar
 
wxString m_configName
 
SETTINGS_MANAGERm_settingsManager
 
FILE_HISTORYm_fileHistory
 
bool m_hasAutoSave
 
bool m_autoSaveState
 
int m_autoSaveInterval
 
wxTimer * m_autoSaveTimer
 
bool m_FlagModified
 
bool m_FlagSave
 
int m_UndoRedoCountMax
 
UNDO_REDO_CONTAINER m_undoList
 
UNDO_REDO_CONTAINER m_redoList
 
wxString m_mruPath
 
EDA_UNITS m_userUnits
 
TOOL_MANAGERm_toolManager
 
ACTIONSm_actions
 
TOOL_DISPATCHERm_toolDispatcher
 
std::vector< std::string > m_toolStack
 
bool m_immediateActions
 
bool m_dragSelects
 
bool m_moveWarpsCursor
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Member Functions

void Exit3DFrame (wxCommandEvent &event)
 Called when user press the File->Exit. More...
 
void OnCloseWindow (wxCloseEvent &event)
 
void Process_Special_Functions (wxCommandEvent &event)
 
void OnRenderEngineSelection (wxCommandEvent &event)
 
void OnDisableRayTracing (wxCommandEvent &aEvent)
 
void OnActivate (wxActivateEvent &event)
 
void OnSetFocus (wxFocusEvent &event)
 
void Install3DViewOptionDialog (wxCommandEvent &event)
 
void OnUpdateUIEngine (wxUpdateUIEvent &aEvent)
 
void OnUpdateUIMaterial (wxUpdateUIEvent &aEvent)
 
void CreateMenuBar ()
 
void ReCreateMainToolbar ()
 
void SyncToolbars () override
 Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state. More...
 
void SaveSettings (APP_SETTINGS_BASE *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void LoadSettings (APP_SETTINGS_BASE *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void takeScreenshot (wxCommandEvent &event)
 Create a Screenshot of the current 3D view. More...
 
void RenderEngineChanged ()
 RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged. More...
 
void loadCommonSettings ()
 Load configuration from common settings. More...
 

Private Attributes

wxFileName m_defaultSaveScreenshotFileName
 
ACTION_TOOLBARm_mainToolBar
 
EDA_3D_CANVASm_canvas
 
BOARD_ADAPTER m_boardAdapter
 
CCAMERAm_currentCamera
 
CTRACK_BALL m_trackBallCamera
 
bool m_disable_ray_tracing
 

Static Private Attributes

static const wxChar * m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" )
 Trace mask used to enable or disable the trace output of this class. More...
 

Detailed Description

Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.

Definition at line 65 of file eda_3d_viewer.h.

Member Enumeration Documentation

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 42 of file kiway_holder.h.

◆ UNDO_REDO_LIST

Function ClearUndoORRedoList (virtual).

this function must remove the aItemCount old commands from aList and delete commands, pickers and picked items if needed Because picked items must be deleted only if they are not in use, this is a virtual pure function that must be created for SCH_SCREEN and PCB_SCREEN

Parameters
aList= the UNDO_REDO_CONTAINER of commands
aItemCount= number of old commands to delete. -1 to remove all old commands this will empty the list of commands. Commands are deleted from the older to the last.
Enumerator
UNDO_LIST 
REDO_LIST 

Definition at line 556 of file eda_base_frame.h.

Constructor & Destructor Documentation

◆ EDA_3D_VIEWER()

EDA_3D_VIEWER::OnUpdateUIMaterial EDA_3D_VIEWER::EDA_3D_VIEWER ( KIWAY aKiway,
PCB_BASE_FRAME aParent,
const wxString &  aTitle,
long  style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE 
)

Definition at line 87 of file eda_3d_viewer.cpp.

88  :
89  KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
90  wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) ),
91  m_mainToolBar( nullptr ),
92  m_canvas( nullptr ),
95 {
96  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::EDA_3D_VIEWER %s", aTitle );
97 
98  m_disable_ray_tracing = false;
99  m_AboutTitle = "3D Viewer";
100 
101  // Give it an icon
102  wxIcon icon;
103  icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
104  SetIcon( icon );
105 
106  // Create the status line
107  static const int status_dims[4] = { -1, 130, 130, 170 };
108 
109  wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
110  SetStatusWidths( arrayDim( status_dims ), status_dims );
111 
114  Prj().Get3DCacheManager() );
115 
116  auto config = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
117  LoadSettings( config );
118 
119  // Some settings need the canvas
121 
122  // Create the manager
124  m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr, config, this );
125 
126  m_actions = new EDA_3D_ACTIONS();
129 
130  // Register tools
134 
135  if( EDA_3D_CONTROLLER* ctrlTool = GetToolManager()->GetTool<EDA_3D_CONTROLLER>() )
136  ctrlTool->SetRotationIncrement( config->m_Camera.rotation_increment );
137 
138  // Run the viewer control tool, it is supposed to be always active
139  m_toolManager->InvokeTool( "3DViewer.Control" );
140 
141  CreateMenuBar();
143 
144  // Create the infobar
145  m_infoBar = new WX_INFOBAR( this, &m_auimgr );
146 
147  m_auimgr.SetManagedWindow( this );
148 
149  m_auimgr.AddPane( m_mainToolBar,
150  EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
151  m_auimgr.AddPane( m_infoBar,
152  EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
153  m_auimgr.AddPane( m_canvas,
154  EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
155 
156  // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
157  // hidding it.
158  m_auimgr.Update();
159 
160  // We don't want the infobar displayed right away
161  m_auimgr.GetPane( "InfoBar" ).Hide();
162  m_auimgr.Update();
163 
164  if( m_canvas )
165  {
167  m_canvas->SetStatusBar( status_bar );
168  }
169 
170  // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
171  // in order to receive mouse events. Otherwise, the user has to click somewhere on
172  // the canvas before it will respond to mouse wheel events.
173  if( m_canvas )
174  m_canvas->SetFocus();
175 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aWdoName=wxFrameNameStr)
CTRACK_BALL m_trackBallCamera
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
void SetStatusBar(wxStatusBar *aStatusBar)
Definition: eda_3d_canvas.h:71
wxString m_AboutTitle
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:47
wxAuiManager m_auimgr
CCAMERA & m_currentCamera
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.
void loadCommonSettings()
Load configuration from common settings.
EDA_3D_CANVAS * m_canvas
TOOL_MANAGER.
Definition: tool_manager.h:51
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
BOARD_ADAPTER m_boardAdapter
void SetInfoBar(WX_INFOBAR *aInfoBar)
Definition: eda_3d_canvas.h:76
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.
const BITMAP_OPAQUE icon_3d_xpm[1]
Definition: icon_3d.cpp:143
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
EDA_3D_CONTROLLER.
Definition: 3d_controller.h:39
ACTIONS * m_actions
Definition: tools_holder.h:49
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:39
COMMON_CONTROL.
Specialization of the wxAuiPaneInfo class for KiCad panels.
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:50
TOOL_DISPATCHER.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:68
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Sets the work environment (model, view, view controls and the parent window).
WX_INFOBAR * m_infoBar
void CreateMenuBar()
Definition: 3d_menubar.cpp:38
ANTIALIASING_MODE AntiAliasingGet() const
GridGet - get the current antialiasing mode value.
ACTION_TOOLBAR * m_mainToolBar
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
void InitTools()
Function InitTools() Initializes all registered tools.
BOARD * GetBoard() const
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
Definition: eda_3d_viewer.h:51
BOARD * GetBoard()
Definition: eda_3d_viewer.h:78
bool m_disable_ray_tracing
void RegisterTool(TOOL_BASE *aTool)
Function RegisterTool() Adds a tool to the manager set and sets it up.

References arrayDim(), PCAD2KICAD::Center, COGL_ATT_LIST::GetAttributesList(), GetBoard(), icon_3d_xpm, KiBitmap(), Pgm(), Prj(), and TOOL_MANAGER::SetEnvironment().

◆ ~EDA_3D_VIEWER()

EDA_3D_VIEWER::~EDA_3D_VIEWER ( )

Definition at line 178 of file eda_3d_viewer.cpp.

179 {
180  m_canvas->SetEventDispatcher( nullptr );
181 
182  m_auimgr.UnInit();
183 
184  // m_canvas delete will be called by wxWidget manager
185  //delete m_canvas;
186  //m_canvas = nullptr;
187 }
wxAuiManager m_auimgr
EDA_3D_CANVAS * m_canvas
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.

References EDA_BASE_FRAME::m_auimgr, m_canvas, and EDA_3D_CANVAS::SetEventDispatcher().

Member Function Documentation

◆ AddStandardHelpMenu()

void EDA_BASE_FRAME::AddStandardHelpMenu ( wxMenuBar *  aMenuBar)
inherited

Adds the standard KiCad help menu to the menubar.

Definition at line 298 of file eda_base_frame.cpp.

299 {
300  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
301  ACTION_MENU* helpMenu = new ACTION_MENU( false );
302 
303  helpMenu->SetTool( commonControl );
304 
305  helpMenu->Add( ACTIONS::help );
306  helpMenu->Add( ACTIONS::gettingStarted );
307  helpMenu->Add( ACTIONS::listHotKeys );
308  helpMenu->Add( ACTIONS::getInvolved );
309  helpMenu->Add( ACTIONS::reportBug );
310 
311  helpMenu->AppendSeparator();
312  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, about_xpm );
313 
314  aMenuBar->Append( helpMenu, _( "&Help" ) );
315 }
static TOOL_ACTION listHotKeys
Definition: actions.h:172
ACTION_MENU.
Definition: action_menu.h:44
static TOOL_ACTION reportBug
Definition: actions.h:174
const BITMAP_OPAQUE about_xpm[1]
Definition: about.cpp:84
COMMON_CONTROL.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION help
Definition: actions.h:171
static TOOL_ACTION getInvolved
Definition: actions.h:173
static TOOL_ACTION gettingStarted
Definition: actions.h:170

References _, about_xpm, ACTIONS::getInvolved, ACTIONS::gettingStarted, TOOL_MANAGER::GetTool(), ACTIONS::help, ACTIONS::listHotKeys, TOOLS_HOLDER::m_toolManager, and ACTIONS::reportBug.

Referenced by CreateMenuBar(), LIB_VIEW_FRAME::ReCreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), and PCB_EDIT_FRAME::ReCreateMenuBar().

◆ ChangeUserUnits()

void EDA_BASE_FRAME::ChangeUserUnits ( EDA_UNITS  aUnits)
inherited

Definition at line 831 of file eda_base_frame.cpp.

832 {
833  SetUserUnits( aUnits );
835 
836  wxCommandEvent e( UNITS_CHANGED );
837  ProcessEventLocally( e );
838 }
virtual void unitsChangeRefresh()
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void SetUserUnits(EDA_UNITS aUnits)

References EDA_BASE_FRAME::SetUserUnits(), and EDA_BASE_FRAME::unitsChangeRefresh().

Referenced by COMMON_TOOLS::ImperialUnits(), COMMON_TOOLS::MetricUnits(), and COMMON_TOOLS::ToggleUnits().

◆ CheckForAutoSaveFile()

void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName)
inherited

Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 729 of file eda_base_frame.cpp.

730 {
731  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
732 
733  wxFileName autoSaveFileName = aFileName;
734 
735  // Check for auto save file.
736  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
737 
738  wxLogTrace( traceAutoSave,
739  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
740 
741  if( !autoSaveFileName.FileExists() )
742  return;
743 
744  wxString msg = wxString::Format( _(
745  "Well this is potentially embarrassing!\n"
746  "It appears that the last time you were editing the file\n"
747  "\"%s\"\n"
748  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
749  GetChars( aFileName.GetFullName() )
750  );
751 
752  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
753 
754  // Make a backup of the current file, delete the file, and rename the auto save file to
755  // the file name.
756  if( response == wxYES )
757  {
758  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
759  {
760  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
761  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
762  }
763  }
764  else
765  {
766  wxLogTrace( traceAutoSave,
767  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
768 
769  // Remove the auto save file when using the previous file as is.
770  wxRemoveFile( autoSaveFileName.GetFullPath() );
771  }
772 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
static wxString GetAutoSaveFilePrefix()
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), EDA_BASE_FRAME::GetAutoSaveFilePrefix(), GetChars(), Pgm(), and traceAutoSave.

Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ ClearFileHistory()

void EDA_BASE_FRAME::ClearFileHistory ( FILE_HISTORY aFileHistory = nullptr)
inherited

Removes all files from the file history.

Parameters
aFileHistoryThe FILE_HISTORY in use. If null, the main application file history is used

Definition at line 626 of file eda_base_frame.cpp.

627 {
628  if( !aFileHistory )
629  aFileHistory = m_fileHistory;
630 
631  wxASSERT( aFileHistory );
632 
633  aFileHistory->ClearFileHistory();
634 
635  // Update the menubar to update the file history menu
636  if( GetMenuBar() )
637  {
638  ReCreateMenuBar();
639  GetMenuBar()->Refresh();
640  }
641 }
void ClearFileHistory()
Clear all entries from the file history.
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.

References FILE_HISTORY::ClearFileHistory(), EDA_BASE_FRAME::m_fileHistory, and EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by GERBVIEW_FRAME::OnClearDrlFileHistory(), KICAD_MANAGER_FRAME::OnClearFileHistory(), PL_EDITOR_FRAME::OnClearFileHistory(), PCB_EDIT_FRAME::OnClearFileHistory(), SCH_EDIT_FRAME::OnClearFileHistory(), GERBVIEW_FRAME::OnClearGbrFileHistory(), GERBVIEW_FRAME::OnClearJobFileHistory(), and GERBVIEW_FRAME::OnClearZipFileHistory().

◆ ClearUndoORRedoList()

virtual void EDA_BASE_FRAME::ClearUndoORRedoList ( UNDO_REDO_LIST  aList,
int  aItemCount = -1 
)
inlinevirtualinherited

◆ ClearUndoRedoList()

◆ CommonSettingsChanged()

void EDA_3D_VIEWER::CommonSettingsChanged ( bool  aEnvVarsChanged,
bool  aTextVarsChanged 
)
overridevirtual

Notification that common settings are updated.

This would be private (and only called by the Kiway), but we need to do this manually from the PCB frame because the 3D viewer isn't updated via the KIWAY.

Reimplemented from TOOLS_HOLDER.

Definition at line 628 of file eda_3d_viewer.cpp.

629 {
630  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
631 
632  // Regen menu bars, etc
633  EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
634 
635  // There is no base class that handles toolbars for this frame
637 
639 
640  NewDisplay( true );
641 }
void loadCommonSettings()
Load configuration from common settings.
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:39
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.

References EDA_BASE_FRAME::CommonSettingsChanged(), loadCommonSettings(), m_logTrace, NewDisplay(), and ReCreateMainToolbar().

Referenced by PCB_BASE_FRAME::CommonSettingsChanged().

◆ config()

APP_SETTINGS_BASE * EDA_BASE_FRAME::config ( ) const
virtualinherited

Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 543 of file eda_base_frame.cpp.

544 {
545  // KICAD_MANAGER_FRAME overrides this
546  return Kiface().KifaceSettings();
547 }
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_i.h:103
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

References Kiface(), and KIFACE_I::KifaceSettings().

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_FRAME::ActivateGalCanvas(), BM2CMP_FRAME::BM2CMP_FRAME(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), SCH_BASE_FRAME::eeconfig(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), DISPLAY_FOOTPRINTS_FRAME::GetAutoZoom(), GRID_MENU::GRID_MENU(), COMMON_TOOLS::GridFast1(), COMMON_TOOLS::GridFast2(), EDA_DRAW_FRAME::IsGridVisible(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), SCH_BASE_FRAME::libeditconfig(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), EDA_DRAW_FRAME::OnUpdateSelectGrid(), EDA_DRAW_FRAME::OnUpdateSelectZoom(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), DISPLAY_FOOTPRINTS_FRAME::SetAutoZoom(), PCB_BASE_EDIT_FRAME::SetBoard(), EDA_DRAW_FRAME::SetGridVisibility(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), LIB_VIEW_FRAME::setupTools(), GERBVIEW_FRAME::setupTools(), LIB_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), ZOOM_MENU::update(), GRID_MENU::update(), EDA_DRAW_FRAME::UpdateGridSelectBox(), EDA_DRAW_FRAME::UpdateZoomSelectBox(), EDA_BASE_FRAME::windowClosing(), ZOOM_MENU::ZOOM_MENU(), and BM2CMP_FRAME::~BM2CMP_FRAME().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineoverridevirtualinherited
Returns
a base name prefix used in Load/Save settings to build the full name of keys used in config. This is usually the name of the frame set by CTOR, except for frames shown in multiple modes in which case the m_configName must be set to the base name so that a single config can be used.

Reimplemented from TOOLS_HOLDER.

Definition at line 348 of file eda_base_frame.h.

349  {
350  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
351  return baseCfgName;
352  }
wxString m_configName

References EDA_BASE_FRAME::m_configName.

Referenced by EDA_BASE_FRAME::SaveWindowSettings().

◆ CreateMenuBar()

void EDA_3D_VIEWER::CreateMenuBar ( )
private

Definition at line 38 of file 3d_menubar.cpp.

39 {
40  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CreateMenuBar" );
41 
43  WX_MENUBAR* menuBar = new WX_MENUBAR();
44 
45 
46  //-- File menu -----------------------------------------------------------
47  //
48  CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, tool );
49 
50  fileMenu->AddItem( ID_MENU_SCREENCOPY_PNG, _( "Export Current View as PNG..." ), "",
52 
53  fileMenu->AddItem( ID_MENU_SCREENCOPY_JPEG, _( "Export Current View as JPEG..." ), "",
55 
56  fileMenu->AddSeparator();
57  fileMenu->AddClose( _( "3D Viewer" ) );
58 
59  fileMenu->Resolve();
60 
61  //-- Edit menu -------------------------------------------------------
62  // Avoid to translate hotkey modifiers like Ctrl and Shift.
63  // The translated modifiers do not always work
64  CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, tool );
65 
66  editMenu->AddItem( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image" ), "",
68 
69  editMenu->Resolve();
70 
71  //-- View menu -------------------------------------------------------
72  //
73  CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, tool );
74 
79 
80  viewMenu->AddSeparator();
83 
84  viewMenu->AddSeparator();
87 
88  viewMenu->AddSeparator();
91 
92  viewMenu->AddSeparator();
97 
98  viewMenu->Resolve();
99 
100  //-- Preferences menu -----------------------------------------------
101  //
102  CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, tool );
103 
104  //clang-format off
105  auto raytracingCondition = [this]( const SELECTION& aSel )
106  {
108  };
109 
110  auto NormalModeCondition = [this]( const SELECTION& aSel )
111  {
113  };
114 
115  auto DiffuseModeCondition = [this]( const SELECTION& aSel )
116  {
118  };
119 
120  auto CADModeCondition = [this]( const SELECTION& aSel )
121  {
123  };
124 
125  auto boundingBoxesCondition = [this]( const SELECTION& aSel )
126  {
128  };
129 
130  auto renderShadowsCondition = [this]( const SELECTION& aSel )
131  {
133  };
134 
135  auto proceduralTexturesCondition = [this]( const SELECTION& aSel )
136  {
138  };
139 
140  auto showFloorCondition = [this]( const SELECTION& aSel )
141  {
143  };
144 
145  auto useRefractionsCondition = [this]( const SELECTION& aSel )
146  {
148  };
149 
150  auto useReflectionsCondition = [this]( const SELECTION& aSel )
151  {
153  };
154 
155  auto antiAliasingCondition = [this]( const SELECTION& aSel )
156  {
158  };
159 
160  auto postProcessCondition = [this]( const SELECTION& aSel )
161  {
163  };
164 
165  auto showAxesCondition = [this]( const SELECTION& aSel )
166  {
167  return m_boardAdapter.GetFlag( FL_AXIS );
168  };
169  //clang-format on
170 
171  prefsMenu->AddItem( ID_TOOL_SET_VISIBLE_ITEMS, _( "Display Options" ), "",
173 
174  prefsMenu->AddCheckItem( ID_RENDER_CURRENT_VIEW, _( "Raytracing" ), "",
175  tools_xpm, raytracingCondition );
176 
177  // Render options submenu
178  CONDITIONAL_MENU* optsSubmenu = new CONDITIONAL_MENU( false, tool );
179  optsSubmenu->SetTitle( _( "Render Options" ) );
180  optsSubmenu->SetIcon( options_3drender_xpm );
181 
182  // Material properties submenu
183  CONDITIONAL_MENU* propsSubmenu = new CONDITIONAL_MENU( false, tool );
184  propsSubmenu->SetTitle( _( "Material Properties" ) );
185  propsSubmenu->SetIcon( color_materials_xpm );
186 
188  _( "Use All Properties" ),
189  _( "Use all material properties from each 3D model file" ),
190  nullptr, NormalModeCondition );
191 
193  _( "Use Diffuse Only" ),
194  _( "Use only the diffuse color property from model 3D model file" ),
195  nullptr, DiffuseModeCondition );
196 
198  _( "CAD Color Style" ),
199  _( "Use a CAD color style based on the diffuse color of the material" ),
200  nullptr, CADModeCondition );
201 
202  optsSubmenu->AddMenu( propsSubmenu, SELECTION_CONDITIONS::ShowAlways );
203 
204  optsSubmenu->AddCheckItem( EDA_3D_ACTIONS::showBoundingBoxes, boundingBoxesCondition );
205 
206  // Raytracing submenu
207  CONDITIONAL_MENU* raySubmenu = new CONDITIONAL_MENU( false, tool );
208  raySubmenu->SetTitle( _( "Raytracing Options" ) );
209  raySubmenu->SetIcon( tools_xpm );
210 
211  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::renderShadows, renderShadowsCondition );
212  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::proceduralTextures, proceduralTexturesCondition );
213  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::addFloor, showFloorCondition );
214  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::showRefractions, useRefractionsCondition );
215  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::showReflections, useReflectionsCondition );
216  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::antiAliasing, antiAliasingCondition );
217 
218  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::postProcessing, postProcessCondition );
219 
220  optsSubmenu->AddMenu( raySubmenu, SELECTION_CONDITIONS::ShowAlways );
221  prefsMenu->AddMenu( optsSubmenu, SELECTION_CONDITIONS::ShowAlways );
222 
223  prefsMenu->AddSeparator();
224 
225  // Color submenu
226  CONDITIONAL_MENU* colorSubmenu = new CONDITIONAL_MENU( false, tool );
227  colorSubmenu->SetTitle( _( "Choose Colors" ) );
228  colorSubmenu->SetIcon( palette_xpm );
229 
230  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_TOP, _( "Background Top Color..." ), "",
232 
233  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_BOTTOM, _( "Background Bottom Color..." ), "",
235 
236  colorSubmenu->AddItem( ID_MENU3D_SILKSCREEN_COLOR, _( "Silkscreen Color..." ), "",
238 
239  colorSubmenu->AddItem( ID_MENU3D_SOLDERMASK_COLOR, _( "Solder Mask Color..." ), "",
241 
242  colorSubmenu->AddItem( ID_MENU3D_SOLDERPASTE_COLOR, _( "Solder Paste Color..." ), "",
244 
245  colorSubmenu->AddItem( ID_MENU3D_COPPER_COLOR, _( "Copper/Surface Finish Color..." ), "",
247 
248  colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
250 
251  // Only allow the stackup to be used in the PCB editor, since it isn't editable in the other frames
252  if( Parent()->IsType( FRAME_PCB_EDITOR ) )
253  {
254  colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
256  }
257 
258  prefsMenu->AddMenu( colorSubmenu );
259 
260  prefsMenu->AddCheckItem( EDA_3D_ACTIONS::showAxis, showAxesCondition );
261 
262  // Grid submenu
263  CONDITIONAL_MENU* gridSubmenu = new CONDITIONAL_MENU( false, tool );
264  gridSubmenu->SetTitle( _( "3D Grid" ) );
265  gridSubmenu->SetIcon( grid_xpm );
266 
267  //clang-format off
268  auto noGridCondition = [this]( const SELECTION& aSel )
269  {
271  };
272 
273  auto grid10mmCondition = [this]( const SELECTION& aSel )
274  {
276  };
277 
278  auto grid5mmCondition = [this]( const SELECTION& aSel )
279  {
281  };
282 
283  auto grid2p5mmCondition = [this]( const SELECTION& aSel )
284  {
286  };
287 
288  auto grid_1mmCondition = [this]( const SELECTION& aSel )
289  {
291  };
292  //clang-format on
293 
294  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::noGrid, noGridCondition );
295  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show10mmGrid, grid10mmCondition );
296  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show5mmGrid, grid5mmCondition );
297  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show2_5mmGrid, grid2p5mmCondition );
298  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show1mmGrid, grid_1mmCondition );
299 
300  prefsMenu->AddMenu( gridSubmenu, SELECTION_CONDITIONS::ShowAlways );
301 
302  prefsMenu->AddSeparator();
303  prefsMenu->AddItem( ID_MENU3D_RESET_DEFAULTS, _( "Reset to Default Settings" ), "",
305 
306 #ifdef __APPLE__ // Note: will get moved to Apple menu by wxWidgets
307  prefsMenu->AddItem( wxID_PREFERENCES,
308  _( "Preferences...\tCTRL+," ),
309  _( "Show preferences for all open tools" ),
311 #endif
312 
313  prefsMenu->Resolve();
314 
315  //-- Menubar -------------------------------------------------------------
316  //
317  menuBar->Append( fileMenu, _( "&File" ) );
318  menuBar->Append( editMenu, _( "&Edit" ) );
319  menuBar->Append( viewMenu, _( "&View" ) );
320  menuBar->Append( prefsMenu, _( "&Preferences" ) );
321  AddStandardHelpMenu( menuBar );
322 
323  SetMenuBar( menuBar );
324 }
static TOOL_ACTION rotateXCW
Definition: 3d_actions.h:47
Use a gray shading based on diffuse material.
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways The default condition function (always returns true).
const BITMAP_OPAQUE options_3drender_xpm[1]
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Function AddMenu()
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
const BITMAP_OPAQUE setcolor_soldermask_xpm[1]
const BITMAP_OPAQUE setcolor_solderpaste_xpm[1]
static TOOL_ACTION show10mmGrid
Definition: 3d_actions.h:70
static TOOL_ACTION showBoundingBoxes
Definition: 3d_actions.h:79
const BITMAP_OPAQUE palette_xpm[1]
Definition: palette.cpp:89
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
void AddCheckItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddCheckItem()
static TOOL_ACTION showRefractions
Definition: 3d_actions.h:83
const BITMAP_OPAQUE setcolor_board_body_xpm[1]
Wrapper around a wxMenuBar object that prevents the accelerator table from being used.
Definition: wx_menubar.h:45
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
static TOOL_ACTION antiAliasing
Definition: 3d_actions.h:85
BOARD_ADAPTER m_boardAdapter
const BITMAP_OPAQUE setcolor_copper_xpm[1]
const BITMAP_OPAQUE read_setup_xpm[1]
Definition: read_setup.cpp:99
static TOOL_ACTION moveLeft
Definition: 3d_actions.h:53
static TOOL_ACTION show5mmGrid
Definition: 3d_actions.h:71
Use all material properties from model file.
static TOOL_ACTION rotateYCW
Definition: 3d_actions.h:49
void SetIcon(const BITMAP_OPAQUE *aIcon)
Function SetIcon() Assigns an icon for the entry.
Definition: action_menu.cpp:70
void AddStandardHelpMenu(wxMenuBar *aMenuBar)
Adds the standard KiCad help menu to the menubar.
const BITMAP_OPAQUE grid_xpm[1]
Definition: grid.cpp:21
const BITMAP_OPAQUE export_xpm[1]
Definition: export.cpp:75
static TOOL_ACTION rotateXCCW
Definition: 3d_actions.h:48
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
const BITMAP_OPAQUE setcolor_silkscreen_xpm[1]
const BITMAP_OPAQUE copy_xpm[1]
Definition: copy.cpp:67
static TOOL_ACTION rotateZCCW
Definition: 3d_actions.h:52
static TOOL_ACTION addFloor
Definition: 3d_actions.h:82
static TOOL_ACTION showAxis
Definition: 3d_actions.h:89
COMMON_CONTROL.
static TOOL_ACTION rotateZCW
Definition: 3d_actions.h:51
void Resolve()
Function Resolve()
const BITMAP_OPAQUE tools_xpm[1]
Definition: tools.cpp:113
void AddSeparator(int aOrder=ANY_ORDER)
Function AddSeparator()
static TOOL_ACTION moveDown
Definition: 3d_actions.h:56
void AddClose(wxString aAppname="")
Function AddClose()
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static TOOL_ACTION proceduralTextures
Definition: 3d_actions.h:81
const BITMAP_OPAQUE setcolor_3d_bg_xpm[1]
static TOOL_ACTION show2_5mmGrid
Definition: 3d_actions.h:72
static TOOL_ACTION show1mmGrid
Definition: 3d_actions.h:73
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
void SetTitle(const wxString &aTitle) override
Function SetTitle() Sets title for the menu.
Definition: action_menu.cpp:88
bool IsType(FRAME_T aType) const
static TOOL_ACTION rotateYCCW
Definition: 3d_actions.h:50
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
static TOOL_ACTION postProcessing
Definition: 3d_actions.h:86
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:76
static TOOL_ACTION moveUp
Definition: 3d_actions.h:55
static TOOL_ACTION noGrid
Definition: 3d_actions.h:69
static TOOL_ACTION zoomIn
Definition: actions.h:88
static TOOL_ACTION zoomOut
Definition: actions.h:89
static TOOL_ACTION showReflections
Definition: 3d_actions.h:84
const BITMAP_OPAQUE preference_xpm[1]
Definition: preference.cpp:66
GRID3D_TYPE GridGet() const noexcept
GridGet - get the current grid.
MATERIAL_MODE MaterialModeGet() const noexcept
MaterialModeGet.
static TOOL_ACTION renderShadows
Definition: 3d_actions.h:80
static TOOL_ACTION moveRight
Definition: 3d_actions.h:54
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
const BITMAP_OPAQUE color_materials_xpm[1]

References _, CONDITIONAL_MENU::AddCheckItem(), CONDITIONAL_MENU::AddClose(), EDA_3D_ACTIONS::addFloor, CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddMenu(), CONDITIONAL_MENU::AddSeparator(), EDA_BASE_FRAME::AddStandardHelpMenu(), EDA_3D_ACTIONS::antiAliasing, CAD_MODE, color_materials_xpm, copy_xpm, DIFFUSE_ONLY, export_xpm, FL_AXIS, FL_RENDER_OPENGL_SHOW_MODEL_BBOX, FL_RENDER_RAYTRACING_ANTI_ALIASING, FL_RENDER_RAYTRACING_BACKFLOOR, FL_RENDER_RAYTRACING_POST_PROCESSING, FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, FL_RENDER_RAYTRACING_REFLECTIONS, FL_RENDER_RAYTRACING_REFRACTIONS, FL_RENDER_RAYTRACING_SHADOWS, FRAME_PCB_EDITOR, BOARD_ADAPTER::GetFlag(), TOOL_MANAGER::GetTool(), GRID_10MM, GRID_1MM, GRID_2P5MM, GRID_5MM, grid_xpm, BOARD_ADAPTER::GridGet(), ID_MENU3D_BGCOLOR_BOTTOM, ID_MENU3D_BGCOLOR_TOP, ID_MENU3D_COPPER_COLOR, ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE, ID_MENU3D_FL_RENDER_MATERIAL_MODE_DIFFUSE_ONLY, ID_MENU3D_FL_RENDER_MATERIAL_MODE_NORMAL, ID_MENU3D_PCB_BODY_COLOR, ID_MENU3D_RESET_DEFAULTS, ID_MENU3D_SILKSCREEN_COLOR, ID_MENU3D_SOLDERMASK_COLOR, ID_MENU3D_SOLDERPASTE_COLOR, ID_MENU3D_STACKUP_COLORS, ID_MENU_SCREENCOPY_JPEG, ID_MENU_SCREENCOPY_PNG, ID_RENDER_CURRENT_VIEW, ID_TOOL_SCREENCOPY_TOCLIBBOARD, ID_TOOL_SET_VISIBLE_ITEMS, EDA_BASE_FRAME::IsType(), m_boardAdapter, m_logTrace, TOOLS_HOLDER::m_toolManager, BOARD_ADAPTER::MaterialModeGet(), EDA_3D_ACTIONS::moveDown, EDA_3D_ACTIONS::moveLeft, EDA_3D_ACTIONS::moveRight, EDA_3D_ACTIONS::moveUp, EDA_3D_ACTIONS::noGrid, NONE, NORMAL, OPENGL_LEGACY, options_3drender_xpm, palette_xpm, Parent(), EDA_3D_ACTIONS::postProcessing, preference_xpm, EDA_3D_ACTIONS::proceduralTextures, read_setup_xpm, BOARD_ADAPTER::RenderEngineGet(), EDA_3D_ACTIONS::renderShadows, CONDITIONAL_MENU::Resolve(), EDA_3D_ACTIONS::rotateXCCW, EDA_3D_ACTIONS::rotateXCW, EDA_3D_ACTIONS::rotateYCCW, EDA_3D_ACTIONS::rotateYCW, EDA_3D_ACTIONS::rotateZCCW, EDA_3D_ACTIONS::rotateZCW, setcolor_3d_bg_xpm, setcolor_board_body_xpm, setcolor_copper_xpm, setcolor_silkscreen_xpm, setcolor_soldermask_xpm, setcolor_solderpaste_xpm, ACTION_MENU::SetIcon(), ACTION_MENU::SetTitle(), EDA_3D_ACTIONS::show10mmGrid, EDA_3D_ACTIONS::show1mmGrid, EDA_3D_ACTIONS::show2_5mmGrid, EDA_3D_ACTIONS::show5mmGrid, SELECTION_CONDITIONS::ShowAlways(), EDA_3D_ACTIONS::showAxis, EDA_3D_ACTIONS::showBoundingBoxes, EDA_3D_ACTIONS::showReflections, EDA_3D_ACTIONS::showRefractions, tools_xpm, ACTIONS::zoomFitScreen, ACTIONS::zoomIn, ACTIONS::zoomOut, and ACTIONS::zoomRedraw.

◆ CurrentToolName()

std::string TOOLS_HOLDER::CurrentToolName ( ) const
inherited

Definition at line 99 of file tools_holder.cpp.

100 {
101  if( m_toolStack.empty() )
102  return ACTIONS::selectionTool.GetName();
103  else
104  return m_toolStack.back();
105 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:52
static TOOL_ACTION selectionTool
Definition: actions.h:147

References TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by TOOL_MANAGER::processEvent().

◆ Destroy()

◆ DismissModal()

void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
inherited

Definition at line 160 of file kiway_player.cpp.

161 {
162  m_modal_ret_val = aRetVal;
163  m_modal_string = aResult;
164 
165  if( m_modal_loop )
166  {
167  m_modal_loop->Exit();
168  m_modal_loop = 0; // this marks it as dismissed.
169  }
170 
171  Show( false );
172 }
bool m_modal_ret_val
Definition: kiway_player.h:205
wxString m_modal_string
Definition: kiway_player.h:204
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:202

References KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_ret_val, and KIWAY_PLAYER::m_modal_string.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint(), LIB_VIEW_FRAME::FinishModal(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ DisplayToolMsg()

virtual void TOOLS_HOLDER::DisplayToolMsg ( const wxString &  msg)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 89 of file tools_holder.h.

89 {};

Referenced by TOOLS_HOLDER::PopTool(), and TOOLS_HOLDER::PushTool().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

This should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 269 of file eda_base_frame.cpp.

270 {
271  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
272 }

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ Exit3DFrame()

void EDA_3D_VIEWER::Exit3DFrame ( wxCommandEvent &  event)
private

Called when user press the File->Exit.

Definition at line 209 of file eda_3d_viewer.cpp.

210 {
211  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Exit3DFrame" );
212 
213  Close( true );
214 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References m_logTrace.

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 504 of file eda_base_frame.h.

504 { return m_AboutTitle; }
wxString m_AboutTitle

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT(), and COMMON_CONTROL::ReportBug().

◆ GetAdapter()

BOARD_ADAPTER& EDA_3D_VIEWER::GetAdapter ( )
inlineoverridevirtual

Implements EDA_3D_BOARD_HOLDER.

Definition at line 104 of file eda_3d_viewer.h.

104 { return m_boardAdapter; }
BOARD_ADAPTER m_boardAdapter

References m_boardAdapter.

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited
Returns
the string to prepend to a file name for automatic save.

Definition at line 176 of file eda_base_frame.h.

177  {
178  return wxT( "_autosave-" );
179  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::Files_io_from_id(), SCH_EDIT_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnExportSTEP(), SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 270 of file eda_base_frame.h.

270 { return m_autoSaveInterval; }

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetBackupSuffix()

static wxString EDA_BASE_FRAME::GetBackupSuffix ( )
inlinestaticprotectedinherited
Returns
the suffix to be appended to the file extension on backup

Definition at line 168 of file eda_base_frame.h.

169  {
170  return wxT( "-bak" );
171  }

◆ GetBoard()

BOARD* EDA_3D_VIEWER::GetBoard ( )
inline

Definition at line 78 of file eda_3d_viewer.h.

78 { return Parent()->GetBoard(); }
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:76
BOARD * GetBoard() const

References PCB_BASE_FRAME::GetBoard(), and Parent().

Referenced by ReloadRequest(), and SynchroniseColoursWithBoard().

◆ GetCanvas()

EDA_3D_CANVAS* EDA_3D_VIEWER::GetCanvas ( )
inline

Definition at line 107 of file eda_3d_viewer.h.

107 { return m_canvas; }
EDA_3D_CANVAS * m_canvas

References m_canvas.

◆ GetCurrentCamera()

CCAMERA& EDA_3D_VIEWER::GetCurrentCamera ( )
inlineoverridevirtual

Implements EDA_3D_BOARD_HOLDER.

Definition at line 105 of file eda_3d_viewer.h.

105 { return m_currentCamera; }
CCAMERA & m_currentCamera

References m_currentCamera.

◆ GetCurrentFileName()

virtual wxString EDA_BASE_FRAME::GetCurrentFileName ( ) const
inlinevirtualinherited

Get the full filename + path of the currently opened file in the frame.

If no file is open, an empty string is returned.

Returns
the filename and full path to the open file

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, PL_EDITOR_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 429 of file eda_base_frame.h.

429 { return wxEmptyString; }

Referenced by EDA_BASE_FRAME::SaveSettings().

◆ GetDoImmediateActions()

bool TOOLS_HOLDER::GetDoImmediateActions ( ) const
inlineinherited

Indicates that hotkeys should perform an immediate action even if another tool is currently active.

If false, the first hotkey should select the relevant tool.

Definition at line 95 of file tools_holder.h.

95 { return m_immediateActions; }
bool m_immediateActions
Definition: tools_holder.h:59

References TOOLS_HOLDER::m_immediateActions.

◆ GetDragSelects()

bool TOOLS_HOLDER::GetDragSelects ( ) const
inlineinherited

Indicates that a drag should draw a selection rectangle, even when started over an item.

Definition at line 101 of file tools_holder.h.

101 { return m_dragSelects; }
bool m_dragSelects
Definition: tools_holder.h:63

References TOOLS_HOLDER::m_dragSelects.

Referenced by EE_SELECTION_TOOL::Main().

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
FILE_HISTORY aFileHistory = nullptr 
)
inherited

Fetches the file name from the file history list.

This removes the selected file, if this file does not exist. The menu is also updated, if FILE_HISTORY::UseMenu was called at init time

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe FILE_HISTORY in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 586 of file eda_base_frame.cpp.

588 {
589  if( !aFileHistory )
590  aFileHistory = m_fileHistory;
591 
592  wxASSERT( aFileHistory );
593 
594  int baseId = aFileHistory->GetBaseId();
595 
596  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) aFileHistory->GetCount() );
597 
598  unsigned i = cmdId - baseId;
599 
600  if( i < aFileHistory->GetCount() )
601  {
602  wxString fn = aFileHistory->GetHistoryFile( i );
603 
604  if( wxFileName::FileExists( fn ) )
605  return fn;
606  else
607  {
608  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
609  wxMessageBox( msg );
610 
611  aFileHistory->RemoveFileFromHistory( i );
612  }
613  }
614 
615  // Update the menubar to update the file history menu
616  if( GetMenuBar() )
617  {
618  ReCreateMenuBar();
619  GetMenuBar()->Refresh();
620  }
621 
622  return wxEmptyString;
623 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:33
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.

References _, Format(), EDA_BASE_FRAME::m_fileHistory, and EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetFileHistory()

FILE_HISTORY& EDA_BASE_FRAME::GetFileHistory ( )
inlineinherited

◆ GetInfoBar()

WX_INFOBAR* EDA_BASE_FRAME::GetInfoBar ( )
inlineinherited

Definition at line 288 of file eda_base_frame.h.

288 { return m_infoBar; }
WX_INFOBAR * m_infoBar

References EDA_BASE_FRAME::m_infoBar.

Referenced by PAD_TOOL::EditPad(), and SCH_EDIT_TOOL::RefreshSymbolFromLibrary().

◆ GetMaxUndoItems()

int EDA_BASE_FRAME::GetMaxUndoItems ( ) const
inlineinherited

Definition at line 601 of file eda_base_frame.h.

601 { return m_UndoRedoCountMax; }

References EDA_BASE_FRAME::m_UndoRedoCountMax.

Referenced by EDA_DRAW_FRAME::SaveSettings().

◆ GetMoveWarpsCursor()

bool TOOLS_HOLDER::GetMoveWarpsCursor ( ) const
inlineinherited

Indicates that a move operation should warp the mouse pointer to the origin of the move object.

This improves snapping, but some users are alergic to mouse warping.

Definition at line 107 of file tools_holder.h.

107 { return m_moveWarpsCursor; }
bool m_moveWarpsCursor
Definition: tools_holder.h:64

References TOOLS_HOLDER::m_moveWarpsCursor.

Referenced by LIB_MOVE_TOOL::Main(), and SCH_MOVE_TOOL::Main().

◆ GetMruPath()

◆ GetRedoCommandCount()

◆ GetSettingsManager()

◆ GetSeverity()

virtual int EDA_BASE_FRAME::GetSeverity ( int  aErrorCode) const
inlinevirtualinherited

Reimplemented in PCB_BASE_FRAME.

Definition at line 236 of file eda_base_frame.h.

References RPT_SEVERITY_UNDEFINED.

Referenced by RC_TREE_MODEL::GetValue().

◆ GetToolCanvas()

wxWindow* EDA_3D_VIEWER::GetToolCanvas ( ) const
inlineoverridevirtual

Canvas access.

Implements TOOLS_HOLDER.

Definition at line 80 of file eda_3d_viewer.h.

80 { return m_canvas; }
EDA_3D_CANVAS * m_canvas

References m_canvas.

◆ GetToolManager()

TOOL_MANAGER* TOOLS_HOLDER::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 74 of file tools_holder.h.

74 { return m_toolManager; }
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48

References TOOLS_HOLDER::m_toolManager.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), LIB_CONTROL::AddSymbolToSchematic(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), TOOLS_HOLDER::CommonSettingsChanged(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), DRAWING_TOOL::DrawVia(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), KICAD_MANAGER_FRAME::InstallPreferences(), PL_EDITOR_FRAME::InstallPreferences(), FOOTPRINT_EDIT_FRAME::InstallPreferences(), LIB_EDIT_FRAME::InstallPreferences(), GERBVIEW_FRAME::InstallPreferences(), SCH_EDIT_FRAME::InstallPreferences(), PCB_EDIT_FRAME::InstallPreferences(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), LIB_EDIT_FRAME::LoadPart(), PCB_EDIT_FRAME::LoadProjectSettings(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_INSPECTOR::onCellClicked(), SIM_PLOT_FRAME::onClose(), SYMBOL_TREE_PANE::onComponentSelected(), DIALOG_DRC::OnDeleteOneClick(), DIALOG_ERC::OnERCItemSelected(), FOOTPRINTS_LISTBOX::OnLeftDClick(), SIM_PLOT_FRAME::onProbe(), DIALOG_PLOT::onRunDRC(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SIM_PLOT_FRAME::onTune(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), DIALOG_PLOT::Plot(), TOOLS_HOLDER::PopTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SaveProjectSettings(), SaveSettings(), DIALOG_FIND::search(), CVPCB_MAINFRAME::setupEventHandlers(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), EDA_DRAW_FRAME::UpdateMsgPanel(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( )
inlineinherited

Definition at line 49 of file kiway_holder.h.

49 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:82

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUndoCommandCount()

◆ GetUserUnits()

EDA_UNITS EDA_BASE_FRAME::GetUserUnits ( ) const
inlineinherited

Return the user units currently in use.

Definition at line 220 of file eda_base_frame.h.

221  {
222  return m_userUnits;
223  }
EDA_UNITS m_userUnits

References EDA_BASE_FRAME::m_userUnits.

Referenced by PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), GERBER_FILE_IMAGE::DisplayImageInfo(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::drawSegment(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_MODEDIT_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), LIB_CIRCLE::GetMsgPanelInfo(), LIB_RECTANGLE::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), LIB_ARC::GetMsgPanelInfo(), LIB_POLYLINE::GetMsgPanelInfo(), MARKER_PCB::GetMsgPanelInfo(), LIB_BEZIER::GetMsgPanelInfo(), TEXTE_PCB::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), WS_DRAW_ITEM_BASE::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), LIB_FIELD::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), LIB_PIN::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), DRAWSEGMENT::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), LIB_PIN::getMsgPanelInfoBase(), GetUserUnits(), RC_TREE_MODEL::GetValue(), GRID_MENU::GRID_MENU(), GERBVIEW_FRAME::Liste_D_Codes(), PCB_VIEWER_TOOLS::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), DIALOG_SELECT_NET_FROM_LIST::onUnitsChanged(), UNIT_BINDER::onUnitsChanged(), PANEL_SETUP_BOARD_STACKUP::onUpdateThicknessValue(), PANEL_PREV_3D::PANEL_PREV_3D(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), POSITION_RELATIVE_TOOL::PositionRelative(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), DRC_ITEM::ShowHtml(), DISPLAY_FOOTPRINTS_FRAME::SyncToolbars(), FOOTPRINT_VIEWER_FRAME::SyncToolbars(), FOOTPRINT_EDIT_FRAME::SyncToolbars(), LIB_EDIT_FRAME::SyncToolbars(), GERBVIEW_FRAME::SyncToolbars(), SCH_EDIT_FRAME::SyncToolbars(), PCB_EDIT_FRAME::SyncToolbars(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), PANEL_GERBVIEW_SETTINGS::TransferDataToWindow(), PANEL_EDIT_OPTIONS::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), GRID_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), GERBVIEW_FRAME::updateDCodeSelectBox(), EDA_DRAW_FRAME::UpdateGridSelectBox(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), DRC::userUnits(), userUnits(), and PANEL_SETUP_TRACKS_AND_VIAS::validateData().

◆ GetWindowSettings()

WINDOW_SETTINGS * EDA_BASE_FRAME::GetWindowSettings ( APP_SETTINGS_BASE aCfg)
virtualinherited

Returns a pointer to the window settings for this frame.

By default, points to aCfg->m_Window for top-level frames.

Parameters
aCfgis this frame's config object

Reimplemented in SIM_PLOT_FRAME, FOOTPRINT_WIZARD_FRAME, FOOTPRINT_VIEWER_FRAME, LIB_VIEW_FRAME, and DISPLAY_FOOTPRINTS_FRAME.

Definition at line 537 of file eda_base_frame.cpp.

538 {
539  return &aCfg->m_Window;
540 }
WINDOW_SETTINGS m_Window
Definition: app_settings.h:154

References APP_SETTINGS_BASE::m_Window.

Referenced by EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), EDA_BASE_FRAME::SaveSettings(), and EDA_DRAW_FRAME::SaveSettings().

◆ GetWindowSize()

wxSize EDA_BASE_FRAME::GetWindowSize ( )
inherited

Get the undecorated window size that can be used for restoring the window size.

This is needed for GTK, since the normal wxWidgets GetSize() call will return a window size that includes the window decorations added by the window manager.

Returns
the undecorated window size

Definition at line 863 of file eda_base_frame.cpp.

864 {
865 #ifdef __WXGTK__
866  // GTK includes the window decorations in the normal GetSize call,
867  // so we have to use a GTK-specific sizing call that returns the
868  // non-decorated window size.
869  int width = 0;
870  int height = 0;
871  GTKDoGetSize( &width, &height );
872 
873  wxSize winSize( width, height );
874 #else
875  wxSize winSize = GetSize();
876 #endif
877 
878  return winSize;
879 }

Referenced by EDA_BASE_FRAME::OnMaximize(), and EDA_BASE_FRAME::SaveWindowSettings().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
virtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 556 of file eda_base_frame.cpp.

557 {
558  return Kiface().GetHelpFileName();
559 }
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:123
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

References KIFACE_I::GetHelpFileName(), and Kiface().

Referenced by COMMON_CONTROL::ShowHelp().

◆ ImportHotkeyConfigFromFile()

void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( std::map< std::string, TOOL_ACTION * >  aActionMap,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for a hotkey file to read, and read it.

Parameters
aActionMap= current hotkey map (over which the imported hotkeys will be applied)
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

◆ Install3DViewOptionDialog()

void EDA_3D_VIEWER::Install3DViewOptionDialog ( wxCommandEvent &  event)
private

Definition at line 58 of file dialog_3D_view_option.cpp.

59 {
60  DIALOG_3D_VIEW_OPTIONS dlg( this );
61 
62  if( dlg.ShowModal() == wxID_OK )
63  {
64  NewDisplay( true );
65  }
66 }
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.

References NewDisplay().

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG ,
PANEL_HOTKEYS_EDITOR  
)
inlinevirtualinherited

Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences dialog.

Parameters
aParenta paged dialog into which the preference panels should be installed

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, PL_EDITOR_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 301 of file eda_base_frame.h.

301 { }

Referenced by EDA_BASE_FRAME::OnPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 191 of file eda_base_frame.h.

191 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsContentModified()

bool EDA_BASE_FRAME::IsContentModified ( )
virtualinherited

Get if the contents of the frame have been modified since the last save.

Returns
true if the contents of the frame have not been saved

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, CVPCB_MAINFRAME, LIB_EDIT_FRAME, PL_EDITOR_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 775 of file eda_base_frame.cpp.

776 {
777  // This function should be overridden in child classes
778  return false;
779 }

◆ IsCurrentTool()

bool TOOLS_HOLDER::IsCurrentTool ( const TOOL_ACTION aAction) const
inherited

Definition at line 108 of file tools_holder.cpp.

109 {
110  if( m_toolStack.empty() )
111  return &aAction == &ACTIONS::selectionTool;
112  else
113  return m_toolStack.back() == aAction.GetName();
114 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:52
static TOOL_ACTION selectionTool
Definition: actions.h:147
const std::string & GetName() const
Function GetName() Returns name of the action.
Definition: tool_action.h:78

References TOOL_ACTION::GetName(), TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by PCB_INSPECTION_TOOL::HighlightNetTool(), SCH_EDIT_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), EDIT_TOOL::Init(), DISPLAY_FOOTPRINTS_FRAME::SyncToolbars(), FOOTPRINT_VIEWER_FRAME::SyncToolbars(), and LIB_EDIT_FRAME::SyncToolbars().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
inherited

Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal().

IOW, it will return true if the dialog is not modal or if it is modal and has been dismissed.

Definition at line 154 of file kiway_player.cpp.

155 {
156  return !m_modal_loop;
157 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:202

References KIWAY_PLAYER::m_modal_loop.

Referenced by LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ IsModal()

◆ IsType()

bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited

Definition at line 272 of file eda_base_frame.h.

272 { return m_Ident == aType; }

References EDA_BASE_FRAME::m_Ident.

Referenced by LIB_CONTROL::AddLibrary(), PCBNEW_CONTROL::AddLibrary(), LIB_CONTROL::AddSymbol(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), BOARD_COMMIT::BOARD_COMMIT(), CreateMenuBar(), LIB_CONTROL::CutCopyDelete(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), KIGFX::SCH_VIEW::DisplaySheet(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), LIB_CONTROL::DuplicateSymbol(), LIB_CONTROL::EditSymbol(), LIB_CONTROL::ExportSymbol(), MODULE::GetMsgPanelInfo(), LIB_CONTROL::Init(), DIALOG_EDIT_ONE_FIELD::init(), SELECTION_TOOL::Init(), DIALOG_PAD_PROPERTIES::initValues(), PICKER_TOOL::Main(), LIB_CONTROL::OnDeMorgan(), PCB_LAYER_WIDGET::OnLayerVisible(), PCB_LAYER_WIDGET::OnRenderEnable(), PCBNEW_CONTROL::Paste(), LIB_CONTROL::PinLibrary(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), LIB_CONTROL::Revert(), EE_INSPECTION_TOOL::RunERC(), LIB_CONTROL::Save(), LIB_CONTROL::ShowComponentTree(), EE_INSPECTION_TOOL::ShowDatasheet(), LIB_CONTROL::UnpinLibrary(), and COMMON_TOOLS::ZoomFitScreen().

◆ IsWritable()

bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 685 of file eda_base_frame.cpp.

686 {
687  wxString msg;
688  wxFileName fn = aFileName;
689 
690  // Check for absence of a file path with a file name. Unfortunately KiCad
691  // uses paths relative to the current project path without the ./ part which
692  // confuses wxFileName. Making the file name path absolute may be less than
693  // elegant but it solves the problem.
694  if( fn.GetPath().IsEmpty() && fn.HasName() )
695  fn.MakeAbsolute();
696 
697  wxCHECK_MSG( fn.IsOk(), false,
698  wxT( "File name object is invalid. Bad programmer!" ) );
699  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
700  wxT( "File name object path <" ) + fn.GetFullPath() +
701  wxT( "> is not set. Bad programmer!" ) );
702 
703  if( fn.IsDir() && !fn.IsDirWritable() )
704  {
705  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
706  GetChars( fn.GetPath() ) );
707  }
708  else if( !fn.FileExists() && !fn.IsDirWritable() )
709  {
710  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
711  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
712  }
713  else if( fn.FileExists() && !fn.IsFileWritable() )
714  {
715  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
716  GetChars( fn.GetFullPath() ) );
717  }
718 
719  if( !msg.IsEmpty() )
720  {
721  wxMessageBox( msg );
722  return false;
723  }
724 
725  return true;
726 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
#define _(s)
Definition: 3d_actions.cpp:33

References _, and GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

57  {
58  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
59  return *m_kiway;
60  }
KIWAY * m_kiway
Definition: kiway_holder.h:81

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), CVPCB_MAINFRAME::DisplayStatus(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithLibEdit(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), PCB_EDIT_FRAME::importFile(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), LIB_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), KIWAY_HOLDER::Prj(), BACK_ANNOTATE::PushNewLinksToPCB(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), PCB_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 175 of file kiway_player.cpp.

176 {
177  // logging support
178  KiwayMailIn( aEvent ); // call the virtual, override in derived.
179 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

Reimplemented in LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, SCH_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 69 of file kiway_player.cpp.

70 {
71  // override this in derived classes.
72 }

Referenced by KIWAY_PLAYER::kiway_express(), and KIWAY::ProcessEvent().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

Function language_change is an event handler called on a language menu selection.

Definition at line 182 of file kiway_player.cpp.

183 {
184  int id = event.GetId();
185 
186  // tell all the KIWAY_PLAYERs about the language change.
187  Kiway().SetLanguage( id );
188 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs.
Definition: kiway.cpp:440

References KIWAY_HOLDER::Kiway(), and KIWAY::SetLanguage().

◆ loadCommonSettings()

void EDA_3D_VIEWER::loadCommonSettings ( )
private

Load configuration from common settings.

Definition at line 906 of file eda_3d_viewer.cpp.

907 {
908  wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );
909 
910  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
911 
912  const DPI_SCALING dpi{ settings, this };
913  m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
914  // TODO(JE) use all control options
916 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
Definition: dpi_scaling.h:36
EDA_3D_CANVAS * m_canvas
BOARD_ADAPTER m_boardAdapter
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.

References FL_MOUSEWHEEL_PANNING, m_boardAdapter, m_canvas, COMMON_SETTINGS::m_Input, Pgm(), COMMON_SETTINGS::INPUT::scroll_modifier_zoom, BOARD_ADAPTER::SetFlag(), and HIDPI_GL_CANVAS::SetScaleFactor().

Referenced by CommonSettingsChanged().

◆ LoadSettings()

void EDA_3D_VIEWER::LoadSettings ( APP_SETTINGS_BASE aCfg)
overrideprivatevirtual

Load common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 396 of file eda_3d_viewer.cpp.

397 {
399 
400  EDA_3D_VIEWER_SETTINGS* cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
401  wxASSERT( cfg );
402 
403  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings" );
404 
405  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
406 
407  auto set_color = [] ( const COLOR4D& aColor, SFVEC3D& aTarget )
408  {
409  aTarget.r = aColor.r;
410  aTarget.g = aColor.g;
411  aTarget.b = aColor.b;
412  };
413 
415  set_color( colors->GetColor( LAYER_3D_BACKGROUND_TOP ), m_boardAdapter.m_BgColorTop );
416  set_color( colors->GetColor( LAYER_3D_BOARD ), m_boardAdapter.m_BoardBodyColor );
417  set_color( colors->GetColor( LAYER_3D_COPPER ), m_boardAdapter.m_CopperColor );
423 
424  if( cfg )
425  {
426 #define TRANSFER_SETTING( flag, field ) m_boardAdapter.SetFlag( flag, cfg->m_Render.field )
427 
429  TRANSFER_SETTING( FL_SUBTRACT_MASK_FROM_SILK, subtract_mask_from_silk );
430 
431  // OpenGL options
432  TRANSFER_SETTING( FL_RENDER_OPENGL_COPPER_THICKNESS, opengl_copper_thickness );
433  TRANSFER_SETTING( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, opengl_show_model_bbox );
434  TRANSFER_SETTING( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, opengl_AA_disableOnMove );
435  TRANSFER_SETTING( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, opengl_thickness_disableOnMove );
436  TRANSFER_SETTING( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, opengl_vias_disableOnMove );
437  TRANSFER_SETTING( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, opengl_holes_disableOnMove );
438 
439  // Raytracing options
440  TRANSFER_SETTING( FL_RENDER_RAYTRACING_SHADOWS, raytrace_shadows );
441  TRANSFER_SETTING( FL_RENDER_RAYTRACING_BACKFLOOR, raytrace_backfloor );
442  TRANSFER_SETTING( FL_RENDER_RAYTRACING_REFRACTIONS, raytrace_refractions );
443  TRANSFER_SETTING( FL_RENDER_RAYTRACING_REFLECTIONS, raytrace_reflections );
444  TRANSFER_SETTING( FL_RENDER_RAYTRACING_POST_PROCESSING, raytrace_post_processing );
445  TRANSFER_SETTING( FL_RENDER_RAYTRACING_ANTI_ALIASING, raytrace_anti_aliasing );
446  TRANSFER_SETTING( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, raytrace_procedural_textures );
447 
448  TRANSFER_SETTING( FL_AXIS, show_axis );
449  TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL, show_footprints_normal );
450  TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, show_footprints_insert );
451  TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_VIRTUAL, show_footprints_virtual );
452  TRANSFER_SETTING( FL_ZONE, show_zones );
453  TRANSFER_SETTING( FL_ADHESIVE, show_adhesive );
454  TRANSFER_SETTING( FL_SILKSCREEN, show_silkscreen );
455  TRANSFER_SETTING( FL_SOLDERMASK, show_soldermask );
456  TRANSFER_SETTING( FL_SOLDERPASTE, show_solderpaste );
457  TRANSFER_SETTING( FL_COMMENTS, show_comments );
458  TRANSFER_SETTING( FL_ECO, show_eco );
459  TRANSFER_SETTING( FL_SHOW_BOARD_BODY, show_board_body );
460  TRANSFER_SETTING( FL_CLIP_SILK_ON_VIA_ANNULUS, clip_silk_on_via_annulus );
461 
462  m_boardAdapter.GridSet( static_cast<GRID3D_TYPE>( cfg->m_Render.grid_type ) );
463  m_boardAdapter.AntiAliasingSet( static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode ) );
464 
465  // When opening the 3D viewer, we use the opengl mode, not the ray tracing engine
466  // because the ray tracing is very time consumming, and can be seen as not working
467  // (freeze window) with large boards.
468 #if 0
469  RENDER_ENGINE engine = static_cast<RENDER_ENGINE>( cfg->m_Render.engine );
470  wxLogTrace( m_logTrace, engine == RENDER_ENGINE::RAYTRACING ?
471  "EDA_3D_VIEWER::LoadSettings render setting Ray Trace" :
472  "EDA_3D_VIEWER::LoadSettings render setting OpenGL" );
473 #else
475 #endif
476 
477  m_boardAdapter.MaterialModeSet( static_cast<MATERIAL_MODE>( cfg->m_Render.material_mode ) );
478 
481 
482 #undef TRANSFER_SETTING
483  }
484 }
void AnimationEnabledSet(bool aAnimationEnabled)
AnimationEnabledSet - Enable or disable camera animation when switching to a pre-defined view.
void GridSet(GRID3D_TYPE aGridType) noexcept
GridSet - set the current grid.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
double g
Green component.
Definition: color4d.h:367
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
void RenderEngineSet(RENDER_ENGINE aRenderEngine) noexcept
RenderEngineSet.
double b
Blue component.
Definition: color4d.h:368
EDA_3D_CANVAS * m_canvas
void MovingSpeedMultiplierSet(int aMovingSpeedMultiplier)
MovingSpeedMultiplierSet - Set the camera animation moving speed multiplier option.
SFVEC3D m_BgColorTop
background top color
BOARD_ADAPTER m_boardAdapter
#define TRANSFER_SETTING(flag, field)
void AntiAliasingSet(ANTIALIASING_MODE aAAmode)
AntiAliasingSet - set the current antialiasing mode value.
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
SFVEC3D m_BgColorBot
background bottom color
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC3D m_CopperColor
in realistic mode: copper color
RENDER_ENGINE
Render engine mode.
Definition: 3d_enums.h:94
Color settings are a bit different than most of the settings objects in that there can be more than o...
double r
Red component.
Definition: color4d.h:366
static VRML_COLOR colors[VRML_COLOR_LAST]
void MaterialModeSet(MATERIAL_MODE aMaterialMode) noexcept
MaterialModeSet.
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References EDA_3D_VIEWER_SETTINGS::CAMERA_SETTINGS::animation_enabled, EDA_3D_CANVAS::AnimationEnabledSet(), BOARD_ADAPTER::AntiAliasingSet(), KIGFX::COLOR4D::b, colors, EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::engine, FL_ADHESIVE, FL_AXIS, FL_CLIP_SILK_ON_VIA_ANNULUS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, FL_RENDER_OPENGL_COPPER_THICKNESS, FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, FL_RENDER_OPENGL_SHOW_MODEL_BBOX, FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, FL_RENDER_RAYTRACING_ANTI_ALIASING, FL_RENDER_RAYTRACING_BACKFLOOR, FL_RENDER_RAYTRACING_POST_PROCESSING, FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, FL_RENDER_RAYTRACING_REFLECTIONS, FL_RENDER_RAYTRACING_REFRACTIONS, FL_RENDER_RAYTRACING_SHADOWS, FL_SHOW_BOARD_BODY, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE, FL_SUBTRACT_MASK_FROM_SILK, FL_USE_REALISTIC_MODE, FL_ZONE, KIGFX::COLOR4D::g, EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::grid_type, BOARD_ADAPTER::GridSet(), LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD, LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK, LAYER_3D_SOLDERPASTE, EDA_BASE_FRAME::LoadSettings(), BOARD_ADAPTER::m_BgColorBot, BOARD_ADAPTER::m_BgColorTop, m_boardAdapter, BOARD_ADAPTER::m_BoardBodyColor, EDA_3D_VIEWER_SETTINGS::m_Camera, m_canvas, BOARD_ADAPTER::m_CopperColor, m_logTrace, EDA_3D_VIEWER_SETTINGS::m_Render, BOARD_ADAPTER::m_SilkScreenColorBot, BOARD_ADAPTER::m_SilkScreenColorTop, BOARD_ADAPTER::m_SolderMaskColorBot, BOARD_ADAPTER::m_SolderMaskColorTop, BOARD_ADAPTER::m_SolderPasteColor, EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::material_mode, BOARD_ADAPTER::MaterialModeSet(), EDA_3D_VIEWER_SETTINGS::CAMERA_SETTINGS::moving_speed_multiplier, EDA_3D_CANVAS::MovingSpeedMultiplierSet(), EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::opengl_AA_mode, OPENGL_LEGACY, Pgm(), KIGFX::COLOR4D::r, RAYTRACING, BOARD_ADAPTER::RenderEngineSet(), and TRANSFER_SETTING.

Referenced by Process_Special_Functions().

◆ LoadWindowSettings()

void EDA_BASE_FRAME::LoadWindowSettings ( WINDOW_SETTINGS aCfg)
inherited

Loads window settings from the given settings object Normally called by LoadSettings unless the window in question is a child window that stores its settings somewhere other than APP_SETTINGS_BASE::m_Window.

Definition at line 349 of file eda_base_frame.cpp.

350 {
351  m_FramePos.x = aCfg->pos_x;
352  m_FramePos.y = aCfg->pos_y;
353  m_FrameSize.x = aCfg->size_x;
354  m_FrameSize.y = aCfg->size_y;
355 
356  wxLogTrace( traceDisplayLocation, "Config position (%d, %d) with size (%d, %d)",
358 
359  // Ensure minimum size is set if the stored config was zero-initialized
361  {
364 
365  wxLogTrace( traceDisplayLocation, "Using minimum size (%d, %d)", m_FrameSize.x, m_FrameSize.y );
366  }
367 
368  wxLogTrace( traceDisplayLocation, "Number of displays: %d", wxDisplay::GetCount() );
369 
370  if( aCfg->display >= wxDisplay::GetCount() )
371  {
372  wxLogTrace( traceDisplayLocation, "Previous display not found" );
373 
374  // If it isn't attached, use the first display
375  // Warning wxDisplay has 2 ctor variants. the parameter needs a type:
376  const unsigned int index = 0;
377  wxDisplay display( index );
378  wxRect clientSize = display.GetClientArea();
379 
380  wxLogDebug( "Client size (%d, %d)", clientSize.width, clientSize.height );
381 
382  m_FramePos = wxDefaultPosition;
383 
384  // Ensure the window fits on the display, since the other one could have been larger
385  if( m_FrameSize.x > clientSize.width )
386  m_FrameSize.x = clientSize.width;
387 
388  if( m_FrameSize.y > clientSize.height )
389  m_FrameSize.y = clientSize.height;
390  }
391  else
392  {
393  wxPoint upperRight( m_FramePos.x + m_FrameSize.x, m_FramePos.y );
394  wxPoint upperLeft( m_FramePos.x, m_FramePos.y );
395 
396  wxDisplay display( aCfg->display );
397  wxRect clientSize = display.GetClientArea();
398 
399 // The percentage size (represented in decimal) of the region around the screen's border where
400 // an upper corner is not allowed
401 #define SCREEN_BORDER_REGION 0.10
402 
403  int yLim = clientSize.y + ( clientSize.height * ( 1.0 - SCREEN_BORDER_REGION ) );
404  int xLimLeft = clientSize.x + ( clientSize.width * SCREEN_BORDER_REGION );
405  int xLimRight = clientSize.x + ( clientSize.width * ( 1.0 - SCREEN_BORDER_REGION ) );
406 
407  if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen
408  upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen
409  upperRight.y > yLim ) // Upper corner too close to the bottom of the screen
410  {
411  m_FramePos = wxDefaultPosition;
412  wxLogTrace( traceDisplayLocation, "Resetting to default position" );
413  }
414  }
415 
416  // Ensure Window title bar is visible
417 #if defined( __WXOSX__ )
418  // for macOSX, the window must be below system (macOSX) toolbar
419  int Ypos_min = 20;
420 #else
421  int Ypos_min = 0;
422 #endif
423  if( m_FramePos.y < Ypos_min )
424  m_FramePos.y = Ypos_min;
425 
426  wxLogTrace( traceDisplayLocation, "Final window position (%d, %d) with size (%d, %d)",
428 
429  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
430 
431  // Center the window if we reset to default
432  if( m_FramePos.x == -1 )
433  {
434  wxLogTrace( traceDisplayLocation, "Centering window" );
435  Center();
436  m_FramePos = GetPosition();
437  }
438 
439  // Record the frame sizes in an un-maximized state
442 
443  // Maximize if we were maximized before
444  if( aCfg->maximized )
445  {
446  wxLogTrace( traceDisplayLocation, "Maximizing window" );
447  Maximize();
448  }
449 
450  if( m_hasAutoSave )
451  m_autoSaveInterval = Pgm().GetCommonSettings()->m_System.autosave_interval;
452 
453  m_perspective = aCfg->perspective;
454  m_mruPath = aCfg->mru_path;
455 
456  TOOLS_HOLDER::CommonSettingsChanged( false, false );
457 }
wxString mru_path
Definition: app_settings.h:71
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
wxString m_mruPath
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxString m_perspective
wxSize m_NormalFrameSize
#define SCREEN_BORDER_REGION
wxString perspective
Definition: app_settings.h:74
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Notification event that some of the common (suite-wide) settings have changed.
static const int s_minsize_x
static const int s_minsize_y
wxPoint m_NormalFramePos
unsigned int display
Definition: app_settings.h:77

References PCAD2KICAD::Center, TOOLS_HOLDER::CommonSettingsChanged(), WINDOW_SETTINGS::display, EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, EDA_BASE_FRAME::m_hasAutoSave, EDA_BASE_FRAME::m_mruPath, EDA_BASE_FRAME::m_NormalFramePos, EDA_BASE_FRAME::m_NormalFrameSize, EDA_BASE_FRAME::m_perspective, WINDOW_SETTINGS::maximized, WINDOW_SETTINGS::mru_path, WINDOW_SETTINGS::perspective, Pgm(), WINDOW_SETTINGS::pos_x, WINDOW_SETTINGS::pos_y, s_minsize_x, s_minsize_y, SCREEN_BORDER_REGION, WINDOW_SETTINGS::size_x, WINDOW_SETTINGS::size_y, traceDisplayLocation, wxPoint::x, and wxPoint::y.

Referenced by EDA_BASE_FRAME::LoadSettings().

◆ NewDisplay()

void EDA_3D_VIEWER::NewDisplay ( bool  aForceImmediateRedraw = false)

Reload and refresh (rebuild) the 3D scene.

Warning: rebuilding the 3D scene can take a bit of time, so rebuilding the scene can be immediate, or made later, during the next 3D canvas refresh (on zoom for instance)

Parameters
aForceImmediateRedraw= true to immediately rebuild the 3D scene, false to wait a refresh later.

Definition at line 198 of file eda_3d_viewer.cpp.

199 {
200  ReloadRequest();
201 
202  // After the ReloadRequest call, the refresh often takes a bit of time,
203  // and it is made here only on request.
204  if( aForceImmediateRedraw )
205  m_canvas->Refresh();
206 }
EDA_3D_CANVAS * m_canvas
void ReloadRequest()
Request reloading the 3D view.

References m_canvas, and ReloadRequest().

Referenced by CommonSettingsChanged(), Install3DViewOptionDialog(), PCB_EDIT_FRAME::OpenProjectFiles(), Process_Special_Functions(), Set3DBoardBodyColorFromUser(), Set3DCopperColorFromUser(), Set3DSilkScreenColorFromUser(), Set3DSolderMaskColorFromUser(), Set3DSolderPasteColorFromUser(), EDA_3D_CONTROLLER::ToggleVisibility(), and PCB_BASE_FRAME::Update3DView().

◆ OnActivate()

void EDA_3D_VIEWER::OnActivate ( wxActivateEvent &  event)
private

Definition at line 367 of file eda_3d_viewer.cpp.

368 {
369  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" );
370 
371  if( m_canvas )
372  {
373  // Reload data if 3D frame shows a board,
374  // because it can be changed since last frame activation
377 
378  // Activates again the focus of the canvas so it will catch mouse and key events
379  m_canvas->SetFocus();
380  }
381 
382  event.Skip(); // required under wxMAC
383 }
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
Definition: eda_3d_canvas.h:87
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References EDA_3D_CANVAS::IsReloadRequestPending(), m_canvas, m_logTrace, and EDA_3D_CANVAS::Request_refresh().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 262 of file eda_base_frame.cpp.

263 {
264  if( !doAutoSave() )
265  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
266 }
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
wxTimer * m_autoSaveTimer

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

◆ OnCharHook()

void EDA_BASE_FRAME::OnCharHook ( wxKeyEvent &  event)
virtualinherited

Capture the key event before it is sent to the GUI.

The basic frame does not capture this event. Editor frames should override this event function to capture and filter these keys when they are used as hotkeys, and skip it if the key is not used as hotkey (otherwise the key events will be not sent to menus).

Reimplemented in FOOTPRINT_VIEWER_FRAME.

Definition at line 275 of file eda_base_frame.cpp.

276 {
277  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
278  // Key events can be filtered here.
279  // Currently no filtering is made.
280  event.Skip();
281 }
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.

References dump(), and kicadTraceKeyEvent.

◆ OnCloseWindow()

void EDA_3D_VIEWER::OnCloseWindow ( wxCloseEvent &  event)
private

Definition at line 217 of file eda_3d_viewer.cpp.

218 {
219  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnCloseWindow" );
220 
221  if( m_canvas )
222  m_canvas->Close();
223 
224  // m_canvas delete will be called by wxWidget manager
225  //delete m_canvas;
226  //m_canvas = nullptr;
227 
228  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
229  Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" );
230 
231  Destroy();
232  event.Skip( true );
233 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
EDA_3D_CANVAS * m_canvas
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
Color settings are a bit different than most of the settings objects in that there can be more than o...
static VRML_COLOR colors[VRML_COLOR_LAST]

References colors, KIWAY_PLAYER::Destroy(), m_canvas, m_logTrace, and Pgm().

◆ OnDisableRayTracing()

void EDA_3D_VIEWER::OnDisableRayTracing ( wxCommandEvent &  aEvent)
private

Definition at line 358 of file eda_3d_viewer.cpp.

359 {
360  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::%s disabling ray tracing.", __WXFUNCTION__ );
361 
362  m_disable_ray_tracing = true;
364 }
void RenderEngineSet(RENDER_ENGINE aRenderEngine) noexcept
RenderEngineSet.
BOARD_ADAPTER m_boardAdapter
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool m_disable_ray_tracing

References m_boardAdapter, m_disable_ray_tracing, m_logTrace, OPENGL_LEGACY, and BOARD_ADAPTER::RenderEngineSet().

◆ OnKicadAbout()

void EDA_BASE_FRAME::OnKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 644 of file eda_base_frame.cpp.

645 {
646  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
647  ShowAboutDialog( this );
648 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ OnMaximize()

void EDA_BASE_FRAME::OnMaximize ( wxMaximizeEvent &  aEvent)
inherited

Definition at line 841 of file eda_base_frame.cpp.

842 {
843  // When we maximize the window, we want to save the old information
844  // so that we can add it to the settings on next window load.
845  // Contrary to the documentation, this event seems to be generated
846  // when the window is also being unmaximized on OSX, so we only
847  // capture the size information when we maximize the window when on OSX.
848 #ifdef __WXOSX__
849  if( !IsMaximized() )
850 #endif
851  {
853  m_NormalFramePos = GetPosition();
854  wxLogTrace( traceDisplayLocation, "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
856  }
857 
858  // Skip event to actually maximize the window
859  aEvent.Skip();
860 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxSize m_NormalFrameSize
wxSize GetWindowSize()
Get the undecorated window size that can be used for restoring the window size.
wxPoint m_NormalFramePos

References EDA_BASE_FRAME::GetWindowSize(), EDA_BASE_FRAME::m_NormalFramePos, EDA_BASE_FRAME::m_NormalFrameSize, traceDisplayLocation, wxPoint::x, and wxPoint::y.

◆ OnMenuEvent()

void EDA_BASE_FRAME::OnMenuEvent ( wxMenuEvent &  event)
inherited

The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves.

Definition at line 284 of file eda_base_frame.cpp.

285 {
286  if( !m_toolDispatcher )
287  aEvent.Skip();
288  else
290 }
virtual void DispatchWxEvent(wxEvent &aEvent)
Function DispatchWxEvent() Processes wxEvents (mostly UI events), translates them to TOOL_EVENTs,...
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:50

References TOOL_DISPATCHER::DispatchWxEvent(), and TOOLS_HOLDER::m_toolDispatcher.

◆ OnMove()

virtual void EDA_BASE_FRAME::OnMove ( wxMoveEvent &  aEvent)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 261 of file eda_base_frame.h.

262  {
263  aEvent.Skip();
264  }

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Definition at line 651 of file eda_base_frame.cpp.

652 {
653  PAGED_DIALOG dlg( this, _( "Preferences" ), true );
654  wxTreebook* book = dlg.GetTreebook();
655 
656  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
657 
658  book->AddPage( new PANEL_MOUSE_SETTINGS( &dlg, book ), _( "Mouse and Touchpad" ) );
659 
660  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
661  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
662 
663  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
664  {
665  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
666 
667  if( frame )
668  frame->InstallPreferences( &dlg, hotkeysPanel );
669  }
670 
671  // The Kicad manager frame is not a player so we have to add it by hand
672  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
673 
674  if( manager )
675  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
676 
677  for( size_t i = 0; i < book->GetPageCount(); ++i )
678  book->GetPage( i )->Layout();
679 
680  if( dlg.ShowModal() == wxID_OK )
681  dlg.Kiway().CommonSettingsChanged( false, false );
682 }
KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of ...
Definition: kiway_player.h:59
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:342
#define KICAD_MANAGER_FRAME_NAME
#define _(s)
Definition: 3d_actions.cpp:33
virtual void InstallPreferences(PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences...

References _, KIWAY::CommonSettingsChanged(), PAGED_DIALOG::GetTreebook(), EDA_BASE_FRAME::InstallPreferences(), KICAD_MANAGER_FRAME_NAME, KIWAY_HOLDER::Kiway(), KIWAY_PLAYER_COUNT, and KIWAY::Player().

◆ OnRenderEngineSelection()

void EDA_3D_VIEWER::OnRenderEngineSelection ( wxCommandEvent &  event)
private

Definition at line 340 of file eda_3d_viewer.cpp.

341 {
342  const RENDER_ENGINE old_engine = m_boardAdapter.RenderEngineGet();
343 
344  if( old_engine == RENDER_ENGINE::OPENGL_LEGACY )
346  else
348 
349  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnRenderEngineSelection type %s ",
351  "OpenGL Legacy" );
352 
353  if( old_engine != m_boardAdapter.RenderEngineGet() )
355 }
void RenderEngineSet(RENDER_ENGINE aRenderEngine) noexcept
RenderEngineSet.
BOARD_ADAPTER m_boardAdapter
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
RENDER_ENGINE
Render engine mode.
Definition: 3d_enums.h:94

References m_boardAdapter, m_logTrace, OPENGL_LEGACY, RAYTRACING, RenderEngineChanged(), BOARD_ADAPTER::RenderEngineGet(), and BOARD_ADAPTER::RenderEngineSet().

◆ OnSetFocus()

void EDA_3D_VIEWER::OnSetFocus ( wxFocusEvent &  event)
private

Definition at line 386 of file eda_3d_viewer.cpp.

387 {
388  // Activates again the focus of the canvas so it will catch mouse and key events
389  if( m_canvas )
390  m_canvas->SetFocus();
391 
392  event.Skip();
393 }
EDA_3D_CANVAS * m_canvas

References m_canvas.

◆ OnUpdateUIEngine()

void EDA_3D_VIEWER::OnUpdateUIEngine ( wxUpdateUIEvent &  aEvent)
private

Definition at line 877 of file eda_3d_viewer.cpp.

878 {
880 }
BOARD_ADAPTER m_boardAdapter
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.

References m_boardAdapter, OPENGL_LEGACY, and BOARD_ADAPTER::RenderEngineGet().

◆ OnUpdateUIMaterial()

void EDA_3D_VIEWER::OnUpdateUIMaterial ( wxUpdateUIEvent &  aEvent)
private

Definition at line 883 of file eda_3d_viewer.cpp.

884 {
885  // Set the state of toggle menus according to the current display options
886  switch( aEvent.GetId() )
887  {
890  break;
891 
894  break;
895 
898  break;
899 
900  default:
901  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::OnUpdateUIMaterial()" );
902  }
903 }
Use a gray shading based on diffuse material.
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
BOARD_ADAPTER m_boardAdapter
Use all material properties from model file.
MATERIAL_MODE MaterialModeGet() const noexcept
MaterialModeGet.

References CAD_MODE, DIFFUSE_ONLY, ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE, ID_MENU3D_FL_RENDER_MATERIAL_MODE_DIFFUSE_ONLY, ID_MENU3D_FL_RENDER_MATERIAL_MODE_NORMAL, m_boardAdapter, BOARD_ADAPTER::MaterialModeGet(), and NORMAL.

◆ OpenProjectFiles()

virtual bool KIWAY_PLAYER::OpenProjectFiles ( const std::vector< wxString > &  aFileList,
int  aCtl = 0 
)
inlinevirtualinherited

Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList.

This is generalized in the direction of worst case. In a typical case aFileList will only hold a single file, like "myboard.kicad_pcb", because any KIWAY_PLAYER is only in one KIWAY and the KIWAY owns the PROJECT. Therefore opening files from multiple projects into the same KIWAY_PLAYER is precluded.

Each derived class should handle this in a way specific to its needs. No filename prompting is done inside here for any file or project. There should be no need to call this with aFileList which is empty. However, calling it with a single filename which does not exist should indicate to the implementor that a new session is being started and that the given name is the desired name for the data file at time of save.

This function does not support "appending". Use a different function for that. Any prior project data tree should be cleared before loading the new stuff.

Therefore, one of the first things an implementation should do is test for existence of the first file in the list, and if it does not exist, treat it as a new session, possibly with a UI notification to that effect.

After loading the window should update its Title as part of this operation. If the KIWAY_PLAYER needs to, it can load the *.pro file as part of this operation.

If the KIWAY_PLAYER cannot load any of the file(s) in the list, then it should say why through some GUI interface, and return false.

Parameters
aFileListincludes files that this frame should open according to the knowledge in the derived wxFrame. In almost every case, the list will have only a single file in it.
aCtlis a set of bit flags ORed together from the set of KICTL_* #defined above.
Returns
bool - true if all requested files were opened OK, else false.

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, GERBVIEW_FRAME, BM2CMP_FRAME, CVPCB_MAINFRAME, and PL_EDITOR_FRAME.

Definition at line 118 of file kiway_player.h.

119  {
120  // overload me for your wxFrame type.
121 
122  // Any overload should probably do this also:
123  // Prj().MaybeLoadProjectSettings();
124 
125  // Then update the window title.
126 
127  return false;
128  }

Referenced by BACK_ANNOTATE::FetchNetlistFromPCB(), PGM_TEST_FRAME::MacOpenFile(), PGM_SINGLE_TOP::MacOpenFile(), PGM_MOCK_EESCHEMA_FRAME::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), SCH_EDIT_FRAME::OnUpdatePCB(), PCB_EDIT_FRAME::RunEeschema(), and PCB_EDIT_FRAME::TestStandalone().

◆ Parent()

PCB_BASE_FRAME* EDA_3D_VIEWER::Parent ( ) const
inline

Definition at line 76 of file eda_3d_viewer.h.

76 { return (PCB_BASE_FRAME*)GetParent(); }
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

Referenced by CreateMenuBar(), GetBoard(), and takeScreenshot().

◆ ParseArgs()

virtual void KIWAY_PLAYER::ParseArgs ( wxCmdLineParser &  aParser)
inlinevirtualinherited

Handles command-line arguments in a frame-specific way.

The given argument parser has already been initialized with the command line and any options/switches that are handled by the top-level launcher before passing control to the child frame.

Parameters
aParseris the argument parser created by the top-level launcher.

Definition at line 138 of file kiway_player.h.

139  {
140  WXUNUSED( aParser );
141  }

Referenced by PGM_SINGLE_TOP::OnPgmInit().

◆ PopCommandFromRedoList()

PICKED_ITEMS_LIST * EDA_BASE_FRAME::PopCommandFromRedoList ( )
virtualinherited

PopCommandFromRedoList return the last command to undo and remove it from list nothing is deleted.

Definition at line 825 of file eda_base_frame.cpp.

826 {
827  return m_redoList.PopCommand();
828 }
PICKED_ITEMS_LIST * PopCommand()
UNDO_REDO_CONTAINER m_redoList

References EDA_BASE_FRAME::m_redoList, and UNDO_REDO_CONTAINER::PopCommand().

Referenced by LIB_EDIT_FRAME::GetComponentFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), and SCH_EDITOR_CONTROL::Redo().

◆ PopCommandFromUndoList()

PICKED_ITEMS_LIST * EDA_BASE_FRAME::PopCommandFromUndoList ( )
virtualinherited

◆ PopTool()

void TOOLS_HOLDER::PopTool ( const std::string &  actionName)
virtualinherited

Definition at line 61 of file tools_holder.cpp.

62 {
63  // Push/pop events can get out of order (such as when they're generated by the Simulator
64  // frame but not processed until the mouse is back in the Schematic frame), so make sure
65  // we're popping the right stack frame.
66 
67  for( int i = (int) m_toolStack.size() - 1; i >= 0; --i )
68  {
69  if( m_toolStack[ i ] == actionName )
70  {
71  m_toolStack.erase( m_toolStack.begin() + i );
72 
73  // If there's something underneath us, and it's now the top of the stack, then
74  // re-activate it
75  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
76  {
77  std::string back = m_toolStack[ i ];
79 
80  if( action )
81  {
82  // Pop the action as running it will push it back onto the stack
83  m_toolStack.pop_back();
84 
85  TOOL_EVENT evt = action->MakeEvent();
86  evt.SetHasPosition( false );
87  GetToolManager()->PostEvent( evt );
88  }
89  }
90  else
92 
93  return;
94  }
95  }
96 }
virtual void DisplayToolMsg(const wxString &msg)
Definition: tools_holder.h:89
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
TOOL_EVENT.
Definition: tool_event.h:171
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
std::vector< std::string > m_toolStack
Definition: tools_holder.h:52
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:194
TOOL_ACTION.
Definition: tool_action.h:46
TOOL_EVENT MakeEvent() const
Function MakeEvent() Returns the event associated with the action (i.e.
Definition: tool_action.h:107
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:268
static TOOL_ACTION selectionTool
Definition: actions.h:147
void SetHasPosition(bool aHasPosition)
Definition: tool_event.h:261

References TOOLS_HOLDER::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), TOOLS_HOLDER::GetToolManager(), TOOLS_HOLDER::m_toolManager, TOOLS_HOLDER::m_toolStack, TOOL_ACTION::MakeEvent(), TOOL_MANAGER::PostEvent(), ACTIONS::selectionTool, and TOOL_EVENT::SetHasPosition().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ PrintMsg()

void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 562 of file eda_base_frame.cpp.

563 {
564  SetStatusText( text );
565 }

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 35 of file kiway_holder.cpp.

36 {
37  return Kiway().Prj();
38 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:172

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), KICAD_MANAGER_FRAME::CloseProject(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), PCB_EDIT_FRAME::doAutoSave(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), DIALOG_EXPORT_SVG::ExportSVGFile(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SCH_EDIT_FRAME::KiwayMailIn(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectSettings(), PCB_EDIT_FRAME::LoadProjectSettings(), DRC::LoadRules(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), PCB_BASE_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_BOM::OnRunGenerator(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), PROPERTIES_FRAME::onScintillaCharAdded(), DIALOG_LABEL_EDITOR::onScintillaCharAdded(), DIALOG_SCH_EDIT_ONE_FIELD::onScintillaCharAdded(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_TOOLS::PasteFootprint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_PLOT::Plot(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), SCH_EDIT_FRAME::PrintPage(), EDA_DRAW_FRAME::PrintWorkSheet(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), SCH_EDIT_TOOL::RefreshSymbolFromLibrary(), ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), LIB_EDIT_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), GERBVIEW_FRAME::SetPageSettings(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), takeScreenshot(), PANEL_SETUP_RULES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary(), DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ Process_Special_Functions()

void EDA_3D_VIEWER::Process_Special_Functions ( wxCommandEvent &  event)
private

Definition at line 236 of file eda_3d_viewer.cpp.

237 {
238  int id = event.GetId();
239  bool isChecked = event.IsChecked();
240 
241  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Process_Special_Functions id %d isChecked %d",
242  id, isChecked );
243 
244  if( m_canvas == NULL )
245  return;
246 
247  switch( id )
248  {
249  case ID_RELOAD3D_BOARD:
250  NewDisplay( true );
251  break;
252 
256  takeScreenshot( event );
257  return;
258 
260  if( Set3DColorFromUser( m_boardAdapter.m_BgColorBot, _( "Background Color, Bottom" ),
261  nullptr ) )
262  {
265  else
266  NewDisplay( true );
267  }
268  return;
269 
271  if( Set3DColorFromUser( m_boardAdapter.m_BgColorTop, _( "Background Color, Top" ), nullptr ) )
272  {
275  else
276  NewDisplay( true );
277  }
278  return;
279 
282  return;
283 
286  return;
287 
290  return;
291 
294  break;
295 
298  break;
299 
302  NewDisplay( true );
303  break;
304 
307  NewDisplay( true );
308  return;
309 
312  NewDisplay( true );
313  return;
314 
317  NewDisplay( true );
318  return;
319 
321  {
322  auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
323  cfg->ResetToDefaults();
324  LoadSettings( cfg );
325 
326  // Tell canvas that we (may have) changed the render engine
328 
329  NewDisplay( true );
330  }
331  return;
332 
333  default:
334  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::Process_Special_Functions()" );
335  return;
336  }
337 }
Use a gray shading based on diffuse material.
void ResetToDefaults()
Resets all parameters to default values.
bool Set3DCopperColorFromUser()
Set the copper color from a set of colors.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
bool Set3DSolderMaskColorFromUser()
Set the solder mask color from a set of colors.
void SynchroniseColoursWithBoard()
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
SFVEC3D m_BgColorTop
background top color
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
BOARD_ADAPTER m_boardAdapter
#define NULL
Use all material properties from model file.
bool Set3DSilkScreenColorFromUser()
Set the silkscreen color from a set of colors.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
bool Set3DSolderPasteColorFromUser()
Set the solder mask color from a set of colors.
SFVEC3D m_BgColorBot
background bottom color
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
#define _(s)
Definition: 3d_actions.cpp:33
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool Set3DBoardBodyColorFromUser()
Set the copper color from a set of colors.
void MaterialModeSet(MATERIAL_MODE aMaterialMode) noexcept
MaterialModeSet.
void takeScreenshot(wxCommandEvent &event)
Create a Screenshot of the current 3D view.

References _, CAD_MODE, DIFFUSE_ONLY, ID_MENU3D_BGCOLOR_BOTTOM, ID_MENU3D_BGCOLOR_TOP, ID_MENU3D_COPPER_COLOR, ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE, ID_MENU3D_FL_RENDER_MATERIAL_MODE_DIFFUSE_ONLY, ID_MENU3D_FL_RENDER_MATERIAL_MODE_NORMAL, ID_MENU3D_PCB_BODY_COLOR, ID_MENU3D_RESET_DEFAULTS, ID_MENU3D_SILKSCREEN_COLOR, ID_MENU3D_SOLDERMASK_COLOR, ID_MENU3D_SOLDERPASTE_COLOR, ID_MENU3D_STACKUP_COLORS, ID_MENU_SCREENCOPY_JPEG, ID_MENU_SCREENCOPY_PNG, ID_RELOAD3D_BOARD, ID_TOOL_SCREENCOPY_TOCLIBBOARD, LoadSettings(), BOARD_ADAPTER::m_BgColorBot, BOARD_ADAPTER::m_BgColorTop, m_boardAdapter, m_canvas, m_logTrace, BOARD_ADAPTER::MaterialModeSet(), NewDisplay(), NORMAL, NULL, OPENGL_LEGACY, Pgm(), RenderEngineChanged(), BOARD_ADAPTER::RenderEngineGet(), EDA_3D_CANVAS::Request_refresh(), JSON_SETTINGS::ResetToDefaults(), Set3DBoardBodyColorFromUser(), Set3DColorFromUser(), Set3DCopperColorFromUser(), Set3DSilkScreenColorFromUser(), Set3DSolderMaskColorFromUser(), Set3DSolderPasteColorFromUser(), SynchroniseColoursWithBoard(), and takeScreenshot().

◆ ProcessEvent()

bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Override the default process event handler to implement the auto save feature.

Warning
If you override this function in a derived class, make sure you call down to this or the auto save feature will be disabled.

Definition at line 204 of file eda_base_frame.cpp.

205 {
206 #ifdef __WXMAC__
207  // Apple in its infinite wisdom will raise a disabled window before even passing
208  // us the event, so we have no way to stop it. Instead, we have to catch an
209  // improperly ordered disabled window and quasi-modal dialog here and reorder
210  // them.
211  if( !IsEnabled() && IsActive() )
212  {
213  wxWindow* dlg = findQuasiModalDialog();
214  if( dlg )
215  dlg->Raise();
216  }
217 #endif
218 
219  if( !wxFrame::ProcessEvent( aEvent ) )
220  return false;
221 
222  if( IsShown() && m_hasAutoSave && IsActive() &&
224  {
225  if( !m_autoSaveState )
226  {
227  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
228  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
229  m_autoSaveState = true;
230  }
231  else if( m_autoSaveTimer->IsRunning() )
232  {
233  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
234  m_autoSaveTimer->Stop();
235  m_autoSaveState = false;
236  }
237  }
238 
239  return true;
240 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
virtual bool isAutoSaveRequired() const
Return the auto save status of the application.
wxTimer * m_autoSaveTimer
wxWindow * findQuasiModalDialog()

References EDA_BASE_FRAME::findQuasiModalDialog(), EDA_BASE_FRAME::isAutoSaveRequired(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, EDA_BASE_FRAME::m_autoSaveTimer, EDA_BASE_FRAME::m_hasAutoSave, and traceAutoSave.

Referenced by COMMON_TOOLS::GridProperties(), LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), and LIB_VIEW_FRAME::ReCreateListCmp().

◆ ProjectChanged()

virtual void EDA_BASE_FRAME::ProjectChanged ( )
inlinevirtualinherited

Notification event that the project has changed.

Reimplemented in PCB_EDIT_FRAME.

Definition at line 502 of file eda_base_frame.h.

502 {}

Referenced by KIWAY::ProjectChanged().

◆ PushCommandToRedoList()

void EDA_BASE_FRAME::PushCommandToRedoList ( PICKED_ITEMS_LIST aItem)
virtualinherited

Function PushCommandToRedoList add a command to redo in redo list delete the very old commands when the max count of redo commands is reached ( using ClearUndoORRedoList)

Definition at line 804 of file eda_base_frame.cpp.

805 {
806  m_redoList.PushCommand( aNewitem );
807 
808  // Delete the extra items, if count max reached
809  if( m_UndoRedoCountMax > 0 )
810  {
811  int extraitems = GetRedoCommandCount() - m_UndoRedoCountMax;
812 
813  if( extraitems > 0 )
814  ClearUndoORRedoList( REDO_LIST, extraitems );
815  }
816 }
int GetRedoCommandCount() const
virtual void ClearUndoORRedoList(UNDO_REDO_LIST aList, int aItemCount=-1)
void PushCommand(PICKED_ITEMS_LIST *aCommand)
UNDO_REDO_CONTAINER m_redoList

References EDA_BASE_FRAME::ClearUndoORRedoList(), EDA_BASE_FRAME::GetRedoCommandCount(), EDA_BASE_FRAME::m_redoList, EDA_BASE_FRAME::m_UndoRedoCountMax, UNDO_REDO_CONTAINER::PushCommand(), and EDA_BASE_FRAME::REDO_LIST.

Referenced by LIB_EDIT_FRAME::GetComponentFromUndoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), and SCH_EDITOR_CONTROL::Undo().

◆ PushCommandToUndoList()

void EDA_BASE_FRAME::PushCommandToUndoList ( PICKED_ITEMS_LIST aItem)
virtualinherited

Function PushCommandToUndoList add a command to undo in undo list delete the very old commands when the max count of undo commands is reached ( using ClearUndoORRedoList)

Definition at line 789 of file eda_base_frame.cpp.

790 {
791  m_undoList.PushCommand( aNewitem );
792 
793  // Delete the extra items, if count max reached
794  if( m_UndoRedoCountMax > 0 )
795  {
796  int extraitems = GetUndoCommandCount() - m_UndoRedoCountMax;
797 
798  if( extraitems > 0 )
799  ClearUndoORRedoList( UNDO_LIST, extraitems );
800  }
801 }
UNDO_REDO_CONTAINER m_undoList
int GetUndoCommandCount() const
virtual void ClearUndoORRedoList(UNDO_REDO_LIST aList, int aItemCount=-1)
void PushCommand(PICKED_ITEMS_LIST *aCommand)

References EDA_BASE_FRAME::ClearUndoORRedoList(), EDA_BASE_FRAME::GetUndoCommandCount(), EDA_BASE_FRAME::m_undoList, EDA_BASE_FRAME::m_UndoRedoCountMax, UNDO_REDO_CONTAINER::PushCommand(), and EDA_BASE_FRAME::UNDO_LIST.

Referenced by LIB_EDIT_FRAME::GetComponentFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), SCH_EDITOR_CONTROL::Redo(), PL_EDITOR_FRAME::SaveCopyInUndoList(), LIB_EDIT_FRAME::SaveCopyInUndoList(), and SCH_EDIT_FRAME::SaveCopyInUndoList().

◆ PushTool()

void TOOLS_HOLDER::PushTool ( const std::string &  actionName)
virtualinherited

NB: the definition of "tool" is different at the user level.

The implementation uses a single TOOL_BASE derived class to implement several user "tools", such as rectangle and circle, or wire and bus. So each user-level tool is actually a TOOL_ACTION.

Definition at line 44 of file tools_holder.cpp.

45 {
46  m_toolStack.push_back( actionName );
47 
48  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
49  if( m_toolStack.size() > 3 )
50  m_toolStack.erase( m_toolStack.begin() );
51 
52  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
53 
54  if( action )
55  DisplayToolMsg( action->GetLabel() );
56  else
57  DisplayToolMsg( actionName );
58 }
virtual void DisplayToolMsg(const wxString &msg)
Definition: tools_holder.h:89
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
wxString GetLabel() const
Definition: tool_action.cpp:69
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
std::vector< std::string > m_toolStack
Definition: tools_holder.h:52
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:194
TOOL_ACTION.
Definition: tool_action.h:46

References TOOLS_HOLDER::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), TOOL_ACTION::GetLabel(), TOOLS_HOLDER::m_toolManager, and TOOLS_HOLDER::m_toolStack.

Referenced by PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ ReCreateMainToolbar()

void EDA_3D_VIEWER::ReCreateMainToolbar ( )
private

Definition at line 39 of file 3d_toolbar.cpp.

40 {
41  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ReCreateMainToolbar" );
42 
43  wxWindowUpdateLocker dummy( this );
44 
45  if( m_mainToolBar )
47  else
48  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
49  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
50 
51  // Set up toolbar
52  m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
53  KiScaledBitmap( import3d_xpm, this ), _( "Reload board" ) );
54 
56  m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
57  KiScaledBitmap( copy_xpm, this ),
58  _( "Copy 3D image to clipboard" ) );
59 
61  m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
63  _( "Set display options, and some layers visibility" ) );
64 
66  m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
68  _( "Render current view using Raytracing" ), wxITEM_CHECK );
69 
75 
79 
83 
87 
90 
96 
99 
100  m_mainToolBar->Realize();
101 }
static TOOL_ACTION rotateXCW
Definition: 3d_actions.h:47
ACTION_TOOLBAR.
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
static const bool TOGGLE
void AddScaledSeparator(wxWindow *aWindow)
Add a separator that introduces space on either side to not squash the tools when scaled.
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false)
Function Add() Adds a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
const BITMAP_OPAQUE import3d_xpm[1]
Definition: import3d.cpp:61
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, wxWindow *aWindow)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:116
static TOOL_ACTION zoomOutCenter
Definition: actions.h:91
static TOOL_ACTION flipView
Definition: 3d_actions.h:59
const BITMAP_OPAQUE read_setup_xpm[1]
Definition: read_setup.cpp:99
static TOOL_ACTION moveLeft
Definition: 3d_actions.h:53
static TOOL_ACTION rotateYCW
Definition: 3d_actions.h:49
static TOOL_ACTION rotateXCCW
Definition: 3d_actions.h:48
const BITMAP_OPAQUE copy_xpm[1]
Definition: copy.cpp:67
static TOOL_ACTION rotateZCCW
Definition: 3d_actions.h:52
static TOOL_ACTION rotateZCW
Definition: 3d_actions.h:51
static TOOL_ACTION moveDown
Definition: 3d_actions.h:56
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
static TOOL_ACTION rotateYCCW
Definition: 3d_actions.h:50
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
static TOOL_ACTION moveUp
Definition: 3d_actions.h:55
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
ACTION_TOOLBAR * m_mainToolBar
const BITMAP_OPAQUE render_mode_xpm[1]
Definition: render_mode.cpp:92
static TOOL_ACTION toggleOrtho
Definition: 3d_actions.h:60
static TOOL_ACTION moveRight
Definition: 3d_actions.h:54
void ClearToolbar()
Clear the toolbar and remove all associated menus.

References _, ACTION_TOOLBAR::Add(), ACTION_TOOLBAR::AddScaledSeparator(), ACTION_TOOLBAR::ClearToolbar(), copy_xpm, dummy(), EDA_3D_ACTIONS::flipView, ID_H_TOOLBAR, ID_RELOAD3D_BOARD, ID_RENDER_CURRENT_VIEW, ID_TOOL_SCREENCOPY_TOCLIBBOARD, ID_TOOL_SET_VISIBLE_ITEMS, import3d_xpm, EDA_BASE_FRAME::KICAD_AUI_TB_STYLE, KiScaledBitmap(), m_logTrace, m_mainToolBar, EDA_3D_ACTIONS::moveDown, EDA_3D_ACTIONS::moveLeft, EDA_3D_ACTIONS::moveRight, EDA_3D_ACTIONS::moveUp, read_setup_xpm, render_mode_xpm, EDA_3D_ACTIONS::rotateXCCW, EDA_3D_ACTIONS::rotateXCW, EDA_3D_ACTIONS::rotateYCCW, EDA_3D_ACTIONS::rotateYCW, EDA_3D_ACTIONS::rotateZCCW, EDA_3D_ACTIONS::rotateZCW, ACTION_TOOLBAR::TOGGLE, EDA_3D_ACTIONS::toggleOrtho, ACTIONS::zoomFitScreen, ACTIONS::zoomInCenter, ACTIONS::zoomOutCenter, and ACTIONS::zoomRedraw.

Referenced by CommonSettingsChanged().

◆ ReCreateMenuBar()

◆ RefreshCanvas()

virtual void TOOLS_HOLDER::RefreshCanvas ( )
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 119 of file tools_holder.h.

119 { }

Referenced by TOOL_MANAGER::ProcessEvent().

◆ ReloadRequest()

void EDA_3D_VIEWER::ReloadRequest ( )

Request reloading the 3D view.

However the request will be executed only when the 3D canvas is refreshed. It allows one to prepare changes and request for 3D rebuild only when all changes are committed. This is made because the 3D rebuild can take a long time, and this rebuild cannot always made after each change, for calculation time reason.

Definition at line 190 of file eda_3d_viewer.cpp.

191 {
192  // This will schedule a request to load later
193  if( m_canvas )
194  m_canvas->ReloadRequest( GetBoard(), Prj().Get3DCacheManager() );
195 }
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
EDA_3D_CANVAS * m_canvas
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
BOARD * GetBoard()
Definition: eda_3d_viewer.h:78

References GetBoard(), m_canvas, KIWAY_HOLDER::Prj(), and EDA_3D_CANVAS::ReloadRequest().

Referenced by NewDisplay().

◆ RemoveShutdownBlockReason()

void EDA_BASE_FRAME::RemoveShutdownBlockReason ( )
inherited

Removes any shutdown block reason set.

Definition at line 177 of file eda_base_frame.cpp.

178 {
179 #if defined( _WIN32 )
180  // Windows: Destroys any block reason that may have existed
181  ShutdownBlockReasonDestroy( GetHandle() );
182 #endif
183 }

Referenced by EDA_BASE_FRAME::~EDA_BASE_FRAME().

◆ RenderEngineChanged()

void EDA_3D_VIEWER::RenderEngineChanged ( )
private

RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.

Definition at line 736 of file eda_3d_viewer.cpp.

737 {
738  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::RenderEngineChanged()" );
739 
740  if( m_canvas )
742 }
EDA_3D_CANVAS * m_canvas
void RenderEngineChanged()
RenderEngineChanged - Notify that the render engine was changed.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References m_canvas, m_logTrace, and EDA_3D_CANVAS::RenderEngineChanged().

Referenced by OnRenderEngineSelection(), and Process_Special_Functions().

◆ SaveProjectSettings()

virtual void EDA_BASE_FRAME::SaveProjectSettings ( )
inlinevirtualinherited

Save changes to the project settings to the project (.pro) file.

The method is virtual so you can override it to call the suitable save method. The base method do nothing

Parameters
aAskForSave= true to open a dialog before saving the settings

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 361 of file eda_base_frame.h.

361 {};

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

◆ SaveSettings()

void EDA_3D_VIEWER::SaveSettings ( APP_SETTINGS_BASE aCfg)
overrideprivatevirtual

Saves common frame parameters to a configuration data file.

Don't forget to call the base class's SaveSettings() from your derived SaveSettings() otherwise the frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 487 of file eda_3d_viewer.cpp.

488 {
489  auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
490 
492 
493  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings" );
494 
495  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
496 
497  auto save_color = [colors] ( SFVEC3D& aSource, LAYER_3D_ID aTarget )
498  {
499  colors->SetColor( aTarget, COLOR4D( aSource.r, aSource.g, aSource.b, 1.0 ) );
500  };
501 
510 
512  "EDA_3D_VIEWER::SaveSettings render setting Ray Trace" :
513  "EDA_3D_VIEWER::SaveSettings render setting OpenGL" );
514 
515  if( cfg )
516  {
517 #define TRANSFER_SETTING( field, flag ) cfg->m_Render.field = m_boardAdapter.GetFlag( flag )
518 
519  cfg->m_Render.engine = static_cast<int>( m_boardAdapter.RenderEngineGet() );
520  cfg->m_Render.grid_type = static_cast<int>( m_boardAdapter.GridGet() );
521  cfg->m_Render.material_mode = static_cast<int>( m_boardAdapter.MaterialModeGet() );
522  cfg->m_Render.opengl_AA_mode = static_cast<int>( m_boardAdapter.AntiAliasingGet() );
523 
524  cfg->m_Camera.animation_enabled = m_canvas->AnimationEnabledGet();
525  cfg->m_Camera.moving_speed_multiplier = m_canvas->MovingSpeedMultiplierGet();
526 
527  if( EDA_3D_CONTROLLER* ctrlTool = GetToolManager()->GetTool<EDA_3D_CONTROLLER>() )
528  cfg->m_Camera.rotation_increment = ctrlTool->GetRotationIncrement();
529 
530  TRANSFER_SETTING( opengl_AA_disableOnMove, FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE );
531  TRANSFER_SETTING( opengl_copper_thickness, FL_RENDER_OPENGL_COPPER_THICKNESS );
532  TRANSFER_SETTING( opengl_show_model_bbox, FL_RENDER_OPENGL_SHOW_MODEL_BBOX );
533  TRANSFER_SETTING( opengl_thickness_disableOnMove, FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE );
534  TRANSFER_SETTING( opengl_vias_disableOnMove, FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE );
535  TRANSFER_SETTING( opengl_holes_disableOnMove, FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE );
536 
537  TRANSFER_SETTING( raytrace_anti_aliasing, FL_RENDER_RAYTRACING_ANTI_ALIASING );
538  TRANSFER_SETTING( raytrace_backfloor, FL_RENDER_RAYTRACING_BACKFLOOR );
539  TRANSFER_SETTING( raytrace_post_processing, FL_RENDER_RAYTRACING_POST_PROCESSING );
540  TRANSFER_SETTING( raytrace_procedural_textures, FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES );
541  TRANSFER_SETTING( raytrace_reflections, FL_RENDER_RAYTRACING_REFLECTIONS );
542  TRANSFER_SETTING( raytrace_refractions, FL_RENDER_RAYTRACING_REFRACTIONS );
543  TRANSFER_SETTING( raytrace_shadows, FL_RENDER_RAYTRACING_SHADOWS );
544 
546  TRANSFER_SETTING( show_adhesive, FL_ADHESIVE );
547  TRANSFER_SETTING( show_axis, FL_AXIS );
548  TRANSFER_SETTING( show_board_body, FL_SHOW_BOARD_BODY );
549  TRANSFER_SETTING( clip_silk_on_via_annulus, FL_CLIP_SILK_ON_VIA_ANNULUS );
550  TRANSFER_SETTING( show_comments, FL_COMMENTS );
551  TRANSFER_SETTING( show_eco, FL_ECO );
552  TRANSFER_SETTING( show_footprints_insert, FL_MODULE_ATTRIBUTES_NORMAL_INSERT );
553  TRANSFER_SETTING( show_footprints_normal, FL_MODULE_ATTRIBUTES_NORMAL );
554  TRANSFER_SETTING( show_footprints_virtual, FL_MODULE_ATTRIBUTES_VIRTUAL );
555  TRANSFER_SETTING( show_silkscreen, FL_SILKSCREEN );
556  TRANSFER_SETTING( show_soldermask, FL_SOLDERMASK );
557  TRANSFER_SETTING( show_solderpaste, FL_SOLDERPASTE );
558  TRANSFER_SETTING( show_zones, FL_ZONE );
559  TRANSFER_SETTING( subtract_mask_from_silk, FL_SUBTRACT_MASK_FROM_SILK );
560 
561 #undef TRANSFER_SETTING
562  }
563 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Saves common frame parameters to a configuration data file.
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
LAYER_3D_ID
3D Viewer virtual layers for color settings
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
EDA_3D_CANVAS * m_canvas
SFVEC3D m_BgColorTop
background top color
BOARD_ADAPTER m_boardAdapter
#define TRANSFER_SETTING(flag, field)
EDA_3D_CONTROLLER.
Definition: 3d_controller.h:39
bool AnimationEnabledGet() const
AnimationEnabledGet - Returns whether camera animation is enabled when switching to a pre-defined vie...
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
SFVEC3D m_BgColorBot
background bottom color
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
int MovingSpeedMultiplierGet() const
MovingSpeedMultiplierGet - Return the current camera animation moving speed multiplier option.
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC3D m_CopperColor
in realistic mode: copper color
Color settings are a bit different than most of the settings objects in that there can be more than o...
ANTIALIASING_MODE AntiAliasingGet() const
GridGet - get the current antialiasing mode value.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
GRID3D_TYPE GridGet() const noexcept
GridGet - get the current grid.
MATERIAL_MODE MaterialModeGet() const noexcept
MaterialModeGet.
static VRML_COLOR colors[VRML_COLOR_LAST]
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References EDA_3D_CANVAS::AnimationEnabledGet(), BOARD_ADAPTER::AntiAliasingGet(), colors, FL_ADHESIVE, FL_AXIS, FL_CLIP_SILK_ON_VIA_ANNULUS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, FL_RENDER_OPENGL_COPPER_THICKNESS, FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, FL_RENDER_OPENGL_SHOW_MODEL_BBOX, FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, FL_RENDER_RAYTRACING_ANTI_ALIASING, FL_RENDER_RAYTRACING_BACKFLOOR, FL_RENDER_RAYTRACING_POST_PROCESSING, FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, FL_RENDER_RAYTRACING_REFLECTIONS, FL_RENDER_RAYTRACING_REFRACTIONS, FL_RENDER_RAYTRACING_SHADOWS, FL_SHOW_BOARD_BODY, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE, FL_SUBTRACT_MASK_FROM_SILK, FL_USE_REALISTIC_MODE, FL_ZONE, TOOLS_HOLDER::GetToolManager(), BOARD_ADAPTER::GridGet(), LAYER_3D_BACKGROUND_BOTTOM, LAYER_3D_BACKGROUND_TOP, LAYER_3D_BOARD, LAYER_3D_COPPER, LAYER_3D_SILKSCREEN_BOTTOM, LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SOLDERMASK, LAYER_3D_SOLDERPASTE, BOARD_ADAPTER::m_BgColorBot, BOARD_ADAPTER::m_BgColorTop, m_boardAdapter, BOARD_ADAPTER::m_BoardBodyColor, m_canvas, BOARD_ADAPTER::m_CopperColor, m_logTrace, BOARD_ADAPTER::m_SilkScreenColorBot, BOARD_ADAPTER::m_SilkScreenColorTop, BOARD_ADAPTER::m_SolderMaskColorTop, BOARD_ADAPTER::m_SolderPasteColor, BOARD_ADAPTER::MaterialModeGet(), EDA_3D_CANVAS::MovingSpeedMultiplierGet(), Pgm(), RAYTRACING, BOARD_ADAPTER::RenderEngineGet(), EDA_BASE_FRAME::SaveSettings(), and TRANSFER_SETTING.

◆ SaveWindowSettings()

void EDA_BASE_FRAME::SaveWindowSettings ( WINDOW_SETTINGS aCfg)
inherited

Saves window settings to the given settings object Normally called by SaveSettings unless the window in question is a child window that stores its settings somewhere other than APP_SETTINGS_BASE::m_Window.

Definition at line 460 of file eda_base_frame.cpp.

461 {
462  wxString text;
463 
464  if( IsIconized() )
465  return;
466 
467  wxString baseCfgName = ConfigBaseName();
468 
469  // If the window is maximized, we use the saved window size from before it was maximized
470  if( IsMaximized() )
471  {
474  }
475  else
476  {
478  m_FramePos = GetPosition();
479  }
480 
481  aCfg->pos_x = m_FramePos.x;
482  aCfg->pos_y = m_FramePos.y;
483  aCfg->size_x = m_FrameSize.x;
484  aCfg->size_y = m_FrameSize.y;
485  aCfg->maximized = IsMaximized();
486  aCfg->display = wxDisplay::GetFromWindow( this );
487 
488  wxLogTrace( traceDisplayLocation, "Saving window maximized: %s", IsMaximized() ? "true" : "false" );
489  wxLogTrace( traceDisplayLocation, "Saving config position (%d, %d) with size (%d, %d)",
491 
492  // TODO(JE) should auto-save in common settings be overwritten by every app?
493  if( m_hasAutoSave )
494  Pgm().GetCommonSettings()->m_System.autosave_interval = m_autoSaveInterval;
495 
496  // Once this is fully implemented, wxAuiManager will be used to maintain
497  // the persistance of the main frame and all it's managed windows and
498  // all of the legacy frame persistence position code can be removed.
499  aCfg->perspective = m_auimgr.SavePerspective().ToStdString();
500 
501  aCfg->mru_path = m_mruPath;
502 }
wxString mru_path
Definition: app_settings.h:71
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
wxString m_mruPath
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxAuiManager m_auimgr
wxSize m_NormalFrameSize
wxString perspective
Definition: app_settings.h:74
wxSize GetWindowSize()
Get the undecorated window size that can be used for restoring the window size.
wxString ConfigBaseName() override
wxPoint m_NormalFramePos
unsigned int display
Definition: app_settings.h:77

References EDA_BASE_FRAME::ConfigBaseName(), WINDOW_SETTINGS::display, EDA_BASE_FRAME::GetWindowSize(), EDA_BASE_FRAME::m_auimgr, EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, EDA_BASE_FRAME::m_hasAutoSave, EDA_BASE_FRAME::m_mruPath, EDA_BASE_FRAME::m_NormalFramePos, EDA_BASE_FRAME::m_NormalFrameSize, WINDOW_SETTINGS::maximized, WINDOW_SETTINGS::mru_path, WINDOW_SETTINGS::perspective, Pgm(), WINDOW_SETTINGS::pos_x, WINDOW_SETTINGS::pos_y, WINDOW_SETTINGS::size_x, WINDOW_SETTINGS::size_y, traceDisplayLocation, wxPoint::x, and wxPoint::y.

Referenced by EDA_BASE_FRAME::SaveSettings().

◆ Set3DBoardBodyColorFromUser()

bool EDA_3D_VIEWER::Set3DBoardBodyColorFromUser ( )

Set the copper color from a set of colors.

Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 836 of file eda_3d_viewer.cpp.

837 {
839 
840  colors.push_back( CUSTOM_COLOR_ITEM( 51/255.0, 43/255.0, 22/255.0, "FR4 natural, dark" ) );
841  colors.push_back( CUSTOM_COLOR_ITEM( 109/255.0, 116/255.0, 75/255.0, "FR4 natural" ) );
842  colors.push_back( CUSTOM_COLOR_ITEM( 78/255.0, 14/255.0, 5/255.0, "brown/red" ) );
843  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 1" ) );
844  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 123/255.0, 54/255.0, "brown 2" ) );
845  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 3" ) );
846  colors.push_back( CUSTOM_COLOR_ITEM( 63/255.0, 126/255.0, 71/255.0, "green 1" ) );
847  colors.push_back( CUSTOM_COLOR_ITEM( 117/255.0, 122/255.0, 90/255.0, "green 2" ) );
848 
849  if( Set3DColorFromUser( m_boardAdapter.m_BoardBodyColor, _( "Board Body Color" ), &colors ) )
850  {
851  NewDisplay( true );
852  return true;
853  }
854 
855  return false;
856 }
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
BOARD_ADAPTER m_boardAdapter
#define _(s)
Definition: 3d_actions.cpp:33
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static VRML_COLOR colors[VRML_COLOR_LAST]

References _, colors, m_boardAdapter, BOARD_ADAPTER::m_BoardBodyColor, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ Set3DColorFromUser()

bool EDA_3D_VIEWER::Set3DColorFromUser ( SFVEC3D aColor,
const wxString &  aTitle,
CUSTOM_COLORS_LIST aPredefinedColors 
)

Get a SFVEC3D from a wx colour dialog.

Parameters
aColoris the SFVEC3D to change
aTitleis the title displayed in the colordialog selector
aPredefinedColorsis a reference to a CUSTOM_COLOR_ITEM list which contains a few predefined colors

Definition at line 745 of file eda_3d_viewer.cpp.

747 {
748  KIGFX::COLOR4D newcolor;
749  KIGFX::COLOR4D oldcolor( aColor.r,aColor.g, aColor.b, 1.0 );
750 
751  DIALOG_COLOR_PICKER picker( this, oldcolor, false, aPredefinedColors );
752 
753  if( picker.ShowModal() != wxID_OK )
754  return false;
755 
756  newcolor = picker.GetColor();
757 
758  if( newcolor == oldcolor )
759  return false;
760 
761  aColor.r = newcolor.r;
762  aColor.g = newcolor.g;
763  aColor.b = newcolor.b;
764 
765  return true;
766 }
double g
Green component.
Definition: color4d.h:367
double b
Blue component.
Definition: color4d.h:368
double r
Red component.
Definition: color4d.h:366
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, DIALOG_COLOR_PICKER::GetColor(), and KIGFX::COLOR4D::r.

Referenced by Process_Special_Functions(), Set3DBoardBodyColorFromUser(), Set3DCopperColorFromUser(), Set3DSilkScreenColorFromUser(), Set3DSolderMaskColorFromUser(), and Set3DSolderPasteColorFromUser().

◆ Set3DCopperColorFromUser()

bool EDA_3D_VIEWER::Set3DCopperColorFromUser ( )

Set the copper color from a set of colors.

Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 817 of file eda_3d_viewer.cpp.

818 {
820 
821  colors.push_back( CUSTOM_COLOR_ITEM( 184/255.0, 115/255.0, 50/255.0, "Copper" ) );
822  colors.push_back( CUSTOM_COLOR_ITEM( 178/255.0, 156/255.0, 0.0, "Gold" ) );
823  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
824  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 160/255.0, 160/255.0, "Tin" ) );
825 
826  if( Set3DColorFromUser( m_boardAdapter.m_CopperColor, _( "Copper Color" ), &colors ) )
827  {
828  NewDisplay( true );
829  return true;
830  }
831 
832  return false;
833 }
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
BOARD_ADAPTER m_boardAdapter
#define _(s)
Definition: 3d_actions.cpp:33
SFVEC3D m_CopperColor
in realistic mode: copper color
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static VRML_COLOR colors[VRML_COLOR_LAST]

References _, colors, m_boardAdapter, BOARD_ADAPTER::m_CopperColor, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ Set3DSilkScreenColorFromUser()

bool EDA_3D_VIEWER::Set3DSilkScreenColorFromUser ( )

Set the silkscreen color from a set of colors.

Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 769 of file eda_3d_viewer.cpp.

770 {
772 
773  colors.push_back( CUSTOM_COLOR_ITEM( 241.0/255.0, 241.0/255.0, 241.0/255.0, "White" ) );
774  colors.push_back( CUSTOM_COLOR_ITEM( 4.0/255.0, 18.0/255.0, 21.0/255.0, "Dark" ) );
775 
776  if( Set3DColorFromUser( m_boardAdapter.m_SilkScreenColorTop, _( "Silkscreen Color" ), &colors ) )
777  {
779  NewDisplay( true );
780  return true;
781  }
782 
783  return false;
784 }
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
BOARD_ADAPTER m_boardAdapter
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
#define _(s)
Definition: 3d_actions.cpp:33
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static VRML_COLOR colors[VRML_COLOR_LAST]

References _, colors, m_boardAdapter, BOARD_ADAPTER::m_SilkScreenColorBot, BOARD_ADAPTER::m_SilkScreenColorTop, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ Set3DSolderMaskColorFromUser()

bool EDA_3D_VIEWER::Set3DSolderMaskColorFromUser ( )

Set the solder mask color from a set of colors.

Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 787 of file eda_3d_viewer.cpp.

788 {
790 
791  colors.push_back( CUSTOM_COLOR_ITEM( 20/255.0, 51/255.0, 36/255.0, "Green" ) );
792  colors.push_back( CUSTOM_COLOR_ITEM( 91/255.0, 168/255.0, 12/255.0, "Light Green" ) );
793  colors.push_back( CUSTOM_COLOR_ITEM( 13/255.0, 104/255.0, 11/255.0, "Saturated Green" ) );
794  colors.push_back( CUSTOM_COLOR_ITEM( 181/255.0, 19/255.0, 21/255.0, "Red" ) );
795  colors.push_back( CUSTOM_COLOR_ITEM( 239/255.0, 53/255.0, 41/255.0, "Red Light Orange" ) );
796  colors.push_back( CUSTOM_COLOR_ITEM( 210/255.0, 40/255.0, 14/255.0, "Red 2" ) );
797  colors.push_back( CUSTOM_COLOR_ITEM( 2/255.0, 59/255.0, 162/255.0, "Blue" ) );
798  colors.push_back( CUSTOM_COLOR_ITEM( 54/255.0, 79/255.0, 116/255.0, "Light blue 1" ) );
799  colors.push_back( CUSTOM_COLOR_ITEM( 61/255.0, 85/255.0, 130/255.0, "Light blue 2" ) );
800  colors.push_back( CUSTOM_COLOR_ITEM( 21/255.0, 70/255.0, 80/255.0, "Green blue (dark)" ) );
801  colors.push_back( CUSTOM_COLOR_ITEM( 11/255.0, 11/255.0, 11/255.0, "Black" ) );
802  colors.push_back( CUSTOM_COLOR_ITEM( 245/255.0, 245/255.0, 245/255.0, "White" ) );
803  colors.push_back( CUSTOM_COLOR_ITEM( 119/255.0, 31/255.0, 91/255.0, "Purple" ) );
804  colors.push_back( CUSTOM_COLOR_ITEM( 32/255.0, 2/255.0, 53/255.0, "Purple Dark" ) );
805 
806  if( Set3DColorFromUser( m_boardAdapter.m_SolderMaskColorTop, _( "Solder Mask Color" ), &colors ) )
807  {
809  NewDisplay( true );
810  return true;
811  }
812 
813  return false;
814 }
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
BOARD_ADAPTER m_boardAdapter
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
#define _(s)
Definition: 3d_actions.cpp:33
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static VRML_COLOR colors[VRML_COLOR_LAST]

References _, colors, m_boardAdapter, BOARD_ADAPTER::m_SolderMaskColorBot, BOARD_ADAPTER::m_SolderMaskColorTop, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ Set3DSolderPasteColorFromUser()

bool EDA_3D_VIEWER::Set3DSolderPasteColorFromUser ( )

Set the solder mask color from a set of colors.

Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 859 of file eda_3d_viewer.cpp.

860 {
862 
863  colors.push_back( CUSTOM_COLOR_ITEM( 128/255.0, 128/255.0, 128/255.0, "grey" ) );
864  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
865  colors.push_back( CUSTOM_COLOR_ITEM( 90/255.0, 90/255.0, 90/255.0, "grey 2" ) );
866 
867  if( Set3DColorFromUser( m_boardAdapter.m_SolderPasteColor, _( "Solder Paste Color" ), &colors ) )
868  {
869  NewDisplay( true );
870  return true;
871  }
872 
873  return false;
874 }
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
BOARD_ADAPTER m_boardAdapter
#define _(s)
Definition: 3d_actions.cpp:33
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static VRML_COLOR colors[VRML_COLOR_LAST]

References _, colors, m_boardAdapter, BOARD_ADAPTER::m_SolderPasteColor, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ SetAutoSaveInterval()

void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 243 of file eda_base_frame.cpp.

244 {
245  m_autoSaveInterval = aInterval;
246 
247  if( m_autoSaveTimer->IsRunning() )
248  {
249  if( m_autoSaveInterval > 0 )
250  {
251  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
252  }
253  else
254  {
255  m_autoSaveTimer->Stop();
256  m_autoSaveState = false;
257  }
258  }
259 }
wxTimer * m_autoSaveTimer

References EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 42 of file kiway_holder.cpp.

43 {
44 #if defined(DEBUG)
45  // offer a trap point for debugging most any window
46  wxASSERT( aDest );
47  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
48  {
49  int breakhere=1;
50  (void) breakhere;
51  }
52 #endif
53 
54  (void) aDest;
55 
56  m_kiway = aKiway;
57 }
KIWAY * m_kiway
Definition: kiway_holder.h:81
const char * name
Definition: DXF_plotter.cpp:60

References KIWAY_HOLDER::m_kiway, and name.

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), PCB::IFACE::CreateWindow(), InvokePcbLibTableEditor(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetModal()

void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineinherited

Definition at line 177 of file kiway_player.h.

177 { m_modal = aIsModal; }

References KIWAY_PLAYER::m_modal.

Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), and LIB_VIEW_FRAME::LIB_VIEW_FRAME().

◆ SetMruPath()

void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

Definition at line 419 of file eda_base_frame.h.

419 { m_mruPath = aPath; }
wxString m_mruPath

References EDA_BASE_FRAME::m_mruPath.

Referenced by PANEL_HOTKEYS_EDITOR::ImportHotKeys(), and KICAD_MANAGER_FRAME::LoadProject().

◆ SetShutdownBlockReason()

void EDA_BASE_FRAME::SetShutdownBlockReason ( const wxString &  reason)
inherited

Sets the block reason why the window/application is preventing OS shutdown.

This should be set far ahead of any close event.

This is mainly intended for Windows platforms where this is a native feature.

Definition at line 186 of file eda_base_frame.cpp.

187 {
188 #if defined( _WIN32 )
189  // Windows: sets up the pretty message on the shutdown page on why it's being "blocked"
190  // This is used in conjunction with handling WM_QUERYENDSESSION (wxCloseEvent)
191  // ShutdownBlockReasonCreate does not block by itself
192 
193  ShutdownBlockReasonDestroy( GetHandle() ); // Destroys any existing or nonexisting reason
194 
195  if( !ShutdownBlockReasonCreate( GetHandle(), aReason.wc_str() ) )
196  {
197  // Nothing bad happens if this fails, at worst it uses a generic application is preventing shutdown message
198  wxLogDebug( wxT( "ShutdownBlockReasonCreate failed to set reason: %s" ), aReason );
199  }
200 #endif
201 }

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), PL_EDITOR_FRAME::OnNewPageLayout(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ SetUserUnits()

◆ ShowChangedLanguage()

void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

◆ ShowModal()

bool KIWAY_PLAYER::ShowModal ( wxString *  aResult = NULL,
wxWindow *  aResultantFocusWindow = NULL 
)
virtualinherited

Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal().

That is, behavior is similar to a modal dialog window. Not all KIWAY_PLAYERs use this interface, so don't call this unless the implementation knows how to call DismissModal() on a button click or double click or some special event which ends the modal behavior.

Parameters
aResultif not NULL, indicates a place to put a resultant string.
aResultantFocusWindowif not NULL, indicates what window to pass focus to on return.
Returns
bool - true if frame implementation called KIWAY_PLAYER::DismissModal() with aRetVal of true.

Reimplemented in FOOTPRINT_VIEWER_FRAME, and LIB_VIEW_FRAME.

Definition at line 75 of file kiway_player.cpp.

76 {
77  wxASSERT_MSG( IsModal(), wxT( "ShowModal() shouldn't be called on non-modal frame" ) );
78 
79  /*
80  This function has a nice interface but a necessarily unsightly implementation.
81  Now the implementation is encapsulated, localizing future changes.
82 
83  It works in tandem with DismissModal(). But only ShowModal() is in the
84  vtable and therefore cross-module capable.
85  */
86 
87  // This is an exception safe way to zero a pointer before returning.
88  // Yes, even though DismissModal() clears this first normally, this is
89  // here in case there's an exception before the dialog is dismissed.
90  struct NULLER
91  {
92  void*& m_what;
93  NULLER( void*& aPtr ) : m_what( aPtr ) {}
94  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
95  } clear_this( (void*&) m_modal_loop );
96 
97 
98  m_modal_resultant_parent = aResultantFocusWindow;
99 
100  Show( true );
101  Raise(); // Needed on some Window managers to always display the frame
102 
103  SetFocus();
104 
105  {
106  // We have to disable all frames but the the modal one.
107  // wxWindowDisabler does that, but it also disables all top level windows
108  // We do not want to disable top level windows which are child of the modal one,
109  // if they are enabled.
110  // An example is an aui toolbar which was moved
111  // or a dialog or another frame or miniframe opened by the modal one.
112  wxWindowList wlist = GetChildren();
113  std::vector<wxWindow*> enabledTopLevelWindows;
114 
115  for( unsigned ii = 0; ii < wlist.size(); ii++ )
116  if( wlist[ii]->IsTopLevel() && wlist[ii]->IsEnabled() )
117  enabledTopLevelWindows.push_back( wlist[ii] );
118 
119  // exception safe way to disable all top level windows except the modal one,
120  // re-enables only those that were disabled on exit
121  wxWindowDisabler toggle( this );
122 
123  for( unsigned ii = 0; ii < enabledTopLevelWindows.size(); ii++ )
124  enabledTopLevelWindows[ii]->Enable( true );
125 
126  WX_EVENT_LOOP event_loop;
127  m_modal_loop = &event_loop;
128  event_loop.Run();
129 
130  } // End of scope for some variables.
131  // End nesting before setting focus below.
132 
133  if( aResult )
134  *aResult = m_modal_string;
135 
136  if( aResultantFocusWindow )
137  {
138  aResultantFocusWindow->Raise();
139 
140  // have the final say, after wxWindowDisabler reenables my parent and
141  // the events settle down, set the focus
142  wxSafeYield();
143  aResultantFocusWindow->SetFocus();
144  }
145 
146  return m_modal_ret_val;
147 }
bool m_modal_ret_val
Definition: kiway_player.h:205
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
wxWindow * m_modal_resultant_parent
Definition: kiway_player.h:203
wxString m_modal_string
Definition: kiway_player.h:204
bool IsModal() const
Definition: kiway_player.h:176
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:202

References KIWAY_PLAYER::IsModal(), KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_resultant_parent, KIWAY_PLAYER::m_modal_ret_val, KIWAY_PLAYER::m_modal_string, and WX_EVENT_LOOP.

Referenced by FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ SupportsShutdownBlockReason()

bool EDA_BASE_FRAME::SupportsShutdownBlockReason ( )
inherited

Whether or not the window supports setting a shutdown block reason.

Definition at line 167 of file eda_base_frame.cpp.

168 {
169 #if defined( _WIN32 )
170  return true;
171 #else
172  return false;
173 #endif
174 }

Referenced by FOOTPRINT_EDIT_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnCloseWindow(), LIB_EDIT_FRAME::OnCloseWindow(), and EDA_BASE_FRAME::~EDA_BASE_FRAME().

◆ SynchroniseColoursWithBoard()

void EDA_3D_VIEWER::SynchroniseColoursWithBoard ( )

Definition at line 566 of file eda_3d_viewer.cpp.

567 {
568  BOARD* brd = GetBoard();
569  const FAB_LAYER_COLOR* stdColors = GetColorStandardList();
570  wxColour color;
571  if( brd )