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:
KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL, SCREEN }
 

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 ()
 
EDA_3D_CANVASGetCanvas ()
 
void ReloadRequest ()
 Request reloading the 3D view. More...
 
void NewDisplay (bool aForceImmediateRedraw=false)
 Reload and refresh (rebuild) the 3D scene. More...
 
CINFO3D_VISUGetSettings ()
 
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) override
 Notification that common settings are updated. More...
 
void SynchroniseColoursWithBoard (void)
 
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 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 ()
 
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)
 
SETTINGS_MANAGERGetSettingsManager () const
 
virtual int GetSeverity (int aErrorCode) 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...
 
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 OnMenuOpen (wxMenuEvent &event)
 Workaround some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
virtual void OnMove (wxMoveEvent &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)
 
virtual APP_SETTINGS_BASEconfig ()
 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 ()
 
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=NULL)
 Fetches the file name from the file history list. More...
 
void ClearFileHistory (FILE_HISTORY *aFileHistory=NULL)
 Removes all files from the file history. More...
 
void UpdateFileHistory (const wxString &FullFileName, FILE_HISTORY *aFileHistory=NULL)
 Update the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
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 RefreshCanvas ()
 Notification to refresh the drawing canvas (if any). 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...
 
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
 
wxString m_AboutTitle
 
wxAuiManager m_auimgr
 
wxString m_configName
 
SETTINGS_MANAGERm_settingsManager
 
TOOL_MANAGERm_toolManager
 
ACTIONSm_actions
 
std::vector< std::string > m_toolStack
 
bool m_immediateActions
 
bool m_dragSelects
 
bool m_moveWarpsCursor
 
bool m_hasAutoSave
 
bool m_autoSaveState
 
int m_autoSaveInterval
 
wxTimer * m_autoSaveTimer
 
wxString m_perspective
 
wxString m_mruPath
 
EDA_UNITS m_userUnits
 

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
 
CINFO3D_VISU m_settings
 
TOOL_DISPATCHERm_toolDispatcher
 
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 
SCREEN 

Definition at line 42 of file kiway_holder.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 86 of file eda_3d_viewer.cpp.

87  :
88  KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
89  wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) ),
90  m_mainToolBar( nullptr ),
91  m_canvas( nullptr ),
92  m_toolDispatcher( nullptr )
93 {
94  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::EDA_3D_VIEWER %s", aTitle );
95 
96  m_disable_ray_tracing = false;
97  m_AboutTitle = "3D Viewer";
98 
99  // Give it an icon
100  wxIcon icon;
101  icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
102  SetIcon( icon );
103 
104  auto config = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
105  LoadSettings( config );
106  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
107 
108  // Create the status line
109  static const int status_dims[5] = { -1, -1, 130, 130, 170 };
110 
111  wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
112  SetStatusWidths( arrayDim( status_dims ), status_dims );
113 
115  aParent->GetBoard(), m_settings, Prj().Get3DCacheManager() );
116 
117  if( m_canvas )
118  m_canvas->SetStatusBar( status_bar );
119 
120  // Some settings need the canvas
122 
123  // Create the manager
125  m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr, this );
126 
127  m_actions = new EDA_3D_ACTIONS();
130 
131  // Register tools
135 
136  // Run the viewer control tool, it is supposed to be always active
137  m_toolManager->InvokeTool( "3DViewer.Control" );
138 
139  CreateMenuBar();
141 
142  m_auimgr.SetManagedWindow( this );
143 
144  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
145  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
146 
147  m_auimgr.Update();
148 
149  // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
150  // in order to receive mouse events. Otherwise, the user has to click somewhere on
151  // the canvas before it will respond to mouse wheel events.
152  if( m_canvas )
153  m_canvas->SetFocus();
154 }
TOOL_DISPATCHER * m_toolDispatcher
static const int * GetAttributesList(bool aUseAntiAliasing)
Get a list of attributes to pass to wxGLCanvas.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
CINFO3D_VISU m_settings
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aWdoName=wxFrameNameStr)
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
ACTIONS * m_actions
void SetStatusBar(wxStatusBar *aStatusBar)
Definition: eda_3d_canvas.h:73
wxString m_AboutTitle
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:46
wxAuiManager m_auimgr
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.
3D_VIEWER_CONTROL
void loadCommonSettings()
Load configuration from common settings.
EDA_3D_CANVAS * m_canvas
TOOL_MANAGER.
Definition: tool_manager.h:50
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
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.
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.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:108
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void CreateMenuBar()
Definition: 3d_menubar.cpp:37
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_BASE_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
ACTION_TOOLBAR * m_mainToolBar
TOOL_MANAGER * m_toolManager
void InitTools()
Function InitTools() Initializes all registered tools.
BOARD * GetBoard() const
virtual APP_SETTINGS_BASE * config()
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
Definition: eda_3d_viewer.h:50
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(), TOOL_MANAGER::SetEnvironment(), and EDA_3D_CANVAS::SetStatusBar().

◆ ~EDA_3D_VIEWER()

EDA_3D_VIEWER::~EDA_3D_VIEWER ( )

Definition at line 157 of file eda_3d_viewer.cpp.

158 {
159  m_canvas->SetEventDispatcher( nullptr );
160 
161  m_auimgr.UnInit();
162 
163  // m_canvas delete will be called by wxWidget manager
164  //delete m_canvas;
165  //m_canvas = nullptr;
166 }
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 397 of file eda_base_frame.cpp.

398 {
399  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
400  ACTION_MENU* helpMenu = new ACTION_MENU( false );
401 
402  helpMenu->SetTool( commonControl );
403 
404  helpMenu->Add( ACTIONS::help );
405  helpMenu->Add( ACTIONS::gettingStarted );
406  helpMenu->Add( ACTIONS::listHotKeys );
407  helpMenu->Add( ACTIONS::getInvolved );
408 
409  helpMenu->AppendSeparator();
410  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, about_xpm );
411 
412  aMenuBar->Append( helpMenu, _( "&Help" ) );
413 }
static TOOL_ACTION listHotKeys
Definition: actions.h:171
ACTION_MENU.
Definition: action_menu.h:43
const BITMAP_OPAQUE about_xpm[1]
Definition: about.cpp:84
COMMON_CONTROL.
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION help
Definition: actions.h:170
TOOL_MANAGER * m_toolManager
static TOOL_ACTION getInvolved
Definition: actions.h:172
static TOOL_ACTION gettingStarted
Definition: actions.h:169

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

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

◆ ChangeUserUnits()

void EDA_BASE_FRAME::ChangeUserUnits ( EDA_UNITS  aUnits)
inlineinherited

Definition at line 225 of file eda_base_frame.h.

226  {
227  SetUserUnits( aUnits );
229  }
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 735 of file eda_base_frame.cpp.

