2007-05-06 16:03:28 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: 3d_frame.cpp
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#if !wxUSE_GLCANVAS
|
|
|
|
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "3d_viewer.h"
|
|
|
|
#include "trackball.h"
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
#include <wx/colordlg.h>
|
2009-11-02 22:24:55 +00:00
|
|
|
#include <wxstruct.h>
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
Info_3D_Visu g_Parm_3D_Visu;
|
2009-11-04 20:46:53 +00:00
|
|
|
double g_Draw3d_dx;
|
|
|
|
double g_Draw3d_dy;
|
|
|
|
double ZBottom;
|
|
|
|
double ZTop;
|
|
|
|
double DataScale3D; // 3D conversion units.
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
BEGIN_EVENT_TABLE( EDA_3D_FRAME, wxFrame )
|
|
|
|
EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
|
|
|
|
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
|
2011-08-03 15:09:39 +00:00
|
|
|
EDA_3D_FRAME::Process_Special_Functions )
|
|
|
|
EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame )
|
|
|
|
EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions )
|
|
|
|
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions )
|
|
|
|
EVT_CLOSE( EDA_3D_FRAME::OnCloseWindow )
|
2007-05-06 16:03:28 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
|
|
|
|
EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title, long style ) :
|
2011-03-01 19:26:17 +00:00
|
|
|
wxFrame( parent, DISPLAY3D_FRAME, title, wxPoint( -1, -1 ), wxSize( -1, -1 ), style )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
m_FrameName = wxT( "Frame3D" );
|
|
|
|
m_Canvas = NULL;
|
|
|
|
m_Parent = parent;
|
|
|
|
m_HToolBar = NULL;
|
|
|
|
m_VToolBar = NULL;
|
2009-11-04 20:46:53 +00:00
|
|
|
m_InternalUnits = 10000; // Internal units = 1/10000 inch
|
2010-05-01 12:46:33 +00:00
|
|
|
m_reloadRequest = false;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
// Give it an icon
|
2011-09-11 11:38:01 +00:00
|
|
|
wxIcon icon;
|
|
|
|
icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
|
|
|
|
SetIcon( icon );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
GetSettings();
|
|
|
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
|
|
|
|
|
|
|
// Create the status line
|
2009-08-07 04:44:42 +00:00
|
|
|
static const int dims[5] = { -1, 100, 100, 100, 140 };
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
CreateStatusBar( 5 );
|
|
|
|
SetStatusWidths( 5, dims );
|
2009-08-07 04:44:42 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
ReCreateMenuBar();
|
|
|
|
ReCreateHToolbar();
|
|
|
|
|
2009-08-04 18:21:32 +00:00
|
|
|
// ReCreateAuxiliaryToolbar();
|
2008-03-21 19:25:41 +00:00
|
|
|
ReCreateVToolbar();
|
|
|
|
|
2011-09-17 15:31:21 +00:00
|
|
|
// Make a EDA_3D_CANVAS
|
2011-08-03 15:09:39 +00:00
|
|
|
int attrs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 };
|
2011-09-17 15:31:21 +00:00
|
|
|
m_Canvas = new EDA_3D_CANVAS( this, attrs );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
|
|
|
m_auimgr.SetManagedWindow( this );
|
|
|
|
|
2011-09-15 18:25:44 +00:00
|
|
|
|
|
|
|
EDA_PANEINFO horiz;
|
|
|
|
horiz.HorizontalToolbarPane();
|
2009-11-04 20:46:53 +00:00
|
|
|
|
|
|
|
m_auimgr.AddPane( m_HToolBar,
|
|
|
|
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top() );
|
|
|
|
|
|
|
|
m_auimgr.AddPane( m_Canvas,
|
|
|
|
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
2009-11-02 22:24:55 +00:00
|
|
|
|
|
|
|
m_auimgr.Update();
|
2011-08-03 15:09:39 +00:00
|
|
|
|
|
|
|
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
|
|
|
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
|
|
|
// the canvas before it will respond to mouse wheel events.
|
|
|
|
m_Canvas->SetFocus();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Exit3DFrame( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-08-03 15:09:39 +00:00
|
|
|
Close( true );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
SaveSettings();
|
2011-08-03 15:09:39 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
if( m_Parent )
|
|
|
|
{
|
|
|
|
m_Parent->m_Draw3DFrame = NULL;
|
|
|
|
}
|
2011-08-03 15:09:39 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::GetSettings()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
wxString text;
|
2011-08-03 15:09:39 +00:00
|
|
|
wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
if( config )
|
2008-03-21 19:25:41 +00:00
|
|
|
{
|
|
|
|
text = m_FrameName + wxT( "Pos_x" );
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Read( text, &m_FramePos.x );
|
2008-03-21 19:25:41 +00:00
|
|
|
text = m_FrameName + wxT( "Pos_y" );
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Read( text, &m_FramePos.y );
|
2008-03-21 19:25:41 +00:00
|
|
|
text = m_FrameName + wxT( "Size_x" );
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Read( text, &m_FrameSize.x, 600 );
|
2008-03-21 19:25:41 +00:00
|
|
|
text = m_FrameName + wxT( "Size_y" );
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Read( text, &m_FrameSize.y, 400 );
|
2011-08-03 15:09:39 +00:00
|
|
|
config->Read( wxT( "BgColor_Red" ), &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
|
|
|
|
config->Read( wxT( "BgColor_Green" ), &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
|
|
|
|
config->Read( wxT( "BgColor_Blue" ), &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
|
2008-03-21 19:25:41 +00:00
|
|
|
}
|
2010-01-15 13:02:04 +00:00
|
|
|
#if defined( __WXMAC__ )
|
2008-03-21 19:25:41 +00:00
|
|
|
// for macOSX, the window must be below system (macOSX) toolbar
|
2010-01-15 13:02:04 +00:00
|
|
|
if( m_FramePos.y < 20 )
|
|
|
|
m_FramePos.y = 20;
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::SaveSettings()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
wxString text;
|
2011-08-03 15:09:39 +00:00
|
|
|
wxConfig* Config = wxGetApp().m_EDA_Config; // Current config used by application
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
if( !Config )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Config->Write( wxT( "BgColor_Red" ), g_Parm_3D_Visu.m_BgColor.m_Red );
|
|
|
|
Config->Write( wxT( "BgColor_Green" ), g_Parm_3D_Visu.m_BgColor.m_Green );
|
|
|
|
Config->Write( wxT( "BgColor_Blue" ), g_Parm_3D_Visu.m_BgColor.m_Blue );
|
|
|
|
|
|
|
|
if( IsIconized() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_FrameSize = GetSize();
|
|
|
|
m_FramePos = GetPosition();
|
|
|
|
|
|
|
|
text = m_FrameName + wxT( "Pos_x" );
|
|
|
|
Config->Write( text, (long) m_FramePos.x );
|
|
|
|
text = m_FrameName + wxT( "Pos_y" );
|
|
|
|
Config->Write( text, (long) m_FramePos.y );
|
|
|
|
text = m_FrameName + wxT( "Size_x" );
|
|
|
|
Config->Write( text, (long) m_FrameSize.x );
|
|
|
|
text = m_FrameName + wxT( "Size_y" );
|
|
|
|
Config->Write( text, (long) m_FrameSize.y );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Process_Zoom( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
int ii;
|
|
|
|
|
|
|
|
switch( event.GetId() )
|
|
|
|
{
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_PAGE:
|
2008-03-21 19:25:41 +00:00
|
|
|
for( ii = 0; ii < 4; ii++ )
|
|
|
|
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
|
|
|
|
|
|
|
|
g_Parm_3D_Visu.m_Zoom = 1.0;
|
|
|
|
g_Draw3d_dx = g_Draw3d_dy = 0;
|
|
|
|
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_IN:
|
2008-03-21 19:25:41 +00:00
|
|
|
g_Parm_3D_Visu.m_Zoom /= 1.2;
|
|
|
|
if( g_Parm_3D_Visu.m_Zoom <= 0.01 )
|
|
|
|
g_Parm_3D_Visu.m_Zoom = 0.01;
|
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_OUT:
|
2008-03-21 19:25:41 +00:00
|
|
|
g_Parm_3D_Visu.m_Zoom *= 1.2;
|
|
|
|
break;
|
|
|
|
|
2009-01-07 15:59:49 +00:00
|
|
|
case ID_ZOOM_REDRAW:
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
m_Canvas->Refresh( false );
|
2009-08-04 18:21:32 +00:00
|
|
|
m_Canvas->DisplayStatus();
|
2008-03-21 19:25:41 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
double EDA_3D_FRAME::BestZoom()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2011-07-05 12:46:14 +00:00
|
|
|
return 1.0;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
#define ROT_ANGLE 10.0
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
switch( event.GetId() )
|
|
|
|
{
|
|
|
|
case ID_RELOAD3D_BOARD:
|
|
|
|
NewDisplay();
|
2008-07-15 10:11:44 +00:00
|
|
|
return;
|
2008-03-21 19:25:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_X_POS:
|
|
|
|
g_Parm_3D_Visu.m_ROTX += ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_X_NEG:
|
|
|
|
g_Parm_3D_Visu.m_ROTX -= ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Y_POS:
|
|
|
|
g_Parm_3D_Visu.m_ROTY += ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Y_NEG:
|
|
|
|
g_Parm_3D_Visu.m_ROTY -= ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Z_POS:
|
|
|
|
g_Parm_3D_Visu.m_ROTZ += ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_ROTATE3D_Z_NEG:
|
|
|
|
g_Parm_3D_Visu.m_ROTZ -= ROT_ANGLE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MOVE3D_LEFT:
|
|
|
|
m_Canvas->SetView3D( WXK_LEFT );
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_RIGHT:
|
|
|
|
m_Canvas->SetView3D( WXK_RIGHT );
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_UP:
|
|
|
|
m_Canvas->SetView3D( WXK_UP );
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MOVE3D_DOWN:
|
|
|
|
m_Canvas->SetView3D( WXK_DOWN );
|
|
|
|
return;
|
2011-05-22 19:08:34 +00:00
|
|
|
|
2010-10-04 12:58:07 +00:00
|
|
|
case ID_ORTHO:
|
|
|
|
m_Canvas->ToggleOrtho();
|
|
|
|
return;
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
|
|
|
|
case ID_MENU_SCREENCOPY_PNG:
|
|
|
|
case ID_MENU_SCREENCOPY_JPEG:
|
|
|
|
m_Canvas->TakeScreenshot( event );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MENU3D_BGCOLOR_SELECTION:
|
|
|
|
Set3DBgColor();
|
|
|
|
return;
|
|
|
|
|
2008-08-16 17:42:40 +00:00
|
|
|
case ID_MENU3D_AXIS_ONOFF:
|
|
|
|
Set3DAxisOnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_MODULE_ONOFF:
|
|
|
|
Set3DModuleOnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_ZONE_ONOFF:
|
|
|
|
Set3DZoneOnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_COMMENTS_ONOFF:
|
|
|
|
Set3DCommentsOnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_DRAWINGS_ONOFF:
|
|
|
|
Set3DDrawingsOnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_ECO1_ONOFF:
|
|
|
|
Set3DEco1OnOff();
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ID_MENU3D_ECO2_ONOFF:
|
|
|
|
Set3DEco2OnOff();
|
|
|
|
return;
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
default:
|
2011-08-03 15:09:39 +00:00
|
|
|
wxMessageBox( wxT( "EDA_3D_FRAME::Process_Special_Functions() error: unknown command" ) );
|
2008-03-21 19:25:41 +00:00
|
|
|
return;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2008-03-21 19:25:41 +00:00
|
|
|
|
2008-07-15 10:11:44 +00:00
|
|
|
m_Canvas->Refresh( true );
|
2009-08-04 18:21:32 +00:00
|
|
|
m_Canvas->DisplayStatus();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::NewDisplay()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2010-05-01 12:46:33 +00:00
|
|
|
m_reloadRequest = false;
|
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
m_Canvas->ClearLists();
|
2008-07-21 13:44:01 +00:00
|
|
|
m_Canvas->CreateDrawGL_List();
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2009-08-04 18:21:32 +00:00
|
|
|
// m_Canvas->InitGL();
|
2008-07-15 10:11:44 +00:00
|
|
|
m_Canvas->Refresh( true );
|
2009-08-04 18:21:32 +00:00
|
|
|
m_Canvas->DisplayStatus();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
|
2010-04-29 09:06:01 +00:00
|
|
|
{
|
|
|
|
// Reload data if 3D frame shows a footprint,
|
|
|
|
// because it can be changed since last frame activation
|
2010-05-01 12:46:33 +00:00
|
|
|
if( m_reloadRequest )
|
|
|
|
NewDisplay();
|
|
|
|
|
2010-04-29 09:06:01 +00:00
|
|
|
event.Skip(); // required under wxMAC
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
/* called to set the background color of the 3D scene
|
2008-03-21 19:25:41 +00:00
|
|
|
*/
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DBgColor()
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-21 19:25:41 +00:00
|
|
|
S3D_Color color;
|
|
|
|
wxColour newcolor, oldcolor;
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
oldcolor.Set( wxRound( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
|
|
|
|
wxRound( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
|
|
|
|
wxRound( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
|
2008-03-21 19:25:41 +00:00
|
|
|
|
|
|
|
newcolor = wxGetColourFromUser( this, oldcolor );
|
2011-08-03 15:09:39 +00:00
|
|
|
|
2008-03-21 19:25:41 +00:00
|
|
|
if( newcolor != oldcolor )
|
|
|
|
{
|
|
|
|
g_Parm_3D_Visu.m_BgColor.m_Red = (double) newcolor.Red() / 255.0;
|
|
|
|
g_Parm_3D_Visu.m_BgColor.m_Green = (double) newcolor.Green() / 255.0;
|
|
|
|
g_Parm_3D_Visu.m_BgColor.m_Blue = (double) newcolor.Blue() / 255.0;
|
|
|
|
NewDisplay();
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
2008-08-16 17:42:40 +00:00
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DAxisOnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DAxis )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DAxis = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DAxis = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DModuleOnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DModule )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DModule = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DModule = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DZoneOnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DZone )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DZone = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DZone = true;
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DCommentsOnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DComments )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DComments = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DComments = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DDrawingsOnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DDrawings )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DDrawings = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DDrawings = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DEco1OnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DEco1 )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DEco1 = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DEco1 = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
|
2011-08-03 15:09:39 +00:00
|
|
|
void EDA_3D_FRAME::Set3DEco2OnOff()
|
2008-08-16 17:42:40 +00:00
|
|
|
{
|
2008-10-26 19:09:20 +00:00
|
|
|
if( g_Parm_3D_Visu.m_Draw3DEco2 )
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DEco2 = false;
|
2008-10-26 19:09:20 +00:00
|
|
|
else
|
2011-08-03 15:09:39 +00:00
|
|
|
g_Parm_3D_Visu.m_Draw3DEco2 = true;
|
|
|
|
|
2008-10-26 19:09:20 +00:00
|
|
|
NewDisplay();
|
2008-08-16 17:42:40 +00:00
|
|
|
}
|