KiCad PCB EDA Suite
EDA_3D_VIEWER Class Reference

Class EDA_3D_VIEWER 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 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...
 
void SetDefaultFileName (const wxString &aFn)
 Function SetDefaultFileName Set the default file name (eg: to be suggested to a screenshot) More...
 
const wxString & GetDefaultFileName () const
 Function GetDefaultFileName. More...
 
CINFO3D_VISUGetSettings ()
 Function GetSettings. More...
 
bool Set3DColorFromUser (SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
 Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog. More...
 
bool Set3DSolderMaskColorFromUser ()
 Function Set3DSolderMaskColorFromUser Set the solder mask color from a set of colors. More...
 
bool Set3DSolderPasteColorFromUser ()
 Function Set3DSolderPasteColorFromUser Set the solder mask color from a set of colors. More...
 
bool Set3DCopperColorFromUser ()
 Function Set3DCopperColorFromUser Set the copper color from a set of colors. More...
 
bool Set3DBoardBodyColorFromUser ()
 Function Set3DBoardBodyBodyColorFromUser Set the copper color from a set of colors. More...
 
bool Set3DSilkScreenColorFromUser ()
 Function Set3DSilkScreenColorFromUser Set the silkscreen color from a set of colors. More...
 
VTBL_ENTRY 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...
 
VTBL_ENTRY bool ImportFile (const wxString &aFileName, int aFileType)
 Function ImportFile load the given filename but sets the path to the current project path. More...
 
VTBL_ENTRY 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 ProcessEvent (wxEvent &aEvent) override
 Function ProcessEvent overrides the default process event handler to implement the auto save feature. More...
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
wxString ConfigBaseName ()
 Function ConfigBaseName. More...
 
virtual void SaveProjectSettings (bool aAskForSave)
 Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More...
 
virtual void OnSelectPreferredEditor (wxCommandEvent &event)
 Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More...
 
int ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More...
 
virtual int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
 Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file. More...
 
int ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Function GetFileFromHistory fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Function UpdateFileHistory Updates the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual void ReCreateMenuBar ()
 Function ReCreateMenuBar Creates recreates the menu bar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Function IsWritable checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension)
 Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Function ShowChangedLanguage redraws the menus and what not in current language. More...
 
virtual void ShowChangedIcons ()
 Function ShowChangedIcons redraws items menus after a icon was changed option. More...
 
void AddMenuIconsOptions (wxMenu *MasterMenu)
 Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More...
 
bool PostCommandMenuEvent (int evt_type)
 Function PostCommandMenuEvent. More...
 
virtual int GetIconScale ()
 Function GetIconScale. More...
 
virtual void SetIconScale (int aScale)
 Function SetIconScale. More...
 
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

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)
 
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 OnChangeIconsOptions (wxCommandEvent &event) override
 Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Function onAutoSaveTimer handles the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Function autoSaveRequired returns the auto save status of the application. More...
 
virtual bool doAutoSave ()
 Function doAutoSave should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual const SEARCH_STACKsys_search ()
 Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual wxString help_name ()
 

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
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used More...
 
wxAuiToolBar * m_mainToolBar
 Standard horizontal Toolbar. More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

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 OnUpdateMenus (wxUpdateUIEvent &event)
 
void ProcessZoom (wxCommandEvent &event)
 
void OnActivate (wxActivateEvent &event)
 
void OnSetFocus (wxFocusEvent &event)
 
void Install3DViewOptionDialog (wxCommandEvent &event)
 
void CreateMenuBar ()
 
void DisplayHotKeys ()
 
void SetMenuBarOptionsState ()
 Set the state of toggle menus according to the current display options. More...
 
void ReCreateMainToolbar ()
 
void SetToolbars ()
 
void SaveSettings (wxConfigBase *aCfg) override
 Function SaveSettings saves common frame parameters to a configuration data file. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Function LoadSettings loads common frame parameters from a configuration file. More...
 
void OnLeftClick (wxDC *DC, const wxPoint &MousePos)
 
void OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu)
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg)
 
void takeScreenshot (wxCommandEvent &event)
 Function TakeScreenshot Create a Screenshot of the current 3D view. More...
 
void RenderEngineChanged ()
 RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged. More...
 

Private Attributes

wxString m_defaultFileName
 Filename to propose for save a screenshot. More...
 
EDA_3D_CANVASm_canvas
 The canvas where the openGL context will be rendered. More...
 
CINFO3D_VISU m_settings
 Store all the settings and options to be used by the renders. More...
 

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

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

Definition at line 50 of file eda_3d_viewer.h.

Constructor & Destructor Documentation

EDA_3D_VIEWER::Process_Special_Functions EDA_3D_VIEWER::On3DGridSelection EDA_3D_VIEWER::OnUpdateMenus 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 144 of file eda_3d_viewer.cpp.

References DIM, COGL_ATT_LIST::GetAttributesList(), EDA_PANEINFO::HorizontalToolbarPane(), ID_RENDER_CURRENT_VIEW, KiBitmap(), Prj(), RENDER_ENGINE_OPENGL_LEGACY, and EDA_3D_CANVAS::SetStatusBar().

147  :
148 
149  KIWAY_PLAYER( aKiway,
150  aParent,
152  aTitle,
153  wxDefaultPosition,
154  wxDefaultSize,
155  style,
157 {
158  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::EDA_3D_VIEWER %s" ), aTitle );
159 
160  m_canvas = NULL;
161  m_defaultFileName = "";
162 
163  // Give it an icon
164  wxIcon icon;
165  icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
166  SetIcon( icon );
167 
168  LoadSettings( config() );
169  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
170 
171  // Create the status line
172  static const int status_dims[4] = { -1, 130, 130, 170 };
173 
174  wxStatusBar *status_bar = CreateStatusBar( DIM( status_dims ) );
175  SetStatusWidths( DIM( status_dims ), status_dims );
176 
177  CreateMenuBar();
179 
180  m_canvas = new EDA_3D_CANVAS( this,
182  aParent->GetBoard(),
183  m_settings,
184  Prj().Get3DCacheManager() );
185 
186  if( m_canvas )
187  m_canvas->SetStatusBar( status_bar );
188 
189  m_auimgr.SetManagedWindow( this );
190 
191  EDA_PANEINFO horiztb;
192  horiztb.HorizontalToolbarPane();
193 
194  m_auimgr.AddPane( m_mainToolBar,
195  wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
196 
197  if( m_canvas )
198  m_auimgr.AddPane( m_canvas,
199  wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
200 
201  m_auimgr.Update();
202 
205 
206  // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
207  // in order to receive mouse events. Otherwise, the user has to click somewhere on
208  // the canvas before it will respond to mouse wheel events.
209  if( m_canvas )
210  m_canvas->SetFocus();
211 }
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
#define DIM(x)
of elements in an array
Definition: macros.h:98
static const int * GetAttributesList(bool aUseAntiAliasing)
Get a list of attributes to pass to wxGLCanvas.
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
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
Function LoadSettings loads common frame parameters from a configuration file.
void SetStatusBar(wxStatusBar *aStatusBar)
Definition: eda_3d_canvas.h:74
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
BOARD * GetBoard() const
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
wxAuiManager m_auimgr
Specialization of the wxAuiPaneInfo class for KiCad panels.
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:39
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
wxString m_defaultFileName
Filename to propose for save a screenshot.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void CreateMenuBar()
Definition: 3d_toolbar.cpp:138
#define VIEWER3D_FRAMENAME
Definition: eda_3d_viewer.h:44
EDA_3D_VIEWER::~EDA_3D_VIEWER ( )

Definition at line 214 of file eda_3d_viewer.cpp.

References EDA_BASE_FRAME::m_auimgr.

215 {
216  m_auimgr.UnInit();
217 
218  // m_canvas delete will be called by wxWidget manager
219  //delete m_canvas;
220  //m_canvas = 0;
221 }
wxAuiManager m_auimgr

Member Function Documentation

void EDA_BASE_FRAME::AddMenuIconsOptions ( wxMenu *  MasterMenu)
inherited

Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu.

Parameters
MasterMenuThe main menu. The sub menu list will be accessible from the menu item with id ID_KICAD_SELECT_ICONS_OPTIONS

Definition at line 677 of file eda_base_frame.cpp.

References AddMenuItem(), ID_KICAD_SELECT_ICONS_IN_MENUS, ID_KICAD_SELECT_ICONS_OPTIONS, KiBitmap(), and Pgm().

Referenced by EDA_BASE_FRAME::GetMruPath(), preparePreferencesMenu(), PL_EDITOR_FRAME::ReCreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), and GERBVIEW_FRAME::ReCreateMenuBar().

678 {
679  wxMenu* menu = NULL;
680  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
681 
682  if( item ) // This menu exists, do nothing
683  return;
684 
685  menu = new wxMenu;
686 
687  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
688  _( "Icons in Menus" ), wxEmptyString,
689  wxITEM_CHECK ) );
690  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
691 
692  AddMenuItem( MasterMenu, menu,
694  _( "Icons Options" ),
695  _( "Select show icons in menus and icons sizes" ),
696  KiBitmap( icon_xpm ) );
697 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:174
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName,
const wxString &  aBackupFileExtension 
)
inherited

Function CheckForAutoSaveFile checks 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.
aBackupFileExtensionA wxString object containing the backup file extension used to create the backup file name.

Definition at line 582 of file eda_base_frame.cpp.

References AUTOSAVE_PREFIX_FILENAME, Format(), GetChars(), Pgm(), and traceAutoSave.

Referenced by EDA_BASE_FRAME::GetMruPath(), and PCB_EDIT_FRAME::OpenProjectFiles().