736 {
737  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
738 
739  wxFileName autoSaveFileName = aFileName;
740 
741  // Check for auto save file.
742  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
743 
744  wxLogTrace( traceAutoSave,
745  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
746 
747  if( !autoSaveFileName.FileExists() )
748  return;
749 
750  wxString msg = wxString::Format( _(
751  "Well this is potentially embarrassing!\n"
752  "It appears that the last time you were editing the file\n"
753  "\"%s\"\n"
754  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
755  GetChars( aFileName.GetFullName() )
756  );
757 
758  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
759 
760  // Make a backup of the current file, delete the file, and rename the auto save file to
761  // the file name.
762  if( response == wxYES )
763  {
764  // Get the backup file name.
765  wxFileName backupFileName = aFileName;
766  backupFileName.SetExt( aFileName.GetExt() + GetBackupSuffix() );
767 
768  // If an old backup file exists, delete it. If an old copy of the file exists, rename
769  // it to the backup file name
770  if( aFileName.FileExists() )
771  {
772  // Rename the old file to the backup file name.
773  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath(), true ) )
774  {
775  msg.Printf( _( "Could not create backup file \"%s\"" ),
776  GetChars( backupFileName.GetFullPath() ) );
777  wxMessageBox( msg );
778  }
779  }
780 
781  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
782  {
783  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
784  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
785  }
786  }
787  else
788  {
789  wxLogTrace( traceAutoSave,
790  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
791 
792  // Remove the auto save file when using the previous file as is.
793  wxRemoveFile( autoSaveFileName.GetFullPath() );
794  }
795 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
static wxString GetBackupSuffix()
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:101
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(), EDA_BASE_FRAME::GetBackupSuffix(), GetChars(), Pgm(), and traceAutoSave.

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

◆ ClearFileHistory()

void EDA_BASE_FRAME::ClearFileHistory ( FILE_HISTORY aFileHistory = NULL)
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 643 of file eda_base_frame.cpp.

644 {
645  if( !aFileHistory )
646  aFileHistory = &Kiface().GetFileHistory();
647 
648  aFileHistory->ClearFileHistory();
649 }
void ClearFileHistory()
Clear all entries from the file history.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:125

References FILE_HISTORY::ClearFileHistory(), KIFACE_I::GetFileHistory(), and Kiface().

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

◆ CommonSettingsChanged()

void EDA_3D_VIEWER::CommonSettingsChanged ( bool  aEnvVarsChanged)
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 EDA_BASE_FRAME.

Definition at line 589 of file eda_3d_viewer.cpp.

590 {
591  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
592 
593  // Regen menu bars, etc
594  EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
595 
596  // There is no base class that handles toolbars for this frame
598 
600 
601  NewDisplay( true );
602 }
void loadCommonSettings()
Load configuration from common settings.
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:39
virtual void CommonSettingsChanged(bool aEnvVarsChanged)
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 ( )
virtualinherited

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

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 572 of file eda_base_frame.cpp.

573 {
574  // KICAD_MANAGER_FRAME overrides this
576  //wxASSERT( ret );
577  return ret;
578 }
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_i.h:103
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:75
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

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

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), SCH_EDIT_FRAME::SaveProject(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_BASE_FRAME::windowClosing(), and BM2CMP_FRAME::~BM2CMP_FRAME().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited
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.

Definition at line 379 of file eda_base_frame.h.

380  {
381  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
382  return baseCfgName;
383  }
wxString m_configName

References EDA_BASE_FRAME::m_configName.

Referenced by EDA_DRAW_FRAME::LoadSettings(), EDA_BASE_FRAME::SaveWindowSettings(), and ACTION_MANAGER::UpdateHotKeys().

◆ CreateMenuBar()

void EDA_3D_VIEWER::CreateMenuBar ( )
private

Definition at line 37 of file 3d_menubar.cpp.

38 {
39  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CreateMenuBar" );
40 
42  wxMenuBar* menuBar = new wxMenuBar;
43 
44 
45  //-- File menu -----------------------------------------------------------
46  //
47  CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, tool );
48 
49  fileMenu->AddItem( ID_MENU_SCREENCOPY_PNG, _( "Export Current View as PNG..." ), "",
51 
52  fileMenu->AddItem( ID_MENU_SCREENCOPY_JPEG, _( "Export Current View as JPEG..." ), "",
54 
55  fileMenu->AddSeparator();
56  fileMenu->AddClose( _( "3D Viewer" ) );
57 
58  fileMenu->Resolve();
59 
60  //-- Edit menu -------------------------------------------------------
61  // Avoid to translate hotkey modifiers like Ctrl and Shift.
62  // The translated modifiers do not always work
63  CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, tool );
64 
65  editMenu->AddItem( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image" ), "",
67 
68  editMenu->Resolve();
69 
70  //-- View menu -------------------------------------------------------
71  //
72  CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, tool );
73 
78 
79  viewMenu->AddSeparator();
82 
83  viewMenu->AddSeparator();
86 
87  viewMenu->AddSeparator();
90 
91  viewMenu->AddSeparator();
96 
97  viewMenu->Resolve();
98 
99  //-- Preferences menu -----------------------------------------------
100  //
101  CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, tool );
102 
103  //clang-format off
104  auto raytracingCondition = [this]( const SELECTION& aSel )
105  {
107  };
108 
109  auto NormalModeCondition = [this]( const SELECTION& aSel )
110  {
112  };
113 
114  auto DiffuseModeCondition = [this]( const SELECTION& aSel )
115  {
117  };
118 
119  auto CADModeCondition = [this]( const SELECTION& aSel )
120  {
122  };
123 
124  auto copperThicknessCondition = [this]( const SELECTION& aSel )
125  {
127  };
128 
129  auto boundingBoxesCondition = [this]( const SELECTION& aSel )
130  {
132  };
133 
134  auto renderShadowsCondition = [this]( const SELECTION& aSel )
135  {
137  };
138 
139  auto proceduralTexturesCondition = [this]( const SELECTION& aSel )
140  {
142  };
143 
144  auto showFloorCondition = [this]( const SELECTION& aSel )
145  {
147  };
148 
149  auto useRefractionsCondition = [this]( const SELECTION& aSel )
150  {
152  };
153 
154  auto useReflectionsCondition = [this]( const SELECTION& aSel )
155  {
157  };
158 
159  auto antiAliasingCondition = [this]( const SELECTION& aSel )
160  {
162  };
163 
164  auto postProcessCondition = [this]( const SELECTION& aSel )
165  {
167  };
168 
169  auto showAxesCondition = [this]( const SELECTION& aSel )
170  {
171  return m_settings.GetFlag( FL_AXIS );
172  };
173  //clang-format on
174 
175  prefsMenu->AddItem( ID_TOOL_SET_VISIBLE_ITEMS, _( "Display Options" ), "",
177 
178  prefsMenu->AddCheckItem( ID_RENDER_CURRENT_VIEW, _( "Raytracing" ), "",
179  tools_xpm, raytracingCondition );
180 
181  // Render options submenu
182  CONDITIONAL_MENU* optsSubmenu = new CONDITIONAL_MENU( false, tool );
183  optsSubmenu->SetTitle( _( "Render Options" ) );
184  optsSubmenu->SetIcon( options_3drender_xpm );
185 
186  // Material properties submenu
187  CONDITIONAL_MENU* propsSubmenu = new CONDITIONAL_MENU( false, tool );
188  propsSubmenu->SetTitle( _( "Material Properties" ) );
189  propsSubmenu->SetIcon( color_materials_xpm );
190 
192  _( "Use All Properties" ),
193  _( "Use all material properties from each 3D model file" ),
194  nullptr, NormalModeCondition );
195 
197  _( "Use Diffuse Only" ),
198  _( "Use only the diffuse color property from model 3D model file" ),
199  nullptr, DiffuseModeCondition );
200 
202  _( "CAD Color Style" ),
203  _( "Use a CAD color style based on the diffuse color of the material" ),
204  nullptr, CADModeCondition );
205 
206  optsSubmenu->AddMenu( propsSubmenu, SELECTION_CONDITIONS::ShowAlways );
207 
208  optsSubmenu->AddCheckItem( EDA_3D_ACTIONS::showCopperThickness, copperThicknessCondition );
209  optsSubmenu->AddCheckItem( EDA_3D_ACTIONS::showBoundingBoxes, boundingBoxesCondition );
210 
211  // Raytracing submenu
212  CONDITIONAL_MENU* raySubmenu = new CONDITIONAL_MENU( false, tool );
213  raySubmenu->SetTitle( _( "Raytracing Options" ) );
214  raySubmenu->SetIcon( tools_xpm );
215 
216  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::renderShadows, renderShadowsCondition );
217  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::proceduralTextures, proceduralTexturesCondition );
218  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::addFloor, showFloorCondition );
219  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::showRefractions, useRefractionsCondition );
220  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::showReflections, useReflectionsCondition );
221  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::antiAliasing, antiAliasingCondition );
222 
223  raySubmenu->AddCheckItem( EDA_3D_ACTIONS::postProcessing, postProcessCondition );
224 
225  optsSubmenu->AddMenu( raySubmenu, SELECTION_CONDITIONS::ShowAlways );
226  prefsMenu->AddMenu( optsSubmenu, SELECTION_CONDITIONS::ShowAlways );
227 
228  prefsMenu->AddSeparator();
229 
230  // Color submenu
231  CONDITIONAL_MENU* colorSubmenu = new CONDITIONAL_MENU( false, tool );
232  colorSubmenu->SetTitle( _( "Choose Colors" ) );
233  colorSubmenu->SetIcon( palette_xpm );
234 
235  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_TOP, _( "Background Top Color..." ), "",
237 
238  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_BOTTOM, _( "Background Bottom Color..." ), "",
240 
241  colorSubmenu->AddItem( ID_MENU3D_SILKSCREEN_COLOR, _( "Silkscreen Color..." ), "",
243 
244  colorSubmenu->AddItem( ID_MENU3D_SOLDERMASK_COLOR, _( "Solder Mask Color..." ), "",
246 
247  colorSubmenu->AddItem( ID_MENU3D_SOLDERPASTE_COLOR, _( "Solder Paste Color..." ), "",
249 
250  colorSubmenu->AddItem( ID_MENU3D_COPPER_COLOR, _( "Copper/Surface Finish Color..." ), "",
252 
253  colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
255 
256  // Only allow the stackup to be used in the PCB editor, since it isn't editable in the other frames
257  if( Parent()->IsType( FRAME_PCB_EDITOR ) )
258  {
259  colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
261  }
262 
263  prefsMenu->AddMenu( colorSubmenu );
264 
265  prefsMenu->AddCheckItem( EDA_3D_ACTIONS::showAxis, showAxesCondition );
266 
267  // Grid submenu
268  CONDITIONAL_MENU* gridSubmenu = new CONDITIONAL_MENU( false, tool );
269  gridSubmenu->SetTitle( _( "3D Grid" ) );
270  gridSubmenu->SetIcon( grid_xpm );
271 
272  //clang-format off
273  auto noGridCondition = [this]( const SELECTION& aSel )
274  {
276  };
277 
278  auto grid10mmCondition = [this]( const SELECTION& aSel )
279  {
281  };
282 
283  auto grid5mmCondition = [this]( const SELECTION& aSel )
284  {
286  };
287 
288  auto grid2p5mmCondition = [this]( const SELECTION& aSel )
289  {
291  };
292 
293  auto grid_1mmCondition = [this]( const SELECTION& aSel )
294  {
296  };
297  //clang-format on
298 
299  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::noGrid, noGridCondition );
300  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show10mmGrid, grid10mmCondition );
301  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show5mmGrid, grid5mmCondition );
302  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show2_5mmGrid, grid2p5mmCondition );
303  gridSubmenu->AddCheckItem( EDA_3D_ACTIONS::show1mmGrid, grid_1mmCondition );
304 
305  prefsMenu->AddMenu( gridSubmenu, SELECTION_CONDITIONS::ShowAlways );
306 
307  prefsMenu->AddSeparator();
308  prefsMenu->AddItem( ID_MENU3D_RESET_DEFAULTS, _( "Reset to Default Settings" ), "",
310 
311 #ifdef __APPLE__ // Note: will get moved to Apple menu by wxWidgets
312  prefsMenu->AddItem( wxID_PREFERENCES,
313  _( "Preferences...\tCTRL+," ),
314  _( "Show preferences for all open tools" ),
316 #endif
317 
318  prefsMenu->Resolve();
319 
320  //-- Menubar -------------------------------------------------------------
321  //
322  menuBar->Append( fileMenu, _( "&File" ) );
323  menuBar->Append( editMenu, _( "&Edit" ) );
324  menuBar->Append( viewMenu, _( "&View" ) );
325  menuBar->Append( prefsMenu, _( "&Preferences" ) );
326  AddStandardHelpMenu( menuBar );
327 
328  SetMenuBar( menuBar );
329 }
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()
const BITMAP_OPAQUE setcolor_soldermask_xpm[1]
const BITMAP_OPAQUE setcolor_solderpaste_xpm[1]
CINFO3D_VISU m_settings
static TOOL_ACTION show10mmGrid
Definition: 3d_actions.h:69
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
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:222
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]
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:252
static TOOL_ACTION antiAliasing
Definition: 3d_actions.h:85
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:70
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:68
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
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
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:240
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:71
static TOOL_ACTION show1mmGrid
Definition: 3d_actions.h:72
void SetTitle(const wxString &aTitle) override
Function SetTitle() Sets title for the menu.
Definition: action_menu.cpp:86
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:68
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
TOOL_MANAGER * m_toolManager
const BITMAP_OPAQUE preference_xpm[1]
Definition: preference.cpp:66
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()
static TOOL_ACTION showCopperThickness
Definition: 3d_actions.h:78
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_COPPER_THICKNESS, 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, CINFO3D_VISU::GetFlag(), TOOL_MANAGER::GetTool(), GRID_10MM, GRID_1MM, GRID_2P5MM, GRID_5MM, grid_xpm, CINFO3D_VISU::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_logTrace, m_settings, EDA_BASE_FRAME::m_toolManager, CINFO3D_VISU::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, CINFO3D_VISU::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::showCopperThickness, EDA_3D_ACTIONS::showReflections, EDA_3D_ACTIONS::showRefractions, tools_xpm, ACTIONS::zoomFitScreen, ACTIONS::zoomIn, ACTIONS::zoomOut, and ACTIONS::zoomRedraw.

◆ CurrentToolName()

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

Definition at line 252 of file eda_base_frame.cpp.

