2012-08-11 12:52:13 +00:00
|
|
|
/**
|
|
|
|
* @file 3d_frame.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-02-24 19:53:02 +00:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-08-11 12:52:13 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <kiface_i.h>
|
|
|
|
#include <pgm_base.h>
|
2014-08-05 06:39:04 +00:00
|
|
|
#include <macros.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <3d_viewer.h>
|
2012-12-15 08:52:02 +00:00
|
|
|
#include <3d_canvas.h>
|
2012-08-11 12:52:13 +00:00
|
|
|
#include <info3d_visu.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <trackball.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
#include <wx/colordlg.h>
|
2012-08-11 12:52:13 +00:00
|
|
|
#include <3d_viewer_id.h>
|
2014-01-30 08:18:47 +00:00
|
|
|
#include <wxBasePcbFrame.h>
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
INFO3D_VISU g_Parm_3D_Visu;
|
|
|
|
|
|
|
|
// Key to store 3D Viewer config:
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
static const wxChar keyBgColor_Red[] = wxT( "BgColor_Red" );
|
|
|
|
static const wxChar keyBgColor_Green[] = wxT( "BgColor_Green" );
|
|
|
|
static const wxChar keyBgColor_Blue[] = wxT( "BgColor_Blue" );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
static const wxChar keyBgColor_Red_Top[] = wxT( "BgColor_Red_Top" );
|
|
|
|
static const wxChar keyBgColor_Green_Top[] = wxT( "BgColor_Green_Top" );
|
|
|
|
static const wxChar keyBgColor_Blue_Top[] = wxT( "BgColor_Blue_Top" );
|
|
|
|
|
|
|
|
static const wxChar keySMaskColor_Red[] = wxT( "SMaskColor_Red" );
|
|
|
|
static const wxChar keySMaskColor_Green[] = wxT( "SMaskColor_Green" );
|
|
|
|
static const wxChar keySMaskColor_Blue[] = wxT( "SMaskColor_Blue" );
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
static const wxChar keySPasteColor_Red[] = wxT( "SPasteColor_Red" );
|
|
|
|
static const wxChar keySPasteColor_Green[] = wxT( "SPasteColor_Green" );
|
|
|
|
static const wxChar keySPasteColor_Blue[] = wxT( "SPasteColor_Blue" );
|
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
static const wxChar keySilkColor_Red[] = wxT( "SilkColor_Red" );
|
|
|
|
static const wxChar keySilkColor_Green[] = wxT( "SilkColor_Green" );
|
|
|
|
static const wxChar keySilkColor_Blue[] = wxT( "SilkColor_Blue" );
|
|
|
|
|
|
|
|
static const wxChar keyCopperColor_Red[] = wxT( "CopperColor_Red" );
|
|
|
|
static const wxChar keyCopperColor_Green[] = wxT( "CopperColor_Green" );
|
|
|
|
static const wxChar keyCopperColor_Blue[] = wxT( "CopperColor_Blue" );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
static const wxChar keyBoardBodyColor_Red[] = wxT( "BoardBodyColor_Red" );
|
|
|
|
static const wxChar keyBoardBodyColor_Green[] = wxT( "BoardBodyColor_Green" );
|
|
|
|
static const wxChar keyBoardBodyColor_Blue[]= wxT( "BoardBodyColor_Blue" );
|
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
static const wxChar keyMousewheelPanning[] = wxT( "MousewheelPAN3D" );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
static const wxChar keyShowRealisticMode[] = wxT( "ShowRealisticMode" );
|
2014-08-19 14:51:15 +00:00
|
|
|
static const wxChar keyRenderShadows[] = wxT( "Render_Shadows" );
|
|
|
|
static const wxChar keyRenderRemoveHoles[] = wxT( "Render_RemoveHoles" );
|
|
|
|
static const wxChar keyRenderTextures[] = wxT( "Render_Textures" );
|
2015-03-10 20:15:41 +00:00
|
|
|
static const wxChar keyRenderSmoothNormals[] = wxT( "Render_Smooth_Normals" );
|
|
|
|
static const wxChar keyRenderUseModelNormals[] =wxT( "Render_Use_Model_Normals" );
|
2014-08-19 14:51:15 +00:00
|
|
|
static const wxChar keyRenderMaterial[] = wxT( "Render_Material" );
|
2015-03-28 11:33:56 +00:00
|
|
|
static const wxChar keyRenderShowModelBBox[] = wxT( "Render_ShowModelBoudingBoxes" );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
static const wxChar keyShowAxis[] = wxT( "ShowAxis" );
|
2014-03-20 06:24:33 +00:00
|
|
|
static const wxChar keyShowGrid[] = wxT( "ShowGrid3D" );
|
|
|
|
static const wxChar keyShowGridSize[] = wxT( "Grid3DSize" );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
static const wxChar keyShowZones[] = wxT( "ShowZones" );
|
|
|
|
static const wxChar keyShowFootprints[] = wxT( "ShowFootprints" );
|
|
|
|
static const wxChar keyShowCopperThickness[] = wxT( "ShowCopperThickness" );
|
|
|
|
static const wxChar keyShowAdhesiveLayers[] = wxT( "ShowAdhesiveLayers" );
|
|
|
|
static const wxChar keyShowSilkScreenLayers[] = wxT( "ShowSilkScreenLayers" );
|
|
|
|
static const wxChar keyShowSolderMaskLayers[] = wxT( "ShowSolderMasLayers" );
|
|
|
|
static const wxChar keyShowSolderPasteLayers[] =wxT( "ShowSolderPasteLayers" );
|
|
|
|
static const wxChar keyShowCommentsLayer[] = wxT( "ShowCommentsLayers" );
|
|
|
|
static const wxChar keyShowBoardBody[] = wxT( "ShowBoardBody" );
|
|
|
|
static const wxChar keyShowEcoLayers[] = wxT( "ShowEcoLayers" );
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-01-30 08:18:47 +00:00
|
|
|
BEGIN_EVENT_TABLE( EDA_3D_FRAME, EDA_BASE_FRAME )
|
2012-12-15 08:52:02 +00:00
|
|
|
EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
|
2012-08-11 12:52:13 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom )
|
|
|
|
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
|
|
|
|
EDA_3D_FRAME::Process_Special_Functions )
|
2013-05-16 19:04:21 +00:00
|
|
|
EVT_TOOL( ID_TOOL_SET_VISIBLE_ITEMS, EDA_3D_FRAME::Process_Special_Functions )
|
2012-12-15 08:52:02 +00:00
|
|
|
EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame )
|
|
|
|
EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions )
|
|
|
|
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions )
|
2012-08-11 12:52:13 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
EVT_MENU_RANGE( ID_MENU3D_GRID, ID_MENU3D_GRID_END,
|
|
|
|
EDA_3D_FRAME::On3DGridSelection )
|
2012-08-11 12:52:13 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
EVT_CLOSE( EDA_3D_FRAME::OnCloseWindow )
|
2012-08-11 12:52:13 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
|
|
|
EDA_3D_FRAME::EDA_3D_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent,
|
|
|
|
const wxString& aTitle, long style ) :
|
2014-04-19 18:47:20 +00:00
|
|
|
KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle,
|
2015-12-21 11:52:00 +00:00
|
|
|
wxDefaultPosition, wxDefaultSize, style, VIEWER3D_FRAMENAME )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas = NULL;
|
2010-05-01 12:46:33 +00:00
|
|
|
m_reloadRequest = false;
|
2012-12-15 08:52:02 +00:00
|
|
|
m_ortho = false;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
// Give it an icon
|
2012-12-15 08:52:02 +00:00
|
|
|
wxIcon icon;
|
2011-09-11 11:38:01 +00:00
|
|
|
icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
|
|
|
|
SetIcon( icon );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
LoadSettings( config() );
|
2014-01-30 08:18:47 +00:00
|
|
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
// Create the status line
|
2015-06-21 18:21:20 +00:00
|
|
|
static const int status_dims[4] = { -1, 130, 130, 170 };
|
2009-08-07 04:44:42 +00:00
|
|
|
|
2015-06-21 18:21:20 +00:00
|
|
|
CreateStatusBar( DIM( status_dims ) );
|
|
|
|
SetStatusWidths( DIM( status_dims ), status_dims );
|
2009-08-07 04:44:42 +00:00
|
|
|
|
2013-05-25 09:01:44 +00:00
|
|
|
CreateMenuBar();
|
2014-01-30 08:18:47 +00:00
|
|
|
ReCreateMainToolbar();
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-09-17 15:31:21 +00:00
|
|
|
// Make a EDA_3D_CANVAS
|
2014-08-04 13:06:32 +00:00
|
|
|
// Note: We try to use anti aliasing if the graphic card allows that,
|
|
|
|
// but only on wxWidgets >= 3.0.0 (this option does not exist on wxWidgets 2.8)
|
2014-08-04 12:21:28 +00:00
|
|
|
int attrs[] = { // This array should be 2*n+1
|
|
|
|
// Sadly wxwidgets / glx < 13 allowed
|
|
|
|
// a thing named "boolean attributes" that don't take a value.
|
|
|
|
// (See src/unix/glx11.cpp -> wxGLCanvasX11::ConvertWXAttrsToGL() ).
|
|
|
|
// To avoid problems due to this, just specify those attributes twice.
|
|
|
|
// Only WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO are such boolean
|
|
|
|
// attributes.
|
|
|
|
|
|
|
|
// Boolean attributes (using itself at padding):
|
|
|
|
WX_GL_RGBA, WX_GL_RGBA,
|
|
|
|
WX_GL_DOUBLEBUFFER, WX_GL_DOUBLEBUFFER,
|
|
|
|
|
|
|
|
// Normal attributes with values:
|
|
|
|
WX_GL_DEPTH_SIZE, 16,
|
|
|
|
WX_GL_STENCIL_SIZE, 1,
|
|
|
|
WX_GL_SAMPLE_BUFFERS, 1, // Enable multisampling support (antialiasing).
|
|
|
|
WX_GL_SAMPLES, 0, // Disable AA for the start.
|
|
|
|
0 }; // NULL termination
|
|
|
|
|
2014-08-04 13:06:32 +00:00
|
|
|
|
2014-08-04 12:21:28 +00:00
|
|
|
// Check if the canvas supports multisampling.
|
|
|
|
if( EDA_3D_CANVAS::IsDisplaySupported( attrs ) )
|
|
|
|
{
|
|
|
|
// Check for possible sample sizes, start form the top.
|
|
|
|
int maxSamples = 8; // Any higher doesn't change anything.
|
|
|
|
int samplesOffset = 0;
|
|
|
|
|
2014-08-05 06:39:04 +00:00
|
|
|
for( unsigned int ii = 0; ii < DIM( attrs ); ii += 2 )
|
2014-08-04 12:21:28 +00:00
|
|
|
{
|
|
|
|
if( attrs[ii] == WX_GL_SAMPLES )
|
|
|
|
{
|
|
|
|
samplesOffset = ii+1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
attrs[samplesOffset] = maxSamples;
|
|
|
|
|
|
|
|
for( ; maxSamples > 0 && !EDA_3D_CANVAS::IsDisplaySupported( attrs );
|
|
|
|
maxSamples = maxSamples>>1 )
|
|
|
|
{
|
|
|
|
attrs[samplesOffset] = maxSamples;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Disable multisampling
|
2014-08-05 06:39:04 +00:00
|
|
|
for( unsigned int ii = 0; ii < DIM( attrs ); ii += 2 )
|
2014-08-04 12:21:28 +00:00
|
|
|
{
|
|
|
|
if( attrs[ii] == WX_GL_SAMPLE_BUFFERS )
|
|
|
|
{
|
|
|
|
attrs[ii+1] = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas = new EDA_3D_CANVAS( this, attrs );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
|
|
|
m_auimgr.SetManagedWindow( this );
|
|
|
|
|
2011-09-15 18:25:44 +00:00
|
|
|
|
2014-01-30 08:18:47 +00:00
|
|
|
EDA_PANEINFO horiztb;
|
|
|
|
horiztb.HorizontalToolbarPane();
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2014-01-30 08:18:47 +00:00
|
|
|
m_auimgr.AddPane( m_mainToolBar,
|
|
|
|
wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_auimgr.AddPane( m_canvas,
|
2009-11-04 20:46:53 +00:00
|
|
|
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
2009-11-02 22:24:55 +00:00
|
|
|
|
|
|
|
m_auimgr.Update();
|
2011-08-03 15:09:39 +00:00
|
|
|
|
|
|
|
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
|
|
|
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
|
|
|
// the canvas before it will respond to mouse wheel events.
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetFocus();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-22 10:21:14 +00:00
|
|
|
EDA_3D_FRAME::~EDA_3D_FRAME()
|
|
|
|
{
|
|
|
|
m_auimgr.UnInit();
|
|
|
|
}
|
|
|
|
|
2015-12-21 15:08:37 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Exit3DFrame( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-08-03 15:09:39 +00:00
|
|
|
Close( true );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_BASE_FRAME::LoadSettings( aCfg );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
INFO3D_VISU& prms = GetPrm3DVisu();
|
2014-01-30 08:18:47 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
aCfg->Read( keyBgColor_Red, &GetPrm3DVisu().m_BgColor.m_Red, 0.4 );
|
|
|
|
aCfg->Read( keyBgColor_Green, &GetPrm3DVisu().m_BgColor.m_Green, 0.4 );
|
|
|
|
aCfg->Read( keyBgColor_Blue, &GetPrm3DVisu().m_BgColor.m_Blue, 0.5 );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
aCfg->Read( keyBgColor_Red_Top, &GetPrm3DVisu().m_BgColor_Top.m_Red, 0.8 );
|
|
|
|
aCfg->Read( keyBgColor_Green_Top, &GetPrm3DVisu().m_BgColor_Top.m_Green, 0.8 );
|
|
|
|
aCfg->Read( keyBgColor_Blue_Top, &GetPrm3DVisu().m_BgColor_Top.m_Blue, 0.9 );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
// m_SolderMaskColor default value = dark grey-green
|
|
|
|
aCfg->Read( keySMaskColor_Red, &GetPrm3DVisu().m_SolderMaskColor.m_Red, 100.0 * 0.2 / 255.0 );
|
|
|
|
aCfg->Read( keySMaskColor_Green, &GetPrm3DVisu().m_SolderMaskColor.m_Green, 255.0 * 0.2 / 255.0 );
|
|
|
|
aCfg->Read( keySMaskColor_Blue, &GetPrm3DVisu().m_SolderMaskColor.m_Blue, 180.0 * 0.2 / 255.0 );
|
|
|
|
|
|
|
|
// m_SolderPasteColor default value = light grey
|
|
|
|
aCfg->Read( keySPasteColor_Red, &GetPrm3DVisu().m_SolderPasteColor.m_Red, 128.0 /255.0 );
|
|
|
|
aCfg->Read( keySPasteColor_Green, &GetPrm3DVisu().m_SolderPasteColor.m_Green, 128.0 /255.0 );
|
|
|
|
aCfg->Read( keySPasteColor_Blue, &GetPrm3DVisu().m_SolderPasteColor.m_Blue, 128.0 /255.0 );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
// m_SilkScreenColor default value = white
|
2015-06-16 18:04:02 +00:00
|
|
|
aCfg->Read( keySilkColor_Red, &GetPrm3DVisu().m_SilkScreenColor.m_Red, 0.9 );
|
|
|
|
aCfg->Read( keySilkColor_Green, &GetPrm3DVisu().m_SilkScreenColor.m_Green, 0.9 );
|
|
|
|
aCfg->Read( keySilkColor_Blue, &GetPrm3DVisu().m_SilkScreenColor.m_Blue, 0.9 );
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
// m_CopperColor default value = gold
|
|
|
|
aCfg->Read( keyCopperColor_Red, &GetPrm3DVisu().m_CopperColor.m_Red, 255.0 * 0.7 / 255.0 );
|
|
|
|
aCfg->Read( keyCopperColor_Green, &GetPrm3DVisu().m_CopperColor.m_Green, 223.0 * 0.7 / 255.0 );
|
|
|
|
aCfg->Read( keyCopperColor_Blue, &GetPrm3DVisu().m_CopperColor.m_Blue, 0.0 /255.0 );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
// m_BoardBodyColor default value = FR4, in realistic mode
|
2015-06-17 15:17:34 +00:00
|
|
|
aCfg->Read( keyBoardBodyColor_Red, &GetPrm3DVisu().m_BoardBodyColor.m_Red, 51.0 / 255.0 );
|
|
|
|
aCfg->Read( keyBoardBodyColor_Green, &GetPrm3DVisu().m_BoardBodyColor.m_Green, 43.0 / 255.0 );
|
|
|
|
aCfg->Read( keyBoardBodyColor_Blue, &GetPrm3DVisu().m_BoardBodyColor.m_Blue, 22.0 /255.0 );
|
2015-06-17 12:59:41 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
bool tmp;
|
2016-02-24 19:53:02 +00:00
|
|
|
aCfg->Read( keyMousewheelPanning, &tmp, false );
|
|
|
|
prms.SetFlag( FL_MOUSEWHEEL_PANNING, tmp );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowRealisticMode, &tmp, false );
|
|
|
|
prms.SetFlag( FL_USE_REALISTIC_MODE, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
aCfg->Read( keyRenderShadows, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_SHADOWS, tmp );
|
|
|
|
|
|
|
|
aCfg->Read( keyRenderRemoveHoles, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES, tmp );
|
|
|
|
|
|
|
|
aCfg->Read( keyRenderTextures, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_TEXTURES, tmp );
|
|
|
|
|
2015-03-10 20:15:41 +00:00
|
|
|
aCfg->Read( keyRenderSmoothNormals, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_SMOOTH_NORMALS, tmp );
|
|
|
|
|
|
|
|
aCfg->Read( keyRenderUseModelNormals, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_USE_MODEL_NORMALS, tmp );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
|
|
|
aCfg->Read( keyRenderMaterial, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_MATERIAL, tmp );
|
2014-07-21 16:26:18 +00:00
|
|
|
|
2015-03-28 11:33:56 +00:00
|
|
|
aCfg->Read( keyRenderShowModelBBox, &tmp, false );
|
|
|
|
prms.SetFlag( FL_RENDER_SHOW_MODEL_BBOX, tmp );
|
2015-04-17 11:12:59 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowAxis, &tmp, true );
|
|
|
|
prms.SetFlag( FL_AXIS, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
2014-03-20 06:24:33 +00:00
|
|
|
aCfg->Read( keyShowGrid, &tmp, true );
|
|
|
|
prms.SetFlag( FL_GRID, tmp );
|
2014-03-08 19:04:23 +00:00
|
|
|
|
2014-03-20 06:24:33 +00:00
|
|
|
aCfg->Read( keyShowGridSize, &prms.m_3D_Grid, 10.0 );
|
2014-03-08 19:04:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowFootprints, &tmp, true );
|
|
|
|
prms.SetFlag( FL_MODULE, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowCopperThickness, &tmp, false );
|
|
|
|
prms.SetFlag( FL_USE_COPPER_THICKNESS, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowZones, &tmp, true );
|
|
|
|
prms.SetFlag( FL_ZONE, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowAdhesiveLayers, &tmp, true );
|
|
|
|
prms.SetFlag( FL_ADHESIVE, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowSilkScreenLayers, &tmp, true );
|
|
|
|
prms.SetFlag( FL_SILKSCREEN, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowSolderMaskLayers, &tmp, true );
|
|
|
|
prms.SetFlag( FL_SOLDERMASK, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowSolderPasteLayers, &tmp, true );
|
|
|
|
prms.SetFlag( FL_SOLDERPASTE, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowCommentsLayer, &tmp, true );
|
|
|
|
prms.SetFlag( FL_COMMENTS, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowEcoLayers, &tmp, true );
|
|
|
|
prms.SetFlag( FL_ECO, tmp );
|
2013-10-07 14:50:23 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
aCfg->Read( keyShowBoardBody, &tmp, true );
|
|
|
|
prms.SetFlag( FL_SHOW_BOARD_BODY, tmp );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
void EDA_3D_FRAME::SaveSettings( wxConfigBase* aCfg )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_BASE_FRAME::SaveSettings( aCfg );
|
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
INFO3D_VISU& prms = GetPrm3DVisu();
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
aCfg->Write( keyBgColor_Red, GetPrm3DVisu().m_BgColor.m_Red );
|
|
|
|
aCfg->Write( keyBgColor_Green, GetPrm3DVisu().m_BgColor.m_Green );
|
|
|
|
aCfg->Write( keyBgColor_Blue, GetPrm3DVisu().m_BgColor.m_Blue );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
aCfg->Write( keyBgColor_Red_Top, GetPrm3DVisu().m_BgColor_Top.m_Red );
|
|
|
|
aCfg->Write( keyBgColor_Green_Top, GetPrm3DVisu().m_BgColor_Top.m_Green );
|
|
|
|
aCfg->Write( keyBgColor_Blue_Top, GetPrm3DVisu().m_BgColor_Top.m_Blue );
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
aCfg->Write( keySMaskColor_Red, GetPrm3DVisu().m_SolderMaskColor.m_Red );
|
|
|
|
aCfg->Write( keySMaskColor_Green, GetPrm3DVisu().m_SolderMaskColor.m_Green );
|
|
|
|
aCfg->Write( keySMaskColor_Blue, GetPrm3DVisu().m_SolderMaskColor.m_Blue );
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
aCfg->Write( keySPasteColor_Red, GetPrm3DVisu().m_SolderPasteColor.m_Red );
|
|
|
|
aCfg->Write( keySPasteColor_Green, GetPrm3DVisu().m_SolderPasteColor.m_Green );
|
|
|
|
aCfg->Write( keySPasteColor_Blue, GetPrm3DVisu().m_SolderPasteColor.m_Blue );
|
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
aCfg->Write( keySilkColor_Red, GetPrm3DVisu().m_SilkScreenColor.m_Red );
|
|
|
|
aCfg->Write( keySilkColor_Green, GetPrm3DVisu().m_SilkScreenColor.m_Green );
|
|
|
|
aCfg->Write( keySilkColor_Blue, GetPrm3DVisu().m_SilkScreenColor.m_Blue );
|
|
|
|
|
|
|
|
aCfg->Write( keyCopperColor_Red, GetPrm3DVisu().m_CopperColor.m_Red );
|
|
|
|
aCfg->Write( keyCopperColor_Green, GetPrm3DVisu().m_CopperColor.m_Green );
|
|
|
|
aCfg->Write( keyCopperColor_Blue, GetPrm3DVisu().m_CopperColor.m_Blue );
|
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
aCfg->Write( keyBoardBodyColor_Red, GetPrm3DVisu().m_BoardBodyColor.m_Red );
|
|
|
|
aCfg->Write( keyBoardBodyColor_Green, GetPrm3DVisu().m_BoardBodyColor.m_Green );
|
|
|
|
aCfg->Write( keyBoardBodyColor_Blue, GetPrm3DVisu().m_BoardBodyColor.m_Blue );
|
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
aCfg->Write( keyMousewheelPanning, prms.GetFlag( FL_MOUSEWHEEL_PANNING ) );
|
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
aCfg->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
|
|
|
|
|
|
|
|
aCfg->Write( keyRenderShadows, prms.GetFlag( FL_RENDER_SHADOWS ) );
|
|
|
|
aCfg->Write( keyRenderRemoveHoles, prms.GetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES ) );
|
|
|
|
aCfg->Write( keyRenderTextures, prms.GetFlag( FL_RENDER_TEXTURES ) );
|
2015-03-10 20:15:41 +00:00
|
|
|
aCfg->Write( keyRenderSmoothNormals, prms.GetFlag( FL_RENDER_SMOOTH_NORMALS ) );
|
|
|
|
aCfg->Write( keyRenderUseModelNormals, prms.GetFlag( FL_RENDER_USE_MODEL_NORMALS ) );
|
2014-08-19 14:51:15 +00:00
|
|
|
aCfg->Write( keyRenderMaterial, prms.GetFlag( FL_RENDER_MATERIAL ) );
|
2015-03-28 11:33:56 +00:00
|
|
|
aCfg->Write( keyRenderShowModelBBox, prms.GetFlag( FL_RENDER_SHOW_MODEL_BBOX ) );
|
2015-04-17 11:12:59 +00:00
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
aCfg->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
|
|
|
|
aCfg->Write( keyShowGrid, prms.GetFlag( FL_GRID ) );
|
|
|
|
aCfg->Write( keyShowGridSize, prms.m_3D_Grid );
|
|
|
|
aCfg->Write( keyShowFootprints, prms.GetFlag( FL_MODULE ) );
|
|
|
|
aCfg->Write( keyShowCopperThickness, prms.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
|
|
|
aCfg->Write( keyShowZones, prms.GetFlag( FL_ZONE ) );
|
|
|
|
aCfg->Write( keyShowAdhesiveLayers, prms.GetFlag( FL_ADHESIVE ) );
|
|
|
|
aCfg->Write( keyShowSilkScreenLayers, prms.GetFlag( FL_SILKSCREEN ) );
|
|
|
|
aCfg->Write( keyShowSolderMaskLayers, prms.GetFlag( FL_SOLDERMASK ) );
|
|
|
|
aCfg->Write( keyShowSolderPasteLayers, prms.GetFlag( FL_SOLDERPASTE ) );
|
|
|
|
aCfg->Write( keyShowCommentsLayer, prms.GetFlag( FL_COMMENTS ) );
|
|
|
|
aCfg->Write( keyShowEcoLayers, prms.GetFlag( FL_ECO ) );
|
|
|
|
aCfg->Write( keyShowBoardBody, prms.GetFlag( FL_SHOW_BOARD_BODY ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Process_Zoom( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
int ii;
|
|
|
|
|
|
|
|
switch( event.GetId() )
|
|
|
|
{
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_PAGE:
|
2012-12-15 08:52:02 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
for( ii = 0; ii < 4; ii++ )
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_Rot[ii] = 0.0;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_Zoom = 1.0;
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetOffset( 0.0, 0.0 );
|
2014-08-21 11:59:57 +00:00
|
|
|
trackball( GetPrm3DVisu().m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_IN:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_Zoom /= 1.2;
|
2012-12-15 08:52:02 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
if( GetPrm3DVisu().m_Zoom <= 0.01 )
|
|
|
|
GetPrm3DVisu().m_Zoom = 0.01;
|
2012-12-15 08:52:02 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_OUT:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_Zoom *= 1.2;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_REDRAW:
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->Refresh( false );
|
|
|
|
m_canvas->DisplayStatus();
|
2008-03-21 19:25:41 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
double EDA_3D_FRAME::BestZoom()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-07-05 12:46:14 +00:00
|
|
|
return 1.0;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
#define ROT_ANGLE 10.0
|
2012-12-15 08:52:02 +00:00
|
|
|
int id = event.GetId();
|
|
|
|
bool isChecked = event.IsChecked();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2012-04-09 09:16:47 +00:00
|
|
|
switch( id )
|
2008-03-21 19:25:41 +00:00
|
|
|
{
|
2013-05-16 19:04:21 +00:00
|
|
|
case ID_TOOL_SET_VISIBLE_ITEMS:
|
|
|
|
Install_3D_ViewOptionDialog( event );
|
|
|
|
break;
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
case ID_RELOAD3D_BOARD:
|
2015-03-17 07:39:15 +00:00
|
|
|
m_reloadRequest = true;
|
2008-03-21 19:25:41 +00:00
|
|
|
NewDisplay();
|
2008-07-15 10:11:44 +00:00
|
|
|
return;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_X_POS:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTX += ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_X_NEG:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTX -= ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Y_POS:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTY += ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Y_NEG:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTY -= ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Z_POS:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTZ += ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Z_NEG:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().m_ROTZ -= ROT_ANGLE;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MOVE3D_LEFT:
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetView3D( WXK_LEFT );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_RIGHT:
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetView3D( WXK_RIGHT );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_UP:
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetView3D( WXK_UP );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_DOWN:
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->SetView3D( WXK_DOWN );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
2011-05-22 19:08:34 +00:00
|
|
|
|
2010-10-04 12:58:07 +00:00
|
|
|
case ID_ORTHO:
|
2012-12-15 08:52:02 +00:00
|
|
|
ToggleOrtho();
|
2010-10-04 12:58:07 +00:00
|
|
|
return;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
|
|
|
|
case ID_MENU_SCREENCOPY_PNG:
|
|
|
|
case ID_MENU_SCREENCOPY_JPEG:
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->TakeScreenshot( event );
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
case ID_MENU3D_BGCOLOR_BOTTOM_SELECTION:
|
2015-06-17 15:17:34 +00:00
|
|
|
if( Set3DColorFromUser( GetPrm3DVisu().m_BgColor, _( "Background Color, Bottom" ) ) )
|
2015-06-17 09:06:39 +00:00
|
|
|
m_canvas->Refresh( true );
|
2014-08-19 14:51:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_BGCOLOR_TOP_SELECTION:
|
2015-06-17 15:17:34 +00:00
|
|
|
if( Set3DColorFromUser( GetPrm3DVisu().m_BgColor_Top, _( "Background Color, Top" ) ) )
|
2015-06-17 09:06:39 +00:00
|
|
|
m_canvas->Refresh( true );
|
2014-08-19 14:51:15 +00:00
|
|
|
return;
|
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
case ID_MENU3D_SILKSCREEN_COLOR_SELECTION:
|
|
|
|
Set3DSilkScreenColorFromUser();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_SOLDERMASK_COLOR_SELECTION:
|
2015-06-17 09:06:39 +00:00
|
|
|
Set3DSolderMaskColorFromUser();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_SOLDERPASTE_COLOR_SELECTION:
|
|
|
|
Set3DSolderPasteColorFromUser();
|
2015-06-16 18:04:02 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_COPPER_COLOR_SELECTION:
|
|
|
|
Set3DCopperColorFromUser();
|
2015-06-17 12:59:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_PCB_BODY_COLOR_SELECTION:
|
|
|
|
Set3DBoardBodyColorFromUser();
|
|
|
|
break;
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
case ID_MENU3D_MOUSEWHEEL_PANNING:
|
|
|
|
GetPrm3DVisu().SetFlag( FL_MOUSEWHEEL_PANNING, isChecked );
|
|
|
|
return;
|
|
|
|
|
2013-10-07 11:51:08 +00:00
|
|
|
case ID_MENU3D_REALISTIC_MODE:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_USE_REALISTIC_MODE, isChecked );
|
2015-08-18 10:59:43 +00:00
|
|
|
GetMenuBar()->FindItem( ID_MENU3D_COMMENTS_ONOFF )->Enable( !isChecked );
|
|
|
|
GetMenuBar()->FindItem( ID_MENU3D_ECO_ONOFF )->Enable( !isChecked );
|
2013-10-07 11:51:08 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
case ID_MENU3D_FL_RENDER_SHADOWS:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_SHADOWS, isChecked );
|
2014-08-19 14:51:15 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_SHOW_HOLES_IN_ZONES, isChecked );
|
2014-08-19 14:51:15 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_FL_RENDER_TEXTURES:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_TEXTURES, isChecked );
|
2014-08-19 14:51:15 +00:00
|
|
|
NewDisplay(GL_ID_BOARD);
|
|
|
|
NewDisplay(GL_ID_TECH_LAYERS);
|
|
|
|
return;
|
|
|
|
|
2015-03-10 20:15:41 +00:00
|
|
|
case ID_MENU3D_FL_RENDER_SMOOTH_NORMALS:
|
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_SMOOTH_NORMALS, isChecked );
|
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_FL_RENDER_USE_MODEL_NORMALS:
|
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_USE_MODEL_NORMALS, isChecked );
|
2014-08-19 14:51:15 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_FL_RENDER_MATERIAL:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_MATERIAL, isChecked );
|
2014-07-21 16:26:18 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
2015-03-28 11:33:56 +00:00
|
|
|
case ID_MENU3D_FL_RENDER_SHOW_MODEL_BBOX:
|
|
|
|
GetPrm3DVisu().SetFlag( FL_RENDER_SHOW_MODEL_BBOX, isChecked );
|
|
|
|
NewDisplay();
|
|
|
|
return;
|
|
|
|
|
2013-10-07 11:51:08 +00:00
|
|
|
case ID_MENU3D_SHOW_BOARD_BODY:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_SHOW_BOARD_BODY, isChecked );
|
2013-10-07 11:51:08 +00:00
|
|
|
NewDisplay();
|
|
|
|
return;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2008-08-16 17:42:40 +00:00
|
|
|
case ID_MENU3D_AXIS_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_AXIS, isChecked );
|
2014-03-08 19:04:23 +00:00
|
|
|
m_canvas->Refresh();
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_MODULE_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_MODULE, isChecked );
|
2014-03-08 19:04:23 +00:00
|
|
|
m_canvas->Refresh();
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2012-08-26 13:59:55 +00:00
|
|
|
case ID_MENU3D_USE_COPPER_THICKNESS:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_USE_COPPER_THICKNESS, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_BOARD );
|
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2012-08-26 13:59:55 +00:00
|
|
|
return;
|
|
|
|
|
2008-08-16 17:42:40 +00:00
|
|
|
case ID_MENU3D_ZONE_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_ZONE, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_BOARD );
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-16 19:04:21 +00:00
|
|
|
case ID_MENU3D_ADHESIVE_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_ADHESIVE, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-16 19:04:21 +00:00
|
|
|
case ID_MENU3D_SILKSCREEN_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_SILKSCREEN, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-16 19:04:21 +00:00
|
|
|
case ID_MENU3D_SOLDER_MASK_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_SOLDERMASK, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2013-05-16 19:04:21 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_SOLDER_PASTE_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_SOLDERPASTE, isChecked );
|
2015-08-10 15:17:10 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2013-05-16 19:04:21 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_COMMENTS_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_COMMENTS, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_AUX_LAYERS );
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-16 19:04:21 +00:00
|
|
|
case ID_MENU3D_ECO_ONOFF:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_ECO, isChecked );
|
2015-03-28 11:33:56 +00:00
|
|
|
NewDisplay( GL_ID_AUX_LAYERS );
|
2008-08-16 17:42:40 +00:00
|
|
|
return;
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
default:
|
2012-08-11 12:52:13 +00:00
|
|
|
wxLogMessage( wxT( "EDA_3D_FRAME::Process_Special_Functions() error: unknown command" ) );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->Refresh( true );
|
|
|
|
m_canvas->DisplayStatus();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
|
2012-08-11 12:52:13 +00:00
|
|
|
void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
int id = event.GetId();
|
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
for( int ii = ID_MENU3D_GRID_NOGRID; ii < ID_MENU3D_GRID_END; ii++ )
|
2012-08-11 12:52:13 +00:00
|
|
|
{
|
|
|
|
if( event.GetId() == ii )
|
|
|
|
continue;
|
2012-12-15 08:52:02 +00:00
|
|
|
|
2012-08-11 12:52:13 +00:00
|
|
|
GetMenuBar()->Check( ii, false );
|
|
|
|
}
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_MENU3D_GRID_NOGRID:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_GRID, false );
|
2012-08-11 12:52:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_GRID_10_MM:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_GRID, true );
|
|
|
|
GetPrm3DVisu().m_3D_Grid = 10.0;
|
2012-08-11 12:52:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_GRID_5_MM:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_GRID, true );
|
|
|
|
GetPrm3DVisu().m_3D_Grid = 5.0;
|
2012-08-11 12:52:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_GRID_2P5_MM:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_GRID, true );
|
|
|
|
GetPrm3DVisu().m_3D_Grid = 2.5;
|
2012-08-11 12:52:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_GRID_1_MM:
|
2014-08-21 11:59:57 +00:00
|
|
|
GetPrm3DVisu().SetFlag( FL_GRID, true );
|
|
|
|
GetPrm3DVisu().m_3D_Grid = 1.0;
|
2012-08-11 12:52:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
wxLogMessage( wxT( "EDA_3D_FRAME::On3DGridSelection() error: unknown command" ) );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-03-08 19:04:23 +00:00
|
|
|
NewDisplay( GL_ID_GRID );
|
2012-08-11 12:52:13 +00:00
|
|
|
}
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-07-30 15:39:55 +00:00
|
|
|
void EDA_3D_FRAME::NewDisplay( int aGlList )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2014-03-08 19:04:23 +00:00
|
|
|
m_canvas->ClearLists( aGlList );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2015-03-17 07:39:15 +00:00
|
|
|
// Rebuild the 3D board and refresh the view on reload request:
|
|
|
|
if( m_reloadRequest )
|
|
|
|
m_canvas->ReportWarnings( true );
|
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->Refresh( true );
|
2015-03-16 17:39:35 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
m_canvas->DisplayStatus();
|
2015-03-17 07:39:15 +00:00
|
|
|
m_reloadRequest = false;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
|
2010-04-29 09:06:01 +00:00
|
|
|
{
|
2015-03-17 07:39:15 +00:00
|
|
|
// Reload data if 3D frame shows a board,
|
2010-04-29 09:06:01 +00:00
|
|
|
// because it can be changed since last frame activation
|
2010-05-01 12:46:33 +00:00
|
|
|
if( m_reloadRequest )
|
|
|
|
NewDisplay();
|
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
event.Skip(); // required under wxMAC
|
2010-04-29 09:06:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool EDA_3D_FRAME::Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle,
|
|
|
|
wxColourData* aPredefinedColors )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2015-06-17 09:06:39 +00:00
|
|
|
wxColour newcolor, oldcolor;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
oldcolor.Set( KiROUND( aColor.m_Red * 255 ),
|
|
|
|
KiROUND( aColor.m_Green * 255 ),
|
|
|
|
KiROUND( aColor.m_Blue * 255 ) );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
wxColourData emptyColorSet; // Provides a empty predefined set of colors
|
|
|
|
// if no color set available to avoid use of an
|
|
|
|
// old color set
|
|
|
|
|
|
|
|
if( aPredefinedColors == NULL )
|
|
|
|
aPredefinedColors = &emptyColorSet;
|
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
newcolor = wxGetColourFromUser( this, oldcolor, aTitle, aPredefinedColors );
|
2011-08-03 15:09:39 +00:00
|
|
|
|
2014-08-04 11:28:29 +00:00
|
|
|
if( !newcolor.IsOk() ) // Cancel command
|
2014-08-19 14:51:15 +00:00
|
|
|
return false;
|
2014-03-08 19:04:23 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
if( newcolor != oldcolor )
|
|
|
|
{
|
2015-06-17 09:06:39 +00:00
|
|
|
aColor.m_Red = (double) newcolor.Red() / 255.0;
|
|
|
|
aColor.m_Green = (double) newcolor.Green() / 255.0;
|
|
|
|
aColor.m_Blue = (double) newcolor.Blue() / 255.0;
|
2008-03-21 19:25:41 +00:00
|
|
|
}
|
2015-06-17 09:06:39 +00:00
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
return true;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2014-03-08 19:04:23 +00:00
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
bool EDA_3D_FRAME::Set3DSilkScreenColorFromUser()
|
|
|
|
{
|
2015-06-17 09:06:39 +00:00
|
|
|
wxColourData definedColors;
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
definedColors.SetCustomColour(0, wxColour( 241, 241, 241 ) ); // White
|
2015-06-17 12:59:41 +00:00
|
|
|
definedColors.SetCustomColour(1, wxColour( 180, 180, 180 ) ); // Gray
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SilkScreenColor,
|
|
|
|
_( "Silk Screen Color" ),
|
|
|
|
&definedColors );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
if( change )
|
2015-06-17 12:59:41 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
return change;
|
2015-06-16 18:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
bool EDA_3D_FRAME::Set3DSolderMaskColorFromUser()
|
2015-06-16 18:04:02 +00:00
|
|
|
{
|
2015-06-17 09:06:39 +00:00
|
|
|
wxColourData definedColors;
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
definedColors.SetCustomColour(0, wxColour( 20, 51, 36 ) ); // Green
|
|
|
|
definedColors.SetCustomColour(1, wxColour( 43, 10, 65 ) ); // Purple
|
|
|
|
definedColors.SetCustomColour(2, wxColour( 117, 19, 21 ) ); // Red
|
|
|
|
definedColors.SetCustomColour(3, wxColour( 54, 79, 116) ); // Light blue
|
|
|
|
definedColors.SetCustomColour(4, wxColour( 11, 11, 11 ) ); // Black
|
|
|
|
definedColors.SetCustomColour(5, wxColour( 241, 241,241) ); // White
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SolderMaskColor,
|
|
|
|
_( "Solder Mask Color" ),
|
|
|
|
&definedColors );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
if( change )
|
2015-06-17 12:59:41 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
return change;
|
2015-06-16 18:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool EDA_3D_FRAME::Set3DCopperColorFromUser()
|
|
|
|
{
|
2015-06-17 09:06:39 +00:00
|
|
|
wxColourData definedColors;
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
definedColors.SetCustomColour( 0, wxColour( 184, 115, 50 ) ); // Copper
|
|
|
|
definedColors.SetCustomColour( 1, wxColour( 233, 221, 82 ) ); // Gold
|
|
|
|
definedColors.SetCustomColour( 2, wxColour( 213, 213, 213) ); // Silver
|
|
|
|
definedColors.SetCustomColour( 3, wxColour( 160, 160, 160) ); // tin
|
2015-06-17 12:59:41 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool change = Set3DColorFromUser( GetPrm3DVisu().m_CopperColor,
|
|
|
|
_( "Copper Color" ),
|
|
|
|
&definedColors );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
if( change )
|
2015-06-17 15:17:34 +00:00
|
|
|
NewDisplay( GL_ID_BOARD );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
return change;
|
|
|
|
}
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
|
|
|
|
bool EDA_3D_FRAME::Set3DBoardBodyColorFromUser()
|
|
|
|
{
|
|
|
|
wxColourData definedColors;
|
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
definedColors.SetCustomColour( 0, wxColour( 51, 43, 22 ) ); // FR4 natural, dark
|
|
|
|
definedColors.SetCustomColour( 1, wxColour( 109, 116, 75 ) ); // FR4 natural
|
|
|
|
definedColors.SetCustomColour( 2, wxColour( 78, 14, 5 ) ); // brown/red
|
|
|
|
definedColors.SetCustomColour( 3, wxColour( 146, 99, 47 ) ); // brown 1
|
|
|
|
definedColors.SetCustomColour( 4, wxColour( 160, 123, 54 ) ); // brown 2
|
|
|
|
definedColors.SetCustomColour( 5, wxColour( 146, 99, 47 ) ); // brown 3
|
|
|
|
definedColors.SetCustomColour( 6, wxColour( 63, 126, 71 ) ); // green 1
|
|
|
|
definedColors.SetCustomColour( 7, wxColour( 117, 122, 90 ) ); // green 2
|
2015-06-17 12:59:41 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool change = Set3DColorFromUser( GetPrm3DVisu().m_BoardBodyColor,
|
|
|
|
_( "Board Body Color" ),
|
|
|
|
&definedColors );
|
2015-06-17 12:59:41 +00:00
|
|
|
|
|
|
|
if( change )
|
|
|
|
NewDisplay( GL_ID_BOARD );
|
|
|
|
|
|
|
|
return change;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
bool EDA_3D_FRAME::Set3DSolderPasteColorFromUser()
|
|
|
|
{
|
|
|
|
wxColourData definedColors;
|
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
definedColors.SetCustomColour(0, wxColour( 128, 128, 128 ) ); // grey
|
|
|
|
definedColors.SetCustomColour(1, wxColour( 213, 213, 213 ) ); // Silver
|
|
|
|
definedColors.SetCustomColour(2, wxColour( 90, 90, 90 ) ); // grey 2
|
2015-06-17 09:06:39 +00:00
|
|
|
|
2015-06-17 15:17:34 +00:00
|
|
|
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SolderPasteColor,
|
|
|
|
_( "Solder Paste Color" ),
|
|
|
|
&definedColors );
|
2015-06-17 09:06:39 +00:00
|
|
|
|
|
|
|
if( change )
|
2015-06-17 12:59:41 +00:00
|
|
|
NewDisplay( GL_ID_TECH_LAYERS );
|
2015-06-16 18:04:02 +00:00
|
|
|
|
2015-06-17 09:06:39 +00:00
|
|
|
return change;
|
2015-06-16 18:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-03-08 19:04:23 +00:00
|
|
|
BOARD* EDA_3D_FRAME::GetBoard()
|
|
|
|
{
|
|
|
|
return Parent()->GetBoard();
|
|
|
|
}
|
2014-08-21 11:59:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
INFO3D_VISU& EDA_3D_FRAME::GetPrm3DVisu() const
|
|
|
|
{
|
|
|
|
// return the INFO3D_VISU which contains the current parameters
|
2015-06-17 09:06:39 +00:00
|
|
|
// to draw the 3D view of the board
|
2014-08-21 11:59:57 +00:00
|
|
|
return g_Parm_3D_Visu;
|
|
|
|
}
|
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
bool EDA_3D_FRAME::IsEnabled( DISPLAY3D_FLG aItem ) const
|
|
|
|
{
|
|
|
|
// return true if aItem must be displayed
|
|
|
|
return GetPrm3DVisu().GetFlag( aItem );
|
|
|
|
}
|