584 {
585  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
586  wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
587 
588  wxFileName autoSaveFileName = aFileName;
589 
590  // Check for auto save file.
591  autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
592 
593  wxLogTrace( traceAutoSave,
594  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
595 
596  if( !autoSaveFileName.FileExists() )
597  return;
598 
599  wxString msg = wxString::Format( _(
600  "Well this is potentially embarrassing!\n"
601  "It appears that the last time you were editing the file\n"
602  "\"%s\"\n"
603  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
604  GetChars( aFileName.GetFullName() )
605  );
606 
607  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
608 
609  // Make a backup of the current file, delete the file, and rename the auto save file to
610  // the file name.
611  if( response == wxYES )
612  {
613  // Get the backup file name.
614  wxFileName backupFileName = aFileName;
615  backupFileName.SetExt( aBackupFileExtension );
616 
617  // If an old backup file exists, delete it. If an old copy of the file exists, rename
618  // it to the backup file name
619  if( aFileName.FileExists() )
620  {
621  // Remove the old file backup file.
622  if( backupFileName.FileExists() )
623  wxRemoveFile( backupFileName.GetFullPath() );
624 
625  // Rename the old file to the backup file name.
626  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
627  {
628  msg.Printf( _( "Could not create backup file \"%s\"" ),
629  GetChars( backupFileName.GetFullPath() ) );
630  wxMessageBox( msg );
631  }
632  }
633 
634  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
635  {
636  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
637  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
638  }
639  }
640  else
641  {
642  wxLogTrace( traceAutoSave,
643  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
644 
645  // Remove the auto save file when using the previous file as is.
646  wxRemoveFile( autoSaveFileName.GetFullPath() );
647  }
648 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
#define AUTOSAVE_PREFIX_FILENAME
Prefix to create filenames for schematic files or other difile when auto-saved to retrieve a crash...
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:92
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
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited
wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited

Function ConfigBaseName.

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, unless m_configFrameName contains a base name. this is the case of frames which can be shown in normal or modal mode. This is needed because we want only one base name prefix, regardless the mode used.

Definition at line 266 of file eda_base_frame.h.

References EDA_BASE_FRAME::m_configFrameName.

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

267  {
268  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
269  return baseCfgName;
270  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
void EDA_3D_VIEWER::CreateMenuBar ( )
private

Definition at line 138 of file 3d_toolbar.cpp.

References AddMenuItem(), GRID3D_10MM, GRID3D_1MM, GRID3D_2P5MM, GRID3D_5MM, GRID3D_NONE, CINFO3D_VISU::GridGet(), ID_MENU3D_ADHESIVE_ONOFF, ID_MENU3D_AXIS_ONOFF, ID_MENU3D_BGCOLOR, ID_MENU3D_BGCOLOR_BOTTOM_SELECTION, ID_MENU3D_BGCOLOR_TOP_SELECTION, ID_MENU3D_COLOR, ID_MENU3D_COMMENTS_ONOFF, ID_MENU3D_COPPER_COLOR_SELECTION, ID_MENU3D_ECO_ONOFF, ID_MENU3D_ENGINE, ID_MENU3D_ENGINE_OPENGL_LEGACY, ID_MENU3D_ENGINE_RAYTRACING, ID_MENU3D_FL, ID_MENU3D_FL_OPENGL, ID_MENU3D_FL_OPENGL_RENDER_COPPER_THICKNESS, ID_MENU3D_FL_OPENGL_RENDER_SHOW_MODEL_BBOX, ID_MENU3D_FL_RAYTRACING, 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, 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, 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_HELP_HOTKEY_SHOW_CURRENT_LIST, ID_MENU3D_LAYERS, ID_MENU3D_MODULE_ONOFF, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL_INSERT, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_VIRTUAL, ID_MENU3D_MOUSEWHEEL_PANNING, ID_MENU3D_PCB_BODY_COLOR_SELECTION, ID_MENU3D_REALISTIC_MODE, ID_MENU3D_RESET_DEFAULTS, ID_MENU3D_SHOW_BOARD_BODY, ID_MENU3D_SILKSCREEN_COLOR_SELECTION, ID_MENU3D_SILKSCREEN_ONOFF, ID_MENU3D_SOLDER_MASK_ONOFF, ID_MENU3D_SOLDER_PASTE_ONOFF, ID_MENU3D_SOLDERMASK_COLOR_SELECTION, ID_MENU3D_SOLDERPASTE_COLOR_SELECTION, ID_MENU3D_ZONE_ONOFF, ID_MENU_SCREENCOPY_JPEG, ID_MENU_SCREENCOPY_PNG, ID_TOOL_SCREENCOPY_TOCLIBBOARD, KiBitmap(), m_logTrace, m_settings, RENDER_ENGINE_OPENGL_LEGACY, RENDER_ENGINE_RAYTRACING, CINFO3D_VISU::RenderEngineGet(), SetMenuBarOptionsState(), and text_xpm.

Referenced by GetSettings().

139 {
140  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::CreateMenuBar" ) );
141 
142  wxMenuBar* menuBar = new wxMenuBar;
143  wxMenu* fileMenu = new wxMenu;
144  wxMenu* editMenu = new wxMenu;
145  wxMenu* prefsMenu = new wxMenu;
146  wxMenu* helpMenu = new wxMenu;
147 
148  menuBar->Append( fileMenu, _( "&File" ) );
149 
151  _( "Export Current View as PNG..." ),
152  KiBitmap( export_xpm ) );
153 
155  _( "Export Current View as JPEG..." ),
156  KiBitmap( export_xpm ) );
157 
158  fileMenu->AppendSeparator();
159  AddMenuItem( fileMenu, wxID_EXIT,
160  _( "&Exit" ),
161  KiBitmap( exit_xpm ) );
162 
163  menuBar->Append( editMenu, _( "&Edit" ) );
164 
166  _( "Copy 3D Image" ),
167  KiBitmap( copy_xpm ) );
168 
169  menuBar->Append( prefsMenu, _( "&Preferences" ) );
170 
172  _( "Use Touchpad to Pan" ),
173  KiBitmap( tools_xpm ), wxITEM_CHECK );
174 
175  prefsMenu->AppendSeparator();
176 
178  _( "Realistic Mode" ),
179  KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
180 
181  wxMenu * renderEngineList = new wxMenu;
182  AddMenuItem( prefsMenu, renderEngineList, ID_MENU3D_ENGINE,
183  _( "Render Engine" ), KiBitmap( render_mode_xpm ) );
184 
185  renderEngineList->AppendRadioItem( ID_MENU3D_ENGINE_OPENGL_LEGACY,
186  _( "OpenGL" ),
187  wxEmptyString );
188 
189  renderEngineList->AppendRadioItem( ID_MENU3D_ENGINE_RAYTRACING,
190  _( "Raytracing" ),
191  wxEmptyString );
192 
193  renderEngineList->Check( ID_MENU3D_ENGINE_OPENGL_LEGACY,
195 
196  renderEngineList->Check( ID_MENU3D_ENGINE_RAYTRACING,
198 
199  wxMenu * renderOptionsMenu = new wxMenu;
200  AddMenuItem( prefsMenu, renderOptionsMenu, ID_MENU3D_FL,
201  _( "Render Options" ), KiBitmap( options_3drender_xpm ) );
202 
203  wxMenu * materialsList = new wxMenu;
204  AddMenuItem( renderOptionsMenu, materialsList, ID_MENU3D_FL_RENDER_MATERIAL,
205  _( "Material Properties" ), KiBitmap( color_materials_xpm ) );
206 
207  materialsList->AppendRadioItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_NORMAL,
208  _( "Use All Properties" ),
209  _( "Use all material properties from each 3D model file" ) );
210 
211  materialsList->AppendRadioItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_DIFFUSE_ONLY,
212  _( "Use Diffuse Only" ),
213  _( "Use only the diffuse color property from model 3D model file " ) );
214 
215  materialsList->AppendRadioItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE,
216  _( "CAD Color Style" ),
217  _( "Use a CAD color style based on the diffuse color of the material" ) );
218 
219  // Add specific preferences for OpenGL
220  // /////////////////////////////////////////////////////////////////////////
221  wxMenu * renderOptionsMenu_OPENGL = new wxMenu;
222 
223  AddMenuItem( renderOptionsMenu, renderOptionsMenu_OPENGL, ID_MENU3D_FL_OPENGL,
224  _( "OpenGL Options" ), KiBitmap( tools_xpm ) );
225 
226  AddMenuItem( renderOptionsMenu_OPENGL, ID_MENU3D_FL_OPENGL_RENDER_COPPER_THICKNESS,
227  _( "Show Copper Thickness" ),
228  _( "Shows the copper thickness on copper layers (slower loading)"),
229  KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
230 
231  AddMenuItem( renderOptionsMenu_OPENGL, ID_MENU3D_FL_OPENGL_RENDER_SHOW_MODEL_BBOX,
232  _( "Show Model Bounding Boxes" ),
233  KiBitmap( ortho_xpm ), wxITEM_CHECK );
234 
235 
236  // Add specific preferences for Raytracing
237  // /////////////////////////////////////////////////////////////////////////
238  wxMenu * renderOptionsMenu_RAYTRACING = new wxMenu;
239  AddMenuItem( renderOptionsMenu, renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING,
240  _( "Raytracing Options" ), KiBitmap( tools_xpm ) );
241 
242  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_RENDER_SHADOWS,
243  _( "Render Shadows" ),
244  KiBitmap( green_xpm ), wxITEM_CHECK );
245 
246  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_PROCEDURAL_TEXTURES,
247  _( "Procedural Textures" ),
248  _( "Apply procedural textures to materials (slow)"),
249  KiBitmap( green_xpm ), wxITEM_CHECK );
250 
251  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_BACKFLOOR,
252  _( "Add Floor" ),
253  _( "Adds a floor plane below the board (slow)"),
254  KiBitmap( green_xpm ), wxITEM_CHECK );
255 
256  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_REFRACTIONS,
257  _( "Refractions" ),
258  _( "Render materials with refractions properties on final render (slow)"),
259  KiBitmap( green_xpm ), wxITEM_CHECK );
260 
261  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_REFLECTIONS,
262  _( "Reflections" ),
263  _( "Render materials with reflections properties on final render (slow)"),
264  KiBitmap( green_xpm ), wxITEM_CHECK );
265 
266  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_ANTI_ALIASING,
267  _( "Anti-aliasing" ),
268  _( "Render with improoved quality on final render (slow)"),
269  KiBitmap( green_xpm ), wxITEM_CHECK );
270 
271  AddMenuItem( renderOptionsMenu_RAYTRACING, ID_MENU3D_FL_RAYTRACING_POST_PROCESSING,
272  _( "Post-processing" ),
273  _( "Apply Screen Space Ambient Occlusion and Global Illumination reflections on final render (slow)"),
274  KiBitmap( green_xpm ), wxITEM_CHECK );
275 
276  prefsMenu->AppendSeparator();
277 
278 
279  // Colors, axis and grid elements
280  // /////////////////////////////////////////////////////////////////////////
281 
282  // Add submenu set Colors
283  wxMenu * setColorMenu = new wxMenu;
284  AddMenuItem( prefsMenu, setColorMenu, ID_MENU3D_COLOR,
285  _( "Choose Colors" ), KiBitmap( palette_xpm ) );
286 
287  wxMenu * setBgColorMenu = new wxMenu;
288  AddMenuItem( setColorMenu, setBgColorMenu, ID_MENU3D_BGCOLOR,
289  _( "Background Color" ), KiBitmap( palette_xpm ) );
290 
292  _( "Background Top Color..." ), KiBitmap( setcolor_3d_bg_xpm ) );
293 
295  _( "Background Bottom Color..." ), KiBitmap( setcolor_3d_bg_xpm ) );
296 
298  _( "Silkscreen Color..." ), KiBitmap( setcolor_silkscreen_xpm ) );
299 
301  _( "Solder Mask Color..." ), KiBitmap( setcolor_soldermask_xpm ) );
302 
304  _( "Solder Paste Color..." ), KiBitmap( setcolor_solderpaste_xpm ) );
305 
307  _( "Copper/Surface Finish Color..." ), KiBitmap( setcolor_copper_xpm ) );
308 
310  _( "Board Body Color..." ), KiBitmap( setcolor_board_body_xpm ) );
311 
312  AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
313  _( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
314 
315 
316  // Creates grid menu
317  // /////////////////////////////////////////////////////////////////////////
318 
319  wxMenu * gridlistMenu = new wxMenu;
320  AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
321  _( "3D Grid" ), KiBitmap( grid_xpm ) );
322  gridlistMenu->AppendRadioItem( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString );
323  gridlistMenu->AppendRadioItem( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString );
324  gridlistMenu->AppendRadioItem( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString );
325  gridlistMenu->AppendRadioItem( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString );
326  gridlistMenu->AppendRadioItem( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString );
327 
328  // If the grid is on, check the corresponding menuitem showing the grid size
329  if( m_settings.GridGet() != GRID3D_NONE )
330  {
331  gridlistMenu->Check( ID_MENU3D_GRID_10_MM, m_settings.GridGet() == GRID3D_10MM );
332  gridlistMenu->Check( ID_MENU3D_GRID_5_MM, m_settings.GridGet() == GRID3D_5MM );
333  gridlistMenu->Check( ID_MENU3D_GRID_2P5_MM, m_settings.GridGet() == GRID3D_2P5MM );
334  gridlistMenu->Check( ID_MENU3D_GRID_1_MM, m_settings.GridGet() == GRID3D_1MM );
335  }
336  else
337  gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
338 
339 
340  // Display elements options
341  // /////////////////////////////////////////////////////////////////////////
342  prefsMenu->AppendSeparator();
343 
345  _( "Show Board Bod&y" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
346 
347  AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
348  _( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
349 
350  wxMenu * moduleAttributes = new wxMenu;
351  AddMenuItem( prefsMenu, moduleAttributes, ID_MENU3D_MODULE_ONOFF,
352  _( "Show 3D M&odels" ), KiBitmap( shape_3d_xpm ) );
353  moduleAttributes->AppendCheckItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL,
354  _( "Through Hole" ),
355  _( "Footprint Properties -> Placement type -> Through hole" ) );
356 
357  moduleAttributes->AppendCheckItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL_INSERT,
358  _( "Surface Mount" ),
359  _( "Footprint Properties -> Placement type -> Surface mount" ) );
360 
361  moduleAttributes->AppendCheckItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_VIRTUAL,
362  _( "Virtual" ),
363  _( "Footprint Properties -> Placement type -> Virtual (eg: edge connectors, test points, mechanical parts)" ) );
364 
365  // Layer options
366  // /////////////////////////////////////////////////////////////////////////
367  prefsMenu->AppendSeparator();
368 
369  wxMenu * layersMenu = new wxMenu;
370  AddMenuItem( prefsMenu, layersMenu, ID_MENU3D_LAYERS,
371  _( "Show &Layers" ), KiBitmap( tools_xpm ) );
372 
374  _( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
375 
377  _( "Show &Silkscreen Layers" ), KiBitmap( text_xpm ), wxITEM_CHECK );
378 
380  _( "Show Solder &Mask Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
381 
383  _( "Show Solder &Paste Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
384 
385  // Other layers are not "board" layers, and are not shown in realistic mode
386  // These menus will be disabled in in realistic mode
388  _( "Show &Comments and Drawings Layers" ), KiBitmap( editor_xpm ), wxITEM_CHECK );
389 
390  AddMenuItem( layersMenu, ID_MENU3D_ECO_ONOFF,
391  _( "Show &Eco Layers" ), KiBitmap( editor_xpm ), wxITEM_CHECK );
392 
393  // Reset options
394  // /////////////////////////////////////////////////////////////////////////
395  prefsMenu->AppendSeparator();
396 
398  _( "Reset to Default Settings" ),
399  KiBitmap( tools_xpm ) );
400 
401  // Help menu
402  // /////////////////////////////////////////////////////////////////////////
403  menuBar->Append( helpMenu, _( "&Help" ) );
404 
406  _( "&List Hotkeys..." ),
407  _( "Displays the current hotkeys list and corresponding commands" ),
408  KiBitmap( hotkeys_xpm ) );
409 
410  SetMenuBar( menuBar );
412 }
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:174
void SetMenuBarOptionsState()
Set the state of toggle menus according to the current display options.
Definition: 3d_toolbar.cpp:415
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
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.
static const char * text_xpm[]
void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited
void EDA_3D_VIEWER::DisplayHotKeys ( )
private

Definition at line 1237 of file eda_3d_viewer.cpp.

References DisplayHotkeyList().

Referenced by GetSettings(), and Process_Special_Functions().

1238 {
1240 }
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
struct EDA_HOTKEY_CONFIG g_3DViewer_Hokeys_Descr[]
bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