253 {
254  if( m_toolStack.empty() )
255  return ACTIONS::selectionTool.GetName();
256  else
257  return m_toolStack.back();
258 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:146

References EDA_BASE_FRAME::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:192
wxString m_modal_string
Definition: kiway_player.h:191
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:189

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 EDA_BASE_FRAME::DisplayToolMsg ( const wxString &  msg)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 253 of file eda_base_frame.h.

253 {};

Referenced by EDA_BASE_FRAME::PopTool(), and EDA_BASE_FRAME::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 335 of file eda_base_frame.cpp.

336 {
337  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
338 }

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 188 of file eda_3d_viewer.cpp.

189 {
190  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Exit3DFrame" );
191 
192  Close( true );
193 }
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 517 of file eda_base_frame.h.

517 { return m_AboutTitle; }
wxString m_AboutTitle

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetAutoSaveFilePrefix()

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

Definition at line 171 of file eda_base_frame.h.

172  {
173  return wxT( "_autosave-" );
174  }

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 303 of file eda_base_frame.h.

303 { 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 163 of file eda_base_frame.h.

164  {
165  return wxT( "-bak" );
166  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), PCB_EDIT_FRAME::createBackupFile(), PCB_EDIT_FRAME::Files_io_from_id(), and SCH_EDIT_FRAME::SaveEEFile().

◆ 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()

◆ GetDoImmediateActions()

bool EDA_BASE_FRAME::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 259 of file eda_base_frame.h.

259 { return m_immediateActions; }

References EDA_BASE_FRAME::m_immediateActions.

◆ GetDragSelects()

bool EDA_BASE_FRAME::GetDragSelects ( ) const
inlineinherited

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

Definition at line 265 of file eda_base_frame.h.

265 { return m_dragSelects; }

References EDA_BASE_FRAME::m_dragSelects.

Referenced by EE_SELECTION_TOOL::Main().

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
FILE_HISTORY aFileHistory = NULL 
)
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 610 of file eda_base_frame.cpp.

612 {
613  FILE_HISTORY* fileHistory = aFileHistory;
614 
615  if( !fileHistory )
616  fileHistory = &Kiface().GetFileHistory();
617 
618  int baseId = fileHistory->GetBaseId();
619 
620  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
621 
622  unsigned i = cmdId - baseId;
623 
624  if( i < fileHistory->GetCount() )
625  {
626  wxString fn = fileHistory->GetHistoryFile( i );
627 
628  if( wxFileName::FileExists( fn ) )
629  return fn;
630  else
631  {
632  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
633  wxMessageBox( msg );
634 
635  fileHistory->RemoveFileFromHistory( i );
636  }
637  }
638 
639  return wxEmptyString;
640 }
This class implements a file history object to store a list of files, that can then be added to a men...
Definition: filehistory.h:42
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
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 & GetFileHistory()
Definition: kiface_i.h:125

References _, Format(), KIFACE_I::GetFileHistory(), and Kiface().

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

◆ GetMoveWarpsCursor()

bool EDA_BASE_FRAME::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 271 of file eda_base_frame.h.

271 { return m_moveWarpsCursor; }

References EDA_BASE_FRAME::m_moveWarpsCursor.

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

◆ GetMruPath()

◆ GetSettings()

CINFO3D_VISU& EDA_3D_VIEWER::GetSettings ( )
inline

◆ GetSettingsManager()

SETTINGS_MANAGER* EDA_BASE_FRAME::GetSettingsManager ( ) const
inlineinherited

Definition at line 231 of file eda_base_frame.h.

231 { return m_settingsManager; }
SETTINGS_MANAGER * m_settingsManager

References EDA_BASE_FRAME::m_settingsManager.

Referenced by GERBVIEW_FRAME::applyDisplaySettingsToGAL().

◆ GetSeverity()

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

Reimplemented in PCB_EDIT_FRAME.

Definition at line 233 of file eda_base_frame.h.

References RPT_SEVERITY_UNDEFINED.

Referenced by RC_TREE_MODEL::GetValue().

◆ GetToolManager()

TOOL_MANAGER* EDA_BASE_FRAME::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 238 of file eda_base_frame.h.

238 { return m_toolManager; }
TOOL_MANAGER * m_toolManager

References EDA_BASE_FRAME::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(), EDA_BASE_FRAME::CommonSettingsChanged(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), KICAD_MANAGER_FRAME::InstallPreferences(), FOOTPRINT_EDIT_FRAME::InstallPreferences(), LIB_EDIT_FRAME::InstallPreferences(), GERBVIEW_FRAME::InstallPreferences(), PCB_EDIT_FRAME::InstallPreferences(), SCH_EDIT_FRAME::InstallPreferences(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), 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(), DIALOG_PLOT::Plot(), EDA_BASE_FRAME::PopTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), DIALOG_FIND::search(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), CVPCB_MAINFRAME::setupEventHandlers(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::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().

◆ GetUserUnits()

EDA_UNITS EDA_BASE_FRAME::GetUserUnits ( ) const
inlineinherited

Return the user units currently in use.

Definition at line 215 of file eda_base_frame.h.

216  {
217  return m_userUnits;
218  }
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(), PCB_EDIT_FRAME::Create_MuWaveComponent(), MWAVE::CreateMicrowaveInductor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), GERBER_FILE_IMAGE::DisplayImageInfo(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), LIB_EDIT_TOOL::editGraphicProperties(), LIB_PIN_TOOL::EditPinProperties(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckNoConnects(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_MODEDIT_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), PANEL_SETUP_NETCLASSES::getNetclassValue(), GetUserUnits(), GRID_MENU::GRID_MENU(), PCB_INSPECTION_TOOL::highlightNet(), GERBVIEW_FRAME::Liste_D_Codes(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), 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(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), CONNECTION_SUBGRAPH::ResolveDrivers(), DISPLAY_FOOTPRINTS_FRAME::SyncToolbars(), FOOTPRINT_EDIT_FRAME::SyncToolbars(), LIB_EDIT_FRAME::SyncToolbars(), GERBVIEW_FRAME::SyncToolbars(), PCB_EDIT_FRAME::SyncToolbars(), SCH_EDIT_FRAME::SyncToolbars(), DRC::testDrilledHoles(), DRC::testUnconnected(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), PANEL_MODEDIT_SETTINGS::TransferDataToWindow(), PANEL_GERBVIEW_SETTINGS::TransferDataToWindow(), PANEL_PCBNEW_SETTINGS::TransferDataToWindow(), PANEL_SETUP_NETCLASSES::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), GRID_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), GERBVIEW_FRAME::updateDCodeSelectBox(), GERBVIEW_FRAME::updateGridSelectBox(), PCB_BASE_FRAME::UpdateGridSelectBox(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), DRC::userUnits(), PANEL_SETUP_TRACKS_AND_VIAS::validateData(), and PANEL_SETUP_NETCLASSES::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 566 of file eda_base_frame.cpp.

567 {
568  return &aCfg->m_Window;
569 }
WINDOW_SETTINGS m_Window
Definition: app_settings.h:132

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().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
virtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 587 of file eda_base_frame.cpp.

588 {
589  return Kiface().GetHelpFileName();
590 }
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 49 of file dialog_3D_view_option.cpp.

50 {
51  DIALOG_3D_VIEW_OPTIONS dlg( this );
52 
53  if( dlg.ShowModal() == wxID_OK )
54  {
55  NewDisplay( true );
56  }
57 }
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 SCH_EDIT_FRAME, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 332 of file eda_base_frame.h.

332 { }

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 186 of file eda_base_frame.h.

