Naming conventions.

This commit is contained in:
Jeff Young 2021-06-19 18:28:45 +01:00
parent afc75fa873
commit 89718dd3ba
45 changed files with 406 additions and 414 deletions

View File

@ -27,7 +27,7 @@
#include "3d_info.h"
#include "3d_cache.h"
#include "3d_cache_dialogs.h"
#include "dlg_select_3dmodel.h"
#include "dialog_select_3d_model.h"
bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, wxString& prevModelSelectDir,
@ -36,7 +36,7 @@ bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, wxString& prevMod
if( NULL == aModel )
return false;
DLG_SELECT_3DMODEL dm( aParent, aCache, aModel, prevModelSelectDir, prevModelWildcard );
DIALOG_SELECT_3DMODEL dm( aParent, aCache, aModel, prevModelSelectDir, prevModelWildcard );
// Use QuasiModal so that Configure3DPaths (and its help window) will work
return dm.ShowQuasiModal() == wxID_OK;

View File

@ -25,12 +25,12 @@
#include <set>
#include "dlg_select_3dmodel.h"
#include "dialog_select_3d_model.h"
#include "project.h"
#include "3d_cache/3d_info.h"
#include "3d_cache/3d_cache.h"
#include "3d_cache_dialogs.h"
#include <3d_model_viewer/3d_model_viewer.h>
#include <3d_model_viewer/eda_3d_model_viewer.h>
#include <common_ogl/ogl_attr_list.h>
#include <filename_resolver.h>
#include <pcbnew/footprint.h>
@ -40,25 +40,19 @@
#include <kiplatform/ui.h>
DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager,
FP_3DMODEL* aModelItem, wxString& prevModelSelectDir,
int& prevModelWildcard ) :
DLG_SELECT_3D_MODELE_BASE( aParent ),
m_model( aModelItem ), m_cache( aCacheManager ), m_previousDir( prevModelSelectDir ),
m_previousFilterIndex( prevModelWildcard )
DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager,
FP_3DMODEL* aModelItem, wxString& prevModelSelectDir,
int& prevModelWildcard ) :
DIALOG_SELECT_3D_MODEL_BASE( aParent ),
m_model( aModelItem ),
m_cache( aCacheManager ),
m_resolver( aCacheManager ? aCacheManager->GetResolver() : nullptr ),
m_previousDir( prevModelSelectDir ),
m_modelViewer( nullptr )
{
if( NULL != m_cache )
m_resolver = m_cache->GetResolver();
else
m_resolver = NULL;
// set to NULL to avoid segfaults when m_FileTree is instantiated
// and wxGenericDirCtrl events are posted
m_modelViewer = NULL;
m_modelViewer = new C3D_MODEL_VIEWER( m_pane3Dviewer,
OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
m_cache );
m_modelViewer = new EDA_3D_MODEL_VIEWER( m_pane3Dviewer,
OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
m_cache );
m_modelViewer->SetMinSize( wxSize( 400, -1 ) );
m_Sizer3Dviewer->Add( m_modelViewer, 1, wxEXPAND|wxRIGHT, 5 );
@ -102,13 +96,19 @@ DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheMana
m_FileTree->SetFilter( full_filter );
}
else
{
m_FileTree->SetFilter( filter );
}
}
else
{
m_FileTree->SetFilter( wxFileSelectorDefaultWildcardStr );
}
if( prevModelWildcard >= 0 && prevModelWildcard < (int)fl->size() )
{
m_FileTree->SetFilterIndex( prevModelWildcard );
}
else
{
prevModelWildcard = 0;
@ -138,7 +138,7 @@ DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheMana
}
bool DLG_SELECT_3DMODEL::TransferDataFromWindow()
bool DIALOG_SELECT_3DMODEL::TransferDataFromWindow()
{
if( !m_model || !m_FileTree )
return true;
@ -160,7 +160,6 @@ bool DLG_SELECT_3DMODEL::TransferDataFromWindow()
return true;
m_previousDir = m_FileTree->GetPath();
m_previousFilterIndex = m_FileTree->GetFilterIndex();
// file selection mode: retrieve the filename and specify a
// path relative to one of the config paths
@ -172,14 +171,14 @@ bool DLG_SELECT_3DMODEL::TransferDataFromWindow()
}
void DLG_SELECT_3DMODEL::OnSelectionChanged( wxCommandEvent& event )
void DIALOG_SELECT_3DMODEL::OnSelectionChanged( wxCommandEvent& event )
{
if( m_modelViewer )
m_modelViewer->Set3DModel( m_FileTree->GetFilePath() );
}
void DLG_SELECT_3DMODEL::OnFileActivated( wxCommandEvent& event )
void DIALOG_SELECT_3DMODEL::OnFileActivated( wxCommandEvent& event )
{
if( m_modelViewer )
m_modelViewer->Set3DModel( m_FileTree->GetFilePath() );
@ -188,21 +187,21 @@ void DLG_SELECT_3DMODEL::OnFileActivated( wxCommandEvent& event )
}
void DLG_SELECT_3DMODEL::SetRootDir( wxCommandEvent& event )
void DIALOG_SELECT_3DMODEL::SetRootDir( wxCommandEvent& event )
{
if( m_FileTree && m_dirChoices->GetSelection() > 0 )
m_FileTree->SetPath( m_dirChoices->GetString( m_dirChoices->GetSelection() ) );
}
void DLG_SELECT_3DMODEL::Cfg3DPaths( wxCommandEvent& event )
void DIALOG_SELECT_3DMODEL::Cfg3DPaths( wxCommandEvent& event )
{
if( S3D::Configure3DPaths( this, m_resolver ) )
updateDirChoiceList();
}
void DLG_SELECT_3DMODEL::updateDirChoiceList( void )
void DIALOG_SELECT_3DMODEL::updateDirChoiceList( void )
{
if( !m_FileTree || !m_resolver || !m_dirChoices )
return;

View File

@ -22,27 +22,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file dlg_select_3dmodel.h
* creates a dialog to select 3D model files
*/
#ifndef DIALOG_SELECT_3DMODEL_H
#define DIALOG_SELECT_3DMODEL_H
#ifndef DLG_SELECT_3DMODEL_H
#define DLG_SELECT_3DMODEL_H
#include "dlg_select_3dmodel_base.h"
#include "dialog_select_3d_model_base.h"
class FP_3DMODEL;
class S3D_CACHE;
class FILENAME_RESOLVER;
class C3D_MODEL_VIEWER;
class EDA_3D_MODEL_VIEWER;
class DLG_SELECT_3DMODEL : public DLG_SELECT_3D_MODELE_BASE
class DIALOG_SELECT_3DMODEL : public DIALOG_SELECT_3D_MODEL_BASE
{
public:
DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, FP_3DMODEL* aModelItem,
wxString& prevModelSelectDir, int& prevModelWildcard );
DIALOG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, FP_3DMODEL* aModelItem,
wxString& prevModelSelectDir, int& prevModelWildcard );
bool TransferDataFromWindow() override;
void OnSelectionChanged( wxCommandEvent& event )override;
@ -53,14 +47,13 @@ public:
private:
void updateDirChoiceList( void );
FP_3DMODEL* m_model; // data for the selected model
S3D_CACHE* m_cache; // cache manager
FILENAME_RESOLVER* m_resolver; // 3D filename resolver
FP_3DMODEL* m_model; // data for the selected model
S3D_CACHE* m_cache; // cache manager
FILENAME_RESOLVER* m_resolver; // 3D filename resolver
wxString& m_previousDir;
int& m_previousFilterIndex;
wxString& m_previousDir;
C3D_MODEL_VIEWER* m_modelViewer;
EDA_3D_MODEL_VIEWER* m_modelViewer;
};
#endif // DLG_SELECT_3DMODEL_H
#endif // DIALOG_SELECT_3DMODEL_H

View File