Function doAutoSave 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 235 of file eda_base_frame.cpp.

Referenced by EDA_BASE_FRAME::isAutoSaveRequired(), and EDA_BASE_FRAME::onAutoSaveTimer().

236 {
237  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
238 }
void EDA_3D_VIEWER::Exit3DFrame ( wxCommandEvent &  event)
private

Called when user press the File->Exit.

Definition at line 243 of file eda_3d_viewer.cpp.

References m_logTrace.

Referenced by GetSettings().

244 {
245  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::Exit3DFrame" ) );
246 
247  Close( true );
248 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void EDA_BASE_FRAME::ExportHotkeyConfigToFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extention not needed) like eechema, kicad...

Definition at line 757 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), and Prj().

Referenced by KICAD_MANAGER_FRAME::Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and EDA_BASE_FRAME::SaveProjectSettings().

759 {
760  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
761  wxString mask = wxT( "*." ) + ext;
762 
763 #if 0
764  wxString path = wxPathOnly( Prj().GetProjectFullName() );
765 #else
766  wxString path = GetMruPath();
767 #endif
768  wxFileName fn( aDefaultShortname );
769  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
770 
771  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
772  path,
773  fn.GetFullPath(),
774  ext,
775  mask,
776  this,
777  wxFD_SAVE,
778  true );
779 
780  if( filename.IsEmpty() )
781  return;
782 
783  WriteHotkeyConfig( aDescList, &filename );
784  SetMruPath( wxFileName( filename ).GetPath() );
785 }
void SetMruPath(const wxString &aPath)
PROJECT & Prj()
Definition: kicad.cpp:270
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 225 of file eda_base_frame.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

Referenced by DIALOG_GENERALOPTIONS::init(), and SCH_EDIT_FRAME::OnPreferencesOptions().

225 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.
BOARD* EDA_3D_VIEWER::GetBoard ( )
inline

Definition at line 64 of file eda_3d_viewer.h.

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

Referenced by ReloadRequest().

64 { return Parent()->GetBoard(); }
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:62
BOARD * GetBoard() const
const wxString& EDA_3D_VIEWER::GetDefaultFileName ( ) const
inline

Function GetDefaultFileName.

Returns
the default suggested file name

Definition at line 103 of file eda_3d_viewer.h.

References m_defaultFileName.

103 { return m_defaultFileName; }
wxString m_defaultFileName
Filename to propose for save a screenshot.
wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function GetFileFromHistory fetches the file name from the file history list.

and removes the selected file, if this file does not exists Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

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

Definition at line 404 of file eda_base_frame.cpp.

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

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

406 {
407  wxFileHistory* fileHistory = aFileHistory;
408 
409  if( !fileHistory )
410  fileHistory = &Kiface().GetFileHistory();
411 
412  int baseId = fileHistory->GetBaseId();
413 
414  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
415 
416  unsigned i = cmdId - baseId;
417 
418  if( i < fileHistory->GetCount() )
419  {
420  wxString fn = fileHistory->GetHistoryFile( i );
421 
422  if( wxFileName::FileExists( fn ) )
423  return fn;
424  else
425  {
426  wxString msg = wxString::Format(
427  _( "File \"%s\" was not found." ),
428  GetChars( fn ) );
429 
430  wxMessageBox( msg );
431 
432  fileHistory->RemoveFileFromHistory( i );
433  }
434  }
435 
436  return wxEmptyString;
437 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
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:92
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
virtual int EDA_BASE_FRAME::GetIconScale ( )
inlinevirtualinherited

Function GetIconScale.

Return the desired scaling for toolbar/menubar icons in fourths (e.g. 4 is unity). A negative number indicates autoscale based on font size.

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

Definition at line 459 of file eda_base_frame.h.

Referenced by get_scale_factor().

459 { return -1; }
void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 531 of file eda_base_frame.cpp.

References ShowAboutDialog().

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

532 {
533  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
534  ShowAboutDialog( this );
535 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 518 of file eda_base_frame.cpp.

References URL_GET_INVOLVED.

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

519 {
520  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
521  {
522  wxString msg;
523  msg.Printf( _( "Could not launch the default browser.\n"
524  "For information on how to help the KiCad project, visit %s" ),
526  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
527  }
528 }
#define URL_GET_INVOLVED
void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 440 of file eda_base_frame.cpp.

References DIM, Format(), GetAssociatedDocument(), GetChars(), EDA_BASE_FRAME::help_name(), SearchHelpFileFullPath(), and EDA_BASE_FRAME::sys_search().

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

441 {
442  const SEARCH_STACK& search = sys_search();
443 
444  /* We have to get document for beginners,
445  * or the full specific doc
446  * if event id is wxID_INDEX, we want the document for beginners.
447  * else the specific doc file (its name is in Kiface().GetHelpFileName())
448  * The document for beginners is the same for all KiCad utilities
449  */
450  if( event.GetId() == wxID_INDEX )
451  {
452  // List of possible names for Getting Started in KiCad
453  const wxChar* names[2] = {
454  wxT( "getting_started_in_kicad" ),
455  wxT( "Getting_Started_in_KiCad" )
456  };
457 
458  wxString helpFile;
459  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
460  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
461  for( unsigned ii = 0; ii < DIM( names ); ii++ )
462  {
463  helpFile = SearchHelpFileFullPath( search, names[ii] );
464 
465  if( !helpFile.IsEmpty() )
466  break;
467  }
468 
469  if( !helpFile )
470  {
471  wxString msg = wxString::Format( _(
472  "Html or pdf help file \n\"%s\"\n or\n\"%s\" could not be found." ), names[0], names[1] );
473  wxMessageBox( msg );
474  }
475  else
476  {
477  GetAssociatedDocument( this, helpFile );
478  }
479 
480  return;
481  }
482 
483  wxString base_name = help_name();
484  wxString helpFile = SearchHelpFileFullPath( search, base_name );
485 
486  if( !helpFile )
487  {
488  wxString msg = wxString::Format( _(
489  "Help file \"%s\" could not be found." ),
490  GetChars( base_name )
491  );
492  wxMessageBox( msg );
493  }
494  else
495  {
496  GetAssociatedDocument( this, helpFile );
497  }
498 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_M...
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSStack, const wxString &aBaseName)
Function SearchHelpFileFullPath returns the help file&#39;s full path.
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:92
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
virtual wxString help_name()
wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 380 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp(), and EDA_BASE_FRAME::isAutoSaveRequired().

381 {
382  return Kiface().GetHelpFileName();
383 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:121
VTBL_ENTRY bool KIWAY_PLAYER::ImportFile ( const wxString &  aFileName,
int  aFileType 
)
inlineinherited

Function ImportFile load the given filename but sets the path to the current project path.

Parameters
fullfilepath of file to be imported.
aFileTypeenum value for filetype

Definition at line 188 of file kiway_player.h.

References VTBL_ENTRY.

189  {
190  // overload me for your wxFrame type.
191 
192  return false;
193  }
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extention not needed) like eechema, kicad...

Definition at line 728 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and EDA_FILE_SELECTOR().

Referenced by KICAD_MANAGER_FRAME::Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and EDA_BASE_FRAME::SaveProjectSettings().

730 {
731  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
732  wxString mask = wxT( "*." ) + ext;
733 
734 
735  wxString path = GetMruPath();
736  wxFileName fn( aDefaultShortname );
737  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
738 
739  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
740  path,
741  fn.GetFullPath(),
742  ext,
743  mask,
744  this,
745  wxFD_OPEN,
746  true );
747 
748  if( filename.IsEmpty() )
749  return;
750 
751  ReadHotkeyConfigFile( filename, aDescList );
752  WriteHotkeyConfig( aDescList );
753  SetMruPath( wxFileName( filename ).GetPath() );
754 }
void SetMruPath(const wxString &aPath)
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current ho...
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
void EDA_3D_VIEWER::Install3DViewOptionDialog ( wxCommandEvent &  event)
private

Definition at line 49 of file dialog_3D_view_option.cpp.

Referenced by GetSettings().

50 {
51  DIALOG_3D_VIEW_OPTIONS dlg( this );
52 
53  if( dlg.ShowModal() == wxID_OK )
54  {
56 
57  // Force immediate display redraw:
58  ReloadRequest();
60  }
61 }
void SetMenuBarOptionsState()
Set the state of toggle menus according to the current display options.
Definition: 3d_toolbar.cpp:415
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
void ReloadRequest()
Request reloading the 3D view.
virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Function autoSaveRequired returns 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 181 of file eda_base_frame.h.

References EDA_BASE_FRAME::config(), EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::EDA_BASE_FRAME(), EDA_BASE_FRAME::help_name(), EDA_BASE_FRAME::ProcessEvent(), EDA_BASE_FRAME::SetAutoSaveInterval(), EDA_BASE_FRAME::sys_search(), and EDA_BASE_FRAME::~EDA_BASE_FRAME().

Referenced by EDA_BASE_FRAME::ProcessEvent().

181 { return false; }
bool KIWAY_PLAYER::IsDismissed ( )
protectedinherited

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 158 of file kiway_player.cpp.

References KIWAY_PLAYER::m_modal_loop.

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

159 {
160  return !m_modal_loop;
161 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:260
bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Function IsWritable 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 538 of file eda_base_frame.cpp.

References GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), EDA_BASE_FRAME::GetMruPath(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

539 {
540  wxString msg;
541  wxFileName fn = aFileName;
542 
543  // Check for absence of a file path with a file name. Unfortunately KiCad
544  // uses paths relative to the current project path without the ./ part which
545  // confuses wxFileName. Making the file name path absolute may be less than
546  // elegant but it solves the problem.
547  if( fn.GetPath().IsEmpty() && fn.HasName() )
548  fn.MakeAbsolute();
549 
550  wxCHECK_MSG( fn.IsOk(), false,
551  wxT( "File name object is invalid. Bad programmer!" ) );
552  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
553  wxT( "File name object path <" ) + fn.GetFullPath() +
554  wxT( "> is not set. Bad programmer!" ) );
555 
556  if( fn.IsDir() && !fn.IsDirWritable() )
557  {
558  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
559  GetChars( fn.GetPath() ) );
560  }
561  else if( !fn.FileExists() && !fn.IsDirWritable() )
562  {
563  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
564  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
565  }
566  else if( fn.FileExists() && !fn.IsFileWritable() )
567  {
568  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
569  GetChars( fn.GetFullPath() ) );
570  }
571 
572  if( !msg.IsEmpty() )
573  {
574  wxMessageBox( msg );
575  return false;
576  }
577 
578  return true;
579 }
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:92
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 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway, KIWAY_HOLDER::Prj(), and KIWAY_HOLDER::SetKiway().