186 { 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 SCH_EDIT_FRAME, PCB_EDIT_FRAME, CVPCB_MAINFRAME, LIB_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 798 of file eda_base_frame.cpp.

799 {
800  // This function should be overridden in child classes
801  return false;
802 }

◆ IsCurrentTool()

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

Definition at line 261 of file eda_base_frame.cpp.

262 {
263  if( m_toolStack.empty() )
264  return &aAction == &ACTIONS::selectionTool;
265  else
266  return m_toolStack.back() == aAction.GetName();
267 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:146
const std::string & GetName() const
Function GetName() Returns name of the action.
Definition: tool_action.h:78

References TOOL_ACTION::GetName(), EDA_BASE_FRAME::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(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), DISPLAY_FOOTPRINTS_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:189

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 305 of file eda_base_frame.h.

305 { 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_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(), LIB_CONTROL::Init(), DIALOG_EDIT_ONE_FIELD::init(), SELECTION_TOOL::Init(), DIALOG_PAD_PROPERTIES::initValues(), PICKER_TOOL::Main(), LIB_CONTROL::OnDeMorgan(), PCB_LAYER_WIDGET::OnRenderEnable(), PCBNEW_CONTROL::Paste(), LIB_CONTROL::PinLibrary(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), LIB_CONTROL::Revert(), EE_INSPECTION_TOOL::RunERC(), LIB_CONTROL::Save(), PCBNEW_CONTROL::Show3DViewer(), 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 691 of file eda_base_frame.cpp.

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

References _, and GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), and PCB_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(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), SCH_EDIT_FRAME::CreateScreens(), 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(), EDIT_TOOL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithLibEdit(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadSheetFromFile(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), 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(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDITOR_CONTROL::Paste(), KIWAY_HOLDER::Prj(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), SCH_EDIT_FRAME::SaveEEFile(), 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(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow(), LIB_MANAGER::UpdatePart(), 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, SCH_EDIT_FRAME, PCB_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:435

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

◆ loadCommonSettings()

void EDA_3D_VIEWER::loadCommonSettings ( )
private

Load configuration from common settings.

Definition at line 865 of file eda_3d_viewer.cpp.

866 {
867  wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );
868 
869  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
870 
871  const DPI_SCALING dpi{ settings, this };
872  m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
874 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
CINFO3D_VISU m_settings
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
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.

References FL_MOUSEWHEEL_PANNING, m_canvas, COMMON_SETTINGS::m_Input, m_settings, COMMON_SETTINGS::INPUT::mousewheel_pan, Pgm(), CINFO3D_VISU::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 378 of file eda_3d_viewer.cpp.

379 {
381 
382  auto cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
383  wxASSERT( cfg );
384 
385  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings" );
386 
387  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
388 
389  auto set_color = [] ( const COLOR4D& aColor, SFVEC3D& aTarget )
390  {
391  aTarget.r = aColor.r;
392  aTarget.g = aColor.g;
393  aTarget.b = aColor.b;
394  };
395 
396  set_color( colors->GetColor( LAYER_3D_BACKGROUND_BOTTOM ), m_settings.m_BgColorBot );
397  set_color( colors->GetColor( LAYER_3D_BACKGROUND_TOP ), m_settings.m_BgColorTop );
398  set_color( colors->GetColor( LAYER_3D_BOARD ), m_settings.m_BoardBodyColor );
399  set_color( colors->GetColor( LAYER_3D_COPPER ), m_settings.m_CopperColor );
402  set_color( colors->GetColor( LAYER_3D_SOLDERMASK ), m_settings.m_SolderMaskColorBot );
403  set_color( colors->GetColor( LAYER_3D_SOLDERMASK ), m_settings.m_SolderMaskColorTop );
404  set_color( colors->GetColor( LAYER_3D_SOLDERPASTE ), m_settings.m_SolderPasteColor );
405 
406  m_settings.SetFlag( FL_USE_REALISTIC_MODE, cfg->m_Render.realistic );
407 
408  m_settings.SetFlag( FL_SUBTRACT_MASK_FROM_SILK, cfg->m_Render.subtract_mask_from_silk );
409 
410  // OpenGL options
411  m_settings.SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, cfg->m_Render.opengl_copper_thickness );
412 
413  m_settings.SetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, cfg->m_Render.opengl_show_model_bbox );
414 
415  // Raytracing options
416  m_settings.SetFlag( FL_RENDER_RAYTRACING_SHADOWS, cfg->m_Render.raytrace_shadows );
417 
418  m_settings.SetFlag( FL_RENDER_RAYTRACING_BACKFLOOR, cfg->m_Render.raytrace_backfloor );
419 
420  m_settings.SetFlag( FL_RENDER_RAYTRACING_REFRACTIONS, cfg->m_Render.raytrace_refractions );
421 
422  m_settings.SetFlag( FL_RENDER_RAYTRACING_REFLECTIONS, cfg->m_Render.raytrace_reflections );
423 
425  cfg->m_Render.raytrace_post_processing );
426 
427  m_settings.SetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING, cfg->m_Render.raytrace_anti_aliasing );
428 
430  cfg->m_Render.raytrace_procedural_textures );
431 
432  m_settings.SetFlag( FL_AXIS, cfg->m_Render.show_axis );
433 
434  m_settings.SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, cfg->m_Render.show_footprints_normal );
435 
436  m_settings.SetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, cfg->m_Render.show_footprints_insert );
437 
438  m_settings.SetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL, cfg->m_Render.show_footprints_virtual );
439 
440  m_settings.SetFlag( FL_ZONE, cfg->m_Render.show_zones );
441 
442  m_settings.SetFlag( FL_ADHESIVE, cfg->m_Render.show_adhesive );
443 
444  m_settings.SetFlag( FL_SILKSCREEN, cfg->m_Render.show_silkscreen );
445 
446  m_settings.SetFlag( FL_SOLDERMASK, cfg->m_Render.show_soldermask );
447 
448  m_settings.SetFlag( FL_SOLDERPASTE, cfg->m_Render.show_solderpaste );
449 
450  m_settings.SetFlag( FL_COMMENTS, cfg->m_Render.show_comments );
451 
452  m_settings.SetFlag( FL_ECO, cfg->m_Render.show_eco );
453 
454  m_settings.SetFlag( FL_SHOW_BOARD_BODY, cfg->m_Render.show_board_body );
455 
456  m_settings.GridSet( static_cast<GRID3D_TYPE>( cfg->m_Render.grid_type ) );
457 
458  RENDER_ENGINE engine = static_cast<RENDER_ENGINE>( cfg->m_Render.engine );
459  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings render setting %s",
460  ( engine == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" : "OpenGL" );
461  m_settings.RenderEngineSet( engine );
462 
463  m_settings.MaterialModeSet( static_cast<MATERIAL_MODE>( cfg->m_Render.material_mode ) );
464 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
CINFO3D_VISU m_settings
void GridSet(GRID3D_TYPE aGridType)
GridSet - set the current grid.
Definition: cinfo3d_visu.h:228
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:516
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:511
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:512
double g
Green component.
Definition: color4d.h:303
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:508
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:515
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:509
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:246
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:510
double b
Blue component.
Definition: color4d.h:304
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:234
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:514
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:513
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:88
double r
Red component.
Definition: color4d.h:302
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
static VRML_COLOR colors[VRML_COLOR_LAST]
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:40

References KIGFX::COLOR4D::b, colors, FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_RENDER_OPENGL_COPPER_THICKNESS, 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, FL_SHOW_BOARD_BODY, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE, FL_SUBTRACT_MASK_FROM_SILK, FL_USE_REALISTIC_MODE, FL_ZONE, KIGFX::COLOR4D::g, CINFO3D_VISU::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(), CINFO3D_VISU::m_BgColorBot, CINFO3D_VISU::m_BgColorTop, CINFO3D_VISU::m_BoardBodyColor, CINFO3D_VISU::m_CopperColor, m_logTrace, m_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::m_SilkScreenColorTop, CINFO3D_VISU::m_SolderMaskColorBot, CINFO3D_VISU::m_SolderMaskColorTop, CINFO3D_VISU::m_SolderPasteColor, CINFO3D_VISU::MaterialModeSet(), Pgm(), KIGFX::COLOR4D::r, RAYTRACING, CINFO3D_VISU::RenderEngineSet(), and CINFO3D_VISU::SetFlag().

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 446 of file eda_base_frame.cpp.

447 {
448  m_FramePos.x = aCfg->pos_x;
449  m_FramePos.y = aCfg->pos_y;
450  m_FrameSize.x = aCfg->size_x;
451  m_FrameSize.y = aCfg->size_y;
452 
453  // Ensure minimum size is set if the stored config was zero-initialized
455  {
458  }
459 
460  // Ensure window isn't bigger than can be displayed
461  int displayIndex = wxDisplay::GetFromPoint( m_FramePos );
462 
463  if( displayIndex == wxNOT_FOUND )
464  displayIndex = 0;
465 
466  wxDisplay display( displayIndex );
467  wxRect clientSize = display.GetClientArea();
468 
469  // The window may have been saved on a display that is no longer present.
470  // First, check the window origin and move it if it's off the chosen display
471 
472  if( m_FramePos.x >= clientSize.x + clientSize.width ||
473  m_FramePos.y >= clientSize.y + clientSize.height )
474  m_FramePos = wxDefaultPosition;
475 
476  // Now, fix up the size if needed
477 
478  if( m_FrameSize.x + m_FramePos.x > clientSize.x + clientSize.width )
479  {
480  m_FrameSize.x = clientSize.width;
481  m_FramePos.x = 0;
482  }
483 
484  if( m_FrameSize.y + m_FramePos.y > clientSize.y + clientSize.height )
485  {
486  m_FrameSize.y = clientSize.height;
487  m_FramePos.y = 0;
488  }
489 
490  if( m_hasAutoSave )
491  m_autoSaveInterval = Pgm().GetCommonSettings()->m_System.autosave_interval;
492 
493  // Ensure Window title bar is visible
494 #if defined( __WXMAC__ )
495  // for macOSX, the window must be below system (macOSX) toolbar
496  // Ypos_min = GetMBarHeight(); seems no more exist in new API (subject to change)
497  int Ypos_min = 20;
498 #else
499  int Ypos_min = 0;
500 #endif
501  if( m_FramePos.y < Ypos_min )
502  {
503  if( m_FrameSize.y + ( Ypos_min - m_FramePos.y ) > clientSize.height)
504  m_FrameSize.y = clientSize.height - Ypos_min;
505 
506  m_FramePos.y = Ypos_min;
507  }
508 
509  if( aCfg->maximized )
510  Maximize();
511 
512  m_perspective = aCfg->perspective;
513  m_mruPath = aCfg->mru_path;
514 
515  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
516 
520 }
wxString mru_path
Definition: app_settings.h:55
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
wxString m_mruPath
wxString m_perspective
wxString perspective
Definition: app_settings.h:58
static const int s_minsize_x
static const int s_minsize_y

References COMMON_SETTINGS::INPUT::immediate_actions, EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_dragSelects, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, EDA_BASE_FRAME::m_hasAutoSave, EDA_BASE_FRAME::m_immediateActions, COMMON_SETTINGS::m_Input, EDA_BASE_FRAME::m_moveWarpsCursor, EDA_BASE_FRAME::m_mruPath, EDA_BASE_FRAME::m_perspective, WINDOW_SETTINGS::maximized, WINDOW_SETTINGS::mru_path, WINDOW_SETTINGS::perspective, Pgm(), WINDOW_SETTINGS::pos_x, WINDOW_SETTINGS::pos_y, COMMON_SETTINGS::INPUT::prefer_select_to_drag, s_minsize_x, s_minsize_y, WINDOW_SETTINGS::size_x, WINDOW_SETTINGS::size_y, COMMON_SETTINGS::INPUT::warp_mouse_on_move, 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 177 of file eda_3d_viewer.cpp.

178 {
179  ReloadRequest();
180 
181  // After the ReloadRequest call, the refresh often takes a bit of time,
182  // and it is made here only on request.
183  if( aForceImmediateRedraw )
184  m_canvas->Refresh();
185 }
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_VIEWER_CONTROL::ToggleVisibility(), and PCB_BASE_FRAME::Update3DView().

◆ OnActivate()

void EDA_3D_VIEWER::OnActivate ( wxActivateEvent &  event)
private

Definition at line 349 of file eda_3d_viewer.cpp.

350 {
351  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" );
352 
353  if( m_canvas )
354  {
355  // Reload data if 3D frame shows a board,
356  // because it can be changed since last frame activation
359 
360  // Activates again the focus of the canvas so it will catch mouse and key events
361  m_canvas->SetFocus();
362  }
363 
364  event.Skip(); // required under wxMAC
365 }
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
Definition: eda_3d_canvas.h:81
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 328 of file eda_base_frame.cpp.

329 {
330  if( !doAutoSave() )
331  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
332 }
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 341 of file eda_base_frame.cpp.

342 {
343  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
344  // Key events can be filtered here.
345  // Currently no filtering is made.
346  event.Skip();
347 }
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 196 of file eda_3d_viewer.cpp.

197 {
198  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnCloseWindow" );
199 
200  if( m_canvas )
201  m_canvas->Close();
202 
203  // m_canvas delete will be called by wxWidget manager
204  //delete m_canvas;
205  //m_canvas = nullptr;
206 
207  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
208  Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" );
209 
210  Destroy();
211  event.Skip( true );
212 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
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.
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 340 of file eda_3d_viewer.cpp.

341 {
342  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::%s disabling ray tracing.", __WXFUNCTION__ );
343 
344  m_disable_ray_tracing = true;
346 }
CINFO3D_VISU m_settings
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:234
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_disable_ray_tracing, m_logTrace, m_settings, OPENGL_LEGACY, and CINFO3D_VISU::RenderEngineSet().

◆ OnKicadAbout()

void EDA_BASE_FRAME::OnKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 652 of file eda_base_frame.cpp.

653 {
654  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
655  ShowAboutDialog( this );
656 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ OnMenuOpen()

void EDA_BASE_FRAME::OnMenuOpen ( wxMenuEvent &  event)
inherited

Workaround some issues in wxWidgets where the menu events aren't captured by the menus themselves.

Definition at line 350 of file eda_base_frame.cpp.

351 {
352  //
353  // wxWidgets has several issues that we have to work around:
354  //
355  // 1) wxWidgets 3.0.x Windows has a bug where wxEVT_MENU_OPEN and wxEVT_MENU_HIGHLIGHT
356  // events are not captured by the ACTON_MENU menus. So we forward them here.
357  // (FWIW, this one is fixed in wxWidgets 3.1.x.)
358  //
359  // 2) wxWidgets doesn't pass the menu pointer for wxEVT_MENU_HIGHLIGHT events. So we
360  // store the menu pointer from the wxEVT_MENU_OPEN call.
361  //
362  // 3) wxWidgets has no way to tell whether a command is from a menu selection or a
363  // hotkey. So we keep track of menu highlighting so we can differentiate.
364  //
365 
366  static ACTION_MENU* currentMenu;
367 
368  if( event.GetEventType() == wxEVT_MENU_OPEN )
369  {
370  currentMenu = dynamic_cast<ACTION_MENU*>( event.GetMenu() );
371 
372  if( currentMenu )
373  currentMenu->OnMenuEvent( event );
374  }
375  else if( event.GetEventType() == wxEVT_MENU_HIGHLIGHT )
376  {
377  if( currentMenu )
378  currentMenu->OnMenuEvent( event );
379  }
380  else if( event.GetEventType() == wxEVT_MENU_CLOSE )
381  {
382  if( currentMenu )
383  currentMenu->OnMenuEvent( event );
384 
385  currentMenu = nullptr;
386  }
387 
388  event.Skip();
389 }
ACTION_MENU.
Definition: action_menu.h:43
void OnMenuEvent(wxMenuEvent &aEvent)

References ACTION_MENU::OnMenuEvent().

◆ OnMove()

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

Reimplemented in EDA_DRAW_FRAME.

Definition at line 296 of file eda_base_frame.h.

297  {
298  aEvent.Skip();
299  }

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Definition at line 659 of file eda_base_frame.cpp.

660 {
661  PAGED_DIALOG dlg( this, _( "Preferences" ) );
662  wxTreebook* book = dlg.GetTreebook();
663 
664  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
665 
666  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
667  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
668 
669  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
670  {
671  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
672 
673  if( frame )
674  frame->InstallPreferences( &dlg, hotkeysPanel );
675  }
676 
677  // The Kicad manager frame is not a player so we have to add it by hand
678  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
679 
680  if( manager )
681  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
682 
683  for( int i = 0; i < book->GetPageCount(); ++i )
684  book->GetPage( i )->Layout();
685 
686  if( dlg.ShowModal() == wxID_OK )
687  dlg.Kiway().CommonSettingsChanged( false );
688 }
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:341
#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 320 of file eda_3d_viewer.cpp.

321 {
322  const RENDER_ENGINE old_engine = m_settings.RenderEngineGet();
323 
324  if( old_engine == RENDER_ENGINE::OPENGL_LEGACY )
326  else
328 
329  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnRenderEngineSelection type %s ",
330  ( m_settings.RenderEngineGet() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
331  "OpenGL Legacy" );
332 
333  if( old_engine != m_settings.RenderEngineGet() )
334  {
336  }
337 }
CINFO3D_VISU m_settings
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:234
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:240
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:88

References m_logTrace, m_settings, OPENGL_LEGACY, RAYTRACING, RenderEngineChanged(), CINFO3D_VISU::RenderEngineGet(), and CINFO3D_VISU::RenderEngineSet().

◆ OnSetFocus()

void EDA_3D_VIEWER::OnSetFocus ( wxFocusEvent &  event)
private

Definition at line 368 of file eda_3d_viewer.cpp.

369 {
370  // Activates again the focus of the canvas so it will catch mouse and key events
371  if( m_canvas )
372  m_canvas->SetFocus();
373 
374  event.Skip();
375 }
EDA_3D_CANVAS * m_canvas

References m_canvas.

◆ OnUpdateUIEngine()

void EDA_3D_VIEWER::OnUpdateUIEngine ( wxUpdateUIEvent &  aEvent)
private

Definition at line 836 of file eda_3d_viewer.cpp.

837 {
839 }
CINFO3D_VISU m_settings
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:240

References m_settings, OPENGL_LEGACY, and CINFO3D_VISU::RenderEngineGet().

◆ OnUpdateUIMaterial()

void EDA_3D_VIEWER::OnUpdateUIMaterial ( wxUpdateUIEvent &  aEvent)
private

Definition at line 842 of file eda_3d_viewer.cpp.

843 {
844  // Set the state of toggle menus according to the current display options
845  switch( aEvent.GetId() )
846  {
848  aEvent.Check( m_settings.MaterialModeGet() == MATERIAL_MODE::NORMAL );
849  break;
850 
853  break;
854 
857  break;
858 
859  default:
860  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::OnUpdateUIMaterial()" );
861  }
862 }
Use a gray shading based on diffuse material.
CINFO3D_VISU m_settings
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:252
Use all material properties from model file.

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_settings, CINFO3D_VISU::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, CVPCB_MAINFRAME, and BM2CMP_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 PCB_EDIT_FRAME::FetchNetlistFromSchematic(), PGM_SINGLE_TOP::MacOpenFile(), PGM_TEST_FRAME::MacOpenFile(), PGM_MOCK_EESCHEMA_FRAME::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), SCH_EDIT_FRAME::OnUpdatePCB(), and PCB_EDIT_FRAME::RunEeschema().

◆ 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().

◆ PopTool()

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

Definition at line 214 of file eda_base_frame.cpp.

215 {
216  // Push/pop events can get out of order (such as when they're generated by the Simulator
217  // frame but not processed until the mouse is back in the Schematic frame), so make sure
218  // we're popping the right stack frame.
219 
220  for( int i = m_toolStack.size() - 1; i >= 0; --i )
221  {
222  if( m_toolStack[ i ] == actionName )
223  {
224  m_toolStack.erase( m_toolStack.begin() + i );
225 
226  // If there's something underneath us, and it's now the top of the stack, then
227  // re-activate it
228  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
229  {
230  std::string back = m_toolStack[ i ];
232 
233  if( action )
234  {
235  // Pop the action as running it will push it back onto the stack
236  m_toolStack.pop_back();
237 
238  TOOL_EVENT evt = action->MakeEvent();
239  evt.SetHasPosition( false );
240  GetToolManager()->PostEvent( evt );
241  }
242  }
243  else
245 
246  return;
247  }
248  }
249 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
virtual void DisplayToolMsg(const wxString &msg)
TOOL_EVENT.
Definition: tool_event.h:171
std::vector< std::string > m_toolStack
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:193
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 * m_toolManager
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:267
static TOOL_ACTION selectionTool
Definition: actions.h:146
void SetHasPosition(bool aHasPosition)
Definition: tool_event.h:261

References EDA_BASE_FRAME::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), EDA_BASE_FRAME::GetToolManager(), EDA_BASE_FRAME::m_toolManager, EDA_BASE_FRAME::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(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), 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 593 of file eda_base_frame.cpp.

594 {
595  SetStatusText( text );
596 }

◆ 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:171

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

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), LIB_CONTROL::AddSymbolToSchematic(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), 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_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PCB_EDIT_FRAME::doAutoSave(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), 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::LoadProjectFile(), CVPCB_MAINFRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), 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(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OnCloseWindow(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), 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(), 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(), MODULE_EDITOR_TOOLS::PasteFootprint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), SCH_DRAWING_TOOLS::PlaceComponent(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Print(), SCH_EDIT_FRAME::PrintPage(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::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(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), 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(), KICAD_MANAGER_FRAME::SetProjectFileName(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), 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 PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

◆ Process_Special_Functions()

void EDA_3D_VIEWER::Process_Special_Functions ( wxCommandEvent &  event)
private

Definition at line 215 of file eda_3d_viewer.cpp.

216 {
217  int id = event.GetId();
218  bool isChecked = event.IsChecked();
219 
220  wxLogTrace( m_logTrace,
221  "EDA_3D_VIEWER::Process_Special_Functions id %d isChecked %d",
222  id, isChecked );
223 
224  if( m_canvas == NULL )
225  return;
226 
227  switch( id )
228  {
229  case ID_RELOAD3D_BOARD:
230  NewDisplay( true );
231  break;
232 
236  takeScreenshot( event );
237  return;
238 
240  if( Set3DColorFromUser( m_settings.m_BgColorBot, _( "Background Color, Bottom" ),
241  nullptr ) )
242  {
245  else
246  NewDisplay( true );
247  }
248  return;
249 
251  if( Set3DColorFromUser( m_settings.m_BgColorTop, _( "Background Color, Top" ), nullptr ) )
252  {
255  else
256  NewDisplay( true );
257  }
258  return;
259 
262  return;
263 
266  return;
267 
270  return;
271 
274  break;
275 
278  break;
279 
282  NewDisplay( true );
283  break;
284 
287  NewDisplay( true );
288  return;
289 
292  NewDisplay( true );
293  return;
294 
297  NewDisplay( true );
298  return;
299 
301  {
302  auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
303  cfg->ResetToDefaults();
304  LoadSettings( cfg );
305 
306  // Tell canvas that we (may have) changed the render engine
308 
309  NewDisplay( true );
310  }
311  return;
312 
313  default:
314  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::Process_Special_Functions()" );
315  return;
316  }
317 }
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:103
CINFO3D_VISU m_settings
bool Set3DSolderMaskColorFromUser()
Set the solder mask color from a set of colors.
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:508
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:509
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:246
EDA_3D_CANVAS * m_canvas
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
#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.
bool Set3DSolderPasteColorFromUser()
Set the solder mask color from a set of colors.
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:240
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 SynchroniseColoursWithBoard(void)
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool Set3DBoardBodyColorFromUser()
Set the copper color from a set of colors.
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(), CINFO3D_VISU::m_BgColorBot, CINFO3D_VISU::m_BgColorTop, m_canvas, m_logTrace, m_settings, CINFO3D_VISU::MaterialModeSet(), NewDisplay(), NORMAL, NULL, OPENGL_LEGACY, Pgm(), RenderEngineChanged(), CINFO3D_VISU::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 270 of file eda_base_frame.cpp.

271 {
272 #ifdef __WXMAC__
273  // Apple in its infinite wisdom will raise a disabled window before even passing
274  // us the event, so we have no way to stop it. Instead, we have to catch an
275  // improperly ordered disabled window and quasi-modal dialog here and reorder
276  // them.
277  if( !IsEnabled() && IsActive() )
278  {
279  wxWindow* dlg = findQuasiModalDialog();
280  if( dlg )
281  dlg->Raise();
282  }
283 #endif
284 
285  if( !wxFrame::ProcessEvent( aEvent ) )
286  return false;
287 
288  if( IsShown() && m_hasAutoSave && IsActive() &&
290  {
291  if( !m_autoSaveState )
292  {
293  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
294  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
295  m_autoSaveState = true;
296  }
297  else if( m_autoSaveTimer->IsRunning() )
298  {
299  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
300  m_autoSaveTimer->Stop();
301  m_autoSaveState = false;
302  }
303  }
304 
305  return true;
306 }
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().

◆ PushTool()

void EDA_BASE_FRAME::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 197 of file eda_base_frame.cpp.

198 {
199  m_toolStack.push_back( actionName );
200 
201  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
202  if( m_toolStack.size() > 3 )
203  m_toolStack.erase( m_toolStack.begin() );
204 
205  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
206 
207  if( action )
208  DisplayToolMsg( action->GetLabel() );
209  else
210  DisplayToolMsg( actionName );
211 }
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
virtual void DisplayToolMsg(const wxString &msg)
wxString GetLabel() const
Definition: tool_action.cpp:69
std::vector< std::string > m_toolStack
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:193
TOOL_ACTION.
Definition: tool_action.h:46
TOOL_MANAGER * m_toolManager

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

Referenced by PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), 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 )
46  m_mainToolBar->Clear();
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 
57  m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
58  KiScaledBitmap( copy_xpm, this ),
59  _( "Copy 3D image to clipboard" ) );
60 
62 
63  m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
65  _( "Set display options, and some layers visibility" ) );
66  m_mainToolBar->AddSeparator();
67 
68  m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
70  _( "Render current view using Raytracing" ), wxITEM_CHECK );
71 
77 
81 
85 
89 
95 
98 
99  m_mainToolBar->Realize();
100 }
static TOOL_ACTION rotateXCW
Definition: 3d_actions.h:47
ACTION_TOOLBAR.
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
static const bool TOGGLE
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, EDA_BASE_FRAME *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
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
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Add a separator to the given toolbar scaled the same way as KiScaledBitmap.
Definition: bitmap.cpp:167
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:59
static TOOL_ACTION moveRight
Definition: 3d_actions.h:54