@ -1,15 +1,15 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dlg_select_3dmodel_base.h"
#include "dialog_select_3d_model_base.h"
///////////////////////////////////////////////////////////////////////////
DLG_SELECT_3D_MODELE_BASE::DLG_SELECT_3D_MODELE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
DIALOG_SELECT_3D_MODEL_BASE::DIALOG_SELECT_3D_MODEL_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
@ -22,7 +22,7 @@ DLG_SELECT_3D_MODELE_BASE::DLG_SELECT_3D_MODELE_BASE( wxWindow* parent, wxWindow
bSizerUpper->SetMinSize( wxSize( -1,400 ) );
m_splitterWin = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
m_splitterWin->SetSashGravity( 0.35 );
m_splitterWin->Connect( wxEVT_IDLE, wxIdleEventHandler( DLG_SELECT_3D_MODELE_BASE::m_splitterWinOnIdle ), NULL, this );
m_splitterWin->Connect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_SELECT_3D_MODEL_BASE::m_splitterWinOnIdle ), NULL, this );
m_panelLeft = new wxPanel( m_splitterWin, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerLeft;
@ -87,18 +87,18 @@ DLG_SELECT_3D_MODELE_BASE::DLG_SELECT_3D_MODELE_BASE( wxWindow* parent, wxWindow
this->Centre( wxBOTH );
// Connect Events
m_FileTree->Connect( wxEVT_DIRCTRL_FILEACTIVATED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::OnFileActivated ), NULL, this );
m_FileTree->Connect( wxEVT_DIRCTRL_SELECTIONCHANGED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::OnSelectionChanged ), NULL, this );
m_dirChoices->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::SetRootDir ), NULL, this );
m_cfgPathsButt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::Cfg3DPaths ), NULL, this );
m_FileTree->Connect( wxEVT_DIRCTRL_FILEACTIVATED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::OnFileActivated ), NULL, this );
m_FileTree->Connect( wxEVT_DIRCTRL_SELECTIONCHANGED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::OnSelectionChanged ), NULL, this );
m_dirChoices->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::SetRootDir ), NULL, this );
m_cfgPathsButt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::Cfg3DPaths ), NULL, this );
}
DLG_SELECT_3D_MODELE_BASE::~DLG_SELECT_3D_MODELE_BASE()
DIALOG_SELECT_3D_MODEL_BASE::~DIALOG_SELECT_3D_MODEL_BASE()
{
// Disconnect Events
m_FileTree->Disconnect( wxEVT_DIRCTRL_FILEACTIVATED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::OnFileActivated ), NULL, this );
m_FileTree->Disconnect( wxEVT_DIRCTRL_SELECTIONCHANGED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::OnSelectionChanged ), NULL, this );
m_dirChoices->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::SetRootDir ), NULL, this );
m_cfgPathsButt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_SELECT_3D_MODELE_BASE::Cfg3DPaths ), NULL, this );
m_FileTree->Disconnect( wxEVT_DIRCTRL_FILEACTIVATED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::OnFileActivated ), NULL, this );
m_FileTree->Disconnect( wxEVT_DIRCTRL_SELECTIONCHANGED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::OnSelectionChanged ), NULL, this );
m_dirChoices->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::SetRootDir ), NULL, this );
m_cfgPathsButt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_3D_MODEL_BASE::Cfg3DPaths ), NULL, this );
}

View File

@ -11,13 +11,12 @@
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dlg_select_3dmodel_base</property>
<property name="file">dialog_select_3d_model_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dlg_select_3dmodel_base</property>
<property name="name">dialog_select_3d_model_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -45,7 +43,7 @@
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DLG_SELECT_3D_MODELE_BASE</property>
<property name="name">DIALOG_SELECT_3D_MODEL_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
@ -466,7 +464,6 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -22,19 +22,19 @@
#include <wx/splitter.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/button.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DLG_SELECT_3D_MODELE_BASE
/// Class DIALOG_SELECT_3D_MODEL_BASE
///////////////////////////////////////////////////////////////////////////////
class DLG_SELECT_3D_MODELE_BASE : public DIALOG_SHIM
class DIALOG_SELECT_3D_MODEL_BASE : public DIALOG_SHIM
{
private:
@ -60,13 +60,13 @@ class DLG_SELECT_3D_MODELE_BASE : public DIALOG_SHIM
public:
DLG_SELECT_3D_MODELE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select 3D Model"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DLG_SELECT_3D_MODELE_BASE();
DIALOG_SELECT_3D_MODEL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select 3D Model"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SELECT_3D_MODEL_BASE();
void m_splitterWinOnIdle( wxIdleEvent& )
{
m_splitterWin->SetSashPosition( 300 );
m_splitterWin->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DLG_SELECT_3D_MODELE_BASE::m_splitterWinOnIdle ), NULL, this );
m_splitterWin->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_SELECT_3D_MODEL_BASE::m_splitterWinOnIdle ), NULL, this );
}
};

View File

