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 ()
 
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)
 
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...
 
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 wxConfigBase * config ()
 Returns the wxConfigBase 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...
 
wxString ConfigBaseName ()
 
virtual void SaveProjectSettings (bool aAskForSave)
 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 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 SyncToolbars ()
 Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state. 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
 
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 On3DGridSelection (wxCommandEvent &event)
 
void OnRenderEngineSelection (wxCommandEvent &event)
 
void OnDisableRayTracing (wxCommandEvent &aEvent)
 
void ProcessZoom (wxCommandEvent &event)
 
void OnActivate (wxActivateEvent &event)
 
void OnSetFocus (wxFocusEvent &event)
 
void Install3DViewOptionDialog (wxCommandEvent &event)
 
void OnUpdateUIEngine (wxUpdateUIEvent &aEvent)
 
void OnUpdateUIMaterial (wxUpdateUIEvent &aEvent)
 
void CreateMenuBar ()
 
void ReCreateMainToolbar ()
 Equivalent of EDA_DRAW_FRAME::ReCreateHToolbar. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void OnKeyEvent (wxKeyEvent &event)
 
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
 
wxAuiToolBar * m_mainToolBar
 
EDA_3D_CANVASm_canvas
 
CINFO3D_VISU m_settings
 
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 56 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 146 of file eda_3d_viewer.cpp.

147  :
148  KIWAY_PLAYER( aKiway, aParent,
149  FRAME_PCB_DISPLAY3D, aTitle,
150  wxDefaultPosition, wxDefaultSize,
151  style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) )
152 {
153  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::EDA_3D_VIEWER %s", aTitle );
154 
155  m_canvas = NULL;
156  m_disable_ray_tracing = false;
157  m_mainToolBar = nullptr;
158  m_AboutTitle = "3D Viewer";
159 
160  // Give it an icon
161  wxIcon icon;
162  icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
163  SetIcon( icon );
164 
165  LoadSettings( config() );
166  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
167 
168  // Create the status line
169  static const int status_dims[4] = { -1, 130, 130, 170 };
170 
171  wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
172  SetStatusWidths( arrayDim( status_dims ), status_dims );
173 
174  m_canvas = new EDA_3D_CANVAS( this,
176  aParent->GetBoard(),
177  m_settings,
178  Prj().Get3DCacheManager() );
179 
180  if( m_canvas )
181  m_canvas->SetStatusBar( status_bar );
182 
183  // Some settings need the canvas
185 
186  // Create the manager
188  m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, this );
189 
190  // Register tools
192  m_actions = new EDA_3D_ACTIONS();
194 
195  CreateMenuBar();
197 
198  m_auimgr.SetManagedWindow( this );
199 
200  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
201  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
202 
203  m_auimgr.Update();
204 
205  m_mainToolBar->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( EDA_3D_VIEWER::OnKeyEvent ),
206  NULL, this );
207 
208  // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
209  // in order to receive mouse events. Otherwise, the user has to click somewhere on
210  // the canvas before it will respond to mouse wheel events.
211  if( m_canvas )
212  m_canvas->SetFocus();
213 }
static const int * GetAttributesList(bool aUseAntiAliasing)
Get a list of attributes to pass to wxGLCanvas.
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)
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
void OnKeyEvent(wxKeyEvent &event)
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
ACTIONS * m_actions
void SetStatusBar(wxStatusBar *aStatusBar)
Definition: eda_3d_canvas.h:81
wxString m_AboutTitle
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:60
virtual wxConfigBase * config()
Returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
wxAuiManager m_auimgr
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:79
wxAuiToolBar * m_mainToolBar
#define NULL
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 ReCreateMainToolbar()
Equivalent of EDA_DRAW_FRAME::ReCreateHToolbar.
Definition: 3d_toolbar.cpp:39
COMMON_CONTROL.
Specialization of the wxAuiPaneInfo class for KiCad panels.
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:38
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).
TOOL_MANAGER * m_toolManager
void InitTools()
Function InitTools() Initializes all registered tools.
BOARD * GetBoard() const
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
Definition: eda_3d_viewer.h:50
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(), icon_3d_xpm, KiBitmap(), NULL, OnKeyEvent(), Prj(), TOOL_MANAGER::SetEnvironment(), and EDA_3D_CANVAS::SetStatusBar().

◆ ~EDA_3D_VIEWER()

EDA_3D_VIEWER::~EDA_3D_VIEWER ( )

Definition at line 216 of file eda_3d_viewer.cpp.

217 {
218  m_mainToolBar->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( EDA_3D_VIEWER::OnKeyEvent ),
219  NULL, this );
220 
221  m_auimgr.UnInit();
222 
223  // m_canvas delete will be called by wxWidget manager
224  //delete m_canvas;
225  //m_canvas = nullptr;
226 }
void OnKeyEvent(wxKeyEvent &event)
wxAuiManager m_auimgr
wxAuiToolBar * m_mainToolBar
#define NULL

References EDA_BASE_FRAME::m_auimgr, m_mainToolBar, NULL, and OnKeyEvent().

Member Function Documentation

◆ AddStandardHelpMenu()

void EDA_BASE_FRAME::AddStandardHelpMenu ( wxMenuBar *  aMenuBar)
inherited

Adds the standard KiCad help menu to the menubar.

Definition at line 412 of file eda_base_frame.cpp.

413 {
414  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
415  ACTION_MENU* helpMenu = new ACTION_MENU( false );
416 
417  helpMenu->SetTool( commonControl );
418 
419  helpMenu->Add( ACTIONS::help );
420  helpMenu->Add( ACTIONS::gettingStarted );
421  helpMenu->Add( ACTIONS::listHotKeys );
422  helpMenu->Add( ACTIONS::getInvolved );
423 
424  helpMenu->AppendSeparator();
425  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, about_xpm );
426 
427  aMenuBar->Append( helpMenu, _( "&Help" ) );
428 }
static TOOL_ACTION listHotKeys
Definition: actions.h:167
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:31
static TOOL_ACTION help
Definition: actions.h:166
TOOL_MANAGER * m_toolManager
static TOOL_ACTION getInvolved
Definition: actions.h:168
static TOOL_ACTION gettingStarted
Definition: actions.h:165

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

222  {
223  SetUserUnits( aUnits );
225  }
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:98
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:31

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

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

988 {
989  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
990 
991  // Regen menu bars, etc
992  EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
993 
994  // There is no base class that handles toolbars for this frame
996 
998 
999  NewDisplay( true );
1000 }
void loadCommonSettings()
Load configuration from common settings.
void ReCreateMainToolbar()
Equivalent of EDA_DRAW_FRAME::ReCreateHToolbar.
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()

wxConfigBase * EDA_BASE_FRAME::config ( )
virtualinherited

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

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 584 of file eda_base_frame.cpp.