Referenced by SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), KIWAY_PLAYER::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KIWAY_PLAYER::OnChangeIconsOptions(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 179 of file kiway_player.cpp.

References KIWAY_PLAYER::KiwayMailIn().

180 {
181  // logging support
182  KiwayMailIn( aEvent ); // call the virtual, override in derived.
183 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.
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 SCH_EDIT_FRAME, PCB_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 73 of file kiway_player.cpp.

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

74 {
75  // override this in derived classes.
76 }
void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

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

Definition at line 186 of file kiway_player.cpp.

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

187 {
188  int id = event.GetId();
189 
190  // tell all the KIWAY_PLAYERs about the language change.
191  Kiway().SetLanguage( id );
192 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:395
void EDA_3D_VIEWER::LoadSettings ( wxConfigBase *  aCfg)
overrideprivatevirtual

Function LoadSettings loads 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 697 of file eda_3d_viewer.cpp.

References FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_MOUSEWHEEL_PANNING, 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, GRID3D_NONE, 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, keyMousewheelPanning, 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_SilkScreenColor, CINFO3D_VISU::m_SolderMaskColor, CINFO3D_VISU::m_SolderPasteColor, MATERIAL_MODE_NORMAL, CINFO3D_VISU::MaterialModeSet(), RENDER_ENGINE_OPENGL_LEGACY, CINFO3D_VISU::RenderEngineSet(), and CINFO3D_VISU::SetFlag().

Referenced by GetSettings(), and Process_Special_Functions().

698 {
700 
701  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::LoadSettings" ) );
702 
703  aCfg->Read( keyBgColor_Red, &m_settings.m_BgColorBot.r, 0.4 );
704  aCfg->Read( keyBgColor_Green, &m_settings.m_BgColorBot.g, 0.4 );
705  aCfg->Read( keyBgColor_Blue, &m_settings.m_BgColorBot.b, 0.5 );
706 
707  aCfg->Read( keyBgColor_Red_Top, &m_settings.m_BgColorTop.r, 0.8 );
708  aCfg->Read( keyBgColor_Green_Top, &m_settings.m_BgColorTop.g, 0.8 );
709  aCfg->Read( keyBgColor_Blue_Top, &m_settings.m_BgColorTop.b, 0.9 );
710 
711  // m_SolderMaskColor default value = dark grey-green
712  aCfg->Read( keySMaskColor_Red, &m_settings.m_SolderMaskColor.r, 100.0 * 0.2 / 255.0 );
713  aCfg->Read( keySMaskColor_Green, &m_settings.m_SolderMaskColor.g, 255.0 * 0.2 / 255.0 );
714  aCfg->Read( keySMaskColor_Blue, &m_settings.m_SolderMaskColor.b, 180.0 * 0.2 / 255.0 );
715 
716  // m_SolderPasteColor default value = light grey
717  aCfg->Read( keySPasteColor_Red, &m_settings.m_SolderPasteColor.r, 128.0 /255.0 );
718  aCfg->Read( keySPasteColor_Green, &m_settings.m_SolderPasteColor.g, 128.0 /255.0 );
719  aCfg->Read( keySPasteColor_Blue, &m_settings.m_SolderPasteColor.b, 128.0 /255.0 );
720 
721  // m_SilkScreenColor default value = white
722  aCfg->Read( keySilkColor_Red, &m_settings.m_SilkScreenColor.r, 0.9 );
723  aCfg->Read( keySilkColor_Green, &m_settings.m_SilkScreenColor.g, 0.9 );
724  aCfg->Read( keySilkColor_Blue, &m_settings.m_SilkScreenColor.b, 0.9 );
725 
726  // m_CopperColor default value = gold
727  aCfg->Read( keyCopperColor_Red, &m_settings.m_CopperColor.r, 255.0 * 0.7 / 255.0 );
728  aCfg->Read( keyCopperColor_Green, &m_settings.m_CopperColor.g, 223.0 * 0.7 / 255.0 );
729  aCfg->Read( keyCopperColor_Blue, &m_settings.m_CopperColor.b, 0.0 /255.0 );
730 
731  // m_BoardBodyColor default value = FR4, in realistic mode
732  aCfg->Read( keyBoardBodyColor_Red, &m_settings.m_BoardBodyColor.r, 51.0 / 255.0 );
733  aCfg->Read( keyBoardBodyColor_Green, &m_settings.m_BoardBodyColor.g, 43.0 / 255.0 );
734  aCfg->Read( keyBoardBodyColor_Blue, &m_settings.m_BoardBodyColor.b, 22.0 /255.0 );
735 
736 
737  bool tmp;
738  aCfg->Read( keyMousewheelPanning, &tmp, false );
740 
741  aCfg->Read( keyShowRealisticMode, &tmp, true );
743 
744  // OpenGL options
745  aCfg->Read( keyRenderOGL_ShowCopperTck, &tmp, true );
747 
748  aCfg->Read( keyRenderOGL_ShowModelBBox, &tmp, false );
750 
751  // Raytracing options
752  aCfg->Read( keyRenderRAY_Shadows, &tmp, true );
754 
755  aCfg->Read( keyRenderRAY_Backfloor, &tmp, true );
757 
758  aCfg->Read( keyRenderRAY_Refractions, &tmp, true );
760 
761  aCfg->Read( keyRenderRAY_Reflections, &tmp, true );
763 
764  aCfg->Read( keyRenderRAY_PostProcess, &tmp, true );
766 
767  aCfg->Read( keyRenderRAY_AAliasing, &tmp, true );
769 
770  aCfg->Read( keyRenderRAY_ProceduralT, &tmp, true );
772 
773  aCfg->Read( keyShowAxis, &tmp, true );
774  m_settings.SetFlag( FL_AXIS, tmp );
775 
776  aCfg->Read( keyShowFootprints_Normal, &tmp, true );
778 
779  aCfg->Read( keyShowFootprints_Insert, &tmp, true );
781 
782  aCfg->Read( keyShowFootprints_Virtual, &tmp, true );
784 
785  aCfg->Read( keyShowZones, &tmp, true );
786  m_settings.SetFlag( FL_ZONE, tmp );
787 
788  aCfg->Read( keyShowAdhesiveLayers, &tmp, true );
790 
791  aCfg->Read( keyShowSilkScreenLayers, &tmp, true );
793 
794  aCfg->Read( keyShowSolderMaskLayers, &tmp, true );
796 
797  aCfg->Read( keyShowSolderPasteLayers, &tmp, true );
799 
800  aCfg->Read( keyShowCommentsLayer, &tmp, true );
802 
803  aCfg->Read( keyShowEcoLayers, &tmp, true );
804  m_settings.SetFlag( FL_ECO, tmp );
805 
806  aCfg->Read( keyShowBoardBody, &tmp, true );
808 
809  int tmpi;
810  aCfg->Read( keyShowGrid, &tmpi, (int)GRID3D_NONE );
811  m_settings.GridSet( (GRID3D_TYPE)tmpi );
812 
813  aCfg->Read( keyRenderEngine, &tmpi, (int)RENDER_ENGINE_OPENGL_LEGACY );
815 
816  aCfg->Read( keyRenderMaterial, &tmpi, (int)MATERIAL_MODE_NORMAL );
818 }
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
Store all the settings and options to be used by the renders.
static const wxChar keyBgColor_Red_Top[]
static const wxChar keySilkColor_Blue[]
static const wxChar keyMousewheelPanning[]
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:509
static const wxChar keyShowFootprints_Insert[]
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:503
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:504
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:505
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[]
static const wxChar keyShowZones[]
static const wxChar keyRenderMaterial[]
static const wxChar keyRenderRAY_AAliasing[]
virtual void LoadSettings(wxConfigBase *aCfg)
Function LoadSettings loads common frame parameters from a configuration file.
static const wxChar keyBgColor_Green[]
static const wxChar keyBoardBodyColor_Blue[]
MATERIAL_MODE
Render 3d model shape materials mode.
Definition: 3d_enums.h:90
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:507
SFVEC3D m_SolderMaskColor
in realistic mode: solder mask color
Definition: cinfo3d_visu.h:506
GRID3D_TYPE
Grid types.
Definition: 3d_enums.h:71
static const wxChar keyRenderOGL_ShowModelBBox[]
static const wxChar keySPasteColor_Green[]
Use all material properties from model file.
Definition: 3d_enums.h:92
static const wxChar keyBoardBodyColor_Red[]
SFVEC3D m_SilkScreenColor
in realistic mode: SilkScreen color
Definition: cinfo3d_visu.h:508
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 * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static const wxChar keySMaskColor_Blue[]
RENDER_ENGINE
Render engine mode.
Definition: 3d_enums.h:82
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[]
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 232 of file eda_3d_viewer.cpp.

References m_canvas, and ReloadRequest().

Referenced by GetBoard(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), FOOTPRINT_EDIT_FRAME::LoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnModify(), PCB_EDIT_FRAME::OpenProjectFiles(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), Set3DBoardBodyColorFromUser(), Set3DCopperColorFromUser(), Set3DSilkScreenColorFromUser(), Set3DSolderMaskColorFromUser(), Set3DSolderPasteColorFromUser(), FOOTPRINT_VIEWER_FRAME::Update3D_Frame(), and FOOTPRINT_WIZARD_FRAME::Update3D_Frame().

233 {
234  ReloadRequest();
235 
236  // After the ReloadRequest call, the refresh often takes a bit of time,
237  // and it is made here only on request.
238  if( aForceImmediateRedraw )
239  m_canvas->Refresh();
240 }
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
void ReloadRequest()
Request reloading the 3D view.
void EDA_3D_VIEWER::On3DGridSelection ( wxCommandEvent &  event)
private

Definition at line 548 of file eda_3d_viewer.cpp.

References GRID3D_10MM, GRID3D_1MM, GRID3D_2P5MM, GRID3D_5MM, GRID3D_NONE, 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, and EDA_3D_CANVAS::Request_refresh().

Referenced by GetSettings().

549 {
550  int id = event.GetId();
551 
552  wxASSERT( id < ID_MENU3D_GRID_END );
553  wxASSERT( id > ID_MENU3D_GRID );
554 
555  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::On3DGridSelection id:%d" ), id );
556 
557  switch( id )
558  {
561  break;
562 
565  break;
566 
567  case ID_MENU3D_GRID_5_MM:
569  break;
570 
573  break;
574 
575  case ID_MENU3D_GRID_1_MM:
577  break;
578 
579  default:
580  wxLogMessage( wxT( "EDA_3D_VIEWER::On3DGridSelection() error: unknown command %d" ), id );
581  return;
582  }
583 
584  if( m_canvas )
586 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
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
The canvas where the openGL context will be rendered.
EDA_3D_VIEWER::Process_Special_Functions ID_MENU3D_GRID_END
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void EDA_3D_VIEWER::OnActivate ( wxActivateEvent &  event)
private

Definition at line 668 of file eda_3d_viewer.cpp.

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

Referenced by GetSettings().

669 {
670  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnActivate" ) );
671 
672  if( m_canvas )
673  {
674  // Reload data if 3D frame shows a board,
675  // because it can be changed since last frame activation
678 
679  // Activates again the focus of the canvas so it will catch mouse and key events
680  m_canvas->SetFocus();
681  }
682 
683  event.Skip(); // required under wxMAC
684 }
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
Definition: eda_3d_canvas.h:82
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Function onAutoSaveTimer handles the auto save timer event.

Definition at line 228 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

229 {
230  if( !doAutoSave() )
231  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
232 }
virtual bool doAutoSave()
Function doAutoSave should be overridden by the derived class to handle the auto save feature...
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
int m_autoSaveInterval
The auto save interval time in seconds.
void KIWAY_PLAYER::OnChangeIconsOptions ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection.

Reimplemented from EDA_BASE_FRAME.

Definition at line 195 of file kiway_player.cpp.

References KIWAY_HOLDER::Kiway(), EDA_BASE_FRAME::OnChangeIconsOptions(), and KIWAY::ShowChangedIcons().

196 {
199 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
virtual void OnChangeIconsOptions(wxCommandEvent &event)
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
VTBL_ENTRY void ShowChangedIcons()
Function ShowChangedIcons Calls ShowChangedIcons() on all KIWAY_PLAYERs.
Definition: kiway.cpp:431
void EDA_3D_VIEWER::OnCloseWindow ( wxCloseEvent &  event)
private

Definition at line 251 of file eda_3d_viewer.cpp.

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

Referenced by GetSettings().

252 {
253  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnCloseWindow" ) );
254 
255  if( m_canvas )
256  m_canvas->Close();
257 
258  // m_canvas delete will be called by wxWidget manager
259  //delete m_canvas;
260  //m_canvas = 0;
261 
262  Destroy();
263  event.Skip( true );
264 }
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
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.
void EDA_3D_VIEWER::OnLeftClick ( wxDC *  DC,
const wxPoint MousePos 
)
private

Definition at line 894 of file eda_3d_viewer.cpp.

References m_logTrace.

Referenced by GetSettings().

895 {
896  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnLeftClick" ) );
897  // Do nothing
898 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void EDA_3D_VIEWER::OnRenderEngineSelection ( wxCommandEvent &  event)
private

Definition at line 589 of file eda_3d_viewer.cpp.

References ID_MENU3D_ENGINE, ID_MENU3D_ENGINE_END, ID_MENU3D_ENGINE_OPENGL_LEGACY, ID_MENU3D_ENGINE_RAYTRACING, m_logTrace, m_settings, RENDER_ENGINE_OPENGL_LEGACY, RENDER_ENGINE_RAYTRACING, RenderEngineChanged(), CINFO3D_VISU::RenderEngineGet(), and CINFO3D_VISU::RenderEngineSet().

Referenced by GetSettings().

590 {
591  int id = event.GetId();
592 
593  wxASSERT( id < ID_MENU3D_ENGINE_END );
594  wxASSERT( id > ID_MENU3D_ENGINE );
595 
596  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnRenderEngineSelection id:%d" ), id );
597 
598  const RENDER_ENGINE old_engine = m_settings.RenderEngineGet();
599 
600  switch( id )
601  {
603  if( old_engine != RENDER_ENGINE_OPENGL_LEGACY )
605  break;
606 
608  if( old_engine != RENDER_ENGINE_RAYTRACING )
610  break;
611 
612  default:
613  wxLogMessage( wxT( "EDA_3D_VIEWER::OnRenderEngineSelection() error: unknown command %d" ), id );
614  return;
615  }
616 
617  if( old_engine != m_settings.RenderEngineGet() )
618  {
620  }
621 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:228
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
RENDER_ENGINE
Render engine mode.
Definition: 3d_enums.h:82
void EDA_3D_VIEWER::OnRightClick ( const wxPoint MousePos,
wxMenu *  PopMenu 
)
private

Definition at line 901 of file eda_3d_viewer.cpp.

References m_logTrace.

Referenced by GetSettings().

902 {
903  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnRightClick" ) );
904  // Do nothing
905 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void EDA_BASE_FRAME::OnSelectPreferredEditor ( wxCommandEvent &  event)
virtualinherited

Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ...

) The full filename editor is saved in configuration (global params)

Definition at line 501 of file eda_base_frame.cpp.

References PGM_BASE::AskUserForPreferredEditor(), PGM_BASE::GetEditorName(), Pgm(), and PGM_BASE::SetEditorName().

Referenced by EDA_BASE_FRAME::SaveProjectSettings().

502 {
503  // Ask for the current editor and instruct GetEditorName() to not show
504  // unless we pass false as argument.
505  wxString editorname = Pgm().GetEditorName( false );
506 
507  // Ask the user to select a new editor, but suggest the current one as the default.
508  editorname = Pgm().AskUserForPreferredEditor( editorname );
509 
510  // If we have a new editor name request it to be copied to m_editor_name and saved
511  // to the preferences file. If the user cancelled the dialog then the previous
512  // value will be retained.
513  if( !editorname.IsEmpty() )
514  Pgm().SetEditorName( editorname );
515 }
VTBL_ENTRY void SetEditorName(const wxString &aFileName)
Definition: pgm_base.cpp:330
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Shows a dialog that instructs the user to select a new preferred editor.
Definition: pgm_base.cpp:375
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
void EDA_3D_VIEWER::OnSetFocus ( wxFocusEvent &  event)
private

Definition at line 687 of file eda_3d_viewer.cpp.

References m_canvas.

Referenced by GetSettings().

688 {
689  // Activates again the focus of the canvas so it will catch mouse and key events
690  if( m_canvas )
691  m_canvas->SetFocus();
692 
693  event.Skip();
694 }
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
void EDA_3D_VIEWER::OnUpdateMenus ( wxUpdateUIEvent &  event)
private

TODO: verify how many times this event is called and check if that is OK

Definition at line 624 of file eda_3d_viewer.cpp.

References SetMenuBarOptionsState().

Referenced by GetSettings().

625 {
627  // to have it working this way
629 }
void SetMenuBarOptionsState()
Set the state of toggle menus according to the current display options.
Definition: 3d_toolbar.cpp:415
VTBL_ENTRY bool KIWAY_PLAYER::OpenProjectFiles ( const std::vector< wxString > &  aFileList,
int  aCtl = 0 
)
inlineinherited

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.

Definition at line 170 of file kiway_player.h.

Referenced by SCH_EDIT_FRAME::doUpdatePcb(), PGM_SINGLE_TOP::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), PCB_EDIT_FRAME::OnUpdatePCBFromSch(), KICAD_MANAGER_FRAME::RunEeschema(), and KICAD_MANAGER_FRAME::RunPcbNew().

171  {
172  // overload me for your wxFrame type.
173 
174  // Any overload should probably do this also:
175  // Prj().MaybeLoadProjectSettings();
176 
177  // Then update the window title.
178 
179  return false;
180  }
PCB_BASE_FRAME* EDA_3D_VIEWER::Parent ( ) const
inline

Definition at line 62 of file eda_3d_viewer.h.

Referenced by GetBoard(), and takeScreenshot().

62 { return (PCB_BASE_FRAME*)GetParent(); }
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

Function PostCommandMenuEvent.

Post a menu event to the frame, which can be used to trigger actions bound to menu items.

Definition at line 651 of file eda_base_frame.cpp.

Referenced by EDA_BASE_FRAME::GetMruPath(), FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), and FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem().

652 {
653  if( evt_type != 0 )
654  {
655  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
656  evt.SetEventObject( this );
657  evt.SetId( evt_type );
658  wxPostEvent( this, evt );
659  return true;
660  }
661 
662  return false;
663 }
void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 386 of file eda_base_frame.cpp.

Referenced by EDA_BASE_FRAME::IsType().

387 {
388  SetStatusText( text );
389 }
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), LIB_VIEW_FRAME::BestZoom(), DIALOG_FOOTPRINT_FP_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_SYMBOL_LIB_TABLE::browseLibrariesHandler(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkNewAlias(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), 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_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), LIB_EDIT_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_FOOTPRINT_FP_EDITOR::Edit3DShapeFileName(), DIALOG_FOOTPRINT_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::Files_io_from_id(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), FOOTPRINT_EDIT_FRAME::getLibPath(), LIB_EDIT_FRAME::getLibraryFileName(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), SCH_EDIT_FRAME::ImportFile(), PCB_EDIT_FRAME::ImportFile(), DIALOG_FOOTPRINT_FP_EDITOR::initModeditProperties(), DIALOG_FOOTPRINT_BOARD_EDITOR::InitModeditProperties(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), KIWAY_HOLDER::Kiway(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_CHOOSE_COMPONENT::OnSchViewPaint(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), takeScreenshot(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), and DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:142
void EDA_3D_VIEWER::Process_Special_Functions ( wxCommandEvent &  event)
private

Definition at line 268 of file eda_3d_viewer.cpp.

References CINFO3D_VISU::CameraGet(), DisplayHotKeys(), FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_MOUSEWHEEL_PANNING, 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_SELECTION, ID_MENU3D_BGCOLOR_TOP_SELECTION, ID_MENU3D_COMMENTS_ONOFF, ID_MENU3D_COPPER_COLOR_SELECTION, 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_HELP_HOTKEY_SHOW_CURRENT_LIST, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL_INSERT, ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_VIRTUAL, ID_MENU3D_MOUSEWHEEL_PANNING, ID_MENU3D_PCB_BODY_COLOR_SELECTION, ID_MENU3D_REALISTIC_MODE, ID_MENU3D_RESET_DEFAULTS, ID_MENU3D_SHOW_BOARD_BODY, ID_MENU3D_SILKSCREEN_COLOR_SELECTION, ID_MENU3D_SILKSCREEN_ONOFF, ID_MENU3D_SOLDER_MASK_ONOFF, ID_MENU3D_SOLDER_PASTE_ONOFF, ID_MENU3D_SOLDERMASK_COLOR_SELECTION, ID_MENU3D_SOLDERPASTE_COLOR_SELECTION, 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_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, LoadSettings(), CINFO3D_VISU::m_BgColorBot, CINFO3D_VISU::m_BgColorTop, m_canvas, m_logTrace, m_settings, MATERIAL_MODE_CAD_MODE, MATERIAL_MODE_DIFFUSE_ONLY, MATERIAL_MODE_NORMAL, CINFO3D_VISU::MaterialModeSet(), ReloadRequest(), RENDER_ENGINE_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(), SetMenuBarOptionsState(), EDA_3D_CANVAS::SetView3D(), takeScreenshot(), and CCAMERA::ToggleProjection().

Referenced by GetSettings().

269 {
270  int id = event.GetId();
271  bool isChecked = event.IsChecked();
272 
273  wxLogTrace( m_logTrace,
274  wxT( "EDA_3D_VIEWER::Process_Special_Functions id:%d isChecked:%d" ),
275  id, isChecked );
276 
277  if( m_canvas == NULL )
278  return;
279 
280  switch( id )
281  {
284  break;
285 
286  case ID_RELOAD3D_BOARD:
287  ReloadRequest();
289  break;
290 
291  case ID_ROTATE3D_X_POS:
292  m_settings.CameraGet().RotateX( glm::radians(ROT_ANGLE) );
294  break;
295 
296  case ID_ROTATE3D_X_NEG:
297  m_settings.CameraGet().RotateX( -glm::radians(ROT_ANGLE) );
299  break;
300 
301  case ID_ROTATE3D_Y_POS:
302  m_settings.CameraGet().RotateY( glm::radians(ROT_ANGLE) );
304  break;
305 
306  case ID_ROTATE3D_Y_NEG:
307  m_settings.CameraGet().RotateY( -glm::radians(ROT_ANGLE) );
309  break;
310 
311  case ID_ROTATE3D_Z_POS:
312  m_settings.CameraGet().RotateZ( glm::radians(ROT_ANGLE) );
314  break;
315 
316  case ID_ROTATE3D_Z_NEG:
317  m_settings.CameraGet().RotateZ( -glm::radians(ROT_ANGLE) );
319  break;
320 
321  case ID_MOVE3D_LEFT:
322  m_canvas->SetView3D( WXK_LEFT );
323  return;
324 
325  case ID_MOVE3D_RIGHT:
326  m_canvas->SetView3D( WXK_RIGHT );
327  return;
328 
329  case ID_MOVE3D_UP:
330  m_canvas->SetView3D( WXK_UP );
331  return;
332 
333  case ID_MOVE3D_DOWN:
334  m_canvas->SetView3D( WXK_DOWN );
335  return;
336 
337  case ID_ORTHO:
340  return;
341 
345  takeScreenshot( event );
346  return;
347 
349  if( Set3DColorFromUser( m_settings.m_BgColorBot, _( "Background Color, Bottom" ) ) )
350  {
353  else
354  ReloadRequest();
355  }
356  return;
357 
359  if( Set3DColorFromUser( m_settings.m_BgColorTop, _( "Background Color, Top" ) ) )
360  {
363  else
364  ReloadRequest();
365  }
366  return;
367 
370  return;
371 
374  return;
375 
378  return;
379 
382  break;
383 
386  break;
387 
390  break;
391 
395  ReloadRequest( );
396  return;
397 
400  ReloadRequest( );
401  return;
402 
405  ReloadRequest( );
406  return;
407 
410  ReloadRequest( );
411  return;
412 
415  ReloadRequest();
416  return;
417 
421  return;
422 
426  return;
427 
430  ReloadRequest( );
431  return;
432 
435  ReloadRequest( );
436  return;
437 
441  return;
442 
446  return;
447 
450  ReloadRequest( );
451  return;
452 
456  return;
457 
459  m_settings.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
460  ReloadRequest( );
461  return;
462 
464  m_settings.SetFlag( FL_AXIS, isChecked );
466  return;
467 
470  ReloadRequest( );
471  return;
472 
475  ReloadRequest( );
476  return;
477 
480  ReloadRequest( );
481  return;
482 
484  m_settings.SetFlag( FL_ZONE, isChecked );
485  ReloadRequest( );
486  return;
487 
489  m_settings.SetFlag( FL_ADHESIVE, isChecked );
490  ReloadRequest( );
491  return;
492 
494  m_settings.SetFlag( FL_SILKSCREEN, isChecked );
495  ReloadRequest( );
496  return;
497 
499  m_settings.SetFlag( FL_SOLDERMASK, isChecked );
500  ReloadRequest( );
501  return;
502 
504  m_settings.SetFlag( FL_SOLDERPASTE, isChecked );
505  ReloadRequest( );
506  return;
507 
509  m_settings.SetFlag( FL_COMMENTS, isChecked );
510  ReloadRequest( );
511  return;
512 
513  case ID_MENU3D_ECO_ONOFF:
514  m_settings.SetFlag( FL_ECO, isChecked );
515  ReloadRequest( );
516  return;
517 
519  {
520  // Reload settings with a dummy config, so it will load the defaults
521  wxConfig *fooconfig = new wxConfig("FooBarApp");
522  LoadSettings( fooconfig );
523  delete fooconfig;
524 
525  // Refresh menu option state
527 
528  // Tell canvas that we (may) changed the render engine
530 
531  ReloadRequest();
532  }
533  return;
534 
536  {
537  DisplayHotKeys();
538  }
539  return;
540 
541  default:
542  wxLogMessage( wxT( "EDA_3D_VIEWER::Process_Special_Functions() error: unknown command %d" ), id );
543  return;
544  }
545 }
bool Set3DCopperColorFromUser()
Function Set3DCopperColorFromUser Set the copper color from a set of colors.
Use only diffuse material properties.
Definition: 3d_enums.h:93
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
bool Set3DSolderMaskColorFromUser()
Function Set3DSolderMaskColorFromUser Set the solder mask color from a set of colors.
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
void SetMenuBarOptionsState()
Set the state of toggle menus according to the current display options.
Definition: 3d_toolbar.cpp:415
void RotateY(float aAngleInRadians)
Definition: ccamera.cpp:503
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:503
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:504
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:240
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
void RotateZ(float aAngleInRadians)
Definition: ccamera.cpp:510
void RotateX(float aAngleInRadians)
Definition: ccamera.cpp:496
void RenderRaytracingRequest()
RenderRaytracingRequest - Request to render the current view in Raytracing mode.
bool Set3DSilkScreenColorFromUser()
Function Set3DSilkScreenColorFromUser Set the silkscreen color from a set of colors.
void ToggleProjection()
Definition: ccamera.cpp:417
Use a gray shading based on diffuse material.
Definition: 3d_enums.h:94
bool Set3DSolderPasteColorFromUser()
Function Set3DSolderPasteColorFromUser Set the solder mask color from a set of colors.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
Use all material properties from model file.
Definition: 3d_enums.h:92
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
#define ROT_ANGLE
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
bool Set3DBoardBodyColorFromUser()
Function Set3DBoardBodyBodyColorFromUser Set the copper color from a set of colors.
void ReloadRequest()
Request reloading the 3D view.
void takeScreenshot(wxCommandEvent &event)
Function TakeScreenshot Create a Screenshot of the current 3D view.
bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Function ProcessEvent overrides 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 176 of file eda_base_frame.cpp.

References 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 EDA_BASE_FRAME::isAutoSaveRequired(), LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), LIB_VIEW_FRAME::ReCreateListCmp(), and PCBNEW_CONTROL::SwitchUnits().

177 {
178  if( !IsEnabled() && IsActive() )
179  {
180  DIALOG_SHIM* dlg = findQuasiModalDialog( GetChildren() );
181  if( dlg )
182  dlg->Raise();
183  }
184 
185  if( !wxFrame::ProcessEvent( aEvent ) )
186  return false;
187 
188  if( IsShown() && m_hasAutoSave && IsActive() &&
190  {
191  if( !m_autoSaveState )
192  {
193  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
194  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
195  m_autoSaveState = true;
196  }
197  else if( m_autoSaveTimer->IsRunning() )
198  {
199  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
200  m_autoSaveTimer->Stop();
201  m_autoSaveState = false;
202  }
203  }
204 
205  return true;
206 }
bool m_autoSaveState
Flag to indicate the last auto save state.
DIALOG_SHIM * findQuasiModalDialog(wxWindowList &aList)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:70
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
virtual bool isAutoSaveRequired() const
Function autoSaveRequired returns the auto save status of the application.
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
int m_autoSaveInterval
The auto save interval time in seconds.
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
void EDA_3D_VIEWER::ProcessZoom ( wxCommandEvent &  event)
private

Definition at line 632 of file eda_3d_viewer.cpp.

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

Referenced by GetSettings().

633 {
634  int id = event.GetId();
635 
636  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::ProcessZoom id:%d" ), id );
637 
638  if( m_canvas == NULL )
639  return;
640 
641  switch( id )
642  {
643  case ID_ZOOM_PAGE:
644  m_canvas->SetView3D( WXK_HOME );
645  break;
646 
647  case ID_ZOOM_IN:
648  m_canvas->SetView3D( WXK_F1 );
649  break;
650 
651  case ID_ZOOM_OUT:
652  m_canvas->SetView3D( WXK_F2 );
653  break;
654 
655  case ID_ZOOM_REDRAW:
657  break;
658 
659  default:
660  wxLogMessage( wxT( "EDA_3D_VIEWER::ProcessZoom() error: unknown command %d" ), id );
661  return;
662  }
663 
665 }
Definition: id.h:241
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
The canvas where the openGL context will be rendered.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
int EDA_BASE_FRAME::ReadHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList)
inherited

Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys.

Parameters
aDescList= current hotkey list descr. to initialize.

Definition at line 649 of file hotkeys_basic.cpp.

References ReadHotkeyConfig().

Referenced by EDA_BASE_FRAME::SaveProjectSettings().

650 {
651  ::ReadHotkeyConfig( GetName(), aDescList );
652  return 1;
653 }
int ReadHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
int EDA_BASE_FRAME::ReadHotkeyConfigFile ( const wxString &  aFilename,
struct EDA_HOTKEY_CONFIG aDescList 
)
inherited

Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys.

Parameters
aFilename= file name to read.
aDescList= current hotkey list descr. to initialize.

Definition at line 594 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and ParseHotkeyConfig().

Referenced by EDA_BASE_FRAME::SaveProjectSettings().

596 {
597  wxFileName fn( aFilename );
598  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
599 
600  wxFile cfgfile( fn.GetFullPath() );
601 
602  if( !cfgfile.IsOpened() ) // There is a problem to open file
603  return 0;
604 
605  // get length
606  cfgfile.SeekEnd();
607  wxFileOffset size = cfgfile.Tell();
608  cfgfile.Seek( 0 );
609 
610  // read data
611  std::vector<char> buffer( size );
612  cfgfile.Read( buffer.data(), size );
613  wxString data( buffer.data(), wxConvUTF8 );
614 
615  // parse
616  ParseHotkeyConfig( data, aDescList );
617 
618  // cleanup
619  cfgfile.Close();
620  return 1;
621 }
void ParseHotkeyConfig(const wxString &data, struct EDA_HOTKEY_CONFIG *aDescList)
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
void EDA_3D_VIEWER::ReCreateMainToolbar ( )
private

Definition at line 39 of file 3d_toolbar.cpp.

References 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, KiBitmap(), EDA_BASE_FRAME::KICAD_AUI_TB_STYLE, m_logTrace, EDA_BASE_FRAME::m_mainToolBar, and SetToolbars().

Referenced by GetSettings().

40 {
41  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::ReCreateMainToolbar" ) );
42 
43  if( m_mainToolBar != NULL )
44  {
45  // Simple update to the list of old files.
46  SetToolbars();
47  return;
48  }
49 
50  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
51  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
52 
53  // Set up toolbar
54  m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
55  KiBitmap( import3d_xpm ), _( "Reload board" ) );
56 
57  m_mainToolBar->AddSeparator();
58 
59  m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
60  KiBitmap( copy_xpm ),
61  _( "Copy 3D image to clipboard" ) );
62 
63  m_mainToolBar->AddSeparator();
64 
65  m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
66  KiBitmap( read_setup_xpm ),
67  _( "Set display options, and some layers visibility" ) );
68  m_mainToolBar->AddSeparator();
69 
70  m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
71  KiBitmap( render_mode_xpm ),
72  _( "Render current view using Raytracing" ) );
73 
74  m_mainToolBar->AddSeparator();
75 
76  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
77  _( "Zoom in" ) );
78 
79  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
80  _( "Zoom out" ) );
81 
82  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
83  KiBitmap( zoom_redraw_xpm ),
84  _( "Redraw view" ) );
85 
86  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
87  _( "Fit in page" ) );
88 
89  m_mainToolBar->AddSeparator();
90  m_mainToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
91  KiBitmap( rotate_neg_x_xpm ),
92  _( "Rotate X <-" ) );
93 
94  m_mainToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
95  KiBitmap( rotate_pos_x_xpm ),
96  _( "Rotate X ->" ) );
97 
98  m_mainToolBar->AddSeparator();
99  m_mainToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
100  KiBitmap( rotate_neg_y_xpm ),
101  _( "Rotate Y <-" ) );
102 
103  m_mainToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
104  KiBitmap( rotate_pos_y_xpm ),
105  _( "Rotate Y ->" ) );
106 
107  m_mainToolBar->AddSeparator();
108  m_mainToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
109  KiBitmap( rotate_neg_z_xpm ),
110  _( "Rotate Z <-" ) );
111 
112  m_mainToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
113  KiBitmap( rotate_pos_z_xpm ),
114  _( "Rotate Z ->" ) );
115 
116  m_mainToolBar->AddSeparator();
117  m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ),
118  _( "Move left" ) );
119 
120  m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ),
121  _( "Move right" ) );
122 
123  m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ),
124  _( "Move up" ) );
125 
126  m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ),
127  _( "Move down" ) );
128 
129  m_mainToolBar->AddSeparator();
130  m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ),
131  _( "Enable/Disable orthographic projection" ),
132  wxITEM_CHECK );
133 
134  m_mainToolBar->Realize();
135 }
Definition: id.h:241
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
void SetToolbars()
Definition: 3d_toolbar.cpp:524
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
void EDA_BASE_FRAME::ReCreateMenuBar ( void  )
virtualinherited
void EDA_3D_VIEWER::RedrawActiveWindow ( wxDC *  DC,
bool  EraseBg 
)
private