@ -24,12 +24,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "panel_prev_3d.h"
#include "panel_preview_3d_model.h"
#include <3d_canvas/eda_3d_canvas.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/3d_actions.h>
#include <tools/3d_controller.h>
#include <tools/eda_3d_actions.h>
#include <tools/eda_3d_controller.h>
#include <base_units.h>
#include <bitmaps.h>
#include <board.h>
@ -41,9 +41,10 @@
#include <widgets/infobar.h>
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList ) :
PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList ) :
PANEL_PREVIEW_3D_MODEL_BASE( aParent, wxID_ANY ),
m_previewPane( nullptr ),
m_infobar( nullptr ),
m_boardAdapter(),
@ -122,7 +123,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRI
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
Connect( eventType, wxMenuEventHandler( PANEL_PREV_3D::OnMenuEvent ), NULL, this );
Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), NULL, this );
#ifdef __WXOSX__
// Call layout once to get the proper button sizes after the bitmaps have been set
@ -145,14 +146,14 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRI
}
PANEL_PREV_3D::~PANEL_PREV_3D()
PANEL_PREVIEW_3D_MODEL::~PANEL_PREVIEW_3D_MODEL()
{
delete m_dummyBoard;
delete m_previewPane;
}
void PANEL_PREV_3D::OnMenuEvent( wxMenuEvent& aEvent )
void PANEL_PREVIEW_3D_MODEL::OnMenuEvent( wxMenuEvent& aEvent )
{
if( !m_toolDispatcher )
aEvent.Skip();
@ -161,7 +162,7 @@ void PANEL_PREV_3D::OnMenuEvent( wxMenuEvent& aEvent )
}
void PANEL_PREV_3D::loadCommonSettings()
void PANEL_PREVIEW_3D_MODEL::loadCommonSettings()
{
wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
@ -199,19 +200,19 @@ static double rotationFromString( const wxString& aValue )
}
wxString PANEL_PREV_3D::formatScaleValue( double aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatScaleValue( double aValue )
{
return wxString::Format( "%.4f", aValue );
}
wxString PANEL_PREV_3D::formatRotationValue( double aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue )
{
return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
}
wxString PANEL_PREV_3D::formatOffsetValue( double aValue )
wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
{
// Convert from internal units (mm) to user units
if( m_userUnits == EDA_UNITS::INCHES )
@ -221,7 +222,7 @@ wxString PANEL_PREV_3D::formatOffsetValue( double aValue )
}
void PANEL_PREV_3D::SetSelectedModel( int idx )
void PANEL_PREVIEW_3D_MODEL::SetSelectedModel( int idx )
{
if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
{
@ -265,7 +266,7 @@ void PANEL_PREV_3D::SetSelectedModel( int idx )
}
void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
void PANEL_PREVIEW_3D_MODEL::updateOrientation( wxCommandEvent &event )
{
if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
{
@ -290,7 +291,7 @@ void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
}
void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event )
void PANEL_PREVIEW_3D_MODEL::onOpacitySlider( wxCommandEvent& event )
{
if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
{
@ -305,7 +306,7 @@ void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event )
}
void PANEL_PREV_3D::doIncrementScale( wxSpinEvent& event, double aSign )
void PANEL_PREVIEW_3D_MODEL::doIncrementScale( wxSpinEvent& event, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
@ -326,7 +327,7 @@ void PANEL_PREV_3D::doIncrementScale( wxSpinEvent& event, double aSign )
}
void PANEL_PREV_3D::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
void PANEL_PREVIEW_3D_MODEL::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
wxTextCtrl* textCtrl = xrot;
@ -346,7 +347,7 @@ void PANEL_PREV_3D::doIncrementRotation( wxSpinEvent& aEvent, double aSign )
}
void PANEL_PREV_3D::doIncrementOffset( wxSpinEvent& event, double aSign )
void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign )
{
wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
@ -372,7 +373,7 @@ void PANEL_PREV_3D::doIncrementOffset( wxSpinEvent& event, double aSign )
}
void PANEL_PREV_3D::onMouseWheelScale( wxMouseEvent& event )
void PANEL_PREVIEW_3D_MODEL::onMouseWheelScale( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
@ -394,7 +395,7 @@ void PANEL_PREV_3D::onMouseWheelScale( wxMouseEvent& event )
}
void PANEL_PREV_3D::onMouseWheelRot( wxMouseEvent& event )
void PANEL_PREVIEW_3D_MODEL::onMouseWheelRot( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
@ -416,7 +417,7 @@ void PANEL_PREV_3D::onMouseWheelRot( wxMouseEvent& event )
}
void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event )
{
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
@ -446,7 +447,7 @@ void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event )
}
void PANEL_PREV_3D::UpdateDummyFootprint( bool aReloadRequired )
void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
{
m_dummyFootprint->Models().clear();

View File

@ -33,10 +33,10 @@
* to tune the positioning of the models without invoking a file selector dialog.
*/
#ifndef PANEL_PREV_MODEL_H
#define PANEL_PREV_MODEL_H
#ifndef PANEL_PREVIEW_3D_MODEL_H
#define PANEL_PREVIEW_3D_MODEL_H
#include "panel_prev_3d_base.h"
#include "panel_preview_3d_model_base.h"
#include <vector>
#include <tool/tools_holder.h>
@ -71,13 +71,13 @@ class BOARD;
class BOARD_ADAPTER;
class FOOTPRINT;
class PANEL_PREV_3D: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREV_3D_BASE
class PANEL_PREVIEW_3D_MODEL: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREVIEW_3D_MODEL_BASE
{
public:
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList );
PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
std::vector<FP_3DMODEL>* aParentModelList );
~PANEL_PREV_3D();
~PANEL_PREVIEW_3D_MODEL();
/**
* The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu
@ -210,4 +210,4 @@ private:
EDA_UNITS m_userUnits;
};
#endif // PANEL_PREV_MODEL_H
#endif // PANEL_PREVIEW_3D_MODEL_H

View File

@ -5,11 +5,11 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "panel_prev_3d_base.h"
#include "panel_preview_3d_model_base.h"
///////////////////////////////////////////////////////////////////////////
PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizermain;
bSizermain = new wxBoxSizer( wxHORIZONTAL );
@ -231,100 +231,100 @@ PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE( wxWindow* parent, wxWindowID id, const w
bSizermain->Fit( this );
// Connect Events
xscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
xscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinXscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
yscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
yscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinYscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
zscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
zscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinZscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
xrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
xrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinXrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
yrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
yrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinYrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
zrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
zrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinZrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
xoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
xoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinXoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
yoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
yoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinYoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
zoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
zoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinZoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
m_opacity->Connect( wxEVT_SLIDER, wxCommandEventHandler( PANEL_PREV_3D_BASE::onOpacitySlider ), NULL, this );
m_bpvISO->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DISO ), NULL, this );
m_bpvLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DLeft ), NULL, this );
m_bpvRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DRight ), NULL, this );
m_bpvFront->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DFront ), NULL, this );
m_bpvBack->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBack ), NULL, this );
m_bpvTop->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DTop ), NULL, this );
m_bpvBottom->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBottom ), NULL, this );
m_bpUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DUpdate ), NULL, this );
xscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
xscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinXscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
yscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
yscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinYscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
zscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
zscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinZscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
xrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
xrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinXrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
yrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
yrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinYrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
zrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
zrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinZrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
xoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
xoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinXoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
yoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
yoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinYoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
zoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
zoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinZoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
m_opacity->Connect( wxEVT_SLIDER, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onOpacitySlider ), NULL, this );
m_bpvISO->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DISO ), NULL, this );
m_bpvLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DLeft ), NULL, this );
m_bpvRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DRight ), NULL, this );
m_bpvFront->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DFront ), NULL, this );
m_bpvBack->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DBack ), NULL, this );
m_bpvTop->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DTop ), NULL, this );
m_bpvBottom->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DBottom ), NULL, this );
m_bpUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DUpdate ), NULL, this );
}
PANEL_PREV_3D_BASE::~PANEL_PREV_3D_BASE()
PANEL_PREVIEW_3D_MODEL_BASE::~PANEL_PREVIEW_3D_MODEL_BASE()
{
// Disconnect Events
xscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
xscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinXscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
yscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
yscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinYscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
zscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
zscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
m_spinZscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
xrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
xrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinXrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
yrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
yrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinYrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
zrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
zrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
m_spinZrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
xoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
xoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
yoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
yoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
zoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
zoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
m_opacity->Disconnect( wxEVT_SLIDER, wxCommandEventHandler( PANEL_PREV_3D_BASE::onOpacitySlider ), NULL, this );
m_bpvISO->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DISO ), NULL, this );
m_bpvLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DLeft ), NULL, this );
m_bpvRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DRight ), NULL, this );
m_bpvFront->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DFront ), NULL, this );
m_bpvBack->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBack ), NULL, this );
m_bpvTop->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DTop ), NULL, this );
m_bpvBottom->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBottom ), NULL, this );
m_bpUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DUpdate ), NULL, this );
xscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
xscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinXscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
yscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
yscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinYscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
zscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelScale ), NULL, this );
zscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementScale ), NULL, this );
m_spinZscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementScale ), NULL, this );
xrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
xrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinXrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
yrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
yrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinYrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
zrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelRot ), NULL, this );
zrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementRot ), NULL, this );
m_spinZrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementRot ), NULL, this );
xoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
xoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
yoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
yoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
zoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onMouseWheelOffset ), NULL, this );
zoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::updateOrientation ), NULL, this );
m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onDecrementOffset ), NULL, this );
m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onIncrementOffset ), NULL, this );
m_opacity->Disconnect( wxEVT_SLIDER, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::onOpacitySlider ), NULL, this );
m_bpvISO->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DISO ), NULL, this );
m_bpvLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DLeft ), NULL, this );
m_bpvRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DRight ), NULL, this );
m_bpvFront->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DFront ), NULL, this );
m_bpvBack->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DBack ), NULL, this );
m_bpvTop->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DTop ), NULL, this );
m_bpvBottom->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DBottom ), NULL, this );
m_bpUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL_BASE::View3DUpdate ), NULL, this );
}

View File

@ -11,12 +11,12 @@
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_prev_3d_base</property>
<property name="file">panel_preview_3d_model_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">panel_prev_3d_base</property>
<property name="name">panel_preview_3d_model_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
@ -41,7 +41,7 @@
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_PREV_3D_BASE</property>
<property name="name">PANEL_PREVIEW_3D_MODEL_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass"></property>

View File

@ -32,9 +32,9 @@
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_PREV_3D_BASE
/// Class PANEL_PREVIEW_3D_MODEL_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_PREV_3D_BASE : public wxPanel
class PANEL_PREVIEW_3D_MODEL_BASE : public wxPanel
{
private:
@ -101,8 +101,8 @@ class PANEL_PREV_3D_BASE : public wxPanel
public:
wxTextCtrl* yoff;
PANEL_PREV_3D_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_PREV_3D_BASE();
PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_PREVIEW_3D_MODEL_BASE();
};

View File

@ -31,7 +31,7 @@
#include <iostream>
#include "3d_rendering/legacy/3d_model.h"
#include "3d_model_viewer.h"
#include "eda_3d_model_viewer.h"
#include "../3d_rendering/legacy/ogl_legacy_utils.h"
#include "../3d_cache/3d_cache.h"
#include "common_ogl/ogl_utils.h"
@ -52,27 +52,27 @@
*
* @ingroup trace_env_vars
*/
const wxChar* C3D_MODEL_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_MODEL_VIEWER" );
const wxChar* EDA_3D_MODEL_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_MODEL_VIEWER" );
BEGIN_EVENT_TABLE( C3D_MODEL_VIEWER, wxGLCanvas )
EVT_PAINT( C3D_MODEL_VIEWER::OnPaint )
BEGIN_EVENT_TABLE( EDA_3D_MODEL_VIEWER, wxGLCanvas )
EVT_PAINT( EDA_3D_MODEL_VIEWER::OnPaint )
// mouse events
EVT_LEFT_DOWN( C3D_MODEL_VIEWER::OnLeftDown )
EVT_LEFT_UP( C3D_MODEL_VIEWER::OnLeftUp )
EVT_MIDDLE_UP( C3D_MODEL_VIEWER::OnMiddleUp )
EVT_MIDDLE_DOWN(C3D_MODEL_VIEWER::OnMiddleDown)
EVT_RIGHT_DOWN( C3D_MODEL_VIEWER::OnRightClick )
EVT_MOUSEWHEEL( C3D_MODEL_VIEWER::OnMouseWheel )
EVT_MOTION( C3D_MODEL_VIEWER::OnMouseMove )
EVT_LEFT_DOWN( EDA_3D_MODEL_VIEWER::OnLeftDown )
EVT_LEFT_UP( EDA_3D_MODEL_VIEWER::OnLeftUp )
EVT_MIDDLE_UP( EDA_3D_MODEL_VIEWER::OnMiddleUp )
EVT_MIDDLE_DOWN( EDA_3D_MODEL_VIEWER::OnMiddleDown)
EVT_RIGHT_DOWN( EDA_3D_MODEL_VIEWER::OnRightClick )
EVT_MOUSEWHEEL( EDA_3D_MODEL_VIEWER::OnMouseWheel )
EVT_MOTION( EDA_3D_MODEL_VIEWER::OnMouseMove )
#ifdef USE_OSX_MAGNIFY_EVENT
EVT_MAGNIFY( C3D_MODEL_VIEWER::OnMagnify )
EVT_MAGNIFY( EDA_3D_MODEL_VIEWER::OnMagnify )
#endif
// other events
EVT_ERASE_BACKGROUND( C3D_MODEL_VIEWER::OnEraseBackground )
EVT_ERASE_BACKGROUND( EDA_3D_MODEL_VIEWER::OnEraseBackground )
END_EVENT_TABLE()
@ -82,13 +82,13 @@ END_EVENT_TABLE()
#define RANGE_SCALE_3D 8.0f
C3D_MODEL_VIEWER::C3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList,
S3D_CACHE* aCacheManager ) :
EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList,
S3D_CACHE* aCacheManager ) :
HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE ),
m_trackBallCamera( RANGE_SCALE_3D * 2.0f ), m_cacheManager( aCacheManager )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::C3D_MODEL_VIEWER" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWER" ) );
m_ogl_initialized = false;
m_reload_is_needed = false;
@ -100,9 +100,9 @@ C3D_MODEL_VIEWER::C3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList,
}
C3D_MODEL_VIEWER::~C3D_MODEL_VIEWER()
EDA_3D_MODEL_VIEWER::~EDA_3D_MODEL_VIEWER()
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::~C3D_MODEL_VIEWER" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::EDA_3D_MODEL_VIEWERWER" ) );
if( m_glRC )
{
@ -117,9 +117,9 @@ C3D_MODEL_VIEWER::~C3D_MODEL_VIEWER()
}
void C3D_MODEL_VIEWER::Set3DModel( const S3DMODEL& a3DModel )
void EDA_3D_MODEL_VIEWER::Set3DModel( const S3DMODEL& a3DModel )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::Set3DModel with a S3DMODEL" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::Set3DModel with a S3DMODEL" ) );
// Validate a3DModel pointers
wxASSERT( a3DModel.m_Materials != nullptr );
@ -144,9 +144,9 @@ void C3D_MODEL_VIEWER::Set3DModel( const S3DMODEL& a3DModel )
}
void C3D_MODEL_VIEWER::Set3DModel(const wxString& aModelPathName)
void EDA_3D_MODEL_VIEWER::Set3DModel( const wxString& aModelPathName)
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::Set3DModel with a wxString" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::Set3DModel with a wxString" ) );
if( m_cacheManager )
{
@ -160,7 +160,7 @@ void C3D_MODEL_VIEWER::Set3DModel(const wxString& aModelPathName)
}
void C3D_MODEL_VIEWER::Clear3DModel()
void EDA_3D_MODEL_VIEWER::Clear3DModel()
{
// Delete the old model
m_reload_is_needed = false;
@ -174,7 +174,7 @@ void C3D_MODEL_VIEWER::Clear3DModel()
}
void C3D_MODEL_VIEWER::ogl_initialize()
void EDA_3D_MODEL_VIEWER::ogl_initialize()
{
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
@ -206,7 +206,7 @@ void C3D_MODEL_VIEWER::ogl_initialize()
}
void C3D_MODEL_VIEWER::ogl_set_arrow_material()
void EDA_3D_MODEL_VIEWER::ogl_set_arrow_material()
{
glEnable( GL_COLOR_MATERIAL );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
@ -218,14 +218,14 @@ void C3D_MODEL_VIEWER::ogl_set_arrow_material()
}
void C3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event )
void EDA_3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event )
{
event.Skip( false );
// SwapBuffer requires the window to be shown before calling
if( !IsShownOnScreen() )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::OnPaint !IsShown" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::OnPaint !IsShown" ) );
return;
}
@ -253,7 +253,7 @@ void C3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event )
if( m_reload_is_needed )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::OnPaint m_reload_is_needed" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::OnPaint m_reload_is_needed" ) );
m_reload_is_needed = false;
m_ogl_3dmodel = new MODEL_3D( *m_3d_model, MATERIAL_MODE::NORMAL );
@ -349,16 +349,16 @@ void C3D_MODEL_VIEWER::OnPaint( wxPaintEvent& event )
}
void C3D_MODEL_VIEWER::OnEraseBackground( wxEraseEvent& event )
void EDA_3D_MODEL_VIEWER::OnEraseBackground( wxEraseEvent& event )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::OnEraseBackground" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::OnEraseBackground" ) );
// Do nothing, to avoid flashing.
}
void C3D_MODEL_VIEWER::OnMouseWheel( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnMouseWheel( wxMouseEvent& event )
{
wxLogTrace( m_logTrace, wxT( "C3D_MODEL_VIEWER::OnMouseWheel" ) );
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::OnMouseWheel" ) );
if( event.ShiftDown() )
{
@ -387,13 +387,13 @@ void C3D_MODEL_VIEWER::OnMouseWheel( wxMouseEvent& event )
#ifdef USE_OSX_MAGNIFY_EVENT
void C3D_MODEL_VIEWER::OnMagnify( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnMagnify( wxMouseEvent& event )
{
}
#endif
void C3D_MODEL_VIEWER::OnMouseMove( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnMouseMove( wxMouseEvent& event )
{
m_trackBallCamera.SetCurWindowSize( GetClientSize() );
@ -410,31 +410,31 @@ void C3D_MODEL_VIEWER::OnMouseMove( wxMouseEvent& event )
}
void C3D_MODEL_VIEWER::OnLeftDown( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnLeftDown( wxMouseEvent& event )
{
event.Skip();
}
void C3D_MODEL_VIEWER::OnLeftUp( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnLeftUp( wxMouseEvent& event )
{
event.Skip();
}
void C3D_MODEL_VIEWER::OnMiddleDown( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnMiddleDown( wxMouseEvent& event )
{
event.Skip();
}
void C3D_MODEL_VIEWER::OnMiddleUp( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnMiddleUp( wxMouseEvent& event )
{
event.Skip();
}
void C3D_MODEL_VIEWER::OnRightClick( wxMouseEvent& event )
void EDA_3D_MODEL_VIEWER::OnRightClick( wxMouseEvent& event )
{
event.Skip();
}

View File

@ -42,7 +42,7 @@ class MODEL_3D;
/**
* Implement a canvas based on a wxGLCanvas.
*/
class C3D_MODEL_VIEWER : public HIDPI_GL_CANVAS
class EDA_3D_MODEL_VIEWER : public HIDPI_GL_CANVAS
{
public:
/**
@ -51,10 +51,10 @@ public:
* @param aParent the parent creator of this canvas.
* @param aAttribList a list of openGL options created by #OGL_ATT_LIST::GetAttributesList.
*/
C3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = nullptr,
S3D_CACHE* aCacheManager = nullptr );
EDA_3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = nullptr,
S3D_CACHE* aCacheManager = nullptr );
~C3D_MODEL_VIEWER();
~EDA_3D_MODEL_VIEWER();
/**
* Set this model to be displayed.

View File

@ -29,15 +29,15 @@
#include <eda_3d_viewer.h>
#include <menus_helpers.h>
#include <3d_viewer_id.h>
#include <3d_viewer/tools/3d_actions.h>
#include <3d_viewer/tools/eda_3d_actions.h>
#include <tool/tool_manager.h>
#include <tool/common_control.h>
#include <widgets/wx_menubar.h>
void EDA_3D_VIEWER::CreateMenuBar()
void EDA_3D_VIEWER_FRAME::CreateMenuBar()
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CreateMenuBar" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::CreateMenuBar" );
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
WX_MENUBAR* menuBar = new WX_MENUBAR();

View File

@ -30,12 +30,12 @@
#include <eda_3d_viewer.h>
#include <menus_helpers.h>
#include <tool/action_toolbar.h>
#include <tools/3d_actions.h>
#include <tools/eda_3d_actions.h>
#include <3d_viewer_id.h>
void EDA_3D_VIEWER::ReCreateMainToolbar()
void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ReCreateMainToolbar" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" );
wxWindowUpdateLocker dummy( this );

View File

@ -29,7 +29,7 @@
#include <board_stackup_manager/board_stackup.h>
#include <board_design_settings.h>
PANEL_3D_COLORS::PANEL_3D_COLORS( EDA_3D_VIEWER* aFrame, wxWindow* aParent ) :
PANEL_3D_COLORS::PANEL_3D_COLORS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent ) :
PANEL_3D_COLORS_BASE( aParent ),
m_settings( aFrame->GetAdapter() )
{

View File

@ -30,7 +30,7 @@
class PANEL_3D_COLORS : public PANEL_3D_COLORS_BASE
{
public:
explicit PANEL_3D_COLORS( EDA_3D_VIEWER* aFrame, wxWindow* aParent );
explicit PANEL_3D_COLORS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent );
/// Automatically called when clicking on the OK button
bool TransferDataFromWindow() override;

View File

@ -25,11 +25,11 @@
#include "panel_3D_display_options.h"
#include <3d_canvas/board_adapter.h>
#include <3d_viewer/eda_3d_viewer.h>
#include <3d_viewer/tools/3d_controller.h>
#include <3d_viewer/tools/eda_3d_controller.h>
#include <tool/tool_manager.h>
PANEL_3D_DISPLAY_OPTIONS::PANEL_3D_DISPLAY_OPTIONS( EDA_3D_VIEWER* aFrame, wxWindow* aParent ) :
PANEL_3D_DISPLAY_OPTIONS::PANEL_3D_DISPLAY_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent ) :
PANEL_3D_DISPLAY_OPTIONS_BASE( aParent ),
m_frame( aFrame ),
m_settings( aFrame->GetAdapter() ),

View File

@ -32,7 +32,7 @@
class PANEL_3D_DISPLAY_OPTIONS : public PANEL_3D_DISPLAY_OPTIONS_BASE
{
public:
explicit PANEL_3D_DISPLAY_OPTIONS( EDA_3D_VIEWER* aFrame, wxWindow* aParent );
explicit PANEL_3D_DISPLAY_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent );
void OnCheckEnableAnimation( wxCommandEvent& WXUNUSED( event ) ) override;
@ -45,9 +45,9 @@ public:
void TransferColorDataToWindow();
private:
EDA_3D_VIEWER* m_frame;
BOARD_ADAPTER& m_settings;
EDA_3D_CANVAS* m_canvas;
EDA_3D_VIEWER_FRAME* m_frame;
BOARD_ADAPTER& m_settings;
EDA_3D_CANVAS* m_canvas;
};

View File

@ -26,9 +26,9 @@
#include <widgets/color_swatch.h>
#include <3d_canvas/board_adapter.h>
#include <3d_viewer/eda_3d_viewer.h>
#include <3d_viewer/tools/3d_controller.h>
#include <3d_viewer/tools/eda_3d_controller.h>
PANEL_3D_OPENGL_OPTIONS::PANEL_3D_OPENGL_OPTIONS( EDA_3D_VIEWER* aFrame, wxWindow* aParent ) :
PANEL_3D_OPENGL_OPTIONS::PANEL_3D_OPENGL_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent ) :
PANEL_3D_OPENGL_OPTIONS_BASE( aParent ),
m_settings( aFrame->GetAdapter() ),
m_canvas( aFrame->GetCanvas() )

View File

@ -31,7 +31,7 @@
class PANEL_3D_OPENGL_OPTIONS : public PANEL_3D_OPENGL_OPTIONS_BASE
{
public:
explicit PANEL_3D_OPENGL_OPTIONS( EDA_3D_VIEWER* aFrame, wxWindow* aParent );
explicit PANEL_3D_OPENGL_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent );
/// Automatically called when clicking on the OK button
bool TransferDataFromWindow() override;

View File

@ -25,11 +25,11 @@
#include "panel_3D_raytracing_options.h"
#include <3d_canvas/board_adapter.h>
#include <3d_viewer/eda_3d_viewer.h>
#include <3d_viewer/tools/3d_controller.h>
#include <3d_viewer/tools/eda_3d_controller.h>
#include <bitmaps.h>
#include <tool/tool_manager.h>
PANEL_3D_RAYTRACING_OPTIONS::PANEL_3D_RAYTRACING_OPTIONS( EDA_3D_VIEWER* aFrame,
PANEL_3D_RAYTRACING_OPTIONS::PANEL_3D_RAYTRACING_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame,
wxWindow* aParent ) :
PANEL_3D_RAYTRACING_OPTIONS_BASE( aParent ),
m_settings( aFrame->GetAdapter() ),

View File

@ -31,7 +31,7 @@
class PANEL_3D_RAYTRACING_OPTIONS : public PANEL_3D_RAYTRACING_OPTIONS_BASE
{
public:
explicit PANEL_3D_RAYTRACING_OPTIONS( EDA_3D_VIEWER* aFrame, wxWindow* aParent );
explicit PANEL_3D_RAYTRACING_OPTIONS( EDA_3D_VIEWER_FRAME* aFrame, wxWindow* aParent );
void ResetPanel() override;

View File

@ -30,11 +30,11 @@
#include <wx/filedlg.h>
#include <wx/treebook.h>
#include "eda_3d_viewer.h"
#include <3d_viewer_settings.h>
#include <eda_3d_viewer_settings.h>
#include <3d_viewer_id.h>
#include <3d_viewer/tools/3d_actions.h>
#include <3d_viewer/tools/3d_controller.h>
#include <3d_viewer/tools/3d_conditions.h>
#include <3d_viewer/tools/eda_3d_actions.h>
#include <3d_viewer/tools/eda_3d_controller.h>
#include <3d_viewer/tools/eda_3d_conditions.h>
#include <bitmaps.h>
#include <board_design_settings.h>
#include <board_stackup_manager/board_stackup.h>
@ -66,27 +66,27 @@
*
* @ingroup trace_env_vars
*/
const wxChar* EDA_3D_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" );
const wxChar* EDA_3D_VIEWER_FRAME::m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" );
BEGIN_EVENT_TABLE( EDA_3D_VIEWER, EDA_BASE_FRAME )
BEGIN_EVENT_TABLE( EDA_3D_VIEWER_FRAME, EDA_BASE_FRAME )
EVT_ACTIVATE( EDA_3D_VIEWER::OnActivate )
EVT_SET_FOCUS( EDA_3D_VIEWER::OnSetFocus )
EVT_ACTIVATE( EDA_3D_VIEWER_FRAME::OnActivate )
EVT_SET_FOCUS( EDA_3D_VIEWER_FRAME::OnSetFocus )
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_MENU_COMMAND_END,
EDA_3D_VIEWER::Process_Special_Functions )
EDA_3D_VIEWER_FRAME::Process_Special_Functions )
EVT_MENU( wxID_CLOSE, EDA_3D_VIEWER::Exit3DFrame )
EVT_MENU( ID_RENDER_CURRENT_VIEW, EDA_3D_VIEWER::OnRenderEngineSelection )
EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER::OnDisableRayTracing )
EVT_MENU( wxID_CLOSE, EDA_3D_VIEWER_FRAME::Exit3DFrame )
EVT_MENU( ID_RENDER_CURRENT_VIEW, EDA_3D_VIEWER_FRAME::OnRenderEngineSelection )
EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER_FRAME::OnDisableRayTracing )
EVT_CLOSE( EDA_3D_VIEWER::OnCloseWindow )
EVT_CLOSE( EDA_3D_VIEWER_FRAME::OnCloseWindow )
END_EVENT_TABLE()
EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxString &aTitle,
long style ) :
EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
const wxString &aTitle, long style ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) ),
m_mainToolBar( nullptr ),
@ -94,7 +94,7 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt
m_currentCamera( m_trackBallCamera ),
m_trackBallCamera( RANGE_SCALE_3D )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::EDA_3D_VIEWER %s", aTitle );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME %s", aTitle );
m_disable_ray_tracing = false;
m_aboutTitle = _( "KiCad 3D Viewer" );
@ -171,7 +171,7 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt
}
EDA_3D_VIEWER::~EDA_3D_VIEWER()
EDA_3D_VIEWER_FRAME::~EDA_3D_VIEWER_FRAME()
{
m_canvas->SetEventDispatcher( nullptr );
@ -183,7 +183,7 @@ EDA_3D_VIEWER::~EDA_3D_VIEWER()
}
void EDA_3D_VIEWER::setupUIConditions()
void EDA_3D_VIEWER_FRAME::setupUIConditions()
{
EDA_BASE_FRAME::setupUIConditions();
@ -227,7 +227,8 @@ void EDA_3D_VIEWER::setupUIConditions()
}
void EDA_3D_VIEWER::InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
void EDA_3D_VIEWER_FRAME::InstallPreferences( PAGED_DIALOG* aParent,
PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
{
wxTreebook* book = aParent->GetTreebook();
@ -241,7 +242,7 @@ void EDA_3D_VIEWER::InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDI
}
void EDA_3D_VIEWER::ReloadRequest()
void EDA_3D_VIEWER_FRAME::ReloadRequest()
{
// This will schedule a request to load later
if( m_canvas )
@ -249,7 +250,7 @@ void EDA_3D_VIEWER::ReloadRequest()
}
void EDA_3D_VIEWER::NewDisplay( bool aForceImmediateRedraw )
void EDA_3D_VIEWER_FRAME::NewDisplay( bool aForceImmediateRedraw )
{
ReloadRequest();
@ -260,7 +261,7 @@ void EDA_3D_VIEWER::NewDisplay( bool aForceImmediateRedraw )
}
void EDA_3D_VIEWER::Redraw()
void EDA_3D_VIEWER_FRAME::Redraw()
{
// Only update in OpenGL for an interactive interaction
if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY )
@ -268,7 +269,7 @@ void EDA_3D_VIEWER::Redraw()
}
void EDA_3D_VIEWER::refreshRender()
void EDA_3D_VIEWER_FRAME::refreshRender()
{
if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY )
m_canvas->Request_refresh();
@ -277,17 +278,17 @@ void EDA_3D_VIEWER::refreshRender()
}
void EDA_3D_VIEWER::Exit3DFrame( wxCommandEvent &event )
void EDA_3D_VIEWER_FRAME::Exit3DFrame( wxCommandEvent &event )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Exit3DFrame" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::Exit3DFrame" );
Close( true );
}
void EDA_3D_VIEWER::OnCloseWindow( wxCloseEvent &event )
void EDA_3D_VIEWER_FRAME::OnCloseWindow( wxCloseEvent &event )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnCloseWindow" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnCloseWindow" );
if( m_canvas )
m_canvas->Close();
@ -301,13 +302,14 @@ void EDA_3D_VIEWER::OnCloseWindow( wxCloseEvent &event )
}
void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event )
void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
{
int id = event.GetId();
bool isChecked = event.IsChecked();
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::Process_Special_Functions id %d isChecked %d",
id, isChecked );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::Process_Special_Functions id %d isChecked %d",
id,
isChecked );
if( m_canvas == nullptr )
return;
@ -338,13 +340,13 @@ void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event )
return;
default:
wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER::Process_Special_Functions()" );
wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER_FRAME::Process_Special_Functions()" );
return;
}
}
void EDA_3D_VIEWER::OnRenderEngineSelection( wxCommandEvent &event )
void EDA_3D_VIEWER_FRAME::OnRenderEngineSelection( wxCommandEvent &event )
{
const RENDER_ENGINE old_engine = m_boardAdapter.GetRenderEngine();
@ -353,27 +355,27 @@ void EDA_3D_VIEWER::OnRenderEngineSelection( wxCommandEvent &event )
else
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnRenderEngineSelection type %s ",
( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ) ? "Ray Trace" :
"OpenGL Legacy" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s ",
( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ) ? "Raytrace" :
"OpenGL" );
if( old_engine != m_boardAdapter.GetRenderEngine() )
RenderEngineChanged();
}
void EDA_3D_VIEWER::OnDisableRayTracing( wxCommandEvent& aEvent )
void EDA_3D_VIEWER_FRAME::OnDisableRayTracing( wxCommandEvent& aEvent )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::%s disabling ray tracing.", __WXFUNCTION__ );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::%s disabling ray tracing.", __WXFUNCTION__ );
m_disable_ray_tracing = true;
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY );
}
void EDA_3D_VIEWER::OnActivate( wxActivateEvent &aEvent )
void EDA_3D_VIEWER_FRAME::OnActivate( wxActivateEvent &aEvent )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnActivate" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnActivate" );
if( aEvent.GetActive() && m_canvas )
{
@ -390,7 +392,7 @@ void EDA_3D_VIEWER::OnActivate( wxActivateEvent &aEvent )
}
void EDA_3D_VIEWER::OnSetFocus( wxFocusEvent& aEvent )
void EDA_3D_VIEWER_FRAME::OnSetFocus( wxFocusEvent& aEvent )
{
// Activates again the focus of the canvas so it will catch mouse and key events
if( m_canvas )
@ -400,14 +402,14 @@ void EDA_3D_VIEWER::OnSetFocus( wxFocusEvent& aEvent )
}
void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg )
void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
EDA_3D_VIEWER_SETTINGS* cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
wxASSERT( cfg );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::LoadSettings" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::LoadSettings" );
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
@ -523,8 +525,8 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg )
#if 0
RENDER_ENGINE engine = static_cast<RENDER_ENGINE>( cfg->m_Render.engine );
wxLogTrace( m_logTrace, engine == RENDER_ENGINE::RAYTRACING ?
"EDA_3D_VIEWER::LoadSettings render setting Ray Trace" :
"EDA_3D_VIEWER::LoadSettings render setting OpenGL" );
"EDA_3D_VIEWER_FRAME::LoadSettings render setting Ray Trace" :
"EDA_3D_VIEWER_FRAME::LoadSettings render setting OpenGL" );
#else
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY );
#endif
@ -540,13 +542,13 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg )
}
void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg )
void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
{
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
EDA_BASE_FRAME::SaveSettings( cfg );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::SaveSettings" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::SaveSettings" );
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
@ -583,8 +585,8 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg )
Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" );
wxLogTrace( m_logTrace, m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ?
"EDA_3D_VIEWER::SaveSettings render setting Ray Trace" :
"EDA_3D_VIEWER::SaveSettings render setting OpenGL" );
"EDA_3D_VIEWER_FRAME::SaveSettings render setting Ray Trace" :
"EDA_3D_VIEWER_FRAME::SaveSettings render setting OpenGL" );
if( cfg )
{
@ -676,9 +678,9 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg )
}
void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::CommonSettingsChanged" );
// Regen menu bars, etc
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
@ -692,7 +694,7 @@ void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsC
}
void EDA_3D_VIEWER::takeScreenshot( wxCommandEvent& event )
void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
{
wxString fullFileName;
bool fmt_is_jpeg = false;
@ -786,16 +788,16 @@ void EDA_3D_VIEWER::takeScreenshot( wxCommandEvent& event )
}
void EDA_3D_VIEWER::RenderEngineChanged()
void EDA_3D_VIEWER_FRAME::RenderEngineChanged()
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::RenderEngineChanged()" );
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::RenderEngineChanged()" );
if( m_canvas )
m_canvas->RenderEngineChanged();
}
void EDA_3D_VIEWER::loadCommonSettings()
void EDA_3D_VIEWER_FRAME::loadCommonSettings()
{
wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );

View File

@ -59,13 +59,13 @@ enum EDA_3D_VIEWER_STATUSBAR
/**
* Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard
*/
class EDA_3D_VIEWER : public EDA_3D_BOARD_HOLDER, public KIWAY_PLAYER
class EDA_3D_VIEWER_FRAME : public EDA_3D_BOARD_HOLDER, public KIWAY_PLAYER
{
public:
EDA_3D_VIEWER( KIWAY* aKiway, PCB_BASE_FRAME* aParent, const wxString& aTitle,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent, const wxString& aTitle,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
~EDA_3D_VIEWER();
~EDA_3D_VIEWER_FRAME();
PCB_BASE_FRAME* Parent() const { return (PCB_BASE_FRAME*)GetParent(); }

View File

@ -23,7 +23,7 @@
#include <settings/parameters.h>
#include <wx/config.h>
#include "3d_viewer_settings.h"
#include "eda_3d_viewer_settings.h"
using KIGFX::COLOR4D;

View File

@ -22,7 +22,7 @@
#include <bitmaps.h>
#include <3d_viewer_id.h>
#include <3d_enums.h>
#include "3d_actions.h"
#include "eda_3d_actions.h"
// Actions, being statically-defined, require specialized I18N handling. We continue to

View File

@ -23,7 +23,7 @@
*/
#include <3d_canvas/board_adapter.h>
#include <3d_viewer/tools/3d_conditions.h>
#include <3d_viewer/tools/eda_3d_conditions.h>
#include <functional>

View File

@ -27,9 +27,8 @@
#include <eda_3d_viewer.h>
#include <id.h>
#include <kiface_i.h>
#include <3d_viewer_id.h>
#include <tools/3d_controller.h>
#include "3d_actions.h"
#include <tools/eda_3d_controller.h>
#include "eda_3d_actions.h"
bool EDA_3D_CONTROLLER::Init()
@ -177,7 +176,7 @@ int EDA_3D_CONTROLLER::SetMaterial( const TOOL_EVENT& aEvent )
m_boardAdapter->SetMaterialMode( mode );
if( EDA_3D_VIEWER* viewer = dynamic_cast<EDA_3D_VIEWER*>( m_toolMgr->GetToolHolder() ) )
if( auto* viewer = dynamic_cast<EDA_3D_VIEWER_FRAME*>( m_toolMgr->GetToolHolder() ) )
viewer->NewDisplay( true );
else
m_canvas->Request_refresh();
@ -218,9 +217,7 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
default:
{
EDA_3D_VIEWER* viewer = dynamic_cast<EDA_3D_VIEWER*>( m_toolMgr->GetToolHolder() );
if( viewer )
if( auto* viewer = dynamic_cast<EDA_3D_VIEWER_FRAME*>( m_toolMgr->GetToolHolder() ) )
viewer->NewDisplay( true );
else
m_canvas->Request_refresh();

View File

@ -26,7 +26,7 @@
#include <tool/tool_interactive.h>
class EDA_3D_VIEWER;
class EDA_3D_VIEWER_FRAME;
class BOARD_ADAPTER;

View File

@ -28,17 +28,17 @@ set(3D-VIEWER_SRCS
3d_cache/3d_cache.cpp
3d_cache/3d_plugin_manager.cpp
${DIR_DLG}/3d_cache_dialogs.cpp
${DIR_DLG}/dlg_select_3dmodel_base.cpp
${DIR_DLG}/dlg_select_3dmodel.cpp
${DIR_DLG}/panel_prev_3d_base.cpp
${DIR_DLG}/panel_prev_3d.cpp
${DIR_DLG}/dialog_select_3d_model_base.cpp
${DIR_DLG}/dialog_select_3d_model.cpp
${DIR_DLG}/panel_preview_3d_model_base.cpp
${DIR_DLG}/panel_preview_3d_model.cpp
3d_canvas/board_adapter.cpp
3d_canvas/create_layer_items.cpp
3d_canvas/create_3Dgraphic_brd_items.cpp
3d_canvas/create_layer_poly.cpp
3d_canvas/eda_3d_canvas.cpp
3d_canvas/eda_3d_canvas_pivot.cpp
3d_model_viewer/3d_model_viewer.cpp
3d_model_viewer/eda_3d_model_viewer.cpp
3d_rendering/legacy/3d_model.cpp
3d_rendering/legacy/ogl_legacy_utils.cpp
3d_rendering/legacy/create_scene.cpp
@ -95,11 +95,11 @@ set(3D-VIEWER_SRCS
3d_viewer/dialogs/panel_3D_opengl_options_base.cpp
3d_viewer/dialogs/panel_3D_raytracing_options.cpp
3d_viewer/dialogs/panel_3D_raytracing_options_base.cpp
3d_viewer/tools/3d_actions.cpp
3d_viewer/tools/3d_conditions.cpp
3d_viewer/tools/3d_controller.cpp
3d_viewer/tools/eda_3d_actions.cpp
3d_viewer/tools/eda_3d_conditions.cpp
3d_viewer/tools/eda_3d_controller.cpp
3d_viewer/eda_3d_viewer.cpp
3d_viewer/3d_viewer_settings.cpp
3d_viewer/eda_3d_viewer_settings.cpp
common_ogl/ogl_attr_list.cpp
common_ogl/ogl_utils.cpp
3d_fastmath.cpp

View File

@ -52,7 +52,7 @@ class BOARD_CONNECTED_ITEM;
class COLOR_SETTINGS;
class FOOTPRINT;
class PAD;
class EDA_3D_VIEWER;
class EDA_3D_VIEWER_FRAME;
class GENERAL_COLLECTOR;
class GENERAL_COLLECTORS_GUIDE;
class BOARD_DESIGN_SETTINGS;
@ -81,7 +81,7 @@ public:
/**
* @return a reference to the child 3D viewer frame, when exists, or NULL
*/
EDA_3D_VIEWER* Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* Get3DViewerFrame();
/**
* Update the 3D view, if the viewer is opened by this frame.
@ -231,7 +231,7 @@ public:
*
* If it does not exist, it is created. If it exists, it is brought to the foreground.
*/
EDA_3D_VIEWER* CreateAndShow3D_Frame();
EDA_3D_VIEWER_FRAME* CreateAndShow3D_Frame();
/**
* @return global configuration options.

View File

@ -42,7 +42,7 @@
#include <settings/settings_manager.h>
#include "3d_cache/dialogs/3d_cache_dialogs.h"
#include "3d_cache/dialogs/panel_prev_3d.h"
#include "3d_cache/dialogs/panel_preview_3d_model.h"
#include <dialog_footprint_properties.h>
@ -52,15 +52,15 @@ int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page
DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent,
FOOTPRINT* aFootprint ) :
DIALOG_FOOTPRINT_PROPERTIES_BASE( aParent ),
m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
m_OrientValidator( 3, &m_OrientValue ),
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
m_initialFocus( true ),
m_inSelect( false )
DIALOG_FOOTPRINT_PROPERTIES_BASE( aParent ),
m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
m_orientValidator( 3, &m_orientValue ),
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
m_initialFocus( true ),
m_inSelect( false )
{
m_frame = aParent;
m_footprint = aFootprint;
@ -119,15 +119,15 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
m_modelsGrid->SetWindowStyleFlag( m_modelsGrid->GetWindowStyle() & ~wxHSCROLL );
m_modelsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
m_OrientValidator.SetRange( -360.0, 360.0 );
m_OrientValueCtrl->SetValidator( m_OrientValidator );
m_OrientValidator.SetWindow( m_OrientValueCtrl );
m_orientValidator.SetRange( -360.0, 360.0 );
m_OrientValueCtrl->SetValidator( m_orientValidator );
m_orientValidator.SetWindow( m_OrientValueCtrl );
aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
m_PreviewPane = new PANEL_PREV_3D( m_Panel3D, m_frame, m_footprint, &m_shapes3D_list );
m_previewPane = new PANEL_PREVIEW_3D_MODEL( m_Panel3D, m_frame, m_footprint, &m_shapes3D_list );
bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
bLowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
// Set font size for items showing long strings:
wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
@ -165,7 +165,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
m_sdbSizerStdButtonsOK->SetDefault();
m_OrientValue = 0;
m_orientValue = 0;
// Configure button logos
m_bpAdd->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
@ -198,7 +198,7 @@ DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES()
m_page = m_NoteBook->GetSelection();
m_NoteBook->SetSelection( 1 );
delete m_PreviewPane;
delete m_previewPane;
}
@ -245,13 +245,13 @@ void DIALOG_FOOTPRINT_PROPERTIES::ChangeFootprint( wxCommandEvent& )
void DIALOG_FOOTPRINT_PROPERTIES::FootprintOrientEvent( wxCommandEvent& )
{
if( m_Orient0->GetValue() )
m_OrientValue = 0.0;
m_orientValue = 0.0;
else if( m_Orient90->GetValue() )
m_OrientValue = 90.0;
m_orientValue = 90.0;
else if( m_Orient270->GetValue() )
m_OrientValue = 270.0;
m_orientValue = 270.0;
else if( m_Orient180->GetValue() )
m_OrientValue = 180.0;
m_orientValue = 180.0;
updateOrientationControl();
}
@ -312,15 +312,15 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
m_BoardSideCtrl->SetSelection( (m_footprint->GetLayer() == B_Cu) ? 1 : 0 );
m_OrientValue = m_footprint->GetOrientation() / 10.0;
m_orientValue = m_footprint->GetOrientation() / 10.0;
if( m_OrientValue == 0.0 )
if( m_orientValue == 0.0 )
m_Orient0->SetValue( true );
else if( m_OrientValue == 90.0 || m_OrientValue == -270.0 )
else if( m_orientValue == 90.0 || m_orientValue == -270.0 )
m_Orient90->SetValue( true );
else if( m_OrientValue == 270.0 || m_OrientValue == -90.0 )
else if( m_orientValue == 270.0 || m_orientValue == -90.0 )
m_Orient270->SetValue( true );
else if( m_OrientValue == 180.0 || m_OrientValue == -180.0 )
else if( m_orientValue == 180.0 || m_orientValue == -180.0 )
m_Orient180->SetValue( true );
else
m_OrientOther->SetValue( true );
@ -402,7 +402,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
}
select3DModel( 0 ); // will clamp idx within bounds
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
// Show the footprint's FPID.
m_tcLibraryID->SetValue( m_footprint->GetFPID().Format() );
@ -452,7 +452,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::select3DModel( int aModelIdx )
m_modelsGrid->SetGridCursor( aModelIdx, 0 );
}
m_PreviewPane->SetSelectedModel( aModelIdx );
m_previewPane->SetSelectedModel( aModelIdx );
m_inSelect = false;
}
@ -505,7 +505,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::On3DModelCellChanged( wxGridEvent& aEvent )
m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT( "1" ) );
}
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
@ -521,7 +521,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnRemove3DModel( wxCommandEvent& )
m_modelsGrid->DeleteRows( idx, 1 );
select3DModel( idx ); // will clamp idx within bounds
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
}
@ -589,7 +589,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DModel( wxCommandEvent& )
m_modelsGrid->SetCellValue( idx, 1, wxT( "1" ) );
select3DModel( idx );
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
@ -753,9 +753,9 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow()
// Now, set orientation. Must be done after other changes because rotation changes field
// positions on board (so that relative positions are held constant)
m_OrientValidator.TransferFromWindow();
m_orientValidator.TransferFromWindow();
double orient = m_OrientValue * 10;
double orient = m_orientValue * 10;
if( m_footprint->GetOrientation() != orient )
m_footprint->Rotate( m_footprint->GetPosition(), orient - m_footprint->GetOrientation() );
@ -852,7 +852,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnDeleteField( wxCommandEvent& )
void DIALOG_FOOTPRINT_PROPERTIES::Cfg3DPath( wxCommandEvent& )
{
if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
@ -967,5 +967,5 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnPageChange( wxNotebookEvent& aEvent )
void DIALOG_FOOTPRINT_PROPERTIES::updateOrientationControl()
{
KIUI::ValidatorTransferToWindowWithoutEvents( m_OrientValidator );
KIUI::ValidatorTransferToWindowWithoutEvents( m_orientValidator );
}

View File

@ -35,7 +35,7 @@
class PCB_EDIT_FRAME;
class PANEL_PREV_3D;
class PANEL_PREVIEW_3D_MODEL;
class DIALOG_FOOTPRINT_PROPERTIES: public DIALOG_FOOTPRINT_PROPERTIES_BASE
@ -93,6 +93,7 @@ private:
*/
void updateOrientationControl();
private:
PCB_EDIT_FRAME* m_frame;
FOOTPRINT* m_footprint;
@ -101,15 +102,15 @@ private:
FP_TEXT_GRID_TABLE* m_texts;
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
wxFloatingPointValidator<double> m_OrientValidator;
double m_OrientValue;
wxFloatingPointValidator<double> m_orientValidator;
double m_orientValue;
UNIT_BINDER m_netClearance;
UNIT_BINDER m_solderMask;
UNIT_BINDER m_solderPaste;
std::vector<FP_3DMODEL> m_shapes3D_list;
PANEL_PREV_3D* m_PreviewPane;
PANEL_PREVIEW_3D_MODEL* m_previewPane;
wxString m_delayedErrorMessage;
wxGrid* m_delayedFocusGrid;

View File

@ -40,7 +40,7 @@
#include <dialog_footprint_properties_fp_editor.h>
#include "filename_resolver.h"
#include <pgm_base.h>
#include "3d_cache/dialogs/panel_prev_3d.h"
#include "3d_cache/dialogs/panel_preview_3d_model.h"
#include "3d_cache/dialogs/3d_cache_dialogs.h"
#include <settings/settings_manager.h>
#include <tool/tool_manager.h>
@ -109,9 +109,9 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR( FO
aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
m_PreviewPane = new PANEL_PREV_3D( m_Panel3D, m_frame, m_footprint, &m_shapes3D_list );
m_previewPane = new PANEL_PREVIEW_3D_MODEL( m_Panel3D, m_frame, m_footprint, &m_shapes3D_list );
bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
bLowerSizer3D->Add( m_previewPane, 1, wxEXPAND, 5 );
m_FootprintNameCtrl->SetValidator( FOOTPRINT_NAME_VALIDATOR() );
@ -187,7 +187,7 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::~DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR()
m_page = m_NoteBook->GetSelection();
m_NoteBook->SetSelection( 1 );
delete m_PreviewPane;
delete m_previewPane;
}
@ -309,7 +309,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow()
}
select3DModel( 0 ); // will clamp idx within bounds
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ )
{
@ -357,7 +357,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::select3DModel( int aModelIdx )
m_modelsGrid->SetGridCursor( aModelIdx, 0 );
}
m_PreviewPane->SetSelectedModel( aModelIdx );
m_previewPane->SetSelectedModel( aModelIdx );
m_inSelect = false;
}
@ -411,7 +411,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::On3DModelCellChanged( wxGridEvent& a
m_shapes3D_list[ aEvent.GetRow() ].m_Show = ( showValue == wxT( "1" ) );
}
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
@ -428,7 +428,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnRemove3DModel( wxCommandEvent& )
m_modelsGrid->DeleteRows( idx );
select3DModel( idx ); // will clamp idx within bounds
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
}
@ -496,7 +496,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAdd3DModel( wxCommandEvent& )
m_modelsGrid->SetCellValue( idx, 1, wxT( "1" ) );
select3DModel( idx );
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}
@ -803,7 +803,7 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnDeleteField( wxCommandEvent& event
void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Cfg3DPath( wxCommandEvent& event )
{
if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
m_PreviewPane->UpdateDummyFootprint();
m_previewPane->UpdateDummyFootprint();
}

View File

@ -32,7 +32,7 @@
#include <dialog_footprint_properties_fp_editor_base.h>
class PANEL_PREV_3D;
class PANEL_PREVIEW_3D_MODEL;
class FOOTPRINT_EDIT_FRAME;
@ -68,19 +68,20 @@ private:
void adjustGridColumns( int aWidth );
private:
FOOTPRINT_EDIT_FRAME* m_frame;
FOOTPRINT* m_footprint;
static int m_page; // remember the last open page during session
FP_TEXT_GRID_TABLE* m_texts;
FP_TEXT_GRID_TABLE* m_texts;
UNIT_BINDER m_netClearance;
UNIT_BINDER m_solderMask;
UNIT_BINDER m_solderPaste;
std::vector<FP_3DMODEL> m_shapes3D_list;
PANEL_PREV_3D* m_PreviewPane;
PANEL_PREVIEW_3D_MODEL* m_previewPane;
wxControl* m_delayedFocusCtrl;
int m_delayedFocusPage;

View File

@ -906,7 +906,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
onBoardLoaded();
// Refresh the 3D view, if any
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
draw3DFrame->NewDisplay();

View File

@ -234,7 +234,7 @@ FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME()
if( m_toolManager )
m_toolManager->DeactivateTool();
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
draw3DFrame->Destroy();

View File

@ -96,15 +96,16 @@ bool PCB_BASE_FRAME::canCloseWindow( wxCloseEvent& aEvent )
}
EDA_3D_VIEWER* PCB_BASE_FRAME::Get3DViewerFrame()
EDA_3D_VIEWER_FRAME* PCB_BASE_FRAME::Get3DViewerFrame()
{
return dynamic_cast<EDA_3D_VIEWER*>( FindWindowByName( QUALIFIED_VIEWER3D_FRAMENAME( this ) ) );
wxWindow* frame = FindWindowByName( QUALIFIED_VIEWER3D_FRAMENAME( this ) );
return dynamic_cast<EDA_3D_VIEWER_FRAME*>( frame );
}
void PCB_BASE_FRAME::Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle )
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
{
@ -428,12 +429,12 @@ void PCB_BASE_FRAME::ShowChangedLanguage()
}
EDA_3D_VIEWER* PCB_BASE_FRAME::CreateAndShow3D_Frame()
EDA_3D_VIEWER_FRAME* PCB_BASE_FRAME::CreateAndShow3D_Frame()
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* draw3DFrame = Get3DViewerFrame();
if( !draw3DFrame )
draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
draw3DFrame = new EDA_3D_VIEWER_FRAME( &Kiway(), this, _( "3D Viewer" ) );
// Raising the window does not show the window on Windows if iconized. This should work
// on any platform.
@ -694,7 +695,7 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
RecreateToolbars();
// The 3D viewer isn't in the Kiway, so send its update manually
EDA_3D_VIEWER* viewer = Get3DViewerFrame();
EDA_3D_VIEWER_FRAME* viewer = Get3DViewerFrame();
if( viewer )
viewer->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );

View File

@ -39,7 +39,7 @@
#include <widgets/ui_common.h>
#include <base_units.h>
#include "../3d-viewer/3d_viewer/3d_viewer_settings.h"
#include "../3d-viewer/3d_viewer/eda_3d_viewer_settings.h"
///! Update the schema version whenever a migration is required

View File

@ -62,7 +62,7 @@ void PCB_VIEWER_TOOLS::Reset( RESET_REASON aReason )
int PCB_VIEWER_TOOLS::Show3DViewer( const TOOL_EVENT& aEvent )
{
EDA_3D_VIEWER* draw3DFrame = frame()->CreateAndShow3D_Frame();
EDA_3D_VIEWER_FRAME* draw3DFrame = frame()->CreateAndShow3D_Frame();
if( frame()->IsType( FRAME_FOOTPRINT_VIEWER )
|| frame()->IsType( FRAME_FOOTPRINT_VIEWER_MODAL )

View File

@ -32,7 +32,7 @@ add_executable( libeval_compiler_test
libeval_compiler_test.cpp
../qa_utils/mocks.cpp
../../common/base_units.cpp
../../3d-viewer/3d_viewer/3d_viewer_settings.cpp
../../3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp
)
include_directories( BEFORE ${INC_BEFORE} )