References _, ACTION_TOOLBAR::Add(), copy_xpm, dummy(), 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(), KiScaledSeparator(), 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()

void EDA_BASE_FRAME::ReCreateMenuBar ( )
virtualinherited

◆ RefreshCanvas()

virtual void EDA_BASE_FRAME::RefreshCanvas ( )
inlinevirtualinherited

Notification to refresh the drawing canvas (if any).

Reimplemented in EDA_DRAW_FRAME.

Definition at line 515 of file eda_base_frame.h.

515 { };

◆ 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 169 of file eda_3d_viewer.cpp.

170 {
171  // This will schedule a request to load later
172  if( m_canvas )
173  m_canvas->ReloadRequest( GetBoard(), Prj().Get3DCacheManager() );
174 }
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 169 of file eda_base_frame.cpp.

170 {
171 #if defined( _WIN32 )
172  // Windows: Destroys any block reason that may have existed
173  ShutdownBlockReasonDestroy( GetHandle() );
174 #endif
175 }

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 695 of file eda_3d_viewer.cpp.

696 {
697  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::RenderEngineChanged()" );
698 
699  if( m_canvas )
701 }
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 392 of file eda_base_frame.h.

392 {};

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 467 of file eda_3d_viewer.cpp.

468 {
469  auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
470 
472 
473  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings" );
474 
475  COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
476 
477  auto save_color = [colors] ( SFVEC3D& aSource, LAYER_3D_ID aTarget )
478  {
479  colors->SetColor( aTarget, COLOR4D( aSource.r, aSource.g, aSource.b, 1.0 ) );
480  };
481 
490 
491  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings render setting %s",
492  ( m_settings.RenderEngineGet() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
493  "OpenGL" );
494 
495  cfg->m_Render.engine = static_cast<int>( m_settings.RenderEngineGet() );
496  cfg->m_Render.grid_type = static_cast<int>( m_settings.GridGet() );
497  cfg->m_Render.material_mode = static_cast<int>( m_settings.MaterialModeGet() );
498 
499  cfg->m_Render.opengl_copper_thickness = m_settings.GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS );
500  cfg->m_Render.opengl_show_model_bbox = m_settings.GetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX );
501  cfg->m_Render.raytrace_anti_aliasing = m_settings.GetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING );
502  cfg->m_Render.raytrace_backfloor = m_settings.GetFlag( FL_RENDER_RAYTRACING_BACKFLOOR );
503  cfg->m_Render.raytrace_post_processing =
505  cfg->m_Render.raytrace_procedural_textures =
507  cfg->m_Render.raytrace_reflections = m_settings.GetFlag( FL_RENDER_RAYTRACING_REFLECTIONS );
508  cfg->m_Render.raytrace_refractions = m_settings.GetFlag( FL_RENDER_RAYTRACING_REFRACTIONS );
509  cfg->m_Render.raytrace_shadows = m_settings.GetFlag( FL_RENDER_RAYTRACING_SHADOWS );
510  cfg->m_Render.realistic = m_settings.GetFlag( FL_USE_REALISTIC_MODE );
511  cfg->m_Render.show_adhesive = m_settings.GetFlag( FL_ADHESIVE );
512  cfg->m_Render.show_axis = m_settings.GetFlag( FL_AXIS );
513  cfg->m_Render.show_board_body = m_settings.GetFlag( FL_SHOW_BOARD_BODY );
514  cfg->m_Render.show_comments = m_settings.GetFlag( FL_COMMENTS );
515  cfg->m_Render.show_eco = m_settings.GetFlag( FL_ECO );
516  cfg->m_Render.show_footprints_insert = m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT );
517  cfg->m_Render.show_footprints_normal = m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL );
518  cfg->m_Render.show_footprints_virtual = m_settings.GetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL );
519  cfg->m_Render.show_silkscreen = m_settings.GetFlag( FL_SILKSCREEN );
520  cfg->m_Render.show_soldermask = m_settings.GetFlag( FL_SOLDERMASK );
521  cfg->m_Render.show_solderpaste = m_settings.GetFlag( FL_SOLDERPASTE );
522  cfg->m_Render.show_zones = m_settings.GetFlag( FL_ZONE );
523  cfg->m_Render.subtract_mask_from_silk = m_settings.GetFlag( FL_SUBTRACT_MASK_FROM_SILK );
524 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
CINFO3D_VISU m_settings
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Saves common frame parameters to a configuration data file.
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:516
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:512
LAYER_3D_ID
3D Viewer virtual layers for color settings
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:222
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:508
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:515
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:509
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:510
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:252
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:514
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:513
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:240
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static VRML_COLOR colors[VRML_COLOR_LAST]
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40