Definition at line 908 of file eda_3d_viewer.cpp.

References m_logTrace.

Referenced by GetSettings().

909 {
910  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::RedrawActiveWindow" ) );
911  // Do nothing
912 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
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 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 224 of file eda_3d_viewer.cpp.

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

Referenced by GetBoard(), NewDisplay(), PCB_EDIT_FRAME::OnModify(), and Process_Special_Functions().

225 {
226  // This will schedule a request to load later
227  if( m_canvas )
228  m_canvas->ReloadRequest( GetBoard(), Prj().Get3DCacheManager() );
229 }
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
BOARD * GetBoard()
Definition: eda_3d_viewer.h:64
void EDA_3D_VIEWER::RenderEngineChanged ( )
private

RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.

Definition at line 991 of file eda_3d_viewer.cpp.

References ID_RENDER_CURRENT_VIEW, m_canvas, EDA_BASE_FRAME::m_mainToolBar, m_settings, RENDER_ENGINE_OPENGL_LEGACY, EDA_3D_CANVAS::RenderEngineChanged(), and CINFO3D_VISU::RenderEngineGet().

Referenced by GetSettings(), OnRenderEngineSelection(), and Process_Special_Functions().

992 {
993  if( m_canvas )
995 
998 
999  m_mainToolBar->Refresh();
1000 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
void RenderEngineChanged()
RenderEngineChanged - Notify that the render engine was changed.
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Function SaveProjectSettings saves 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 280 of file eda_base_frame.h.

References EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::GetFileFromHistory(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), EDA_BASE_FRAME::OnSelectPreferredEditor(), EDA_BASE_FRAME::ReadHotkeyConfig(), EDA_BASE_FRAME::ReadHotkeyConfigFile(), EDA_BASE_FRAME::UpdateFileHistory(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick(), SCH_EDIT_FRAME::OnPreferencesOptions(), and SCH_EDIT_FRAME::Process_Config().

280 {};
void EDA_3D_VIEWER::SaveSettings ( wxConfigBase *  aCfg)
overrideprivatevirtual

Function SaveSettings 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 821 of file eda_3d_viewer.cpp.

References FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_MOUSEWHEEL_PANNING, 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, keyMousewheelPanning, 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_SilkScreenColor, CINFO3D_VISU::m_SolderMaskColor, CINFO3D_VISU::m_SolderPasteColor, CINFO3D_VISU::MaterialModeGet(), CINFO3D_VISU::RenderEngineGet(), and EDA_BASE_FRAME::SaveSettings().

Referenced by GetSettings().

822 {
824 
825  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::SaveSettings" ) );
826 
827  aCfg->Write( keyBgColor_Red, m_settings.m_BgColorBot.r );
828  aCfg->Write( keyBgColor_Green, m_settings.m_BgColorBot.g );
829  aCfg->Write( keyBgColor_Blue, m_settings.m_BgColorBot.b );
830 
831  aCfg->Write( keyBgColor_Red_Top, m_settings.m_BgColorTop.r );
832  aCfg->Write( keyBgColor_Green_Top, m_settings.m_BgColorTop.g );
833  aCfg->Write( keyBgColor_Blue_Top, m_settings.m_BgColorTop.b );
834 
838 
842 
846 
847  aCfg->Write( keyCopperColor_Red, m_settings.m_CopperColor.r );
849  aCfg->Write( keyCopperColor_Blue, m_settings.m_CopperColor.b );
850 
854 
856 
858 
859  aCfg->Write( keyRenderEngine, (int)m_settings.RenderEngineGet() );
860 
861  aCfg->Write( keyRenderMaterial, (int)m_settings.MaterialModeGet() );
862 
863  // OpenGL options
866 
867  // Raytracing options
875 
876  aCfg->Write( keyShowAxis, m_settings.GetFlag( FL_AXIS ) );
877  aCfg->Write( keyShowGrid, (int)m_settings.GridGet() );
878 
882 
883  aCfg->Write( keyShowZones, m_settings.GetFlag( FL_ZONE ) );
889  aCfg->Write( keyShowEcoLayers, m_settings.GetFlag( FL_ECO ) );
891 }
static const wxChar keyShowSolderMaskLayers[]
static const wxChar keyShowFootprints_Normal[]
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
static const wxChar keyRenderRAY_ProceduralT[]
static const wxChar keyShowGrid[]
static const wxChar keyShowBoardBody[]
static const wxChar keyRenderRAY_Reflections[]
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
static const wxChar keyBgColor_Red_Top[]
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
static const wxChar keySilkColor_Blue[]
static const wxChar keyMousewheelPanning[]
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:509
static const wxChar keyShowFootprints_Insert[]
virtual void SaveSettings(wxConfigBase *aCfg)
Function SaveSettings saves common frame parameters to a configuration data file. ...
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:503
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:504
static const wxChar keyShowRealisticMode[]
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:505
static const wxChar keyCopperColor_Blue[]
static const wxChar keySMaskColor_Green[]
static const wxChar keyBgColor_Green_Top[]
static const wxChar keyShowSolderPasteLayers[]
static const wxChar keySPasteColor_Red[]
static const wxChar keyShowSilkScreenLayers[]
static const wxChar keyCopperColor_Red[]
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:507
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
SFVEC3D m_SolderMaskColor
in realistic mode: solder mask color
Definition: cinfo3d_visu.h:506
static const wxChar keyRenderOGL_ShowModelBBox[]
static const wxChar keySPasteColor_Green[]
static const wxChar keyBoardBodyColor_Red[]
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
SFVEC3D m_SilkScreenColor
in realistic mode: SilkScreen color
Definition: cinfo3d_visu.h:508
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 * m_logTrace
Trace mask used to enable or disable the trace output of this class.
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[]
bool EDA_3D_VIEWER::Set3DBoardBodyColorFromUser ( )

Function Set3DBoardBodyBodyColorFromUser 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 1121 of file eda_3d_viewer.cpp.

References CINFO3D_VISU::m_BoardBodyColor, m_settings, NewDisplay(), and Set3DColorFromUser().

Referenced by GetSettings(), and Process_Special_Functions().

1122 {
1123  wxColourData definedColors;
1124  unsigned int i = 0;
1125 
1126  definedColors.SetCustomColour( i++, wxColour( 51, 43, 22 ) ); // FR4 natural, dark
1127  definedColors.SetCustomColour( i++, wxColour( 109, 116, 75 ) ); // FR4 natural
1128  definedColors.SetCustomColour( i++, wxColour( 78, 14, 5 ) ); // brown/red
1129  definedColors.SetCustomColour( i++, wxColour( 146, 99, 47 ) ); // brown 1
1130  definedColors.SetCustomColour( i++, wxColour( 160, 123, 54 ) ); // brown 2
1131  definedColors.SetCustomColour( i++, wxColour( 146, 99, 47 ) ); // brown 3
1132  definedColors.SetCustomColour( i++, wxColour( 63, 126, 71 ) ); // green 1
1133  definedColors.SetCustomColour( i++, wxColour( 117, 122, 90 ) ); // green 2
1134 
1135  for(; i < wxColourData::NUM_CUSTOM;)
1136  {
1137  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1138  }
1139 
1141  _( "Board Body Color" ),
1142  &definedColors );
1143 
1144  if( change )
1145  NewDisplay();
1146 
1147  return change;
1148 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:505
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool EDA_3D_VIEWER::Set3DColorFromUser ( SFVEC3D aColor,
const wxString &  aTitle,
wxColourData *  aPredefinedColors = NULL 
)

Function Set3DColorFromUser 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 wxColourData which contains a few predefined colors if it is NULL, no predefined colors are used
Returns
true if a new color is chosen, false if no change or aborted by user

Definition at line 1003 of file eda_3d_viewer.cpp.

References KiROUND().

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

1005 {
1006  wxColour newcolor, oldcolor;
1007 
1008  oldcolor.Set( KiROUND( aColor.r * 255 ),
1009  KiROUND( aColor.g * 255 ),
1010  KiROUND( aColor.b * 255 ) );
1011 
1012  wxColourData emptyColorSet; // Provides a empty predefined set of colors
1013  // if no color set available to avoid use of an
1014  // old color set
1015 
1016  if( aPredefinedColors == NULL )
1017  aPredefinedColors = &emptyColorSet;
1018 
1019  newcolor = wxGetColourFromUser( this, oldcolor, aTitle, aPredefinedColors );
1020 
1021  if( !newcolor.IsOk() ) // Cancel command
1022  return false;
1023 
1024  if( newcolor != oldcolor )
1025  {
1026  aColor.r = (double) newcolor.Red() / 255.0;
1027  aColor.g = (double) newcolor.Green() / 255.0;
1028  aColor.b = (double) newcolor.Blue() / 255.0;
1029  }
1030 
1031  return true;
1032 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
bool EDA_3D_VIEWER::Set3DCopperColorFromUser ( )

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

References CINFO3D_VISU::m_CopperColor, m_settings, NewDisplay(), and Set3DColorFromUser().

Referenced by GetSettings(), and Process_Special_Functions().

1096 {
1097  wxColourData definedColors;
1098  unsigned int i = 0;
1099 
1100  definedColors.SetCustomColour( i++, wxColour( 184, 115, 50) ); // Copper
1101  definedColors.SetCustomColour( i++, wxColour( 191, 155, 58) ); // Gold
1102  definedColors.SetCustomColour( i++, wxColour( 213, 213, 213) ); // Silver
1103  definedColors.SetCustomColour( i++, wxColour( 160, 160, 160) ); // tin
1104 
1105  for(; i < wxColourData::NUM_CUSTOM;)
1106  {
1107  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1108  }
1109 
1111  _( "Copper Color" ),
1112  &definedColors );
1113 
1114  if( change )
1115  NewDisplay();
1116 
1117  return change;
1118 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:509
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool EDA_3D_VIEWER::Set3DSilkScreenColorFromUser ( )

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

References m_settings, CINFO3D_VISU::m_SilkScreenColor, NewDisplay(), and Set3DColorFromUser().

Referenced by GetSettings(), and Process_Special_Functions().

1036 {
1037  wxColourData definedColors;
1038  unsigned int i = 0;
1039 
1040  definedColors.SetCustomColour( i++, wxColour( 241, 241, 241 ) ); // White
1041  definedColors.SetCustomColour( i++, wxColour( 4, 18, 21 ) ); // Dark
1042 
1043  for(; i < wxColourData::NUM_CUSTOM;)
1044  {
1045  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1046  }
1047 
1049  _( "Silk Screen Color" ),
1050  &definedColors );
1051 
1052  if( change )
1053  NewDisplay();
1054 
1055  return change;
1056 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
SFVEC3D m_SilkScreenColor
in realistic mode: SilkScreen color
Definition: cinfo3d_visu.h:508
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool EDA_3D_VIEWER::Set3DSolderMaskColorFromUser ( )

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

References m_settings, CINFO3D_VISU::m_SolderMaskColor, NewDisplay(), and Set3DColorFromUser().

Referenced by GetSettings(), and Process_Special_Functions().

1060 {
1061  wxColourData definedColors;
1062  unsigned int i = 0;
1063 
1064  definedColors.SetCustomColour( i++, wxColour( 20, 51, 36 ) ); // Green
1065  definedColors.SetCustomColour( i++, wxColour( 91, 168, 12 ) ); // Light Green
1066  definedColors.SetCustomColour( i++, wxColour( 13, 104, 11 ) ); // Saturated Green
1067  definedColors.SetCustomColour( i++, wxColour(181, 19, 21 ) ); // Red
1068  definedColors.SetCustomColour( i++, wxColour(239, 53, 41 ) ); // Red Light Orange
1069  definedColors.SetCustomColour( i++, wxColour(210, 40, 14 ) ); // Red 2
1070  definedColors.SetCustomColour( i++, wxColour( 2, 59, 162 ) ); // Blue
1071  definedColors.SetCustomColour( i++, wxColour( 54, 79, 116 ) ); // Light blue 1
1072  definedColors.SetCustomColour( i++, wxColour( 61, 85, 130 ) ); // Light blue 2
1073  definedColors.SetCustomColour( i++, wxColour( 21, 70, 80 ) ); // Green blue (dark)
1074  definedColors.SetCustomColour( i++, wxColour( 11, 11, 11 ) ); // Black
1075  definedColors.SetCustomColour( i++, wxColour( 245, 245,245 ) ); // White
1076  definedColors.SetCustomColour( i++, wxColour(119, 31, 91 ) ); // Purple
1077  definedColors.SetCustomColour( i++, wxColour( 32, 2, 53 ) ); // Purple Dark
1078 
1079  for(; i < wxColourData::NUM_CUSTOM;)
1080  {
1081  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1082  }
1083 
1085  _( "Solder Mask Color" ),
1086  &definedColors );
1087 
1088  if( change )
1089  NewDisplay();
1090 
1091  return change;
1092 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
SFVEC3D m_SolderMaskColor
in realistic mode: solder mask color
Definition: cinfo3d_visu.h:506
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
bool EDA_3D_VIEWER::Set3DSolderPasteColorFromUser ( )

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

References _HKI, GR_KB_SHIFT, Hk3D_AttributesSMD, Hk3D_AttributesTHT, Hk3D_AttributesVirtual, Hk3D_HomeView, Hk3D_MoveDown, Hk3D_MoveLeft, Hk3D_MoveRight, Hk3D_MoveUp, Hk3D_PivotCenter, Hk3D_ResetView, Hk3D_Rotate45axisZ, Hk3D_ViewBack, Hk3D_ViewBot, Hk3D_ViewFront, Hk3D_ViewLeft, Hk3D_ViewRight, Hk3D_ViewTop, Hk3D_ZoomIn, Hk3D_ZoomOut, ID_POPUP_MOVE3D_DOWN, ID_POPUP_MOVE3D_LEFT, ID_POPUP_MOVE3D_RIGHT, ID_POPUP_MOVE3D_UP, ID_POPUP_VIEW_XNEG, ID_POPUP_VIEW_XPOS, ID_POPUP_VIEW_YNEG, ID_POPUP_VIEW_YPOS, ID_POPUP_VIEW_ZNEG, ID_POPUP_VIEW_ZPOS, ID_POPUP_ZOOMIN, ID_POPUP_ZOOMOUT, m_settings, CINFO3D_VISU::m_SolderPasteColor, NewDisplay(), Set3DColorFromUser(), and viewer3DSectionTitle().

Referenced by GetSettings(), and Process_Special_Functions().

1152 {
1153  wxColourData definedColors;
1154  unsigned int i = 0;
1155 
1156  definedColors.SetCustomColour( i++, wxColour( 128, 128, 128 ) ); // grey
1157  definedColors.SetCustomColour( i++, wxColour( 213, 213, 213 ) ); // Silver
1158  definedColors.SetCustomColour( i++, wxColour( 90, 90, 90 ) ); // grey 2
1159 
1160  for(; i < wxColourData::NUM_CUSTOM;)
1161  {
1162  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1163  }
1164 
1166  _( "Solder Paste Color" ),
1167  &definedColors );
1168 
1169  if( change )
1170  NewDisplay();
1171 
1172  return change;
1173 }
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:507
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 209 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::isAutoSaveRequired(), DIALOG_GENERALOPTIONS::OnOkClick(), and SCH_EDIT_FRAME::OnPreferencesOptions().

210 {
211  m_autoSaveInterval = aInterval;
212 
213  if( m_autoSaveTimer->IsRunning() )
214  {
215  if( m_autoSaveInterval > 0 )
216  {
217  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
218  }
219  else
220  {
221  m_autoSaveTimer->Stop();
222  m_autoSaveState = false;
223  }
224  }
225 }
bool m_autoSaveState
Flag to indicate the last auto save state.
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
int m_autoSaveInterval
The auto save interval time in seconds.
void EDA_3D_VIEWER::SetDefaultFileName ( const wxString &  aFn)
inline

Function SetDefaultFileName Set the default file name (eg: to be suggested to a screenshot)

Parameters
aFn= file name to assign

Definition at line 93 of file eda_3d_viewer.h.

References m_defaultFileName.

Referenced by PCB_EDIT_FRAME::Show3D_Frame().

94  {
95  wxFileName fn( aFn );
96  m_defaultFileName = fn.GetName();
97  }
wxString m_defaultFileName
Filename to propose for save a screenshot.
virtual void EDA_BASE_FRAME::SetIconScale ( int  aScale)
inlinevirtualinherited

Function SetIconScale.

Modify the scale of icons in the window; should refresh them and save the setting.

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

Definition at line 466 of file eda_base_frame.h.

466 {}
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 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), KIWAY_HOLDER::Kiway(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

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

Set the state of toggle menus according to the current display options.

Definition at line 415 of file 3d_toolbar.cpp.

References FL_ADHESIVE, FL_AXIS, FL_COMMENTS, FL_ECO, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, FL_MOUSEWHEEL_PANNING, 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(), ID_MENU3D_ADHESIVE_ONOFF, ID_MENU3D_AXIS_ONOFF, ID_MENU3D_COMMENTS_ONOFF, ID_MENU3D_ECO_ONOFF, ID_MENU3D_ENGINE_OPENGL_LEGACY, ID_MENU3D_ENGINE_RAYTRACING, 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_MOUSEWHEEL_PANNING, ID_MENU3D_REALISTIC_MODE, ID_MENU3D_SHOW_BOARD_BODY, ID_MENU3D_SILKSCREEN_ONOFF, ID_MENU3D_SOLDER_MASK_ONOFF, ID_MENU3D_SOLDER_PASTE_ONOFF, ID_MENU3D_ZONE_ONOFF, m_logTrace, m_settings, MATERIAL_MODE_CAD_MODE, MATERIAL_MODE_DIFFUSE_ONLY, MATERIAL_MODE_NORMAL, CINFO3D_VISU::MaterialModeGet(), RENDER_ENGINE_OPENGL_LEGACY, RENDER_ENGINE_RAYTRACING, and CINFO3D_VISU::RenderEngineGet().

Referenced by CreateMenuBar(), GetSettings(), OnUpdateMenus(), and Process_Special_Functions().

416 {
417  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::SetMenuBarOptionsState" ) );
418 
419  wxMenuBar* menuBar = GetMenuBar();
420 
421  if( menuBar == NULL )
422  {
423  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::SetMenuBarOptionsState menuBar == NULL" ) );
424 
425  return;
426  }
427 
428  wxMenuItem* item;
429  // Set the state of toggle menus according to the current display options
430  item = menuBar->FindItem( ID_MENU3D_MOUSEWHEEL_PANNING );
431  item->Check( m_settings.GetFlag( FL_MOUSEWHEEL_PANNING ) );
432 
433 
434  item = menuBar->FindItem( ID_MENU3D_ENGINE_OPENGL_LEGACY );
436 
437  item = menuBar->FindItem( ID_MENU3D_ENGINE_RAYTRACING );
439 
440  item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
441  item->Check( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) );
442  item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
443  item->Enable( !m_settings.GetFlag( FL_USE_REALISTIC_MODE ) );
444  item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
445  item->Enable( !m_settings.GetFlag( FL_USE_REALISTIC_MODE ) );
446 
447  item = menuBar->FindItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_NORMAL );
448  item->Check( m_settings.MaterialModeGet() == MATERIAL_MODE_NORMAL );
449 
450  item = menuBar->FindItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_DIFFUSE_ONLY );
452 
453  item = menuBar->FindItem( ID_MENU3D_FL_RENDER_MATERIAL_MODE_CAD_MODE );
455 
456  // OpenGL
457  item = menuBar->FindItem( ID_MENU3D_FL_OPENGL_RENDER_COPPER_THICKNESS );
459 
460  item = menuBar->FindItem( ID_MENU3D_FL_OPENGL_RENDER_SHOW_MODEL_BBOX );
462 
463  // Raytracing
464  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_RENDER_SHADOWS );
466 
467  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_BACKFLOOR );
469 
470  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_REFRACTIONS );
472 
473  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_REFLECTIONS );
475 
476  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_POST_PROCESSING );
478 
479  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_ANTI_ALIASING );
481 
482  item = menuBar->FindItem( ID_MENU3D_FL_RAYTRACING_PROCEDURAL_TEXTURES );
484 
485 
486  item = menuBar->FindItem( ID_MENU3D_SHOW_BOARD_BODY );
487  item->Check( m_settings.GetFlag( FL_SHOW_BOARD_BODY ) );
488 
489  item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL );
491 
492  item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_NORMAL_INSERT );
494 
495  item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF_ATTRIBUTES_VIRTUAL );
497 
498  item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
499  item->Check( m_settings.GetFlag( FL_ZONE ) );
500 
501  item = menuBar->FindItem( ID_MENU3D_AXIS_ONOFF );
502  item->Check( m_settings.GetFlag( FL_AXIS ) );
503 
504  item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
505  item->Check( m_settings.GetFlag( FL_ADHESIVE ) );
506 
507  item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
508  item->Check( m_settings.GetFlag( FL_SILKSCREEN ) );
509 
510  item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
511  item->Check( m_settings.GetFlag( FL_SOLDERMASK ) );
512 
513  item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
514  item->Check( m_settings.GetFlag( FL_SOLDERPASTE ) );
515 
516  item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
517  item->Check( m_settings.GetFlag( FL_COMMENTS ) );
518 
519  item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
520  item->Check( m_settings.GetFlag( FL_ECO ));
521 }
Use only diffuse material properties.
Definition: 3d_enums.h:93
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
Use a gray shading based on diffuse material.
Definition: 3d_enums.h:94
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
Use all material properties from model file.
Definition: 3d_enums.h:92
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineprotectedinherited

