2011-11-10 15:55:05 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2014-01-30 08:18:47 +00:00
|
|
|
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2011-11-10 15:55:05 +00:00
|
|
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2011-09-17 15:31:21 +00:00
|
|
|
/**
|
|
|
|
* @file 3d_viewer.h
|
|
|
|
*/
|
2011-11-10 15:55:05 +00:00
|
|
|
|
2009-05-06 11:55:36 +00:00
|
|
|
#ifndef __3D_VIEWER_H__
|
|
|
|
#define __3D_VIEWER_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 <draw_frame.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#if !wxUSE_GLCANVAS
|
2014-01-30 08:18:47 +00:00
|
|
|
#error Please build wxWidgets with Opengl support (./configure --with-opengl)
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wx/glcanvas.h>
|
|
|
|
#include <3d_struct.h>
|
2014-08-19 14:51:15 +00:00
|
|
|
#include <info3d_visu.h>
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2014-08-24 07:05:07 +00:00
|
|
|
/// A variable name whose value holds the path of 3D shape files.
|
|
|
|
/// Currently an environment variable, eventually a project variable.
|
|
|
|
#define KISYS3DMOD wxT( "KISYS3DMOD" )
|
|
|
|
|
|
|
|
/// All 3D files are expected to be stored in LIB3D_FOLDER, or one of
|
|
|
|
/// its subdirectory.
|
|
|
|
#define LIB3D_FOLDER wxT( "packages3d" )
|
* 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
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
class EDA_3D_CANVAS;
|
2014-01-30 08:18:47 +00:00
|
|
|
class PCB_BASE_FRAME;
|
2015-06-17 09:06:39 +00:00
|
|
|
class wxColourData;
|
2011-09-23 13:57:12 +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
|
|
|
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
|
|
|
|
|
2007-06-05 12:10:51 +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
|
|
|
class EDA_3D_FRAME : public KIWAY_PLAYER
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-05-01 12:46:33 +00:00
|
|
|
private:
|
2012-12-15 08:52:02 +00:00
|
|
|
EDA_3D_CANVAS* m_canvas;
|
2011-04-13 19:30:27 +00:00
|
|
|
bool m_reloadRequest;
|
2012-08-29 16:59:50 +00:00
|
|
|
wxString m_defaultFileName; /// Filename to propose for screenshot
|
* 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
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
/// Tracks whether to use Orthographic or Perspective projection
|
|
|
|
bool m_ortho;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
* 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_3D_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent, const wxString& aTitle,
|
2011-08-03 15:09:39 +00:00
|
|
|
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
|
* 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
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
~EDA_3D_FRAME()
|
2010-05-01 12:46:33 +00:00
|
|
|
{
|
|
|
|
m_auimgr.UnInit();
|
|
|
|
};
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2014-05-04 17:08:36 +00:00
|
|
|
PCB_BASE_FRAME* Parent() const { return (PCB_BASE_FRAME*)GetParent(); }
|
2011-08-03 15:09:39 +00:00
|
|
|
|
2014-03-08 19:04:23 +00:00
|
|
|
BOARD* GetBoard();
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ReloadRequest
|
2010-05-01 12:46:33 +00:00
|
|
|
* must be called when reloading data from Pcbnew is needed
|
2011-09-17 15:31:21 +00:00
|
|
|
* mainly after edition of the board or footprint being displayed.
|
2010-10-04 12:58:07 +00:00
|
|
|
* mainly for the module editor.
|
2010-05-01 12:46:33 +00:00
|
|
|
*/
|
|
|
|
void ReloadRequest( )
|
|
|
|
{
|
|
|
|
m_reloadRequest = true;
|
|
|
|
}
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2012-08-11 12:52:13 +00:00
|
|
|
/**
|
|
|
|
* Function NewDisplay
|
|
|
|
* Rebuild the display list.
|
|
|
|
* must be called when 3D opengl data is modified
|
2014-03-08 19:04:23 +00:00
|
|
|
* @param aGlList = the list to rebuild.
|
|
|
|
* if 0 (default) all lists are rebuilt
|
2012-08-11 12:52:13 +00:00
|
|
|
*/
|
2014-07-30 15:39:55 +00:00
|
|
|
void NewDisplay( int aGlList = 0 );
|
2012-08-11 12:52:13 +00:00
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
void SetDefaultFileName(const wxString &aFn) { m_defaultFileName = aFn; }
|
|
|
|
const wxString &GetDefaultFileName() const { return m_defaultFileName; }
|
2012-12-15 08:52:02 +00:00
|
|
|
|
|
|
|
/// Toggles orthographic projection on and off
|
|
|
|
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
|
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
/// @return the orthographic projection flag
|
2012-12-15 08:52:02 +00:00
|
|
|
bool ModeIsOrtho() { return m_ortho ;};
|
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
/** @return the INFO3D_VISU which contains the current parameters
|
|
|
|
* to draw the 3D view og the board
|
|
|
|
*/
|
|
|
|
INFO3D_VISU& GetPrm3DVisu() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return true if aItem must be displayed
|
|
|
|
* @param aItem = an item of DISPLAY3D_FLG enum
|
|
|
|
*/
|
|
|
|
bool IsEnabled( DISPLAY3D_FLG aItem ) const;
|
|
|
|
|
|
|
|
|
2012-08-11 12:52:13 +00:00
|
|
|
private:
|
2012-12-15 08:52:02 +00:00
|
|
|
// Event handlers:
|
2012-08-11 12:52:13 +00:00
|
|
|
void Exit3DFrame( wxCommandEvent& event );
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
2012-12-15 08:52:02 +00:00
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
|
|
|
void On3DGridSelection( wxCommandEvent& event );
|
|
|
|
void Process_Zoom( wxCommandEvent& event );
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
2013-05-16 19:04:21 +00:00
|
|
|
void Install_3D_ViewOptionDialog( wxCommandEvent& event );
|
2012-12-15 08:52:02 +00:00
|
|
|
|
|
|
|
// initialisation
|
2013-05-25 09:01:44 +00:00
|
|
|
void CreateMenuBar();
|
|
|
|
void SetMenuBarOptionsState(); // Set the state of toggle menus according
|
|
|
|
// to the current display options
|
2014-01-30 08:18:47 +00:00
|
|
|
void ReCreateMainToolbar();
|
2012-08-11 12:52:13 +00:00
|
|
|
void SetToolbars();
|
* 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 LoadSettings( wxConfigBase* aCfg ); // overload virtual
|
|
|
|
void SaveSettings( wxConfigBase* aCfg ); // overload virtual
|
2012-08-11 12:52:13 +00:00
|
|
|
|
2012-12-15 08:52:02 +00:00
|
|
|
// Other functions
|
2009-11-04 20:46:53 +00:00
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
void OnKeyEvent( wxKeyEvent& event );
|
2011-07-05 12:46:14 +00:00
|
|
|
double BestZoom();
|
2009-11-04 20:46:53 +00:00
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
/**
|
2015-06-17 09:06:39 +00:00
|
|
|
* Function Set3DColorFromUser
|
2015-06-16 18:04:02 +00:00
|
|
|
* Get a S3D_COLOR from a wx colour dialog
|
2015-06-17 09:06:39 +00:00
|
|
|
* @param aColor is the S3D_COLOR to change
|
2015-06-17 15:17:34 +00:00
|
|
|
* @param aTitle is the title displayed in the colordialog selector
|
2015-06-17 09:06:39 +00:00
|
|
|
* @param aPredefinedColors is a reference to a wxColourData
|
|
|
|
* which contains a few predefined colors
|
|
|
|
* if it is NULL, no predefined colors are used
|
2015-06-16 18:04:02 +00:00
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
2015-06-17 15:17:34 +00:00
|
|
|
bool Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle,
|
|
|
|
wxColourData* aPredefinedColors = NULL );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
/**
|
2015-06-17 09:06:39 +00:00
|
|
|
* Function Set3DSolderMaskColorFromUser
|
2015-06-16 18:04:02 +00:00
|
|
|
* Set the solder mask color from a set of colors
|
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
2015-06-17 09:06:39 +00:00
|
|
|
bool Set3DSolderMaskColorFromUser();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Set3DSolderPasteColorFromUser
|
|
|
|
* Set the solder mask color from a set of colors
|
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
|
|
|
bool Set3DSolderPasteColorFromUser();
|
2015-06-16 18:04:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Set3DCopperColorFromUser
|
|
|
|
* Set the copper color from a set of colors
|
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
|
|
|
bool Set3DCopperColorFromUser();
|
|
|
|
|
2015-06-17 12:59:41 +00:00
|
|
|
/**
|
|
|
|
* Function Set3DBoardBodyBodyColorFromUser
|
|
|
|
* Set the copper color from a set of colors
|
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
|
|
|
bool Set3DBoardBodyColorFromUser();
|
|
|
|
|
2015-06-16 18:04:02 +00:00
|
|
|
/**
|
|
|
|
* Function Set3DSilkScreenColorFromUser
|
|
|
|
* Set the silkscreen color from a set of colors
|
|
|
|
* @return true if a new color is chosen, false if
|
|
|
|
* no change or aborted by user
|
|
|
|
*/
|
|
|
|
bool Set3DSilkScreenColorFromUser();
|
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2009-05-06 11:55:36 +00:00
|
|
|
#endif /* __3D_VIEWER_H__ */
|