References colors, FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_RENDER_OPENGL_COPPER_THICKNESS, 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, FL_SHOW_BOARD_BODY, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE, FL_SUBTRACT_MASK_FROM_SILK, FL_USE_REALISTIC_MODE, FL_ZONE, CINFO3D_VISU::GetFlag(), CINFO3D_VISU::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, CINFO3D_VISU::m_BgColorBot, CINFO3D_VISU::m_BgColorTop, CINFO3D_VISU::m_BoardBodyColor, CINFO3D_VISU::m_CopperColor, m_logTrace, m_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::m_SilkScreenColorTop, CINFO3D_VISU::m_SolderMaskColorTop, CINFO3D_VISU::m_SolderPasteColor, CINFO3D_VISU::MaterialModeGet(), Pgm(), RAYTRACING, CINFO3D_VISU::RenderEngineGet(), and EDA_BASE_FRAME::SaveSettings().

◆ 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 523 of file eda_base_frame.cpp.

524 {
525  wxString text;
526 
527  if( IsIconized() )
528  return;
529 
530  wxString baseCfgName = ConfigBaseName();
531 
532  m_FrameSize = GetSize();
533  m_FramePos = GetPosition();
534 
535  aCfg->pos_x = m_FramePos.x;
536  aCfg->pos_y = m_FramePos.y;
537  aCfg->size_x = m_FrameSize.x;
538  aCfg->size_y = m_FrameSize.y;
539  aCfg->maximized = IsMaximized();
540 
541  // TODO(JE) should auto-save in common settings be overwritten by every app?
542  if( m_hasAutoSave )
543  Pgm().GetCommonSettings()->m_System.autosave_interval = m_autoSaveInterval;
544 
545  // Once this is fully implemented, wxAuiManager will be used to maintain
546  // the persistance of the main frame and all it's managed windows and
547  // all of the legacy frame persistence position code can be removed.
548  aCfg->perspective = m_auimgr.SavePerspective().ToStdString();
549 
550  aCfg->mru_path = m_mruPath;
551 }
wxString mru_path
Definition: app_settings.h:55
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
wxString m_mruPath
wxString ConfigBaseName()
wxAuiManager m_auimgr
wxString perspective
Definition: app_settings.h:58

References EDA_BASE_FRAME::ConfigBaseName(), 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, 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, 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 795 of file eda_3d_viewer.cpp.

796 {
798 
799  colors.push_back( CUSTOM_COLOR_ITEM( 51/255.0, 43/255.0, 22/255.0, "FR4 natural, dark" ) );
800  colors.push_back( CUSTOM_COLOR_ITEM( 109/255.0, 116/255.0, 75/255.0, "FR4 natural" ) );
801  colors.push_back( CUSTOM_COLOR_ITEM( 78/255.0, 14/255.0, 5/255.0, "brown/red" ) );
802  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 1" ) );
803  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 123/255.0, 54/255.0, "brown 2" ) );
804  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 3" ) );
805  colors.push_back( CUSTOM_COLOR_ITEM( 63/255.0, 126/255.0, 71/255.0, "green 1" ) );
806  colors.push_back( CUSTOM_COLOR_ITEM( 117/255.0, 122/255.0, 90/255.0, "green 2" ) );
807 
808  if( Set3DColorFromUser( m_settings.m_BoardBodyColor, _( "Board Body Color" ), &colors ) )
809  {
810  NewDisplay( true );
811  return true;
812  }
813 
814  return false;
815 }
CINFO3D_VISU m_settings
a class to handle a custom color (predefined color) for the color picker dialog
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:510
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, CUSTOM_COLORS_LIST *aPredefinedColors)
Get a SFVEC3D from a wx colour dialog.
#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, CINFO3D_VISU::m_BoardBodyColor, m_settings, 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 704 of file eda_3d_viewer.cpp.

706 {
707  KIGFX::COLOR4D newcolor;
708  KIGFX::COLOR4D oldcolor( aColor.r,aColor.g, aColor.b, 1.0 );
709 
710  DIALOG_COLOR_PICKER picker( this, oldcolor, false, aPredefinedColors );
711 
712  if( picker.ShowModal() != wxID_OK )
713  return false;
714 
715  newcolor = picker.GetColor();
716 
717  if( newcolor == oldcolor )
718  return false;
719 
720  aColor.r = newcolor.r;
721  aColor.g = newcolor.g;
722  aColor.b = newcolor.b;
723 
724  return true;
725 }
double g
Green component.
Definition: color4d.h:303
double b
Blue component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:302
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40

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 776 of file eda_3d_viewer.cpp.