585 {
586  // KICAD_MANAGER_FRAME overrides this
587  wxConfigBase* ret = Kiface().KifaceSettings();
588  //wxASSERT( ret );
589  return ret;
590 }
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

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

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_EDIT_FRAME::GetSettings(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and EDA_BASE_FRAME::windowClosing().

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

346  {
347  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
348  return baseCfgName;
349  }
wxString m_configName

References EDA_BASE_FRAME::m_configName.

Referenced by DISPLAY_FOOTPRINTS_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and ACTION_MANAGER::UpdateHotKeys().

◆ CreateMenuBar()

void EDA_3D_VIEWER::CreateMenuBar ( )
private

Definition at line 38 of file 3d_menubar.cpp.

39 {
40  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CreateMenuBar" );
41 
43  wxMenuBar* menuBar = new wxMenuBar;
44 
45 
46  //-- File menu -----------------------------------------------------------
47  //
48  CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, tool );
49 
50  fileMenu->AddItem( ID_MENU_SCREENCOPY_PNG, _( "Export Current View as PNG..." ), "",
52 
53  fileMenu->AddItem( ID_MENU_SCREENCOPY_JPEG, _( "Export Current View as JPEG..." ), "",
55 
56  fileMenu->AddSeparator();
57  fileMenu->AddClose( _( "3D Viewer" ) );
58 
59  fileMenu->Resolve();
60 
61  //-- Edit menu -------------------------------------------------------
62  // Avoid to translate hotkey modifiers like Ctrl and Shift.
63  // The translated modifiers do not always work
64  CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, tool );
65 
66  editMenu->AddItem( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image" ), "",
68 
69  editMenu->Resolve();
70 
71  //-- View menu -------------------------------------------------------
72  //
73  CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, tool );
74 
75  viewMenu->AddItem( ID_ZOOM_IN, _( "Zoom In\tF1" ), HELP_ZOOM_IN,
77 
78  viewMenu->AddItem( ID_ZOOM_OUT, _( "Zoom Out\tF2" ), HELP_ZOOM_OUT,
80 
81  viewMenu->AddItem( ID_ZOOM_PAGE, _( "Zoom to Fit" ), HELP_ZOOM_FIT,
83 
84  viewMenu->AddItem( ID_ZOOM_REDRAW, _( "Redraw\tR" ), HELP_ZOOM_REDRAW,
86 
87  viewMenu->AddSeparator();
88  viewMenu->AddItem( ID_ROTATE3D_X_NEG, _( "Rotate X Clockwise" ) + "\tCtrl+Shift+X", "",
90 
91  viewMenu->AddItem( ID_ROTATE3D_X_POS, _( "Rotate X Counterclockwise" ) + "\tCtrl+X", "",
93 
94  viewMenu->AddSeparator();
95  viewMenu->AddItem( ID_ROTATE3D_Y_NEG, _( "Rotate Y Clockwise" ) + "\tCtrl+Shift+Y", "",
97 
98  viewMenu->AddItem( ID_ROTATE3D_Y_POS, _( "Rotate Y Counterclockwise" ) + "\tCtrl+Y", "",
100 
101  viewMenu->AddSeparator();
102  viewMenu->AddItem( ID_ROTATE3D_Z_NEG, _( "Rotate Z Clockwise" ) + "\tCtrl+Shift+Z", "",
104 
105  viewMenu->AddItem( ID_ROTATE3D_Z_POS, _( "Rotate Z Counterclockwise" ) + "\tCtrl+Z", "",
107 
108  viewMenu->AddSeparator();
109  viewMenu->AddItem( ID_MOVE3D_LEFT, _( "Move Left\tLeft" ), "",
111 
112  viewMenu->AddItem( ID_MOVE3D_RIGHT, _( "Move Right\tRight" ), "",
114 
115  viewMenu->AddItem( ID_MOVE3D_UP, _( "Move Up\tUp" ), "",
117 
118  viewMenu->AddItem( ID_MOVE3D_DOWN, _( "Move Down\tDown" ), "",
120 
121  viewMenu->Resolve();
122 
123  //-- Preferences menu -----------------------------------------------
124  //
125  CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, tool );
126 
127  //clang-format off
128  auto raytracingCondition = [this]( const SELECTION& aSel )
129  {
131  };
132 
133  auto NormalModeCondition = [this]( const SELECTION& aSel )
134  {
136  };
137 
138  auto DiffuseModeCondition = [this]( const SELECTION& aSel )
139  {
141  };
142 
143  auto CADModeCondition = [this]( const SELECTION& aSel )
144  {
146  };
147 
148  auto copperThicknessCondition = [this]( const SELECTION& aSel )
149  {
151  };
152 
153  auto boundingBoxesCondition = [this]( const SELECTION& aSel )
154  {
156  };
157 
158  auto renderShadowsCondition = [this]( const SELECTION& aSel )
159  {
161  };
162 
163  auto proceduralTexturesCondition = [this]( const SELECTION& aSel )
164  {
166  };
167 
168  auto showFloorCondition = [this]( const SELECTION& aSel )
169  {
171  };
172 
173  auto useRefractionsCondition = [this]( const SELECTION& aSel )
174  {
176  };
177 
178  auto useReflectionsCondition = [this]( const SELECTION& aSel )
179  {
181  };
182 
183  auto antiAliasingCondition = [this]( const SELECTION& aSel )
184  {
186  };
187 
188  auto postProcessCondition = [this]( const SELECTION& aSel )
189  {
191  };
192 
193  auto showAxesCondition = [this]( const SELECTION& aSel )
194  {
195  return m_settings.GetFlag( FL_AXIS );
196  };
197  //clang-format on
198 
199  prefsMenu->AddItem( ID_TOOL_SET_VISIBLE_ITEMS, _( "Display Options" ), "",
201 
202  prefsMenu->AddCheckItem( ID_RENDER_CURRENT_VIEW, _( "Raytracing" ), "",
203  tools_xpm, raytracingCondition );
204 
205  // Render options submenu
206  CONDITIONAL_MENU* optsSubmenu = new CONDITIONAL_MENU( false, tool );
207  optsSubmenu->SetTitle( _( "Render Options" ) );
208  optsSubmenu->SetIcon( options_3drender_xpm );
209 
210  // Material properties submenu
211  CONDITIONAL_MENU* propsSubmenu = new CONDITIONAL_MENU( false, tool );
212  propsSubmenu->SetTitle( _( "Material Properties" ) );
213  propsSubmenu->SetIcon( color_materials_xpm );
214 
216  _( "Use All Properties" ),
217  _( "Use all material properties from each 3D model file" ),
218  nullptr, NormalModeCondition );
219 
221  _( "Use Diffuse Only" ),
222  _( "Use only the diffuse color property from model 3D model file" ),
223  nullptr, DiffuseModeCondition );
224 
226  _( "CAD Color Style" ),
227  _( "Use a CAD color style based on the diffuse color of the material" ),
228  nullptr, CADModeCondition );
229 
230  optsSubmenu->AddMenu( propsSubmenu, SELECTION_CONDITIONS::ShowAlways );
231 
233  _( "Show Copper Thickness" ),
234  _( "Shows the copper thickness on copper layers (slower loading)" ),
235  use_3D_copper_thickness_xpm, copperThicknessCondition );
236 
238  _( "Show Model Bounding Boxes" ), "",
239  ortho_xpm, boundingBoxesCondition );
240 
241  // Raytracing submenu
242  CONDITIONAL_MENU* raySubmenu = new CONDITIONAL_MENU( false, tool );
243  raySubmenu->SetTitle( _( "Raytracing Options" ) );
244  raySubmenu->SetIcon( tools_xpm );
245 
247  _( "Render Shadows" ), "",
248  green_xpm, renderShadowsCondition );
249 
251  _( "Procedural Textures" ),
252  _( "Apply procedural textures to materials (slow)"),
253  green_xpm, proceduralTexturesCondition );
254 
256  _( "Add Floor" ),
257  _( "Adds a floor plane below the board (slow)"),
258  green_xpm, showFloorCondition );
259 
261  _( "Refractions" ),
262  _( "Render materials with refractions properties on final render (slow)"),
263  green_xpm, useRefractionsCondition );
264 
266  _( "Reflections" ),
267  _( "Render materials with reflections properties on final render (slow)"),
268  green_xpm, useReflectionsCondition );
269 
271  _( "Anti-aliasing" ),
272  _( "Render with improved quality on final render (slow)"),
273  green_xpm, antiAliasingCondition );
274 
276  _( "Post-processing" ),
277  _( "Apply Screen Space Ambient Occlusion and Global Illumination reflections on final render (slow)"),
278  green_xpm, postProcessCondition );
279 
280  optsSubmenu->AddMenu( raySubmenu, SELECTION_CONDITIONS::ShowAlways );
281  prefsMenu->AddMenu( optsSubmenu, SELECTION_CONDITIONS::ShowAlways );
282 
283  prefsMenu->AddSeparator();
284 
285  // Color submenu
286  CONDITIONAL_MENU* colorSubmenu = new CONDITIONAL_MENU( false, tool );
287  colorSubmenu->SetTitle( _( "Choose Colors" ) );
288  colorSubmenu->SetIcon( palette_xpm );
289 
290  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_TOP, _( "Background Top Color..." ), "",
292 
293  colorSubmenu->AddItem( ID_MENU3D_BGCOLOR_BOTTOM, _( "Background Bottom Color..." ), "",
295 
296  colorSubmenu->AddItem( ID_MENU3D_SILKSCREEN_COLOR, _( "Silkscreen Color..." ), "",
298 
299  colorSubmenu->AddItem( ID_MENU3D_SOLDERMASK_COLOR, _( "Solder Mask Color..." ), "",
301 
302  colorSubmenu->AddItem( ID_MENU3D_SOLDERPASTE_COLOR, _( "Solder Paste Color..." ), "",
304 
305  colorSubmenu->AddItem( ID_MENU3D_COPPER_COLOR, _( "Copper/Surface Finish Color..." ), "",
307 
308  colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
310 
311  // Only allow the stackup to be used in the PCB editor, since it isn't editable in the other frames
312  if( Parent()->IsType( FRAME_PCB_EDITOR ) )
313  {
314  colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
316  }
317 
318  prefsMenu->AddMenu( colorSubmenu );
319 
320  prefsMenu->AddCheckItem( ID_MENU3D_AXIS_ONOFF, _( "Show 3D &Axis" ), "",
321  axis3d_front_xpm, showAxesCondition );
322 
323  // Grid submenu
324  CONDITIONAL_MENU* gridSubmenu = new CONDITIONAL_MENU( false, tool );
325  gridSubmenu->SetTitle( _( "3D Grid" ) );
326  gridSubmenu->SetIcon( grid_xpm );
327 
328  //clang-format off
329  auto noGridCondition = [this]( const SELECTION& aSel )
330  {
332  };
333 
334  auto grid10mmCondition = [this]( const SELECTION& aSel )
335  {
337  };
338 
339  auto grid5mmCondition = [this]( const SELECTION& aSel )
340  {
342  };
343 
344  auto grid2p5mmCondition = [this]( const SELECTION& aSel )
345  {
347  };
348 
349  auto grid_1mmCondition = [this]( const SELECTION& aSel )
350  {
352  };
353  //clang-format on
354 
355  gridSubmenu->AddCheckItem( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), "",
356  nullptr, noGridCondition );
357  gridSubmenu->AddCheckItem( ID_MENU3D_GRID_10_MM, _( "3D Grid 10mm" ), "",
358  nullptr, grid10mmCondition );
359  gridSubmenu->AddCheckItem( ID_MENU3D_GRID_5_MM, _( "3D Grid 5mm" ), "",
360  nullptr, grid5mmCondition );
361  gridSubmenu->AddCheckItem( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5mm" ), "",
362  nullptr, grid2p5mmCondition );
363  gridSubmenu->AddCheckItem( ID_MENU3D_GRID_1_MM, _( "3D Grid 1mm" ), "",
364  nullptr, grid_1mmCondition );
365 
366  prefsMenu->AddMenu( gridSubmenu, SELECTION_CONDITIONS::ShowAlways );
367 
368  prefsMenu->AddSeparator();
369  prefsMenu->AddItem( ID_MENU3D_RESET_DEFAULTS, _( "Reset to Default Settings" ), "",
371 
372 #ifdef __APPLE__ // Note: will get moved to Apple menu by wxWidgets
373  prefsMenu->AddItem( wxID_PREFERENCES,
374  _( "Preferences...\tCTRL+," ),
375  _( "Show preferences for all open tools" ),
377 #endif
378 
379  prefsMenu->Resolve();
380 
381  //-- Menubar -------------------------------------------------------------
382  //
383  menuBar->Append( fileMenu, _( "&File" ) );
384  menuBar->Append( editMenu, _( "&Edit" ) );
385  menuBar->Append( viewMenu, _( "&View" ) );
386  menuBar->Append( prefsMenu, _( "&Preferences" ) );
387  AddStandardHelpMenu( menuBar );
388 
389  SetMenuBar( menuBar );
390 }
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 right_xpm[1]
Definition: right.cpp:49
const BITMAP_OPAQUE down_xpm[1]
Definition: down.cpp:47
const BITMAP_OPAQUE axis3d_front_xpm[1]
const BITMAP_OPAQUE setcolor_solderpaste_xpm[1]
CINFO3D_VISU m_settings
#define HELP_ZOOM_OUT
const BITMAP_OPAQUE palette_xpm[1]
Definition: palette.cpp:89
const BITMAP_OPAQUE rotate_neg_z_xpm[1]
Definition: id.h:200
const BITMAP_OPAQUE ortho_xpm[1]
Definition: ortho.cpp:55
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
const BITMAP_OPAQUE zoom_fit_in_page_xpm[1]
void AddCheckItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddCheckItem()
#define HELP_ZOOM_IN
const BITMAP_OPAQUE left_xpm[1]
Definition: left.cpp:48
const BITMAP_OPAQUE rotate_pos_z_xpm[1]
const BITMAP_OPAQUE setcolor_board_body_xpm[1]
const BITMAP_OPAQUE rotate_pos_y_xpm[1]
const BITMAP_OPAQUE zoom_redraw_xpm[1]
Definition: zoom_redraw.cpp:58
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
const BITMAP_OPAQUE rotate_pos_x_xpm[1]
Use only diffuse material properties.
ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
const BITMAP_OPAQUE zoom_out_xpm[1]
Definition: zoom_out.cpp:58
const BITMAP_OPAQUE setcolor_copper_xpm[1]
const BITMAP_OPAQUE read_setup_xpm[1]
Definition: read_setup.cpp:99
Use all material properties from model file.
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
const BITMAP_OPAQUE up_xpm[1]
Definition: up.cpp:47
#define HELP_ZOOM_REDRAW
const BITMAP_OPAQUE setcolor_silkscreen_xpm[1]
const BITMAP_OPAQUE copy_xpm[1]
Definition: copy.cpp:67
COMMON_CONTROL.
void Resolve()
Function Resolve()
const BITMAP_OPAQUE tools_xpm[1]
Definition: tools.cpp:113
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
void AddSeparator(int aOrder=ANY_ORDER)
Function AddSeparator()
void AddClose(wxString aAppname="")
Function AddClose()
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
const BITMAP_OPAQUE rotate_neg_x_xpm[1]
#define HELP_ZOOM_FIT
const BITMAP_OPAQUE setcolor_3d_bg_xpm[1]
void SetTitle(const wxString &aTitle) override
Function SetTitle() Sets title for the menu.
Definition: action_menu.cpp:86
const BITMAP_OPAQUE rotate_neg_y_xpm[1]
bool IsType(FRAME_T aType) const
#define _(s)
Definition: 3d_actions.cpp:31
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:67
const BITMAP_OPAQUE use_3D_copper_thickness_xpm[1]
TOOL_MANAGER * m_toolManager
const BITMAP_OPAQUE preference_xpm[1]
Definition: preference.cpp:66
const BITMAP_OPAQUE green_xpm[1]
Definition: green.cpp:95
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
const BITMAP_OPAQUE color_materials_xpm[1]
const BITMAP_OPAQUE zoom_in_xpm[1]
Definition: zoom_in.cpp:59

References _, CONDITIONAL_MENU::AddCheckItem(), CONDITIONAL_MENU::AddClose(), CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddMenu(), CONDITIONAL_MENU::AddSeparator(), EDA_BASE_FRAME::AddStandardHelpMenu(), axis3d_front_xpm, CAD_MODE, color_materials_xpm, copy_xpm, DIFFUSE_ONLY, down_xpm, 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(), green_xpm, GRID_10MM, GRID_1MM, GRID_2P5MM, GRID_5MM, grid_xpm, CINFO3D_VISU::GridGet(), HELP_ZOOM_FIT, HELP_ZOOM_IN, HELP_ZOOM_OUT, HELP_ZOOM_REDRAW, ID_MENU3D_AXIS_ONOFF, ID_MENU3D_BGCOLOR_BOTTOM, ID_MENU3D_BGCOLOR_TOP, ID_MENU3D_COPPER_COLOR, ID_MENU3D_FL_OPENGL_RENDER_COPPER_THICKNESS, ID_MENU3D_FL_OPENGL_RENDER_SHOW_MODEL_BBOX, ID_MENU3D_FL_RAYTRACING_ANTI_ALIASING, ID_MENU3D_FL_RAYTRACING_BACKFLOOR, ID_MENU3D_FL_RAYTRACING_POST_PROCESSING, ID_MENU3D_FL_RAYTRACING_PROCEDURAL_TEXTURES, ID_MENU3D_FL_RAYTRACING_REFLECTIONS, ID_MENU3D_FL_RAYTRACING_REFRACTIONS, ID_MENU3D_FL_RAYTRACING_RENDER_SHADOWS, 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_GRID_10_MM, ID_MENU3D_GRID_1_MM, ID_MENU3D_GRID_2P5_MM, ID_MENU3D_GRID_5_MM, ID_MENU3D_GRID_NOGRID, 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_MOVE3D_DOWN, ID_MOVE3D_LEFT, ID_MOVE3D_RIGHT, ID_MOVE3D_UP, ID_RENDER_CURRENT_VIEW, ID_ROTATE3D_X_NEG, ID_ROTATE3D_X_POS, ID_ROTATE3D_Y_NEG, ID_ROTATE3D_Y_POS, ID_ROTATE3D_Z_NEG, ID_ROTATE3D_Z_POS, ID_TOOL_SCREENCOPY_TOCLIBBOARD, ID_TOOL_SET_VISIBLE_ITEMS, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, EDA_BASE_FRAME::IsType(), left_xpm, m_logTrace, m_settings, EDA_BASE_FRAME::m_toolManager, CINFO3D_VISU::MaterialModeGet(), NONE, NORMAL, OPENGL_LEGACY, options_3drender_xpm, ortho_xpm, palette_xpm, Parent(), preference_xpm, read_setup_xpm, CINFO3D_VISU::RenderEngineGet(), CONDITIONAL_MENU::Resolve(), right_xpm, rotate_neg_x_xpm, rotate_neg_y_xpm, rotate_neg_z_xpm, rotate_pos_x_xpm, rotate_pos_y_xpm, rotate_pos_z_xpm, 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(), SELECTION_CONDITIONS::ShowAlways(), tools_xpm, up_xpm, use_3D_copper_thickness_xpm, zoom_fit_in_page_xpm, zoom_in_xpm, zoom_out_xpm, and zoom_redraw_xpm.

◆ CurrentToolName()

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

Definition at line 267 of file eda_base_frame.cpp.

268 {
269  if( m_toolStack.empty() )
270  return ACTIONS::selectionTool.GetName();
271  else
272  return m_toolStack.back();
273 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:143

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

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

245 {};

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

351 {
352  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
353 }

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

249 {
250  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Exit3DFrame" );
251 
252  Close( true );
253 }
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 475 of file eda_base_frame.h.

475 { 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 167 of file eda_base_frame.h.

168  {
169  return wxT( "_autosave-" );
170  }

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

290 { 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 159 of file eda_base_frame.h.

160  {
161  return wxT( "-bak" );
162  }

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 69 of file eda_3d_viewer.h.

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

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

Referenced by ReloadRequest(), and SynchroniseColoursWithBoard().

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

251 { 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 257 of file eda_base_frame.h.

257 { 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 622 of file eda_base_frame.cpp.

624 {
625  FILE_HISTORY* fileHistory = aFileHistory;
626 
627  if( !fileHistory )
628  fileHistory = &Kiface().GetFileHistory();
629 
630  int baseId = fileHistory->GetBaseId();
631 
632  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
633 
634  unsigned i = cmdId - baseId;
635 
636  if( i < fileHistory->GetCount() )
637  {
638  wxString fn = fileHistory->GetHistoryFile( i );
639 
640  if( wxFileName::FileExists( fn ) )
641  return fn;
642  else
643  {
644  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
645  wxMessageBox( msg );
646 
647  fileHistory->RemoveFileFromHistory( i );
648  }
649  }
650 
651  return wxEmptyString;
652 }
This class implements a file history object to store a list of files, that can then be added to a men...
Definition: filehistory.h:40
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:31
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123

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

263 { 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
Returns
current settings

Definition at line 96 of file eda_3d_viewer.h.

96 { return m_settings; }
CINFO3D_VISU m_settings

References m_settings.

◆ GetToolManager()

TOOL_MANAGER* EDA_BASE_FRAME::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 230 of file eda_base_frame.h.

230 { 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_DRC_CONTROL::DelDRCMarkers(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_DRC_CONTROL::doSelectionMenu(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), DIALOG_DRC_CONTROL::focusOnItem(), 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_CONTROL::OnDeleteOneClick(), DIALOG_ERC::OnLeftClickMarkersList(), FOOTPRINTS_LISTBOX::OnLeftDClick(), SIM_PLOT_FRAME::onProbe(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem(), 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(), and GERBVIEW_FRAME::SaveSettings().

◆ GetUserUnits()

EDA_UNITS EDA_BASE_FRAME::GetUserUnits ( ) const
inlineinherited

Return the user units currently in use.

Definition at line 211 of file eda_base_frame.h.

212  {
213  return m_userUnits;
214  }
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(), MARKER_BASE::DisplayMarkerInfo(), 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(), 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(), DRC::Reset(), 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(), DRC::updatePointers(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), PCB_BASE_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), PANEL_SETUP_TRACKS_AND_VIAS::validateData(), and PANEL_SETUP_NETCLASSES::validateData().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
virtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 599 of file eda_base_frame.cpp.

600 {
601  return Kiface().GetHelpFileName();
602 }
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:121
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 319 of file eda_base_frame.h.

319 { }

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

182 { 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 276 of file eda_base_frame.cpp.

277 {
278  if( m_toolStack.empty() )
279  return &aAction == &ACTIONS::selectionTool;
280  else
281  return m_toolStack.back() == aAction.GetName();
282 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:143
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 292 of file eda_base_frame.h.

292 { 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(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), LIB_CONTROL::Revert(), EE_INSPECTION_TOOL::RunERC(), LIB_CONTROL::Save(), PCBNEW_CONTROL::Show3DViewer(), LIB_CONTROL::ShowComponentTree(), EE_INSPECTION_TOOL::ShowDatasheet(), 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:31

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(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

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

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), 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_EDIT_FRAME::EditSheet(), SCH_EDITOR_CONTROL::EditWithLibEdit(), 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(), 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(), 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(), LIB_MANAGER::UpdatePart(), 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, SCH_EDIT_FRAME, FOOTPRINT_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 1263 of file eda_3d_viewer.cpp.

1264 {
1265  wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );
1266 
1267  wxConfigBase& cmnCfg = *Pgm().CommonSettings();
1268 
1269  {
1270  const DPI_SCALING dpi{ &cmnCfg, this };
1271  m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
1272  }
1273 
1274  {
1275  bool option;
1276  cmnCfg.Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false );
1278  }
1279 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:98
CINFO3D_VISU m_settings
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
Definition: dpi_scaling.h:35
EDA_3D_CANVAS * m_canvas
#define ENBL_MOUSEWHEEL_PAN_KEY
Definition: pgm_base.h:50
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 ENBL_MOUSEWHEEL_PAN_KEY, FL_MOUSEWHEEL_PANNING, m_canvas, m_settings, Pgm(), CINFO3D_VISU::SetFlag(), and HIDPI_GL_CANVAS::SetScaleFactor().

Referenced by CommonSettingsChanged().

◆ LoadSettings()

void EDA_3D_VIEWER::LoadSettings ( wxConfigBase *  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 705 of file eda_3d_viewer.cpp.

706 {
708 
709  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings" );
710 
711  aCfg->Read( keyBgColor_Red, &m_settings.m_BgColorBot.r, 0.4 );
712  aCfg->Read( keyBgColor_Green, &m_settings.m_BgColorBot.g, 0.4 );
713  aCfg->Read( keyBgColor_Blue, &m_settings.m_BgColorBot.b, 0.5 );
714 
715  aCfg->Read( keyBgColor_Red_Top, &m_settings.m_BgColorTop.r, 0.8 );
716  aCfg->Read( keyBgColor_Green_Top, &m_settings.m_BgColorTop.g, 0.8 );
717  aCfg->Read( keyBgColor_Blue_Top, &m_settings.m_BgColorTop.b, 0.9 );
718 
719  // m_SolderMaskColorTop default value = dark grey-green
720  aCfg->Read( keySMaskColor_Red, &m_settings.m_SolderMaskColorTop.r, 100.0 * 0.2 / 255.0 );
721  aCfg->Read( keySMaskColor_Green, &m_settings.m_SolderMaskColorTop.g, 255.0 * 0.2 / 255.0 );
722  aCfg->Read( keySMaskColor_Blue, &m_settings.m_SolderMaskColorTop.b, 180.0 * 0.2 / 255.0 );
723 
724  // m_SolderMaskColorBot default value = dark grey-green
725  aCfg->Read( keySMaskColor_Red, &m_settings.m_SolderMaskColorBot.r, 100.0 * 0.2 / 255.0 );
726  aCfg->Read( keySMaskColor_Green, &m_settings.m_SolderMaskColorBot.g, 255.0 * 0.2 / 255.0 );
727  aCfg->Read( keySMaskColor_Blue, &m_settings.m_SolderMaskColorBot.b, 180.0 * 0.2 / 255.0 );
728 
729  // m_SolderPasteColor default value = light grey
730  aCfg->Read( keySPasteColor_Red, &m_settings.m_SolderPasteColor.r, 128.0 / 255.0 );
731  aCfg->Read( keySPasteColor_Green, &m_settings.m_SolderPasteColor.g, 128.0 / 255.0 );
732  aCfg->Read( keySPasteColor_Blue, &m_settings.m_SolderPasteColor.b, 128.0 / 255.0 );
733 
734  // m_SilkScreenColorTop default value = white
735  aCfg->Read( keySilkColor_Red, &m_settings.m_SilkScreenColorTop.r, 0.9 );
736  aCfg->Read( keySilkColor_Green, &m_settings.m_SilkScreenColorTop.g, 0.9 );
737  aCfg->Read( keySilkColor_Blue, &m_settings.m_SilkScreenColorTop.b, 0.9 );
738 
739  // m_SilkScreenColorBot default value = white
740  aCfg->Read( keySilkColor_Red, &m_settings.m_SilkScreenColorBot.r, 0.9 );
741  aCfg->Read( keySilkColor_Green, &m_settings.m_SilkScreenColorBot.g, 0.9 );
742  aCfg->Read( keySilkColor_Blue, &m_settings.m_SilkScreenColorBot.b, 0.9 );
743 
744  // m_CopperColor default value = gold
745  aCfg->Read( keyCopperColor_Red, &m_settings.m_CopperColor.r, 255.0 * 0.7 / 255.0 );
746  aCfg->Read( keyCopperColor_Green, &m_settings.m_CopperColor.g, 223.0 * 0.7 / 255.0 );
747  aCfg->Read( keyCopperColor_Blue, &m_settings.m_CopperColor.b, 0.0 );
748 
749  // m_BoardBodyColor default value = FR4, in realistic mode
750  aCfg->Read( keyBoardBodyColor_Red, &m_settings.m_BoardBodyColor.r, 51.0 / 255.0 );
751  aCfg->Read( keyBoardBodyColor_Green, &m_settings.m_BoardBodyColor.g, 43.0 / 255.0 );
752  aCfg->Read( keyBoardBodyColor_Blue, &m_settings.m_BoardBodyColor.b, 22.0 / 255.0 );
753 
754 
755  bool tmp;
756  aCfg->Read( keyShowRealisticMode, &tmp, true );
758 
759  // OpenGL options
760  aCfg->Read( keyRenderOGL_ShowCopperTck, &tmp, true );
762 
763  aCfg->Read( keyRenderOGL_ShowModelBBox, &tmp, false );
765 
766  // Raytracing options
767  aCfg->Read( keyRenderRAY_Shadows, &tmp, true );
769 
770  aCfg->Read( keyRenderRAY_Backfloor, &tmp, false );
772 
773  aCfg->Read( keyRenderRAY_Refractions, &tmp, true );
775 
776  aCfg->Read( keyRenderRAY_Reflections, &tmp, true );
778 
779  aCfg->Read( keyRenderRAY_PostProcess, &tmp, true );
781 
782  aCfg->Read( keyRenderRAY_AAliasing, &tmp, true );
784 
785  aCfg->Read( keyRenderRAY_ProceduralT, &tmp, true );
787 
788  aCfg->Read( keyShowAxis, &tmp, true );
789  m_settings.SetFlag( FL_AXIS, tmp );
790 
791  aCfg->Read( keyShowFootprints_Normal, &tmp, true );
793 
794  aCfg->Read( keyShowFootprints_Insert, &tmp, true );
796 
797  aCfg->Read( keyShowFootprints_Virtual, &tmp, true );
799 
800  aCfg->Read( keyShowZones, &tmp, true );
801  m_settings.SetFlag( FL_ZONE, tmp );
802 
803  aCfg->Read( keyShowAdhesiveLayers, &tmp, true );
805 
806  aCfg->Read( keyShowSilkScreenLayers, &tmp, true );
808 
809  aCfg->Read( keyShowSolderMaskLayers, &tmp, true );
811 
812  aCfg->Read( keyShowSolderPasteLayers, &tmp, true );
814 
815  aCfg->Read( keyShowCommentsLayer, &tmp, true );
817 
818  aCfg->Read( keyShowEcoLayers, &tmp, true );
819  m_settings.SetFlag( FL_ECO, tmp );
820 
821  aCfg->Read( keyShowBoardBody, &tmp, true );
823 
824  int tmpi;
825  aCfg->Read( keyShowGrid, &tmpi, static_cast<int>( GRID3D_TYPE::NONE ) );
826  m_settings.GridSet( static_cast<GRID3D_TYPE>( tmpi ) );
827 
828  aCfg->Read( keyRenderEngine, &tmpi, static_cast<int>( RENDER_ENGINE::OPENGL_LEGACY ) );
829  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings render setting %s",
830  ( static_cast<RENDER_ENGINE>( tmpi ) == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
831  "OpenGL" );
832  m_settings.RenderEngineSet( static_cast<RENDER_ENGINE>( tmpi ) );
833 
834  aCfg->Read( keyRenderMaterial, &tmpi, static_cast<int>( MATERIAL_MODE::NORMAL ) );
835  m_settings.MaterialModeSet( static_cast<MATERIAL_MODE>( tmpi ) );
836 }
static const wxChar keyShowSolderMaskLayers[]
static const wxChar keyShowFootprints_Normal[]
static const wxChar keyRenderRAY_ProceduralT[]
static const wxChar keyShowGrid[]
static const wxChar keyShowBoardBody[]
static const wxChar keyRenderRAY_Reflections[]
CINFO3D_VISU m_settings
static const wxChar keyBgColor_Red_Top[]
static const wxChar keySilkColor_Blue[]
static const wxChar keyBgColor_Blue_Top[]
void GridSet(GRID3D_TYPE aGridType)
GridSet - set the current grid.
Definition: cinfo3d_visu.h:222
static const wxChar keyRenderEngine[]
static const wxChar keyBgColor_Red[]
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:505
static const wxChar keyShowFootprints_Insert[]
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:500
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:501
static const wxChar keyCopperColor_Green[]
static const wxChar keyShowFootprints_Virtual[]
static const wxChar keyShowAdhesiveLayers[]
static const wxChar keySilkColor_Green[]
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:497
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:504
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:498
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:240
static const wxChar keyShowRealisticMode[]
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:499
static const wxChar keyCopperColor_Blue[]
static const wxChar keySMaskColor_Green[]
static const wxChar keyBgColor_Green_Top[]
static const wxChar keyShowSolderPasteLayers[]
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:228
static const wxChar keySPasteColor_Red[]
static const wxChar keyShowSilkScreenLayers[]
static const wxChar keyCopperColor_Red[]
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:503
static const wxChar keyShowZones[]
static const wxChar keyRenderMaterial[]
static const wxChar keyRenderRAY_AAliasing[]
Use all material properties from model file.
virtual void LoadSettings(wxConfigBase *aCfg)
Load common frame parameters from a configuration file.
static const wxChar keyBgColor_Green[]
static const wxChar keyBoardBodyColor_Blue[]
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:502
static const wxChar keyRenderOGL_ShowModelBBox[]
static const wxChar keySPasteColor_Green[]
static const wxChar keyBoardBodyColor_Red[]
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static const wxChar keySilkColor_Red[]
static const wxChar keyBgColor_Blue[]
static const wxChar keySMaskColor_Red[]
static const wxChar keyRenderRAY_Refractions[]
static const wxChar keyRenderOGL_ShowCopperTck[]
static const wxChar keyRenderRAY_Backfloor[]
static const wxChar keySMaskColor_Blue[]
static const wxChar keyBoardBodyColor_Green[]
static const wxChar keyShowAxis[]
static const wxChar keySPasteColor_Blue[]
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
static const wxChar keyShowEcoLayers[]
static const wxChar keyShowCommentsLayer[]
static const wxChar keyRenderRAY_Shadows[]
static const wxChar keyRenderRAY_PostProcess[]

References 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_USE_REALISTIC_MODE, FL_ZONE, CINFO3D_VISU::GridSet(), keyBgColor_Blue, keyBgColor_Blue_Top, keyBgColor_Green, keyBgColor_Green_Top, keyBgColor_Red, keyBgColor_Red_Top, keyBoardBodyColor_Blue, keyBoardBodyColor_Green, keyBoardBodyColor_Red, keyCopperColor_Blue, keyCopperColor_Green, keyCopperColor_Red, keyRenderEngine, keyRenderMaterial, keyRenderOGL_ShowCopperTck, keyRenderOGL_ShowModelBBox, keyRenderRAY_AAliasing, keyRenderRAY_Backfloor, keyRenderRAY_PostProcess, keyRenderRAY_ProceduralT, keyRenderRAY_Reflections, keyRenderRAY_Refractions, keyRenderRAY_Shadows, keyShowAdhesiveLayers, keyShowAxis, keyShowBoardBody, keyShowCommentsLayer, keyShowEcoLayers, keyShowFootprints_Insert, keyShowFootprints_Normal, keyShowFootprints_Virtual, keyShowGrid, keyShowRealisticMode, keyShowSilkScreenLayers, keyShowSolderMaskLayers, keyShowSolderPasteLayers, keyShowZones, keySilkColor_Blue, keySilkColor_Green, keySilkColor_Red, keySMaskColor_Blue, keySMaskColor_Green, keySMaskColor_Red, keySPasteColor_Blue, keySPasteColor_Green, keySPasteColor_Red, 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(), NONE, NORMAL, OPENGL_LEGACY, RAYTRACING, CINFO3D_VISU::RenderEngineSet(), and CINFO3D_VISU::SetFlag().

Referenced by Process_Special_Functions().

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

238 {
239  ReloadRequest();
240 
241  // After the ReloadRequest call, the refresh often takes a bit of time,
242  // and it is made here only on request.
243  if( aForceImmediateRedraw )
244  m_canvas->Refresh();
245 }
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(), and PCB_BASE_FRAME::Update3DView().

◆ On3DGridSelection()

void EDA_3D_VIEWER::On3DGridSelection ( wxCommandEvent &  event)
private

Definition at line 574 of file eda_3d_viewer.cpp.

575 {
576  int id = event.GetId();
577 
578  wxASSERT( id < ID_MENU3D_GRID_END );
579  wxASSERT( id > ID_MENU3D_GRID );
580 
581  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::On3DGridSelection id %d", id );
582 
583  switch( id )
584  {
587  break;
590  break;
591  case ID_MENU3D_GRID_5_MM:
593  break;
596  break;
597  case ID_MENU3D_GRID_1_MM:
599  break;
600 
601  default:
602  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::On3DGridSelection()" );
603  }
604 
605  int menu_ids[]
606  {
609  };
610 
611  // Refresh checkmarks
612  wxMenuBar* menuBar = GetMenuBar();
613 
614  for( int ii = 0; ii < 5; ii++ )
615  {
616  wxMenuItem* item = menuBar->FindItem( menu_ids[ii] );
617  item->Check( menu_ids[ii] == id );
618  }
619 
620  if( m_canvas )
622 }
CINFO3D_VISU m_settings
void GridSet(GRID3D_TYPE aGridType)
GridSet - set the current grid.
Definition: cinfo3d_visu.h:222
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 GRID_10MM, GRID_1MM, GRID_2P5MM, GRID_5MM, CINFO3D_VISU::GridSet(), ID_MENU3D_GRID, ID_MENU3D_GRID_10_MM, ID_MENU3D_GRID_1_MM, ID_MENU3D_GRID_2P5_MM, ID_MENU3D_GRID_5_MM, ID_MENU3D_GRID_END, ID_MENU3D_GRID_NOGRID, m_canvas, m_logTrace, m_settings, NONE, and EDA_3D_CANVAS::Request_refresh().

◆ OnActivate()

void EDA_3D_VIEWER::OnActivate ( wxActivateEvent &  event)
private

Definition at line 676 of file eda_3d_viewer.cpp.

677 {
678  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" );
679 
680  if( m_canvas )
681  {
682  // Reload data if 3D frame shows a board,
683  // because it can be changed since last frame activation
686 
687  // Activates again the focus of the canvas so it will catch mouse and key events
688  m_canvas->SetFocus();
689  }
690 
691  event.Skip(); // required under wxMAC
692 }
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
Definition: eda_3d_canvas.h:89
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 343 of file eda_base_frame.cpp.

344 {
345  if( !doAutoSave() )
346  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
347 }
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 356 of file eda_base_frame.cpp.

357 {
358  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
359  // Key events can be filtered here.
360  // Currently no filtering is made.
361  event.Skip();
362 }
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 256 of file eda_3d_viewer.cpp.

257 {
258  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnCloseWindow" );
259 
260  if( m_canvas )
261  m_canvas->Close();
262 
263  // m_canvas delete will be called by wxWidget manager
264  //delete m_canvas;
265  //m_canvas = nullptr;
266 
267  Destroy();
268  event.Skip( true );
269 }
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.

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

◆ OnDisableRayTracing()

void EDA_3D_VIEWER::OnDisableRayTracing ( wxCommandEvent &  aEvent)
private

Definition at line 667 of file eda_3d_viewer.cpp.

668 {
669  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::%s disabling ray tracing.", __WXFUNCTION__ );
670 
671  m_disable_ray_tracing = true;
673 }
CINFO3D_VISU m_settings
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:228
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().

◆ OnKeyEvent()

void EDA_3D_VIEWER::OnKeyEvent ( wxKeyEvent &  event)
private

Definition at line 1003 of file eda_3d_viewer.cpp.

1004 {
1005  if( m_canvas )
1006  return m_canvas->OnKeyEvent( event );
1007 
1008  event.Skip();
1009 }
EDA_3D_CANVAS * m_canvas
void OnKeyEvent(wxKeyEvent &event)

References m_canvas, and EDA_3D_CANVAS::OnKeyEvent().

Referenced by EDA_3D_VIEWER(), and ~EDA_3D_VIEWER().

◆ OnKicadAbout()

void EDA_BASE_FRAME::OnKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 655 of file eda_base_frame.cpp.

656 {
657  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
658  ShowAboutDialog( this );
659 }
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 365 of file eda_base_frame.cpp.

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

References ACTION_MENU::OnMenuEvent().

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Definition at line 662 of file eda_base_frame.cpp.

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

626 {
627  const RENDER_ENGINE old_engine = m_settings.RenderEngineGet();
628 
629  if( old_engine == RENDER_ENGINE::OPENGL_LEGACY )
631  else
633 
634  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnRenderEngineSelection type %s ",
635  ( m_settings.RenderEngineGet() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
636  "OpenGL Legacy" );
637 
638  if( old_engine != m_settings.RenderEngineGet() )
639  {
641  }
642 }
CINFO3D_VISU m_settings
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:228
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
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:82

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

696 {
697  // Activates again the focus of the canvas so it will catch mouse and key events
698  if( m_canvas )
699  m_canvas->SetFocus();
700 
701  event.Skip();
702 }
EDA_3D_CANVAS * m_canvas

References m_canvas.

◆ OnUpdateUIEngine()

void EDA_3D_VIEWER::OnUpdateUIEngine ( wxUpdateUIEvent &  aEvent)
private

Definition at line 1234 of file eda_3d_viewer.cpp.

1235 {
1237 }
CINFO3D_VISU m_settings
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234

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

◆ OnUpdateUIMaterial()

void EDA_3D_VIEWER::OnUpdateUIMaterial ( wxUpdateUIEvent &  aEvent)
private

Definition at line 1240 of file eda_3d_viewer.cpp.

1241 {
1242  // Set the state of toggle menus according to the current display options
1243  switch( aEvent.GetId() )
1244  {
1246  aEvent.Check( m_settings.MaterialModeGet() == MATERIAL_MODE::NORMAL );
1247  break;
1248 
1251  break;
1252 
1254  aEvent.Check( m_settings.MaterialModeGet() == MATERIAL_MODE::CAD_MODE );
1255  break;
1256 
1257  default:
1258  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::OnUpdateUIMaterial()" );
1259  }
1260 }
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:246
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_MOCK_EESCHEMA_FRAME::MacOpenFile(), PGM_TEST_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 67 of file eda_3d_viewer.h.

67 { 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 229 of file eda_base_frame.cpp.

230 {
231  // Push/pop events can get out of order (such as when they're generated by the Simulator
232  // frame but not processed until the mouse is back in the Schematic frame), so make sure
233  // we're popping the right stack frame.
234 
235  for( int i = m_toolStack.size() - 1; i >= 0; --i )
236  {
237  if( m_toolStack[ i ] == actionName )
238  {
239  m_toolStack.erase( m_toolStack.begin() + i );
240 
241  // If there's something underneath us, and it's now the top of the stack, then
242  // re-activate it
243  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
244  {
245  std::string back = m_toolStack[ i ];
247 
248  if( action )
249  {
250  // Pop the action as running it will push it back onto the stack
251  m_toolStack.pop_back();
252 
253  TOOL_EVENT evt = action->MakeEvent();
254  evt.SetHasPosition( false );
255  GetToolManager()->PostEvent( evt );
256  }
257  }
258  else
260 
261  return;
262  }
263  }
264 }
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:163
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:237
static TOOL_ACTION selectionTool
Definition: actions.h:143
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 605 of file eda_base_frame.cpp.

606 {
607  SetStatusText( text );
608 }

◆ 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_DRC_CONTROL::makeValidFileNameReport(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), DIALOG_SCH_SHEET_PROPS::OnBrowseClicked(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), 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_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 273 of file eda_3d_viewer.cpp.

274 {
275  int id = event.GetId();
276  bool isChecked = event.IsChecked();
277 
278  wxLogTrace( m_logTrace,
279  "EDA_3D_VIEWER::Process_Special_Functions id %d isChecked %d",
280  id, isChecked );
281 
282  if( m_canvas == NULL )
283  return;
284 
285  switch( id )
286  {
287  case ID_RELOAD3D_BOARD:
288  NewDisplay( true );
289  break;
290 
291  case ID_ROTATE3D_X_POS:
292  m_settings.CameraGet().RotateX( glm::radians(ROT_ANGLE) );
293 
296  else
298 
299  break;
300 
301  case ID_ROTATE3D_X_NEG:
302  m_settings.CameraGet().RotateX( -glm::radians(ROT_ANGLE) );
303 
306  else
308 
309  break;
310 
311  case ID_ROTATE3D_Y_POS:
312  m_settings.CameraGet().RotateY( glm::radians(ROT_ANGLE) );
313 
316  else
318 
319  break;
320 
321  case ID_ROTATE3D_Y_NEG:
322  m_settings.CameraGet().RotateY( -glm::radians(ROT_ANGLE) );
323 
326  else
328 
329  break;
330 
331  case ID_ROTATE3D_Z_POS:
332  m_settings.CameraGet().RotateZ( glm::radians(ROT_ANGLE) );
333 
336  else
338 
339  break;
340 
341  case ID_ROTATE3D_Z_NEG:
342  m_settings.CameraGet().RotateZ( -glm::radians(ROT_ANGLE) );
343 
346  else
348 
349  break;
350 
351  case ID_MOVE3D_LEFT:
352  m_canvas->SetView3D( WXK_LEFT );
353  return;
354 
355  case ID_MOVE3D_RIGHT:
356  m_canvas->SetView3D( WXK_RIGHT );
357  return;
358 
359  case ID_MOVE3D_UP:
360  m_canvas->SetView3D( WXK_UP );
361  return;
362 
363  case ID_MOVE3D_DOWN:
364  m_canvas->SetView3D( WXK_DOWN );
365  return;
366 
367  case ID_ORTHO:
369 
372  else
374  return;
375 
379  takeScreenshot( event );
380  return;
381 
383  if( Set3DColorFromUser( m_settings.m_BgColorBot, _( "Background Color, Bottom" ),
384  nullptr ) )
385  {
388  else
389  NewDisplay( true );
390  }
391  return;
392 
394  if( Set3DColorFromUser( m_settings.m_BgColorTop, _( "Background Color, Top" ), nullptr ) )
395  {
398  else
399  NewDisplay( true );
400  }
401  return;
402 
405  return;
406 
409  return;
410 
413  return;
414 
417  break;
418 
421  break;
422 
425  NewDisplay( true );
426  break;
427 
430  NewDisplay( true );
431  return;
432 
435  NewDisplay( true );
436  return;
437 
440  NewDisplay( true );
441  return;
442 
445  NewDisplay( true );
446  return;
447 
450  NewDisplay( true );
451  return;
452 
456  return;
457 
461  return;
462 
465  NewDisplay( true );
466  return;
467 
470  NewDisplay( true );
471  return;
472 
476  return;
477 
481  return;
482 
485  NewDisplay( true );
486  return;
487 
491  return;
492 
494  m_settings.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
495  NewDisplay( true );
496  return;
497 
499  m_settings.SetFlag( FL_AXIS, isChecked );
501  return;
502 
505  NewDisplay( true );
506  return;
507 
510  NewDisplay( true );
511  return;
512 
515  NewDisplay( true );
516  return;
517 
519  m_settings.SetFlag( FL_ZONE, isChecked );
520  NewDisplay( true );
521  return;
522 
524  m_settings.SetFlag( FL_ADHESIVE, isChecked );
525  NewDisplay( true );
526  return;
527 
529  m_settings.SetFlag( FL_SILKSCREEN, isChecked );
530  NewDisplay( true );
531  return;
532 
534  m_settings.SetFlag( FL_SOLDERMASK, isChecked );
535  NewDisplay( true );
536  return;
537 
539  m_settings.SetFlag( FL_SOLDERPASTE, isChecked );
540  NewDisplay( true );
541  return;
542 
544  m_settings.SetFlag( FL_COMMENTS, isChecked );
545  NewDisplay( true );
546  return;
547 
548  case ID_MENU3D_ECO_ONOFF:
549  m_settings.SetFlag( FL_ECO, isChecked );
550  NewDisplay( true );
551  return;
552 
554  {
555  // Reload settings with a dummy config, so it will load the defaults
556  wxConfig *fooconfig = new wxConfig( "FooBarApp" );
557  LoadSettings( fooconfig );
558  delete fooconfig;
559 
560  // Tell canvas that we (may have) changed the render engine
562 
563  NewDisplay( true );
564  }
565  return;
566 
567  default:
568  wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::Process_Special_Functions()" );
569  return;
570  }
571 }
Use a gray shading based on diffuse material.
bool Set3DCopperColorFromUser()
Set the copper color from a set of colors.
CINFO3D_VISU m_settings
bool Set3DSolderMaskColorFromUser()
Set the solder mask color from a set of colors.
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
void RotateY(float aAngleInRadians)
Definition: ccamera.cpp:533
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:497
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:498
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:240
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
void RotateZ(float aAngleInRadians)
Definition: ccamera.cpp:540
void RotateX(float aAngleInRadians)
Definition: ccamera.cpp:526
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
void RenderRaytracingRequest()
RenderRaytracingRequest - Request to render the current view in Raytracing mode.
#define NULL
Use all material properties from model file.
bool Set3DSilkScreenColorFromUser()
Set the silkscreen color from a set of colors.
void ToggleProjection()
Definition: ccamera.cpp:447
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:234
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
#define _(s)
Definition: 3d_actions.cpp:31
bool SetView3D(int aKeycode)
SetView3D - Helper function to call view commands.
#define ROT_ANGLE
void SynchroniseColoursWithBoard(void)
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
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, CINFO3D_VISU::CameraGet(), DIFFUSE_ONLY, 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_USE_REALISTIC_MODE, FL_ZONE, ID_MENU3D_ADHESIVE_ONOFF, ID_MENU3D_AXIS_ONOFF, ID_MENU3D_BGCOLOR_BOTTOM, ID_MENU3D_BGCOLOR_TOP, ID_MENU3D_COMMENTS_ONOFF, ID_MENU3D_COPPER_COLOR, ID_MENU3D_ECO_ONOFF, ID_MENU3D_FL_OPENGL_RENDER_COPPER_THICKNESS, ID_MENU3D_FL_OPENGL_RENDER_SHOW_MODEL_BBOX, ID_MENU3D_FL_RAYTRACING_ANTI_ALIASING, ID_MENU3D_FL_RAYTRACING_BACKFLOOR, ID_MENU3D_FL_RAYTRACING_POST_PROCESSING, ID_MENU3D_FL_RAYTRACING_PROCEDURAL_TEXTURES, ID_MENU3D_FL_RAYTRACING_REFLECTIONS, ID_MENU3D_FL_RAYTRACING_REFRACTIONS, ID_MENU3D_FL_RAYTRACING_RENDER_SHADOWS, 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_MODULE_ONOFF_ATTRIBUTES_NORMAL, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL_INSERT, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_VIRTUAL, ID_MENU3D_PCB_BODY_COLOR, ID_MENU3D_REALISTIC_MODE, ID_MENU3D_RESET_DEFAULTS, ID_MENU3D_SHOW_BOARD_BODY, ID_MENU3D_SILKSCREEN_COLOR, ID_MENU3D_SILKSCREEN_ONOFF, ID_MENU3D_SOLDER_MASK_ONOFF, ID_MENU3D_SOLDER_PASTE_ONOFF, ID_MENU3D_SOLDERMASK_COLOR, ID_MENU3D_SOLDERPASTE_COLOR, ID_MENU3D_STACKUP_COLORS, ID_MENU3D_ZONE_ONOFF, ID_MENU_SCREENCOPY_JPEG, ID_MENU_SCREENCOPY_PNG, ID_MOVE3D_DOWN, ID_MOVE3D_LEFT, ID_MOVE3D_RIGHT, ID_MOVE3D_UP, ID_ORTHO, ID_RELOAD3D_BOARD, ID_ROTATE3D_X_NEG, ID_ROTATE3D_X_POS, ID_ROTATE3D_Y_NEG, ID_ROTATE3D_Y_POS, ID_ROTATE3D_Z_NEG, ID_ROTATE3D_Z_POS, 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, RenderEngineChanged(), CINFO3D_VISU::RenderEngineGet(), EDA_3D_CANVAS::RenderRaytracingRequest(), EDA_3D_CANVAS::Request_refresh(), ROT_ANGLE, CCAMERA::RotateX(), CCAMERA::RotateY(), CCAMERA::RotateZ(), Set3DBoardBodyColorFromUser(), Set3DColorFromUser(), Set3DCopperColorFromUser(), Set3DSilkScreenColorFromUser(), Set3DSolderMaskColorFromUser(), Set3DSolderPasteColorFromUser(), CINFO3D_VISU::SetFlag(), EDA_3D_CANVAS::SetView3D(), SynchroniseColoursWithBoard(), takeScreenshot(), and CCAMERA::ToggleProjection().

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

286 {
287 #ifdef __WXMAC__
288  // Apple in its infinite wisdom will raise a disabled window before even passing
289  // us the event, so we have no way to stop it. Instead, we have to catch an
290  // improperly ordered disabled window and quasi-modal dialog here and reorder
291  // them.
292  if( !IsEnabled() && IsActive() )
293  {
294  wxWindow* dlg = findQuasiModalDialog();
295  if( dlg )
296  dlg->Raise();
297  }
298 #endif
299 
300  if( !wxFrame::ProcessEvent( aEvent ) )
301  return false;
302 
303  if( IsShown() && m_hasAutoSave && IsActive() &&
305  {
306  if( !m_autoSaveState )
307  {
308  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
309  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
310  m_autoSaveState = true;
311  }
312  else if( m_autoSaveTimer->IsRunning() )
313  {
314  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
315  m_autoSaveTimer->Stop();
316  m_autoSaveState = false;
317  }
318  }
319 
320  return true;
321 }
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().

◆ ProcessZoom()

void EDA_3D_VIEWER::ProcessZoom ( wxCommandEvent &  event)
private

Definition at line 645 of file eda_3d_viewer.cpp.

646 {
647  int id = event.GetId();
648 
649  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ProcessZoom id:%d", id );
650 
651  if( m_canvas == NULL )
652  return;
653 
654  switch( id )
655  {
656  case ID_ZOOM_PAGE: m_canvas->SetView3D( WXK_HOME ); break;
657  case ID_ZOOM_IN: m_canvas->SetView3D( WXK_F1 ); break;
658  case ID_ZOOM_OUT: m_canvas->SetView3D( WXK_F2 ); break;
659  case ID_ZOOM_REDRAW: m_canvas->Request_refresh(); break;
660  default: wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::ProcessZoom()" );
661  }
662 
664 }
Definition: id.h:200
void DisplayStatus()
DisplayStatus - Update the status bar with the position information.
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
#define NULL
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool SetView3D(int aKeycode)
SetView3D - Helper function to call view commands.

References EDA_3D_CANVAS::DisplayStatus(), ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, m_canvas, m_logTrace, NULL, EDA_3D_CANVAS::Request_refresh(), and EDA_3D_CANVAS::SetView3D().

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

213 {
214  m_toolStack.push_back( actionName );
215 
216  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
217  if( m_toolStack.size() > 3 )
218  m_toolStack.erase( m_toolStack.begin() );
219 
220  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
221 
222  if( action )
223  DisplayToolMsg( action->GetLabel() );
224  else
225  DisplayToolMsg( actionName );
226 }
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:163
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

Equivalent of EDA_DRAW_FRAME::ReCreateHToolbar.

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  {
47  m_mainToolBar->Clear();
48  }
49  else
50  {
51  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
52  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
53  }
54 
55  // Set up toolbar
56  m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
57  KiScaledBitmap( import3d_xpm, this ), _( "Reload board" ) );
58 
60 
61  m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
62  KiScaledBitmap( copy_xpm, this ),
63  _( "Copy 3D image to clipboard" ) );
64 
66 
67  m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
69  _( "Set display options, and some layers visibility" ) );
70  m_mainToolBar->AddSeparator();
71 
72  m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
74  _( "Render current view using Raytracing" ), wxITEM_CHECK );
75 
77 
78  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
79  KiScaledBitmap( zoom_in_xpm, this ),
80  _( "Zoom in" ) );
81 
82  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
84  _( "Zoom out" ) );
85 
86  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
88  _( "Redraw view" ) );
89 
90  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
92  _( "Zoom to fit 3D model" ) );
93 
95 
96  m_mainToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
98  _( "Rotate X Clockwise" ) );
99 
100  m_mainToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
102  _( "Rotate X Counterclockwise" ) );
103 
105 
106  m_mainToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
108  _( "Rotate Y Clockwise" ) );
109 
110  m_mainToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
112  _( "Rotate Y Counterclockwise" ) );
113 
115 
116  m_mainToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
118  _( "Rotate Z Clockwise" ) );
119 
120  m_mainToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
122  _( "Rotate Z Counterclockwise" ) );
123 
125 
126  m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString,
127  KiScaledBitmap( left_xpm, this ),
128  _( "Move left" ) );
129 
130  m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString,
131  KiScaledBitmap( right_xpm, this ),
132  _( "Move right" ) );
133 
134  m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString,
135  KiScaledBitmap( up_xpm, this ),
136  _( "Move up" ) );
137 
138  m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString,
139  KiScaledBitmap( down_xpm, this ),
140  _( "Move down" ) );
141 
143 
144  m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString,
145  KiScaledBitmap( ortho_xpm, this ),
146  _( "Enable/Disable orthographic projection" ),
147  wxITEM_CHECK );
148 
149  m_mainToolBar->Realize();
150 }
const BITMAP_OPAQUE right_xpm[1]
Definition: right.cpp:49
const BITMAP_OPAQUE down_xpm[1]
Definition: down.cpp:47
const BITMAP_OPAQUE rotate_neg_z_xpm[1]
Definition: id.h:200
const BITMAP_OPAQUE ortho_xpm[1]
Definition: ortho.cpp:55
const BITMAP_OPAQUE zoom_fit_in_page_xpm[1]
const BITMAP_OPAQUE left_xpm[1]
Definition: left.cpp:48
const BITMAP_OPAQUE import3d_xpm[1]
Definition: import3d.cpp:61
const BITMAP_OPAQUE rotate_pos_z_xpm[1]
const BITMAP_OPAQUE rotate_pos_y_xpm[1]
const BITMAP_OPAQUE zoom_redraw_xpm[1]
Definition: zoom_redraw.cpp:58
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
const BITMAP_OPAQUE rotate_pos_x_xpm[1]
const BITMAP_OPAQUE zoom_out_xpm[1]
Definition: zoom_out.cpp:58
const BITMAP_OPAQUE read_setup_xpm[1]
Definition: read_setup.cpp:99
wxAuiToolBar * m_mainToolBar
const BITMAP_OPAQUE up_xpm[1]
Definition: up.cpp:47
const BITMAP_OPAQUE copy_xpm[1]
Definition: copy.cpp:67
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
const BITMAP_OPAQUE rotate_neg_x_xpm[1]
const BITMAP_OPAQUE rotate_neg_y_xpm[1]
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
#define _(s)
Definition: 3d_actions.cpp:31
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
const BITMAP_OPAQUE render_mode_xpm[1]
Definition: render_mode.cpp:92
const BITMAP_OPAQUE zoom_in_xpm[1]
Definition: zoom_in.cpp:59

References _, copy_xpm, down_xpm, dummy(), ID_H_TOOLBAR, ID_MOVE3D_DOWN, ID_MOVE3D_LEFT, ID_MOVE3D_RIGHT, ID_MOVE3D_UP, ID_ORTHO, ID_RELOAD3D_BOARD, ID_RENDER_CURRENT_VIEW, ID_ROTATE3D_X_NEG, ID_ROTATE3D_X_POS, ID_ROTATE3D_Y_NEG, ID_ROTATE3D_Y_POS, ID_ROTATE3D_Z_NEG, ID_ROTATE3D_Z_POS, ID_TOOL_SCREENCOPY_TOCLIBBOARD, ID_TOOL_SET_VISIBLE_ITEMS, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, import3d_xpm, EDA_BASE_FRAME::KICAD_AUI_TB_STYLE, KiScaledBitmap(), KiScaledSeparator(), left_xpm, m_logTrace, m_mainToolBar, ortho_xpm, read_setup_xpm, render_mode_xpm, right_xpm, rotate_neg_x_xpm, rotate_neg_y_xpm, rotate_neg_z_xpm, rotate_pos_x_xpm, rotate_pos_y_xpm, rotate_pos_z_xpm, up_xpm, zoom_fit_in_page_xpm, zoom_in_xpm, zoom_out_xpm, and zoom_redraw_xpm.

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

473 { };

Referenced by TOOL_MANAGER::ProcessEvent().

◆ ReloadRequest()

void EDA_3D_VIEWER::ReloadRequest ( )

Request reloading the 3D view.

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

Definition at line 229 of file eda_3d_viewer.cpp.

230 {
231  // This will schedule a request to load later
232  if( m_canvas )
233  m_canvas->ReloadRequest( GetBoard(), Prj().Get3DCacheManager() );
234 }
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:69

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

185 {
186 #if defined( _WIN32 )
187  // Windows: Destroys any block reason that may have existed
188  ShutdownBlockReasonDestroy( GetHandle() );
189 #endif
190 }

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

1094 {
1095  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::RenderEngineChanged()" );
1096 
1097  if( m_canvas )
1099 }
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 ( bool  aAskForSave)
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 358 of file eda_base_frame.h.

358 {};

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

◆ SaveSettings()

void EDA_3D_VIEWER::SaveSettings ( wxConfigBase *  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 839 of file eda_3d_viewer.cpp.

840 {
842 
843  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings" );
844 
845  aCfg->Write( keyBgColor_Red, m_settings.m_BgColorBot.r );
846  aCfg->Write( keyBgColor_Green, m_settings.m_BgColorBot.g );
847  aCfg->Write( keyBgColor_Blue, m_settings.m_BgColorBot.b );
848 
849  aCfg->Write( keyBgColor_Red_Top, m_settings.m_BgColorTop.r );
850  aCfg->Write( keyBgColor_Green_Top, m_settings.m_BgColorTop.g );
851  aCfg->Write( keyBgColor_Blue_Top, m_settings.m_BgColorTop.b );
852 
856 
860 
864 
868 
872 
873  aCfg->Write( keyCopperColor_Red, m_settings.m_CopperColor.r );
875  aCfg->Write( keyCopperColor_Blue, m_settings.m_CopperColor.b );
876 
880 
882 
883  aCfg->Write( keyRenderEngine, static_cast<int>( m_settings.RenderEngineGet() ) );
884  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings render setting %s",
885  ( m_settings.RenderEngineGet() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
886  "OpenGL" );
887 
888  aCfg->Write( keyRenderMaterial, (int)m_settings.MaterialModeGet() );
889 
890  // OpenGL options
891  aCfg->Write( keyRenderOGL_ShowCopperTck,
893  aCfg->Write( keyRenderOGL_ShowModelBBox,
895 
896  // Raytracing options
901  aCfg->Write(
904  aCfg->Write( keyRenderRAY_ProceduralT,
906 
907  aCfg->Write( keyShowAxis, m_settings.GetFlag( FL_AXIS ) );
908  aCfg->Write( keyShowGrid, (int) m_settings.GridGet() );
909 
911  aCfg->Write(
914 
915  aCfg->Write( keyShowZones, m_settings.GetFlag( FL_ZONE ) );
921  aCfg->Write( keyShowEcoLayers, m_settings.GetFlag( FL_ECO ) );
923 }
static const wxChar keyShowSolderMaskLayers[]
static const wxChar keyShowFootprints_Normal[]
static const wxChar keyRenderRAY_ProceduralT[]
static const wxChar keyShowGrid[]
static const wxChar keyShowBoardBody[]
static const wxChar keyRenderRAY_Reflections[]
CINFO3D_VISU m_settings
static const wxChar keyBgColor_Red_Top[]
static const wxChar keySilkColor_Blue[]
static const wxChar keyBgColor_Blue_Top[]
static const wxChar keyRenderEngine[]
static const wxChar keyBgColor_Red[]
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:505
static const wxChar keyShowFootprints_Insert[]
virtual void SaveSettings(wxConfigBase *aCfg)
Saves common frame parameters to a configuration data file.
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:500
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:501
static const wxChar keyCopperColor_Green[]
static const wxChar keyShowFootprints_Virtual[]
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
static const wxChar keyShowAdhesiveLayers[]
static const wxChar keySilkColor_Green[]
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:497
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:504
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:498
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
static const wxChar keyShowRealisticMode[]
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:499
static const wxChar keyCopperColor_Blue[]
static const wxChar keySMaskColor_Green[]
static const wxChar keyBgColor_Green_Top[]
static const wxChar keyShowSolderPasteLayers[]
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
static const wxChar keySPasteColor_Red[]
static const wxChar keyShowSilkScreenLayers[]
static const wxChar keyCopperColor_Red[]
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:503
static const wxChar keyShowZones[]
static const wxChar keyRenderMaterial[]
static const wxChar keyRenderRAY_AAliasing[]
static const wxChar keyBgColor_Green[]
static const wxChar keyBoardBodyColor_Blue[]
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:502
static const wxChar keyRenderOGL_ShowModelBBox[]
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
static const wxChar keySPasteColor_Green[]
static const wxChar keyBoardBodyColor_Red[]
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static const wxChar keySilkColor_Red[]
static const wxChar keyBgColor_Blue[]
static const wxChar keySMaskColor_Red[]
static const wxChar keyRenderRAY_Refractions[]
static const wxChar keyRenderOGL_ShowCopperTck[]
static const wxChar keyRenderRAY_Backfloor[]
static const wxChar keySMaskColor_Blue[]
static const wxChar keyBoardBodyColor_Green[]
static const wxChar keyShowAxis[]
static const wxChar keySPasteColor_Blue[]
static const wxChar keyShowEcoLayers[]
static const wxChar keyShowCommentsLayer[]
static const wxChar keyRenderRAY_Shadows[]
static const wxChar keyRenderRAY_PostProcess[]

References 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_USE_REALISTIC_MODE, FL_ZONE, CINFO3D_VISU::GetFlag(), CINFO3D_VISU::GridGet(), keyBgColor_Blue, keyBgColor_Blue_Top, keyBgColor_Green, keyBgColor_Green_Top, keyBgColor_Red, keyBgColor_Red_Top, keyBoardBodyColor_Blue, keyBoardBodyColor_Green, keyBoardBodyColor_Red, keyCopperColor_Blue, keyCopperColor_Green, keyCopperColor_Red, keyRenderEngine, keyRenderMaterial, keyRenderOGL_ShowCopperTck, keyRenderOGL_ShowModelBBox, keyRenderRAY_AAliasing, keyRenderRAY_Backfloor, keyRenderRAY_PostProcess, keyRenderRAY_ProceduralT, keyRenderRAY_Reflections, keyRenderRAY_Refractions, keyRenderRAY_Shadows, keyShowAdhesiveLayers, keyShowAxis, keyShowBoardBody, keyShowCommentsLayer, keyShowEcoLayers, keyShowFootprints_Insert, keyShowFootprints_Normal, keyShowFootprints_Virtual, keyShowGrid, keyShowRealisticMode, keyShowSilkScreenLayers, keyShowSolderMaskLayers, keyShowSolderPasteLayers, keyShowZones, keySilkColor_Blue, keySilkColor_Green, keySilkColor_Red, keySMaskColor_Blue, keySMaskColor_Green, keySMaskColor_Red, keySPasteColor_Blue, keySPasteColor_Green, keySPasteColor_Red, 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::MaterialModeGet(), RAYTRACING, CINFO3D_VISU::RenderEngineGet(), and 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 1193 of file eda_3d_viewer.cpp.

1194 {
1196 
1197  colors.push_back( CUSTOM_COLOR_ITEM( 51/255.0, 43/255.0, 22/255.0, "FR4 natural, dark" ) );
1198  colors.push_back( CUSTOM_COLOR_ITEM( 109/255.0, 116/255.0, 75/255.0, "FR4 natural" ) );
1199  colors.push_back( CUSTOM_COLOR_ITEM( 78/255.0, 14/255.0, 5/255.0, "brown/red" ) );
1200  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 1" ) );
1201  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 123/255.0, 54/255.0, "brown 2" ) );
1202  colors.push_back( CUSTOM_COLOR_ITEM( 146/255.0, 99/255.0, 47/255.0, "brown 3" ) );
1203  colors.push_back( CUSTOM_COLOR_ITEM( 63/255.0, 126/255.0, 71/255.0, "green 1" ) );
1204  colors.push_back( CUSTOM_COLOR_ITEM( 117/255.0, 122/255.0, 90/255.0, "green 2" ) );
1205 
1206  if( Set3DColorFromUser( m_settings.m_BoardBodyColor, _( "Board Body Color" ), &colors ) )
1207  {
1208  NewDisplay( true );
1209  return true;
1210  }
1211 
1212  return false;
1213 }
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:499
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:31
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 if empty, no predefined colors are used. no change if aborted by user

Definition at line 1102 of file eda_3d_viewer.cpp.

1104 {
1105  KIGFX::COLOR4D newcolor;
1106  KIGFX::COLOR4D oldcolor( aColor.r,aColor.g, aColor.b, 1.0 );
1107 
1108  DIALOG_COLOR_PICKER picker( this, oldcolor, false, aPredefinedColors );
1109 
1110  if( picker.ShowModal() != wxID_OK )
1111  return false;
1112 
1113  newcolor = picker.GetColor();
1114 
1115  if( newcolor == oldcolor )
1116  return false;
1117 
1118  aColor.r = newcolor.r;
1119  aColor.g = newcolor.g;
1120  aColor.b = newcolor.b;
1121 
1122  return true;
1123 }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

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

1175 {
1177 
1178  colors.push_back( CUSTOM_COLOR_ITEM( 184/255.0, 115/255.0, 50/255.0, "Copper" ) );
1179  colors.push_back( CUSTOM_COLOR_ITEM( 178/255.0, 156/255.0, 0.0, "Gold" ) );
1180  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
1181  colors.push_back( CUSTOM_COLOR_ITEM( 160/255.0, 160/255.0, 160/255.0, "Tin" ) );
1182 
1183  if( Set3DColorFromUser( m_settings.m_CopperColor, _( "Copper Color" ), &colors ) )
1184  {
1185  NewDisplay( true );
1186  return true;
1187  }
1188 
1189  return false;
1190 }
CINFO3D_VISU m_settings
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:505
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:31
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 1126 of file eda_3d_viewer.cpp.

1127 {
1129 
1130  colors.push_back( CUSTOM_COLOR_ITEM( 241.0/255.0, 241.0/255.0, 241.0/255.0, "White" ) );
1131  colors.push_back( CUSTOM_COLOR_ITEM( 4.0/255.0, 18.0/255.0, 21.0/255.0, "Dark" ) );
1132 
1133  if( Set3DColorFromUser( m_settings.m_SilkScreenColorTop, _( "Silkscreen Color" ), &colors ) )
1134  {
1136  NewDisplay( true );
1137  return true;
1138  }
1139 
1140  return false;
1141 }
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:504
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:503
#define _(s)
Definition: 3d_actions.cpp:31
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 1144 of file eda_3d_viewer.cpp.

1145 {
1147 
1148  colors.push_back( CUSTOM_COLOR_ITEM( 20/255.0, 51/255.0, 36/255.0, "Green" ) );
1149  colors.push_back( CUSTOM_COLOR_ITEM( 91/255.0, 168/255.0, 12/255.0, "Light Green" ) );
1150  colors.push_back( CUSTOM_COLOR_ITEM( 13/255.0, 104/255.0, 11/255.0, "Saturated Green" ) );
1151  colors.push_back( CUSTOM_COLOR_ITEM( 181/255.0, 19/255.0, 21/255.0, "Red" ) );
1152  colors.push_back( CUSTOM_COLOR_ITEM( 239/255.0, 53/255.0, 41/255.0, "Red Light Orange" ) );
1153  colors.push_back( CUSTOM_COLOR_ITEM( 210/255.0, 40/255.0, 14/255.0, "Red 2" ) );
1154  colors.push_back( CUSTOM_COLOR_ITEM( 2/255.0, 59/255.0, 162/255.0, "Blue" ) );
1155  colors.push_back( CUSTOM_COLOR_ITEM( 54/255.0, 79/255.0, 116/255.0, "Light blue 1" ) );
1156  colors.push_back( CUSTOM_COLOR_ITEM( 61/255.0, 85/255.0, 130/255.0, "Light blue 2" ) );
1157  colors.push_back( CUSTOM_COLOR_ITEM( 21/255.0, 70/255.0, 80/255.0, "Green blue (dark)" ) );
1158  colors.push_back( CUSTOM_COLOR_ITEM( 11/255.0, 11/255.0, 11/255.0, "Black" ) );
1159  colors.push_back( CUSTOM_COLOR_ITEM( 245/255.0, 245/255.0, 245/255.0, "White" ) );
1160  colors.push_back( CUSTOM_COLOR_ITEM( 119/255.0, 31/255.0, 91/255.0, "Purple" ) );
1161  colors.push_back( CUSTOM_COLOR_ITEM( 32/255.0, 2/255.0, 53/255.0, "Purple Dark" ) );
1162 
1163  if( Set3DColorFromUser( m_settings.m_SolderMaskColorTop, _( "Solder Mask Color" ), &colors ) )
1164  {
1166  NewDisplay( true );
1167  return true;
1168  }
1169 
1170  return false;
1171 }
CINFO3D_VISU m_settings
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:500
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:501
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:31
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 1216 of file eda_3d_viewer.cpp.

1217 {
1219 
1220  colors.push_back( CUSTOM_COLOR_ITEM( 128/255.0, 128/255.0, 128/255.0, "grey" ) );
1221  colors.push_back( CUSTOM_COLOR_ITEM( 213/255.0, 213/255.0, 213/255.0, "Silver" ) );
1222  colors.push_back( CUSTOM_COLOR_ITEM( 90/255.0, 90/255.0, 90/255.0, "grey 2" ) );
1223 
1224  if( Set3DColorFromUser( m_settings.m_SolderPasteColor, _( "Solder Paste Color" ), &colors ) )
1225  {
1226  NewDisplay( true );
1227  return true;
1228  }
1229 
1230  return false;
1231 }
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:502
#define _(s)
Definition: 3d_actions.cpp:31
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 324 of file eda_base_frame.cpp.

325 {
326  m_autoSaveInterval = aInterval;
327 
328  if( m_autoSaveTimer->IsRunning() )
329  {
330  if( m_autoSaveInterval > 0 )
331  {
332  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
333  }
334  else
335  {
336  m_autoSaveTimer->Stop();
337  m_autoSaveState = false;
338  }
339  }
340 }
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 398 of file eda_base_frame.h.

398 { 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 193 of file eda_base_frame.cpp.

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

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

175 {
176 #if defined( _WIN32 )
177  return true;
178 #else
179  return false;
180 #endif
181 }

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

927 {
928  BOARD* brd = GetBoard();
929  const FAB_LAYER_COLOR* stdColors = GetColorStandardList();
930  wxColour color;
931  if( brd )
932  {
934 
935  for( BOARD_STACKUP_ITEM* stckpItem : stckp.GetList() )
936  {
937  wxString colorName = stckpItem->GetColor();
938 
939