Definition at line 230 of file kiway_player.h.

Referenced by LIB_VIEW_FRAME::LIB_VIEW_FRAME().

230 { m_modal = aIsModal; }
void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

Definition at line 367 of file eda_base_frame.h.

Referenced by KICAD_MANAGER_FRAME::LoadProject().

367 { m_mruPath = aPath; }
wxString m_mruPath
Most recently used path.
void EDA_3D_VIEWER::SetToolbars ( )
private

Definition at line 524 of file 3d_toolbar.cpp.

Referenced by GetSettings(), and ReCreateMainToolbar().

525 {
526 }
void EDA_BASE_FRAME::ShowChangedIcons ( )
virtualinherited

Function ShowChangedIcons redraws items menus after a icon was changed option.

Definition at line 253 of file eda_base_frame.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by EDA_BASE_FRAME::GetMruPath(), and KIWAY::ShowChangedIcons().

254 {
255  ReCreateMenuBar();
256  GetMenuBar()->Refresh();
257 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

Function ShowChangedLanguage redraws the menus and what not in current language.

Reimplemented in PCB_EDIT_FRAME, and GERBVIEW_FRAME.

Definition at line 246 of file eda_base_frame.cpp.

References EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by EDA_BASE_FRAME::GetMruPath(), KIWAY::SetLanguage(), GERBVIEW_FRAME::ShowChangedLanguage(), and PCB_EDIT_FRAME::ShowChangedLanguage().

247 {
248  ReCreateMenuBar();
249  GetMenuBar()->Refresh();
250 }
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
bool KIWAY_PLAYER::ShowModal ( wxString *  aResult = NULL,
wxWindow *  aResultantFocusWindow = NULL 
)
inherited

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.

Definition at line 79 of file kiway_player.cpp.

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 DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), PCB_BASE_FRAME::SelectFootprintFromLibBrowser(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

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

Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 374 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp(), and EDA_BASE_FRAME::isAutoSaveRequired().

375 {
376  return Kiface().KifaceSearch();
377 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
SEARCH_STACK & KifaceSearch()
Only for DSO specific &#39;non-library&#39; files.
Definition: kiface_i.h:127
void EDA_3D_VIEWER::takeScreenshot ( wxCommandEvent &  event)
private

Function TakeScreenshot Create a Screenshot of the current 3D view.

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

Definition at line 915 of file eda_3d_viewer.cpp.

References EDA_FILE_SELECTOR(), PROJECT::GetProjectFullName(), EDA_3D_CANVAS::GetScreenshot(), ID_MENU_SCREENCOPY_JPEG, ID_TOOL_SCREENCOPY_TOCLIBBOARD, m_canvas, m_defaultFileName, Parent(), KIWAY_HOLDER::Prj(), and Refresh().

Referenced by GetSettings(), and Process_Special_Functions().

916 {
917  wxString fullFileName;
918  bool fmt_is_jpeg = false;
919 
920  if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
921  fmt_is_jpeg = true;
922 
923  if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
924  {
925  // Remember path between saves during this session only.
926  static wxFileName fn;
927  const wxString file_ext = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png" );
928  const wxString mask = wxT( "*." ) + file_ext;
929 
930  // First time path is set to the project path.
931  if( !fn.IsOk() )
932  fn = Parent()->Prj().GetProjectFullName();
933 
934  fn.SetExt( file_ext );
935 
936  fullFileName = EDA_FILE_SELECTOR( _( "3D Image File Name:" ), fn.GetPath(),
937  m_defaultFileName, file_ext, mask, this,
938  wxFD_SAVE | wxFD_OVERWRITE_PROMPT, true );
939 
940  if( fullFileName.IsEmpty() )
941  return;
942 
943  fn = fullFileName;
944 
945  // Be sure the screen area destroyed by the file dialog is redrawn
946  // before making a screen copy.
947  // Without this call, under Linux the screen refresh is made to late.
948  wxYield();
949  }
950 
951  // Be sure we have the latest 3D view (remember 3D view is buffered)
952  Refresh();
953  wxYield();
954 
955  // Build image from the 3D buffer
956  wxWindowUpdateLocker noUpdates( this );
957 
958  wxImage screenshotImage;
959 
960  if( m_canvas )
961  m_canvas->GetScreenshot( screenshotImage );
962 
963  if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
964  {
965  wxBitmap bitmap( screenshotImage );
966 
967  if( wxTheClipboard->Open() )
968  {
969  wxBitmapDataObject* dobjBmp = new wxBitmapDataObject( bitmap );
970 
971  if( !wxTheClipboard->SetData( dobjBmp ) )
972  wxMessageBox( _( "Failed to copy image to clipboard" ) );
973 
974  wxTheClipboard->Flush(); /* the data in clipboard will stay
975  * available after the application exits */
976  wxTheClipboard->Close();
977  }
978  }
979  else
980  {
981  if( !screenshotImage.SaveFile( fullFileName,
982  fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
983  wxMessageBox( _( "Can't save file" ) );
984 
985  screenshotImage.Destroy();
986  }
987 
988 }
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:62
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:94
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void Refresh()
Update the board display after modifying it bu a python script (note: it is automatically called by a...
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
void GetScreenshot(wxImage &aDstImage)
Request a screenshot and output it to the aDstImage.
wxString m_defaultFileName
Filename to propose for save a screenshot.
void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function UpdateFileHistory Updates the list of recently opened files.

Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

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

Definition at line 392 of file eda_base_frame.cpp.

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

Referenced by SCH_EDIT_FRAME::ImportFile(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberFiles(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), EDA_BASE_FRAME::SaveProjectSettings(), and GERBVIEW_FRAME::unarchiveFiles().

394 {
395  wxFileHistory* fileHistory = aFileHistory;
396 
397  if( !fileHistory )
398  fileHistory = &Kiface().GetFileHistory();
399 
400  fileHistory->AddFileToHistory( FullFileName );
401 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
int EDA_BASE_FRAME::WriteHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList,
wxString *  aFullFileName = NULL 
)
virtualinherited

Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mechanism or a file.

Parameters
aDescList= pointer to the current hotkey list.
aFullFileName= a wxString pointer to a full file name. if NULL, use the standard wxConfig mechanism (default) the output format is: shortcut "key" "function" lines starting with # are comments

Reimplemented in EDA_DRAW_FRAME.

Definition at line 528 of file hotkeys_basic.cpp.

References AddDelimiterString(), DEFAULT_HOTKEY_FILENAME_EXT, GetChars(), GetNewConfig(), HOTKEYS_CONFIG_KEY, KeyNameFromKeyCode(), EDA_HOTKEY_CONFIG::m_HK_InfoList, EDA_HOTKEY::m_InfoMsg, EDA_HOTKEY::m_KeyCode, EDA_HOTKEY_CONFIG::m_SectionTag, EDA_HOTKEY_CONFIG::m_Title, and TO_UTF8.

Referenced by EDA_BASE_FRAME::SaveProjectSettings(), HOTKEYS_EDITOR_DIALOG::TransferDataFromWindow(), and EDA_DRAW_FRAME::WriteHotkeyConfig().

530 {
531  wxString msg;
532  wxString keyname, infokey;
533 
534  msg = wxT( "$hotkey list\n" );
535 
536  // Print the current hotkey list
537  EDA_HOTKEY** list;
538 
539  for( ; aDescList->m_HK_InfoList != nullptr; aDescList++ )
540  {
541  if( aDescList->m_Title )
542  {
543  msg += wxT( "# " );
544  msg += *aDescList->m_Title;
545  msg += wxT( "\n" );
546  }
547 
548  msg += *aDescList->m_SectionTag;
549  msg += wxT( "\n" );
550 
551  list = aDescList->m_HK_InfoList;
552 
553  for( ; *list != nullptr; list++ )
554  {
555  EDA_HOTKEY* hk_decr = *list;
556  msg += wxT( "shortcut " );
557  keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
558  AddDelimiterString( keyname );
559  infokey = hk_decr->m_InfoMsg;
560  AddDelimiterString( infokey );
561  msg += keyname + wxT( ": " ) + infokey + wxT( "\n" );
562  }
563  }
564 
565  msg += wxT( "$Endlist\n" );
566 
567  if( aFullFileName )
568  {
569  FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
570 
571  if( file )
572  {
573  fputs( TO_UTF8( msg ), file );
574  fclose( file );
575  }
576  else
577  {
578  msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
579  return 0;
580  }
581  }
582  else
583  {
584  wxFileName fn( GetName() );
585  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
586  std::unique_ptr<wxConfigBase> config( GetNewConfig( fn.GetFullPath() ) );
587  config->Write( HOTKEYS_CONFIG_KEY, msg );
588  }
589 
590  return 1;
591 }
EDA_HOTKEY ** m_HK_InfoList
Definition: hotkeys_basic.h:91
wxConfigBase * GetNewConfig(const wxString &aProgName)
Function GetNewConfig.
Definition: common.cpp:205
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
#define HOTKEYS_CONFIG_KEY
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done)...
Definition: gestfich.cpp:44
wxString * m_SectionTag
Definition: hotkeys_basic.h:90
wxString m_InfoMsg
Definition: hotkeys_basic.h:64
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:92
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
wxString * m_Title
Definition: hotkeys_basic.h:92
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Function KeyNameFromKeyCode return the key name from the key code Only some wxWidgets key values are ...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

Member Data Documentation

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

Name of program displayed in About.

Definition at line 147 of file eda_base_frame.h.

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited
wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited
EDA_3D_CANVAS* EDA_3D_VIEWER::m_canvas
private

The canvas where the openGL context will be rendered.

Definition at line 234 of file eda_3d_viewer.h.

Referenced by NewDisplay(), On3DGridSelection(), OnActivate(), OnCloseWindow(), OnSetFocus(), Process_Special_Functions(), ProcessZoom(), ReloadRequest(), RenderEngineChanged(), and takeScreenshot().

wxString EDA_BASE_FRAME::m_configFrameName
protectedinherited

prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used

Definition at line 142 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::ConfigBaseName(), and LIB_VIEW_FRAME::LIB_VIEW_FRAME().

wxString EDA_3D_VIEWER::m_defaultFileName
private

Filename to propose for save a screenshot.

Definition at line 229 of file eda_3d_viewer.h.

Referenced by GetDefaultFileName(), SetDefaultFileName(), and takeScreenshot().

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

Flag to indicate if this frame supports auto save.

Definition at line 152 of file eda_base_frame.h.

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

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

Id Type (pcb, schematic, library..)

Definition at line 138 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

const wxChar * EDA_3D_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" )
staticprivate

Trace mask used to enable or disable the trace output of this class.

The debug output can be turned on by setting the WXTRACE environment variable to "KI_TRACE_EDA_3D_VIEWER". See the wxWidgets documentation on wxLogTrace for more information.

Definition at line 247 of file eda_3d_viewer.h.

Referenced by CreateMenuBar(), Exit3DFrame(), LoadSettings(), On3DGridSelection(), OnActivate(), OnCloseWindow(), OnLeftClick(), OnRenderEngineSelection(), OnRightClick(), Process_Special_Functions(), ProcessZoom(), ReCreateMainToolbar(), RedrawActiveWindow(), SaveSettings(), and SetMenuBarOptionsState().

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 259 of file kiway_player.h.

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited
wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 261 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited
wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 262 of file kiway_player.h.

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

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

wxAuiManager perspective.

Definition at line 163 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::LoadSettings().


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