777 {
779 
780  colors.push_back( CUSTOM_COLOR_ITEM( 184/255.0, 115/255.0, 50/255.0, "Copper" ) );
781  colors.push_back( CUSTOM_COLOR_ITEM( 178/255.0, 156/255.0, 0.0, "Gold" ) );
782  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
783  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 160/255.0, 160/255.0, "Tin" ) );
784 
785  if( Set3DColorFromUser( m_settings.m_CopperColor, _( "Copper Color" ), &colors ) )
786  {
787  NewDisplay( true );
788  return true;
789  }
790 
791  return false;
792 }
CINFO3D_VISU m_settings
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:516
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.
#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, CINFO3D_VISU::m_CopperColor, m_settings, 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 728 of file eda_3d_viewer.cpp.

729 {
731 
732  colors.push_back( CUSTOM_COLOR_ITEM( 241.0/255.0, 241.0/255.0, 241.0/255.0, "White" ) );
733  colors.push_back( CUSTOM_COLOR_ITEM( 4.0/255.0, 18.0/255.0, 21.0/255.0, "Dark" ) );
734 
735  if( Set3DColorFromUser( m_settings.m_SilkScreenColorTop, _( "Silkscreen Color" ), &colors ) )
736  {
738  NewDisplay( true );
739  return true;
740  }
741 
742  return false;
743 }
CINFO3D_VISU m_settings
a class to handle a custom color (predefined color) for the color picker dialog
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:515
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.
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:514
#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_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::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 746 of file eda_3d_viewer.cpp.

747 {
749 
750  colors.push_back( CUSTOM_COLOR_ITEM( 20/255.0, 51/255.0, 36/255.0, "Green" ) );
751  colors.push_back( CUSTOM_COLOR_ITEM( 91/255.0, 168/255.0, 12/255.0, "Light Green" ) );
752  colors.push_back( CUSTOM_COLOR_ITEM( 13/255.0, 104/255.0, 11/255.0, "Saturated Green" ) );
753  colors.push_back( CUSTOM_COLOR_ITEM( 181/255.0, 19/255.0, 21/255.0, "Red" ) );
754  colors.push_back( CUSTOM_COLOR_ITEM( 239/255.0, 53/255.0, 41/255.0, "Red Light Orange" ) );
755  colors.push_back( CUSTOM_COLOR_ITEM( 210/255.0, 40/255.0, 14/255.0, "Red 2" ) );
756  colors.push_back( CUSTOM_COLOR_ITEM( 2/255.0, 59/255.0, 162/255.0, "Blue" ) );
757  colors.push_back( CUSTOM_COLOR_ITEM( 54/255.0, 79/255.0, 116/255.0, "Light blue 1" ) );
758  colors.push_back( CUSTOM_COLOR_ITEM( 61/255.0, 85/255.0, 130/255.0, "Light blue 2" ) );
759  colors.push_back( CUSTOM_COLOR_ITEM( 21/255.0, 70/255.0, 80/255.0, "Green blue (dark)" ) );
760  colors.push_back( CUSTOM_COLOR_ITEM( 11/255.0, 11/255.0, 11/255.0, "Black" ) );
761  colors.push_back( CUSTOM_COLOR_ITEM( 245/255.0, 245/255.0, 245/255.0, "White" ) );
762  colors.push_back( CUSTOM_COLOR_ITEM( 119/255.0, 31/255.0, 91/255.0, "Purple" ) );
763  colors.push_back( CUSTOM_COLOR_ITEM( 32/255.0, 2/255.0, 53/255.0, "Purple Dark" ) );
764 
765  if( Set3DColorFromUser( m_settings.m_SolderMaskColorTop, _( "Solder Mask Color" ), &colors ) )
766  {
768  NewDisplay( true );
769  return true;
770  }
771 
772  return false;
773 }
CINFO3D_VISU m_settings
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:511
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:512
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.
#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_settings, CINFO3D_VISU::m_SolderMaskColorBot, CINFO3D_VISU::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 818 of file eda_3d_viewer.cpp.

819 {
821 
822  colors.push_back( CUSTOM_COLOR_ITEM( 128/255.0, 128/255.0, 128/255.0, "grey" ) );
823  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
824  colors.push_back( CUSTOM_COLOR_ITEM( 90/255.0, 90/255.0, 90/255.0, "grey 2" ) );
825 
826  if( Set3DColorFromUser( m_settings.m_SolderPasteColor, _( "Solder Paste Color" ), &colors ) )
827  {
828  NewDisplay( true );
829  return true;
830  }
831 
832  return false;
833 }
CINFO3D_VISU m_settings
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.
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:513
#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_settings, CINFO3D_VISU::m_SolderPasteColor, NewDisplay(), and Set3DColorFromUser().

Referenced by Process_Special_Functions().

◆ SetAutoSaveInterval()

void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 309 of file eda_base_frame.cpp.

310 {
311  m_autoSaveInterval = aInterval;
312 
313  if( m_autoSaveTimer->IsRunning() )
314  {
315  if( m_autoSaveInterval > 0 )
316  {
317  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
318  }
319  else
320  {
321  m_autoSaveTimer->Stop();
322  m_autoSaveState = false;
323  }
324  }
325 }
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(), 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 164 of file kiway_player.h.

164 { 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 440 of file eda_base_frame.h.

440 { 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 178 of file eda_base_frame.cpp.

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

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), 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:192
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
wxWindow * m_modal_resultant_parent
Definition: kiway_player.h:190
wxString m_modal_string
Definition: kiway_player.h:191
bool IsModal()
Definition: kiway_player.h:163
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:189

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 159 of file eda_base_frame.cpp.

160 {
161 #if defined( _WIN32 )
162  return true;
163 #else
164  return false;
165 #endif
166 }

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

◆ SynchroniseColoursWithBoard()

void EDA_3D_VIEWER::SynchroniseColoursWithBoard ( void  )

Definition at line 527 of file eda_3d_viewer.cpp.

528 {
529  BOARD* brd = GetBoard();
530  const FAB_LAYER_COLOR* stdColors = GetColorStandardList();
531  wxColour color;
532  if( brd )
533  {
535 
536  for( BOARD_STACKUP_ITEM* stckpItem : stckp.GetList() )
537  {
538  wxString colorName = stckpItem->GetColor();
539 
540  if( colorName.StartsWith( "#" ) ) // This is a user defined color.
541  {
542  color.Set( colorName );
543  }
544  else
545  {
546  for( int i = 0; i < GetColorStandardListCount(); i++ )
547  {
548  if( stdColors[i].m_ColorName == colorName )
549  {
550  color = stdColors[i].m_Color;
551  break;
552  }
553  }
554  }
555 
556  if( color.IsOk() )
557  {
558  switch( stckpItem->GetBrdLayerId() )
559  {
560  case F_SilkS:
561  m_settings.m_SilkScreenColorTop.r = color.Red() / 255.0;
562  m_settings.m_SilkScreenColorTop.g = color.Green() / 255.0;
563  m_settings.m_SilkScreenColorTop.b = color.Blue() / 255.0;
564  break;
565  case B_SilkS:
566  m_settings.m_SilkScreenColorBot.r = color.Red() / 255.0;
567  m_settings.m_SilkScreenColorBot.g = color.Green() / 255.0;
568  m_settings.m_SilkScreenColorBot.b = color.Blue() / 255.0;
569  break;
570  case F_Mask:
571  m_settings.m_SolderMaskColorTop.r = color.Red() / 255.0;
572  m_settings.m_SolderMaskColorTop.g = color.Green() / 255.0;
573  m_settings.m_SolderMaskColorTop.b = color.Blue() / 255.0;
574  break;
575  case B_Mask:
576  m_settings.m_SolderMaskColorBot.r = color.Red() / 255.0;
577  m_settings.m_SolderMaskColorBot.g = color.Green() / 255.0;
578  m_settings.m_SolderMaskColorBot.b = color.Blue() / 255.0;
579  break;
580  default:
581  break;
582  }
583  }
584  }
585  }
586 }
std::vector< BOARD_STACKUP_ITEM * > & GetList()
CINFO3D_VISU m_settings
this class manage the layers needed to make a physical board they are solder mask,...
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:511
int color
Definition: DXF_plotter.cpp:61
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:512
int GetColorStandardListCount()
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:512
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:515
BOARD_STACKUP & GetStackupDescriptor()
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:514
this class manage one layer needed to make a physical board it can be a solder mask,...
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:163
const FAB_LAYER_COLOR * GetColorStandardList()
BOARD * GetBoard()
Definition: eda_3d_viewer.h:78

References B_Mask, B_SilkS, color, F_Mask, F_SilkS, GetBoard(), GetColorStandardList(), GetColorStandardListCount(), BOARD::GetDesignSettings(), BOARD_STACKUP::GetList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), FAB_LAYER_COLOR::m_Color, m_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::m_SilkScreenColorTop, CINFO3D_VISU::m_SolderMaskColorBot, and CINFO3D_VISU::m_SolderMaskColorTop.

Referenced by Process_Special_Functions().

◆ SyncToolbars()

void EDA_3D_VIEWER::SyncToolbars ( )
overrideprivatevirtual

Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.

Reimplemented from EDA_BASE_FRAME.

Definition at line 103 of file 3d_toolbar.cpp.

104 {
106 
108  m_mainToolBar->Refresh();
109 }
CINFO3D_VISU m_settings
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:216
PROJECTION_TYPE GetProjection()
Definition: ccamera.h:164
void Toggle(const TOOL_ACTION &aAction, bool aState)
Applies the default toggle action.
ACTION_TOOLBAR * m_mainToolBar
static TOOL_ACTION toggleOrtho
Definition: 3d_actions.h:59

References CINFO3D_VISU::CameraGet(), CCAMERA::GetProjection(), m_mainToolBar, m_settings, ORTHO, ACTION_TOOLBAR::Toggle(), and EDA_3D_ACTIONS::toggleOrtho.

◆ sys_search()

const SEARCH_STACK & EDA_BASE_FRAME::sys_search ( )
virtualinherited

Return a SEARCH_STACK pertaining to entire program.

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 581 of file eda_base_frame.cpp.

582 {
583  return Kiface().KifaceSearch();
584 }
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
Definition: kiface_i.h:129
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

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

Referenced by COMMON_CONTROL::ShowHelp().

◆ takeScreenshot()

void EDA_3D_VIEWER::takeScreenshot ( wxCommandEvent &  event)
private

Create a Screenshot of the current 3D view.

Output file format is png or jpeg, or image is copied to the clipboard

Definition at line 605 of file eda_3d_viewer.cpp.

606 {
607  wxString fullFileName;
608  bool fmt_is_jpeg = false;
609 
610  if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
611  fmt_is_jpeg = true;
612 
613  if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
614  {
615  // Remember path between saves during this session only.
616  const wxString wildcard = fmt_is_jpeg ? JpegFileWildcard() : PngFileWildcard();
617  const wxString ext = fmt_is_jpeg ? JpegFileExtension : PngFileExtension;
618 
619  // First time path is set to the project path.
620  if( !m_defaultSaveScreenshotFileName.IsOk() )
622 
623  m_defaultSaveScreenshotFileName.SetExt( ext );
624 
625  wxFileDialog dlg( this, _( "3D Image File Name" ),
627  m_defaultSaveScreenshotFileName.GetFullName(), wildcard,
628  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
629 
630  if( dlg.ShowModal() == wxID_CANCEL )
631  return;
632 
633  m_defaultSaveScreenshotFileName = dlg.GetPath();
634 
635  if( m_defaultSaveScreenshotFileName.GetExt().IsEmpty() )
636  m_defaultSaveScreenshotFileName.SetExt( ext );
637 
638  fullFileName = m_defaultSaveScreenshotFileName.GetFullPath();
639 
640  if( !wxFileName::IsFileWritable( fullFileName ) )
641  {
642  wxString msg;
643 
644  msg.Printf( _( "Insufficient permissions required to save file\n%s" ), fullFileName );
645  wxMessageBox( msg, _( "Error" ), wxOK | wxICON_ERROR, this );
646  return;
647  }
648 
649  // Be sure the screen area destroyed by the file dialog is redrawn
650  // before making a screen copy.
651  // Without this call, under Linux the screen refresh is made to late.
652  wxYield();
653  }
654 
655  // Be sure we have the latest 3D view (remember 3D view is buffered)
656  m_canvas->Request_refresh( true );
657  wxYield();
658 
659  // Build image from the 3D buffer
660  wxWindowUpdateLocker noUpdates( this );
661 
662  wxImage screenshotImage;
663 
664  if( m_canvas )
665  m_canvas->GetScreenshot( screenshotImage );
666 
667  if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
668  {
669  wxBitmap bitmap( screenshotImage );
670 
671  if( wxTheClipboard->Open() )
672  {
673  wxBitmapDataObject* dobjBmp = new wxBitmapDataObject( bitmap );
674 
675  if( !wxTheClipboard->SetData( dobjBmp ) )
676  wxMessageBox( _( "Failed to copy image to clipboard" ) );
677 
678  wxTheClipboard->Flush(); /* the data in clipboard will stay
679  * available after the application exits */
680  wxTheClipboard->Close();
681  }
682  }
683  else
684  {
685  if( !screenshotImage.SaveFile( fullFileName,
686  fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
687  wxMessageBox( _( "Can't save file" ) );
688 
689  screenshotImage.Destroy();
690  }
691 
692 }
const std::string JpegFileExtension
wxString JpegFileWildcard()
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
wxString PngFileWildcard()
void GetScreenshot(wxImage &aDstImage)
Request a screenshot and output it to the aDstImage.
wxFileName m_defaultSaveScreenshotFileName
#define _(s)
Definition: 3d_actions.cpp:33
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:76
const std::string PngFileExtension

References _, PROJECT::GetProjectFullName(), EDA_3D_CANVAS::GetScreenshot(), ID_MENU_SCREENCOPY_JPEG, ID_TOOL_SCREENCOPY_TOCLIBBOARD, JpegFileExtension, JpegFileWildcard(), m_canvas, m_defaultSaveScreenshotFileName, Parent(), PngFileExtension, PngFileWildcard(), KIWAY_HOLDER::Prj(), and EDA_3D_CANVAS::Request_refresh().

Referenced by Process_Special_Functions().

◆ ToolStackIsEmpty()

◆ unitsChangeRefresh()

virtual void EDA_BASE_FRAME::unitsChangeRefresh ( )
inlineprotectedvirtualinherited

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.

The default version only updates the status bar. Don't forget to call the default in your derived class or the status bar will not get updated properly.

Reimplemented in PCB_BASE_EDIT_FRAME, GERBVIEW_FRAME, EDA_DRAW_FRAME, and PCB_BASE_FRAME.

Definition at line 201 of file eda_base_frame.h.

201 { }

Referenced by EDA_BASE_FRAME::ChangeUserUnits().

◆ UpdateFileHistory()

void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
FILE_HISTORY aFileHistory = NULL 
)
inherited

Update the list of recently opened files.

The menu is also updated, if FILE_HISTORY::UseMenu was called at init time.

Parameters
FullFileNameThe full file name including the path.
aFileHistoryThe FILE_HISTORY in use. If NULL, the main application file history is used.

Definition at line 599 of file eda_base_frame.cpp.

600 {
601  FILE_HISTORY* fileHistory = aFileHistory;
602 
603  if( !fileHistory )
604  fileHistory = &Kiface().GetFileHistory();
605 
606  fileHistory->AddFileToHistory( FullFileName );
607 }
This class implements a file history object to store a list of files, that can then be added to a men...
Definition: filehistory.h:42
void AddFileToHistory(const wxString &aFile) override
Adds a file to the history.
Definition: filehistory.cpp:94
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:125

References FILE_HISTORY::AddFileToHistory(), KIFACE_I::GetFileHistory(), and Kiface().

Referenced by SCH_EDIT_FRAME::importFile(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberJobFile(), GERBVIEW_FRAME::loadListOfGerberAndDrillFiles(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), and GERBVIEW_FRAME::unarchiveFiles().

◆ UpdateStatusBar()

virtual void EDA_BASE_FRAME::UpdateStatusBar ( )
inlinevirtualinherited

Update the status bar information.

The status bar can draw itself. This is not a drawing function per se, but rather updates lines of text held by the components within the status bar which is owned by the wxFrame.

Reimplemented in EDA_DRAW_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, and SCH_BASE_FRAME.

Definition at line 493 of file eda_base_frame.h.

493 { }

Referenced by TOOL_MANAGER::UpdateUI().

Member Data Documentation

◆ KICAD_AUI_TB_STYLE

◆ m_AboutTitle

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

◆ m_actions

◆ m_auimgr

◆ m_autoSaveInterval

◆ m_autoSaveState

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited

◆ m_autoSaveTimer

wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited

◆ m_canvas

◆ m_configName

wxString EDA_BASE_FRAME::m_configName
protectedinherited

◆ m_defaultSaveScreenshotFileName

wxFileName EDA_3D_VIEWER::m_defaultSaveScreenshotFileName
private

Definition at line 208 of file eda_3d_viewer.h.

Referenced by takeScreenshot().

◆ m_disable_ray_tracing

bool EDA_3D_VIEWER::m_disable_ray_tracing
private

Definition at line 216 of file eda_3d_viewer.h.

Referenced by OnDisableRayTracing().

◆ m_dragSelects

bool EDA_BASE_FRAME::m_dragSelects
protectedinherited

◆ m_FramePos

◆ m_FrameSize

◆ m_hasAutoSave

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

◆ m_Ident

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

◆ m_immediateActions

bool EDA_BASE_FRAME::m_immediateActions
protectedinherited

◆ m_mainToolBar

ACTION_TOOLBAR* EDA_3D_VIEWER::m_mainToolBar
private

Definition at line 210 of file eda_3d_viewer.h.

Referenced by ReCreateMainToolbar(), and SyncToolbars().

◆ m_modal

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 188 of file kiway_player.h.

Referenced by KIWAY_PLAYER::IsModal(), and KIWAY_PLAYER::SetModal().

◆ m_modal_loop

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited

◆ m_modal_resultant_parent

wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 190 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

◆ m_modal_ret_val

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited

◆ m_modal_string

wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 191 of file kiway_player.h.

Referenced by KIWAY_PLAYER::DismissModal(), and KIWAY_PLAYER::ShowModal().

◆ m_moveWarpsCursor

bool EDA_BASE_FRAME::m_moveWarpsCursor
protectedinherited

◆ m_mruPath

◆ m_perspective

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

Definition at line 151 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::LoadWindowSettings().

◆ m_settings

◆ m_settingsManager

SETTINGS_MANAGER* EDA_BASE_FRAME::m_settingsManager
protectedinherited

Definition at line 131 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::GetSettingsManager().

◆ m_toolDispatcher

TOOL_DISPATCHER* EDA_3D_VIEWER::m_toolDispatcher
private

Definition at line 214 of file eda_3d_viewer.h.

◆ m_toolManager

TOOL_MANAGER* EDA_BASE_FRAME::m_toolManager
protectedinherited

Definition at line 133 of file eda_base_frame.h.

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_FRAME::ActivateGalCanvas(), SCH_EDIT_FRAME::AddJunction(), EDA_BASE_FRAME::AddStandardHelpMenu(), EDA_DRAW_FRAME::AddStandardSubMenus(), SCH_EDIT_FRAME::AppendSchematic(), GERBVIEW_FRAME::Clear_DrawLayers(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::ConvertTextType(), CreateMenuBar(), LIB_EDIT_FRAME::CreateNewPart(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), LIB_VIEW_FRAME::DClickOnCmpList(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_FRAME::DisplayCurrentSheet(), LIB_EDIT_FRAME::emptyScreen(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), EDA_BASE_FRAME::GetToolManager(), SCH_EDIT_FRAME::importFile(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadOneLibraryPartAux(), LIB_EDIT_FRAME::LoadOneSymbol(), SCH_EDIT_FRAME::OnCloseWindow(), GERBVIEW_FRAME::OnCloseWindow(), LIB_EDIT_FRAME::OnExportBody(), LIB_EDIT_FRAME::OnImportBody(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), EDA_DRAW_FRAME::OnSelectGrid(), LIB_EDIT_FRAME::OnSelectUnit(), EDA_DRAW_FRAME::OnSelectZoom(), SCH_EDIT_FRAME::OpenProjectFiles(), EDA_BASE_FRAME::PopTool(), EDA_BASE_FRAME::PushTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), LIB_VIEW_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), SCH_BASE_FRAME::RefreshSelection(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), LIB_EDIT_FRAME::RollbackPartFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_EDIT_FRAME::saveLibrary(), SCH_EDIT_FRAME::SchematicCleanUp(), GERBVIEW_FRAME::SetActiveLayer(), PCB_BASE_EDIT_FRAME::SetBoard(), LIB_EDIT_FRAME::SetCurPart(), SCH_BASE_FRAME::SetScreen(), LIB_VIEW_FRAME::SetSelectedComponent(), FOOTPRINT_EDIT_FRAME::setupTools(), LIB_VIEW_FRAME::setupTools(), GERBVIEW_FRAME::setupTools(), LIB_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), EDA_DRAW_FRAME::Zoom_Automatique(), CVPCB_MAINFRAME::~CVPCB_MAINFRAME(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), EDA_DRAW_FRAME::~EDA_DRAW_FRAME(), FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME(), LIB_EDIT_FRAME::~LIB_EDIT_FRAME(), LIB_VIEW_FRAME::~LIB_VIEW_FRAME(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ m_toolStack

std::vector<std::string> EDA_BASE_FRAME::m_toolStack
protectedinherited

◆ m_userUnits


The documentation for this class was generated from the following files: