3D-Viewer: Add new options: Anti-aliasing quality, "While moving"

Create new window options with tabs for 3D-Viewer. Remove
"showCopperThickness" option from menus and place it on OpenGL options.
This commit is contained in:
Mario Luzeiro 2020-04-17 22:33:23 +01:00
parent 656efc8d62
commit 00da17bc7d
21 changed files with 4390 additions and 2546 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -86,7 +86,7 @@ DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheMana
bSizer2->Add( m_FileTree, 1, wxEXPAND | wxALL, 5 );
bSizer1->Add( bSizer2, 3, wxEXPAND, 5 );
m_modelViewer = new C3D_MODEL_VIEWER( this, COGL_ATT_LIST::GetAttributesList( true ), m_cache );
m_modelViewer = new C3D_MODEL_VIEWER( this, COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ), m_cache );
m_modelViewer->SetMinSize( wxSize( 500, 400 ) );
bSizer1->Add( m_modelViewer, 5, wxEXPAND | wxALL | wxCENTER, 5 );

View File

@ -84,7 +84,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
m_dummyBoard->Add( m_dummyModule );
// Create the 3D canvas
m_previewPane = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( true ),
m_previewPane = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
m_dummyBoard, m_boardAdapter, m_currentCamera,
aFrame->Prj().Get3DCacheManager() );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -57,6 +57,7 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::BOARD_ADAPTER" ) );
m_3D_grid_type = GRID3D_TYPE::NONE;
m_antialiasing_mode = ANTIALIASING_MODE::AA_8X;
m_drawFlags.resize( FL_LAST, false );
if( PgmOrNull() )
@ -93,7 +94,6 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
SetFlag( FL_USE_REALISTIC_MODE, true );
SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, true );
SetFlag( FL_SHOW_BOARD_BODY, true );
SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, true );
SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, true );
SetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, true );
SetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL, true );
@ -102,6 +102,12 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
SetFlag( FL_SOLDERMASK, true );
SetFlag( FL_SUBTRACT_MASK_FROM_SILK, false );
SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, true );
SetFlag( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, false );
SetFlag( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, false );
SetFlag( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, false );
SetFlag( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, false );
m_BgColorBot = SFVEC3D( 0.4, 0.4, 0.5 );
m_BgColorTop = SFVEC3D( 0.8, 0.8, 0.9 );
m_BoardBodyColor = SFVEC3D( 0.4, 0.4, 0.5 );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -33,6 +33,7 @@
#include "../3d_rendering/ccamera.h"
#include "../3d_enums.h"
#include "../3d_cache/3d_cache.h"
#include "../common_ogl/cogl_att_list.h"
#include <layers_id_colors_and_visibility.h>
#include <class_pad.h>
@ -254,6 +255,18 @@ class BOARD_ADAPTER
m_3D_grid_type = aGridType;
}
/**
* @brief GridGet - get the current antialiasing mode value
* @return antialiasing mode value
*/
ANTIALIASING_MODE AntiAliasingGet() const { return m_antialiasing_mode; }
/**
* @brief AntiAliasingSet - set the current antialiasing mode value
* @param aAAmode = antialiasing mode value
*/
void AntiAliasingSet( ANTIALIASING_MODE aAAmode ) { m_antialiasing_mode = aAAmode; }
/**
* @brief RenderEngineSet
* @param aRenderEngine = the render engine mode selected
@ -629,6 +642,7 @@ private:
GRID3D_TYPE m_3D_grid_type;
RENDER_ENGINE m_render_engine;
MATERIAL_MODE m_material_mode;
ANTIALIASING_MODE m_antialiasing_mode;
// Pcb board position

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -53,6 +53,10 @@ enum DISPLAY3D_FLG {
// OpenGL options
FL_RENDER_OPENGL_SHOW_MODEL_BBOX,
FL_RENDER_OPENGL_COPPER_THICKNESS,
FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE,
FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE,
FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE,
FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE,
// Raytracing options
FL_RENDER_RAYTRACING_SHADOWS,

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -565,13 +565,16 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
if( aIsMoving == false )
if( m_boardAdapter.GetFlag( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE ) )
{
glEnable( GL_MULTISAMPLE );
}
else
{
glDisable( GL_MULTISAMPLE );
if( aIsMoving == false )
{
glEnable( GL_MULTISAMPLE );
}
else
{
glDisable( GL_MULTISAMPLE );
}
}
// clear color and depth buffers
@ -633,6 +636,11 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
glLightfv( GL_LIGHT0, GL_POSITION, headlight_pos );
}
bool drawMiddleSegments = !( (aIsMoving == true) &&
m_boardAdapter.GetFlag( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE ) );
const bool skipRenderHoles = (aIsMoving == true ) &&
m_boardAdapter.GetFlag( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE );
// Display board body
// /////////////////////////////////////////////////////////////////////////
@ -647,7 +655,7 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
m_ogl_disp_list_board->SetItIsTransparent( false );
if( m_ogl_disp_list_through_holes_outer_with_npth )
if( (m_ogl_disp_list_through_holes_outer_with_npth) && (!skipRenderHoles) )
{
m_ogl_disp_list_through_holes_outer_with_npth->ApplyScalePosition(
-m_boardAdapter.GetEpoxyThickness3DU() / 2.0f,
@ -675,14 +683,26 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
OGL_SetMaterial( m_materials.m_GrayMaterial );
}
if( m_ogl_disp_list_via )
if( ( (aIsMoving == true) &&
m_boardAdapter.GetFlag( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE ) ) ||
skipRenderHoles )
{
m_ogl_disp_list_via->DrawAll();
// Do not render vias while moving or if skipRenderHoles
}
else
{
if( m_ogl_disp_list_via )
{
m_ogl_disp_list_via->DrawAll();
}
}
if( m_ogl_disp_list_pads_holes )
if( !skipRenderHoles )
{
m_ogl_disp_list_pads_holes->DrawAll();
if( m_ogl_disp_list_pads_holes )
{
m_ogl_disp_list_pads_holes->DrawAll();
}
}
@ -722,33 +742,41 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
if( (layer_id >= F_Cu) && (layer_id <= B_Cu) )
{
if( m_ogl_disp_lists_layers_holes_outer.find( layer_id ) !=
m_ogl_disp_lists_layers_holes_outer.end() )
if( skipRenderHoles )
{
const CLAYERS_OGL_DISP_LISTS* viasHolesLayer =
m_ogl_disp_lists_layers_holes_outer.at( layer_id );
wxASSERT( viasHolesLayer != NULL );
if( viasHolesLayer != NULL )
{
pLayerDispList->DrawAllCameraCulledSubtractLayer(
m_ogl_disp_list_through_holes_outer,
viasHolesLayer,
(aIsMoving == false) );
}
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, drawMiddleSegments );
}
else
{
pLayerDispList->DrawAllCameraCulledSubtractLayer(
m_ogl_disp_list_through_holes_outer,
NULL,
(aIsMoving == false) );
if( m_ogl_disp_lists_layers_holes_outer.find( layer_id ) !=
m_ogl_disp_lists_layers_holes_outer.end() )
{
const CLAYERS_OGL_DISP_LISTS* viasHolesLayer =
m_ogl_disp_lists_layers_holes_outer.at( layer_id );
wxASSERT( viasHolesLayer != NULL );
if( viasHolesLayer != NULL )
{
pLayerDispList->DrawAllCameraCulledSubtractLayer(
m_ogl_disp_list_through_holes_outer,
viasHolesLayer,
drawMiddleSegments );
}
}
else
{
pLayerDispList->DrawAllCameraCulledSubtractLayer(
m_ogl_disp_list_through_holes_outer,
NULL,
drawMiddleSegments );
}
}
}
else
{
if( m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) &&
if( (!skipRenderHoles) &&
m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) &&
( ( ( layer_id == B_SilkS ) &&
( m_ogl_disp_lists_layers.find( B_Mask ) != m_ogl_disp_lists_layers.end() ) ) ||
( ( layer_id == F_SilkS ) &&
@ -761,11 +789,12 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
pLayerDispList->DrawAllCameraCulledSubtractLayer(
pLayerDispListMask,
m_ogl_disp_list_through_holes_vias_outer,
(aIsMoving == false) );
drawMiddleSegments );
}
else
{
if( m_ogl_disp_list_through_holes_vias_outer &&
if( (!skipRenderHoles) &&
m_ogl_disp_list_through_holes_vias_outer &&
( ( layer_id == B_SilkS ) || ( layer_id == F_SilkS )
// Remove vias on SolderPaste can be added as an option in future
// ( layer_id == B_Paste ) || ( layer_id == F_Paste ) )
@ -774,11 +803,17 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
pLayerDispList->DrawAllCameraCulledSubtractLayer(
NULL,
m_ogl_disp_list_through_holes_vias_outer,
(aIsMoving == false) );
drawMiddleSegments );
}
else
{
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, aIsMoving == false );
// Do not render Paste layers when skipRenderHoles is enabled
// otherwise it will cause z-fight issues
if( !( skipRenderHoles &&
( ( layer_id == B_Paste ) || ( layer_id == F_Paste ) ) ) )
{
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, drawMiddleSegments );
}
}
}
}
@ -790,12 +825,7 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
// Render 3D Models (Non-transparent)
// /////////////////////////////////////////////////////////////////////////
//setLight_Top( false );
//setLight_Bottom( true );
render_3D_models( false, false );
//setLight_Top( true );
//setLight_Bottom( false );
render_3D_models( true, false );
@ -814,18 +844,18 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
if( m_camera.GetPos().z > 0 )
{
render_solder_mask_layer( B_Mask, m_boardAdapter.GetLayerTopZpos3DU( B_Mask ),
aIsMoving );
drawMiddleSegments, skipRenderHoles );
render_solder_mask_layer( F_Mask, m_boardAdapter.GetLayerBottomZpos3DU( F_Mask ),
aIsMoving );
drawMiddleSegments, skipRenderHoles );
}
else
{
render_solder_mask_layer( F_Mask, m_boardAdapter.GetLayerBottomZpos3DU( F_Mask ),
aIsMoving );
drawMiddleSegments, skipRenderHoles );
render_solder_mask_layer( B_Mask, m_boardAdapter.GetLayerTopZpos3DU( B_Mask ),
aIsMoving );
drawMiddleSegments, skipRenderHoles );
}
glDisable( GL_POLYGON_OFFSET_FILL );
@ -835,13 +865,7 @@ bool C3D_RENDER_OGL_LEGACY::Redraw(
// Render 3D Models (Transparent)
// /////////////////////////////////////////////////////////////////////////
//setLight_Top( false );
//setLight_Bottom( true );
render_3D_models( false, true );
//setLight_Top( true );
//setLight_Bottom( false );
render_3D_models( true, true );
@ -1027,9 +1051,10 @@ void C3D_RENDER_OGL_LEGACY::ogl_free_all_display_lists()
}
void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer( PCB_LAYER_ID aLayerID,
float aZPosition,
bool aIsRenderingOnPreviewMode )
void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer(PCB_LAYER_ID aLayerID,
float aZPosition,
bool aDrawMiddleSegments,
bool aSkipRenderHoles )
{
wxASSERT( (aLayerID == B_Mask) || (aLayerID == F_Mask) );
@ -1053,10 +1078,18 @@ void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer( PCB_LAYER_ID aLayerID,
m_ogl_disp_list_board->SetItIsTransparent( true );
m_ogl_disp_list_board->DrawAllCameraCulledSubtractLayer(
pLayerDispListMask,
m_ogl_disp_list_through_holes_vias_outer,
!aIsRenderingOnPreviewMode );
if( aSkipRenderHoles )
{
m_ogl_disp_list_board->DrawAllCameraCulled( m_camera.GetPos().z,
aDrawMiddleSegments );
}
else
{
m_ogl_disp_list_board->DrawAllCameraCulledSubtractLayer(
pLayerDispListMask,
m_ogl_disp_list_through_holes_vias_outer,
aDrawMiddleSegments );
}
}
else
{
@ -1075,10 +1108,18 @@ void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer( PCB_LAYER_ID aLayerID,
m_ogl_disp_list_board->SetItIsTransparent( true );
m_ogl_disp_list_board->DrawAllCameraCulledSubtractLayer(
NULL,
m_ogl_disp_list_through_holes_vias_outer,
!aIsRenderingOnPreviewMode );
if( aSkipRenderHoles )
{
m_ogl_disp_list_board->DrawAllCameraCulled( m_camera.GetPos().z,
aDrawMiddleSegments );
}
else
{
m_ogl_disp_list_board->DrawAllCameraCulledSubtractLayer(
NULL,
m_ogl_disp_list_through_holes_vias_outer,
aDrawMiddleSegments );
}
}
}
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -148,7 +148,8 @@ private:
void render_solder_mask_layer( PCB_LAYER_ID aLayerID,
float aZPosition,
bool aIsRenderingOnPreviewMode );
bool aDrawMiddleSegments,
bool aSkipRenderHoles );
void get_layer_z_pos( PCB_LAYER_ID aLayerID,
float &aOutZtop,

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2020 Oleg Endo <olegendo@gcc.gnu.org>
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -205,7 +205,6 @@ void EDA_3D_VIEWER::CreateMenuBar()
optsSubmenu->AddMenu( propsSubmenu, SELECTION_CONDITIONS::ShowAlways );
optsSubmenu->AddCheckItem( EDA_3D_ACTIONS::showCopperThickness, copperThicknessCondition );
optsSubmenu->AddCheckItem( EDA_3D_ACTIONS::showBoundingBoxes, boundingBoxesCondition );
// Raytracing submenu

View File

@ -19,6 +19,7 @@
*/
#include <3d_enums.h>
#include <common_ogl/cogl_att_list.h>
#include <settings/parameters.h>
#include <wx/config.h>
@ -48,10 +49,28 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
static_cast<int>( MATERIAL_MODE::NORMAL ),
static_cast<int>( MATERIAL_MODE::CAD_MODE ) ) );
m_params.emplace_back( new PARAM<int>( "render.opengl_AA_mode", &m_Render.opengl_AA_mode,
static_cast<int>( ANTIALIASING_MODE::AA_8X ),
static_cast<int>( ANTIALIASING_MODE::AA_NONE ),
static_cast<int>( ANTIALIASING_MODE::AA_8X ) ) );
// OpenGL options
m_params.emplace_back( new PARAM<bool>(
"render.opengl_copper_thickness", &m_Render.opengl_copper_thickness, true ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_show_model_bbox", &m_Render.opengl_show_model_bbox, false ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_AA_disableOnMove", &m_Render.opengl_AA_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_thickness_disableOnMove", &m_Render.opengl_thickness_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_vias_disableOnMove", &m_Render.opengl_vias_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_holes_disableOnMove", &m_Render.opengl_holes_disableOnMove, false ) );
m_params.emplace_back( new PARAM<bool>(
"render.opengl_render_bbox_only_OnMove", &m_Render.opengl_render_bbox_only_OnMove, false ) );
// Raytracing options
m_params.emplace_back( new PARAM<bool>( "render.raytrace_anti_aliasing",
&m_Render.raytrace_anti_aliasing, true ) );
m_params.emplace_back( new PARAM<bool>( "render.raytrace_backfloor",
@ -66,6 +85,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
&m_Render.raytrace_refractions, true ) );
m_params.emplace_back( new PARAM<bool>( "render.raytrace_shadows",
&m_Render.raytrace_shadows, true ) );
m_params.emplace_back( new PARAM<bool>( "render.realistic", &m_Render.realistic, true ) );
m_params.emplace_back(
new PARAM<bool>( "render.show_adhesive", &m_Render.show_adhesive, true ) );

View File

@ -32,7 +32,13 @@ public:
{
int engine;
int grid_type;
int opengl_AA_mode;
int material_mode;
bool opengl_AA_disableOnMove;
bool opengl_thickness_disableOnMove;
bool opengl_vias_disableOnMove;
bool opengl_holes_disableOnMove;
bool opengl_render_bbox_only_OnMove;
bool opengl_copper_thickness;
bool opengl_show_model_bbox;
bool raytrace_anti_aliasing;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2014-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2014-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -94,9 +94,7 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow()
// Check/uncheck checkboxes
m_checkBoxRealisticMode->SetValue( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) );
m_checkBoxBoardBody->SetValue( m_settings.GetFlag( FL_SHOW_BOARD_BODY ) );
m_checkBoxCuThickness->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) );
m_checkBoxAreas->SetValue( m_settings.GetFlag( FL_ZONE ) );
m_checkBoxBoundingBoxes->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX ) );
m_checkBox3DshapesTH->SetValue( m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL ) );
m_checkBox3DshapesSMD->SetValue( m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT ) );
@ -110,6 +108,24 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow()
m_checkBoxECO->SetValue( m_settings.GetFlag( FL_ECO ) );
m_checkBoxSubtractMaskFromSilk->SetValue( m_settings.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) );
// OpenGL options
m_checkBoxCuThickness->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) );
m_checkBoxBoundingBoxes->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX ) );
m_checkBoxDisableAAMove->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE ) );
m_checkBoxDisableMoveThickness->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE ) );
m_checkBoxDisableMoveVias->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE ) );
m_checkBoxDisableMoveHoles->SetValue( m_settings.GetFlag( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE ) );
m_choiceAntiAliasing->SetSelection( static_cast<int>( m_settings.AntiAliasingGet() ) );
// Raytracing options
m_checkBoxRaytracing_renderShadows->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_SHADOWS ) );
m_checkBoxRaytracing_addFloor->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_BACKFLOOR ) );
m_checkBoxRaytracing_showRefractions->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_REFRACTIONS ) );
m_checkBoxRaytracing_showReflections->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_REFLECTIONS ) );
m_checkBoxRaytracing_postProcessing->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) );
m_checkBoxRaytracing_antiAliasing->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING ) );
m_checkBoxRaytracing_proceduralTextures->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES ) );
return true;
}
@ -121,9 +137,7 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow()
// Set visibility of items
m_settings.SetFlag( FL_SHOW_BOARD_BODY, m_checkBoxBoardBody->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, m_checkBoxCuThickness->GetValue() );
m_settings.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, m_checkBoxBoundingBoxes->GetValue() );
m_settings.SetFlag( FL_SUBTRACT_MASK_FROM_SILK, m_checkBoxSubtractMaskFromSilk->GetValue() );
// Set 3D shapes visibility
@ -139,5 +153,23 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow()
m_settings.SetFlag( FL_COMMENTS, m_checkBoxComments->GetValue() );
m_settings.SetFlag( FL_ECO, m_checkBoxECO->GetValue( ) );
// OpenGL options
m_settings.SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, m_checkBoxCuThickness->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, m_checkBoxBoundingBoxes->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, m_checkBoxDisableAAMove->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, m_checkBoxDisableMoveThickness->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, m_checkBoxDisableMoveVias->GetValue() );
m_settings.SetFlag( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, m_checkBoxDisableMoveHoles->GetValue() );
m_settings.AntiAliasingSet( static_cast<ANTIALIASING_MODE>( m_choiceAntiAliasing->GetSelection() ) );
// Raytracing options
m_settings.SetFlag( FL_RENDER_RAYTRACING_SHADOWS, m_checkBoxRaytracing_renderShadows->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_BACKFLOOR, m_checkBoxRaytracing_addFloor->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_REFRACTIONS, m_checkBoxRaytracing_showRefractions->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_REFLECTIONS, m_checkBoxRaytracing_showReflections->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING, m_checkBoxRaytracing_postProcessing->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING, m_checkBoxRaytracing_antiAliasing->GetValue() );
m_settings.SetFlag( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, m_checkBoxRaytracing_proceduralTextures->GetValue() );
return true;
}

View File

@ -16,13 +16,15 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelDspOpt = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizeLeft;
bSizeLeft = new wxBoxSizer( wxVERTICAL );
m_staticText3DRenderOpts = new wxStaticText( this, wxID_ANY, _("Render options:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3DRenderOpts = new wxStaticText( m_panelDspOpt, wxID_ANY, _("Render options:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3DRenderOpts->Wrap( -1 );
m_staticText3DRenderOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
@ -36,55 +38,37 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
fgSizerRenderOptions->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
m_bitmapRealisticMode = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapRealisticMode = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxRealisticMode = new wxCheckBox( this, wxID_ANY, _("Realistic mode"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRealisticMode = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Realistic mode"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxRealisticMode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapBoardBody = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapBoardBody = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapBoardBody, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxBoardBody = new wxCheckBox( this, wxID_ANY, _("Show board body"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxBoardBody = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show board body"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxBoardBody, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerRenderOptions->Add( 0, 0, 1, wxEXPAND, 5 );
m_bitmapCuThickness = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxCuThickness, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapBoundingBoxes = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapBoundingBoxes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxBoundingBoxes = new wxCheckBox( this, wxID_ANY, _("Show model bounding boxes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxBoundingBoxes, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerRenderOptions->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapAreas = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapAreas = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxAreas = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxAreas, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerRenderOptions->Add( 0, 0, 0, wxALIGN_LEFT|wxALIGN_RIGHT, 10 );
m_bitmapSubtractMaskFromSilk = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapSubtractMaskFromSilk = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_bitmapSubtractMaskFromSilk, 0, wxALL, 5 );
m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSubtractMaskFromSilk = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerRenderOptions->Add( m_checkBoxSubtractMaskFromSilk, 0, wxALL, 5 );
wxFlexGridSizer* fgSizer3;
@ -101,7 +85,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizeLeft->Add( 0, 10, 0, 0, 5 );
m_staticText3DmodelVisibility = new wxStaticText( this, wxID_ANY, _("3D model visibility:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3DmodelVisibility = new wxStaticText( m_panelDspOpt, wxID_ANY, _("3D model visibility:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3DmodelVisibility->Wrap( -1 );
m_staticText3DmodelVisibility->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
@ -115,28 +99,28 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
fgSizer3DVisibility->Add( 0, 0, 1, wxRIGHT|wxLEFT, 10 );
m_bitmap3DshapesTH = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap3DshapesTH = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_bitmap3DshapesTH, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBox3DshapesTH = new wxCheckBox( this, wxID_ANY, _("Show 3D through hole models"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBox3DshapesTH = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show 3D through hole models"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_checkBox3DshapesTH, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizer3DVisibility->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmap3DshapesSMD = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap3DshapesSMD = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_bitmap3DshapesSMD, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBox3DshapesSMD = new wxCheckBox( this, wxID_ANY, _("Show 3D SMD models"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBox3DshapesSMD = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show 3D SMD models"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_checkBox3DshapesSMD, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizer3DVisibility->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmap3DshapesVirtual = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap3DshapesVirtual = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_bitmap3DshapesVirtual, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBox3DshapesVirtual = new wxCheckBox( this, wxID_ANY, _("Show 3D virtual models"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBox3DshapesVirtual = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show 3D virtual models"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3DVisibility->Add( m_checkBox3DshapesVirtual, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
@ -145,7 +129,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizerUpper->Add( bSizeLeft, 1, wxEXPAND, 5 );
m_staticlineVertical = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
m_staticlineVertical = new wxStaticLine( m_panelDspOpt, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bSizerUpper->Add( m_staticlineVertical, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizerRight;
@ -154,7 +138,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
wxBoxSizer* bSizeLayer;
bSizeLayer = new wxBoxSizer( wxVERTICAL );
m_staticTextBoardLayers = new wxStaticText( this, wxID_ANY, _("Board layers:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBoardLayers = new wxStaticText( m_panelDspOpt, wxID_ANY, _("Board layers:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBoardLayers->Wrap( -1 );
m_staticTextBoardLayers->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
@ -168,37 +152,37 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapSilkscreen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapSilkscreen = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_bitmapSilkscreen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSilkscreen = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_checkBoxSilkscreen, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapSolderMask = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapSolderMask = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_bitmapSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSolderMask = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_checkBoxSolderMask, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapSolderPaste = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapSolderPaste = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_bitmapSolderPaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSolderpaste = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_checkBoxSolderpaste, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerShowBrdLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapAdhesive = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapAdhesive = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_bitmapAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxAdhesive = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowBrdLayersOpts->Add( m_checkBoxAdhesive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
@ -207,7 +191,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizeLayer->Add( 0, 10, 0, 0, 5 );
m_staticTextUserLayers = new wxStaticText( this, wxID_ANY, _("User layers (not shown in realistic mode):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUserLayers = new wxStaticText( m_panelDspOpt, wxID_ANY, _("User layers (not shown in realistic mode):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUserLayers->Wrap( -1 );
m_staticTextUserLayers->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
@ -221,19 +205,19 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
fgSizerShowUserLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapComments = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapComments = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowUserLayersOpts->Add( m_bitmapComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxComments = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show comments and drawings layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowUserLayersOpts->Add( m_checkBoxComments, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerShowUserLayersOpts->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
m_bitmapECO = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_bitmapECO = new wxStaticBitmap( m_panelDspOpt, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowUserLayersOpts->Add( m_bitmapECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECO layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxECO = new wxCheckBox( m_panelDspOpt, wxID_ANY, _("Show ECO layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShowUserLayersOpts->Add( m_checkBoxECO, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
@ -246,7 +230,193 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
bSizerUpper->Add( bSizerRight, 1, wxEXPAND, 5 );
bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 );
m_panelDspOpt->SetSizer( bSizerUpper );
m_panelDspOpt->Layout();
bSizerUpper->Fit( m_panelDspOpt );
m_notebook->AddPage( m_panelDspOpt, _("Display Options"), true );
m_panelOpenGL = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerOpenGL;
bSizerOpenGL = new wxBoxSizer( wxVERTICAL );
m_staticTextOpenGLRenderOpts = new wxStaticText( m_panelOpenGL, wxID_ANY, _("OpenGL Render options:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOpenGLRenderOpts->Wrap( -1 );
m_staticTextOpenGLRenderOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerOpenGL->Add( m_staticTextOpenGLRenderOpts, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* fgSizer6;
fgSizer6 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer6->SetFlexibleDirection( wxBOTH );
fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer6->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_bitmapBoundingBoxes = new wxStaticBitmap( m_panelOpenGL, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer6->Add( m_bitmapBoundingBoxes, 0, wxALL, 5 );
m_checkBoxBoundingBoxes = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Show model bounding boxes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer6->Add( m_checkBoxBoundingBoxes, 0, wxALL, 5 );
fgSizer6->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_bitmapCuThickness = new wxStaticBitmap( m_panelOpenGL, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer6->Add( m_bitmapCuThickness, 0, wxALL, 5 );
m_checkBoxCuThickness = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer6->Add( m_checkBoxCuThickness, 0, wxALL, 5 );
bSizerOpenGL->Add( fgSizer6, 1, wxEXPAND, 5 );
m_staticTextOpenGLRenderOptsAA = new wxStaticText( m_panelOpenGL, wxID_ANY, _("Anti-aliasing"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOpenGLRenderOptsAA->Wrap( -1 );
m_staticTextOpenGLRenderOptsAA->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerOpenGL->Add( m_staticTextOpenGLRenderOptsAA, 0, wxALL, 5 );
wxFlexGridSizer* fgSizer7;
fgSizer7 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer7->SetFlexibleDirection( wxBOTH );
fgSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer7->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
wxString m_choiceAntiAliasingChoices[] = { _("Disabled"), _("2x"), _("4x"), _("8x"), wxEmptyString };
int m_choiceAntiAliasingNChoices = sizeof( m_choiceAntiAliasingChoices ) / sizeof( wxString );
m_choiceAntiAliasing = new wxChoice( m_panelOpenGL, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceAntiAliasingNChoices, m_choiceAntiAliasingChoices, 0 );
m_choiceAntiAliasing->SetSelection( 0 );
fgSizer7->Add( m_choiceAntiAliasing, 0, 0, 5 );
fgSizer7->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_staticText14 = new wxStaticText( m_panelOpenGL, wxID_ANY, _("(3D-Viewer must be closed and re-opened to apply this setting)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
fgSizer7->Add( m_staticText14, 0, wxLEFT, 5 );
bSizerOpenGL->Add( fgSizer7, 1, wxEXPAND, 5 );
m_staticTextOpenGLWhileMoving = new wxStaticText( m_panelOpenGL, wxID_ANY, _("While Moving"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOpenGLWhileMoving->Wrap( -1 );
m_staticTextOpenGLWhileMoving->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerOpenGL->Add( m_staticTextOpenGLWhileMoving, 0, wxALL, 5 );
wxFlexGridSizer* fgSizer8;
fgSizer8 = new wxFlexGridSizer( 0, 4, 0, 0 );
fgSizer8->SetFlexibleDirection( wxBOTH );
fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer8->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxDisableAAMove = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Disable anti-aliasing"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( m_checkBoxDisableAAMove, 0, wxALL, 5 );
fgSizer8->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxDisableMoveThickness = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Disable thickness"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( m_checkBoxDisableMoveThickness, 0, wxALL, 5 );
fgSizer8->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxDisableMoveVias = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Disable vias"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( m_checkBoxDisableMoveVias, 0, wxALL, 5 );
fgSizer8->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxDisableMoveHoles = new wxCheckBox( m_panelOpenGL, wxID_ANY, _("Disable holes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer8->Add( m_checkBoxDisableMoveHoles, 0, wxALL, 5 );
bSizerOpenGL->Add( fgSizer8, 1, wxEXPAND, 5 );
m_panelOpenGL->SetSizer( bSizerOpenGL );
m_panelOpenGL->Layout();
bSizerOpenGL->Fit( m_panelOpenGL );
m_notebook->AddPage( m_panelOpenGL, _("OpenGL"), false );
m_panelRaytracing = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer14;
bSizer14 = new wxBoxSizer( wxVERTICAL );
m_staticTextRaytracingRenderOpts = new wxStaticText( m_panelRaytracing, wxID_ANY, _("Raytracing Render options:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRaytracingRenderOpts->Wrap( -1 );
m_staticTextRaytracingRenderOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizer14->Add( m_staticTextRaytracingRenderOpts, 0, wxALL, 5 );
wxFlexGridSizer* fgSizer9;
fgSizer9 = new wxFlexGridSizer( 0, 4, 0, 0 );
fgSizer9->SetFlexibleDirection( wxBOTH );
fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_renderShadows = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Render Shadows"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_renderShadows->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_renderShadows, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_proceduralTextures = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Procedural Textures"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_proceduralTextures->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_proceduralTextures, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_addFloor = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Add Floor"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_addFloor->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_addFloor, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_showRefractions = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Refractions"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_showRefractions->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_showRefractions, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_showReflections = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Reflections"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_showReflections->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_showReflections, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_antiAliasing = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Anti-aliasing"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_antiAliasing->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_antiAliasing, 0, wxALL, 5 );
fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 );
m_checkBoxRaytracing_postProcessing = new wxCheckBox( m_panelRaytracing, wxID_ANY, _("Post-processing"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxRaytracing_postProcessing->SetValue(true);
fgSizer9->Add( m_checkBoxRaytracing_postProcessing, 0, wxALL, 5 );
bSizer14->Add( fgSizer9, 1, wxEXPAND, 5 );
m_panelRaytracing->SetSizer( bSizer14 );
m_panelRaytracing->Layout();
bSizer14->Fit( m_panelRaytracing );
m_notebook->AddPage( m_panelRaytracing, _("Raytracing"), false );
bSizerMain->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );
m_staticlineH = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticlineH, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
@ -263,6 +433,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,9 @@
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/panel.h>
#include <wx/choice.h>
#include <wx/notebook.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -38,15 +41,13 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
private:
protected:
wxNotebook* m_notebook;
wxPanel* m_panelDspOpt;
wxStaticText* m_staticText3DRenderOpts;
wxStaticBitmap* m_bitmapRealisticMode;
wxCheckBox* m_checkBoxRealisticMode;
wxStaticBitmap* m_bitmapBoardBody;
wxCheckBox* m_checkBoxBoardBody;
wxStaticBitmap* m_bitmapCuThickness;
wxCheckBox* m_checkBoxCuThickness;
wxStaticBitmap* m_bitmapBoundingBoxes;
wxCheckBox* m_checkBoxBoundingBoxes;
wxStaticBitmap* m_bitmapAreas;
wxCheckBox* m_checkBoxAreas;
wxStaticBitmap* m_bitmapSubtractMaskFromSilk;
@ -73,6 +74,29 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
wxCheckBox* m_checkBoxComments;
wxStaticBitmap* m_bitmapECO;
wxCheckBox* m_checkBoxECO;
wxPanel* m_panelOpenGL;
wxStaticText* m_staticTextOpenGLRenderOpts;
wxStaticBitmap* m_bitmapBoundingBoxes;
wxCheckBox* m_checkBoxBoundingBoxes;
wxStaticBitmap* m_bitmapCuThickness;
wxCheckBox* m_checkBoxCuThickness;
wxStaticText* m_staticTextOpenGLRenderOptsAA;
wxChoice* m_choiceAntiAliasing;
wxStaticText* m_staticText14;
wxStaticText* m_staticTextOpenGLWhileMoving;
wxCheckBox* m_checkBoxDisableAAMove;
wxCheckBox* m_checkBoxDisableMoveThickness;
wxCheckBox* m_checkBoxDisableMoveVias;
wxCheckBox* m_checkBoxDisableMoveHoles;
wxPanel* m_panelRaytracing;
wxStaticText* m_staticTextRaytracingRenderOpts;
wxCheckBox* m_checkBoxRaytracing_renderShadows;
wxCheckBox* m_checkBoxRaytracing_proceduralTextures;
wxCheckBox* m_checkBoxRaytracing_addFloor;
wxCheckBox* m_checkBoxRaytracing_showRefractions;
wxCheckBox* m_checkBoxRaytracing_showReflections;
wxCheckBox* m_checkBoxRaytracing_antiAliasing;
wxCheckBox* m_checkBoxRaytracing_postProcessing;
wxStaticLine* m_staticlineH;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
@ -84,7 +108,7 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
public:
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,372 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_3D_VIEW_OPTIONS_BASE();
};

View File

@ -112,7 +112,7 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt
wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
SetStatusWidths( arrayDim( status_dims ), status_dims );
m_canvas = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( true ),
m_canvas = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( m_boardAdapter.AntiAliasingGet() ),
aParent->GetBoard(), m_boardAdapter, m_currentCamera,
Prj().Get3DCacheManager() );
@ -404,38 +404,43 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg )
if( cfg )
{
#define TRANSER_SETTING( flag, field ) m_boardAdapter.SetFlag( flag, cfg->m_Render.field )
#define TRANSFER_SETTING( flag, field ) m_boardAdapter.SetFlag( flag, cfg->m_Render.field )
TRANSER_SETTING( FL_USE_REALISTIC_MODE, realistic );
TRANSER_SETTING( FL_SUBTRACT_MASK_FROM_SILK, subtract_mask_from_silk );
TRANSFER_SETTING( FL_USE_REALISTIC_MODE, realistic );
TRANSFER_SETTING( FL_SUBTRACT_MASK_FROM_SILK, subtract_mask_from_silk );
// OpenGL options
TRANSER_SETTING( FL_RENDER_OPENGL_COPPER_THICKNESS, opengl_copper_thickness );
TRANSER_SETTING( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, opengl_show_model_bbox );
TRANSFER_SETTING( FL_RENDER_OPENGL_COPPER_THICKNESS, opengl_copper_thickness );
TRANSFER_SETTING( FL_RENDER_OPENGL_SHOW_MODEL_BBOX, opengl_show_model_bbox );
TRANSFER_SETTING( FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE, opengl_AA_disableOnMove );
TRANSFER_SETTING( FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE, opengl_thickness_disableOnMove );
TRANSFER_SETTING( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, opengl_vias_disableOnMove );
TRANSFER_SETTING( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, opengl_holes_disableOnMove );
// Raytracing options
TRANSER_SETTING( FL_RENDER_RAYTRACING_SHADOWS, raytrace_shadows );
TRANSER_SETTING( FL_RENDER_RAYTRACING_BACKFLOOR, raytrace_backfloor );
TRANSER_SETTING( FL_RENDER_RAYTRACING_REFRACTIONS, raytrace_refractions );
TRANSER_SETTING( FL_RENDER_RAYTRACING_REFLECTIONS, raytrace_reflections );
TRANSER_SETTING( FL_RENDER_RAYTRACING_POST_PROCESSING, raytrace_post_processing );
TRANSER_SETTING( FL_RENDER_RAYTRACING_ANTI_ALIASING, raytrace_anti_aliasing );
TRANSER_SETTING( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, raytrace_procedural_textures );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_SHADOWS, raytrace_shadows );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_BACKFLOOR, raytrace_backfloor );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_REFRACTIONS, raytrace_refractions );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_REFLECTIONS, raytrace_reflections );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_POST_PROCESSING, raytrace_post_processing );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_ANTI_ALIASING, raytrace_anti_aliasing );
TRANSFER_SETTING( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, raytrace_procedural_textures );
TRANSER_SETTING( FL_AXIS, show_axis );
TRANSER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL, show_footprints_normal );
TRANSER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, show_footprints_insert );
TRANSER_SETTING( FL_MODULE_ATTRIBUTES_VIRTUAL, show_footprints_virtual );
TRANSER_SETTING( FL_ZONE, show_zones );
TRANSER_SETTING( FL_ADHESIVE, show_adhesive );
TRANSER_SETTING( FL_SILKSCREEN, show_silkscreen );
TRANSER_SETTING( FL_SOLDERMASK, show_soldermask );
TRANSER_SETTING( FL_SOLDERPASTE, show_solderpaste );
TRANSER_SETTING( FL_COMMENTS, show_comments );
TRANSER_SETTING( FL_ECO, show_eco );
TRANSER_SETTING( FL_SHOW_BOARD_BODY, show_board_body );
TRANSFER_SETTING( FL_AXIS, show_axis );
TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL, show_footprints_normal );
TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, show_footprints_insert );
TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_VIRTUAL, show_footprints_virtual );
TRANSFER_SETTING( FL_ZONE, show_zones );
TRANSFER_SETTING( FL_ADHESIVE, show_adhesive );
TRANSFER_SETTING( FL_SILKSCREEN, show_silkscreen );
TRANSFER_SETTING( FL_SOLDERMASK, show_soldermask );
TRANSFER_SETTING( FL_SOLDERPASTE, show_solderpaste );
TRANSFER_SETTING( FL_COMMENTS, show_comments );
TRANSFER_SETTING( FL_ECO, show_eco );
TRANSFER_SETTING( FL_SHOW_BOARD_BODY, show_board_body );
m_boardAdapter.GridSet( static_cast<GRID3D_TYPE>( cfg->m_Render.grid_type ) );
m_boardAdapter.AntiAliasingSet( static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode ) );
RENDER_ENGINE engine = static_cast<RENDER_ENGINE>( cfg->m_Render.engine );
wxLogTrace( m_logTrace, engine == RENDER_ENGINE::RAYTRACING ?
@ -482,12 +487,18 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg )
{
#define TRANSFER_SETTING( field, flag ) cfg->m_Render.field = m_boardAdapter.GetFlag( flag )
cfg->m_Render.engine = static_cast<int>( m_boardAdapter.RenderEngineGet() );
cfg->m_Render.grid_type = static_cast<int>( m_boardAdapter.GridGet() );
cfg->m_Render.material_mode = static_cast<int>( m_boardAdapter.MaterialModeGet() );
cfg->m_Render.engine = static_cast<int>( m_boardAdapter.RenderEngineGet() );
cfg->m_Render.grid_type = static_cast<int>( m_boardAdapter.GridGet() );
cfg->m_Render.material_mode = static_cast<int>( m_boardAdapter.MaterialModeGet() );
cfg->m_Render.opengl_AA_mode = static_cast<int>( m_boardAdapter.AntiAliasingGet() );
TRANSFER_SETTING( opengl_AA_disableOnMove, FL_RENDER_OPENGL_AA_DISABLE_ON_MOVE );
TRANSFER_SETTING( opengl_copper_thickness, FL_RENDER_OPENGL_COPPER_THICKNESS );
TRANSFER_SETTING( opengl_show_model_bbox, FL_RENDER_OPENGL_SHOW_MODEL_BBOX );
TRANSFER_SETTING( opengl_thickness_disableOnMove, FL_RENDER_OPENGL_THICKNESS_DISABLE_ON_MOVE );
TRANSFER_SETTING( opengl_vias_disableOnMove, FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE );
TRANSFER_SETTING( opengl_holes_disableOnMove, FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE );
TRANSFER_SETTING( opengl_copper_thickness, FL_RENDER_OPENGL_COPPER_THICKNESS );
TRANSFER_SETTING( opengl_show_model_bbox, FL_RENDER_OPENGL_SHOW_MODEL_BBOX );
TRANSFER_SETTING( raytrace_anti_aliasing, FL_RENDER_RAYTRACING_ANTI_ALIASING );
TRANSFER_SETTING( raytrace_backfloor, FL_RENDER_RAYTRACING_BACKFLOOR );
TRANSFER_SETTING( raytrace_post_processing, FL_RENDER_RAYTRACING_POST_PROCESSING );
@ -511,7 +522,7 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg )
TRANSFER_SETTING( show_zones, FL_ZONE );
TRANSFER_SETTING( subtract_mask_from_silk, FL_SUBTRACT_MASK_FROM_SILK );
#undef TRANSER_SETTING
#undef TRANSFER_SETTING
}
}

View File

@ -198,11 +198,6 @@ TOOL_ACTION EDA_3D_ACTIONS::attributesVirtual( "3DViewer.Control.attributesVirtu
_( "Toggle Virtual 3D models" ), _( "Toggle 3D models with 'Virtual' attribute" ),
nullptr, AF_NONE, (void*) FL_MODULE_ATTRIBUTES_VIRTUAL );
TOOL_ACTION EDA_3D_ACTIONS::showCopperThickness( "3DViewer.Control.showCopperThickness",
AS_GLOBAL, 0, "",
_( "Show Copper Thickness" ), _( "Shows the thickness of copper layers (slow)" ),
use_3D_copper_thickness_xpm, AF_NONE, (void*) FL_RENDER_OPENGL_COPPER_THICKNESS );
TOOL_ACTION EDA_3D_ACTIONS::showBoundingBoxes( "3DViewer.Control.showBoundingBoxes",
AS_GLOBAL, 0, "",
_( "Show Model Bounding Boxes" ), _( "Show Model Bounding Boxes" ),
@ -238,7 +233,6 @@ TOOL_ACTION EDA_3D_ACTIONS::antiAliasing( "3DViewer.Control.antiAliasing",
_( "Anti-aliasing" ), _( "Render with improved quality on final render (slow)" ),
nullptr, AF_NONE, (void*) FL_RENDER_RAYTRACING_ANTI_ALIASING );
TOOL_ACTION EDA_3D_ACTIONS::postProcessing( "3DViewer.Control.postProcessing",
AS_GLOBAL, 0, "",
_( "Post-processing" ),

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2016 CERN
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -75,7 +75,6 @@ public:
static TOOL_ACTION attributesTHT;
static TOOL_ACTION attributesSMD;
static TOOL_ACTION attributesVirtual;
static TOOL_ACTION showCopperThickness;
static TOOL_ACTION showBoundingBoxes;
static TOOL_ACTION renderShadows;
static TOOL_ACTION proceduralTextures;

View File

@ -322,7 +322,6 @@ void EDA_3D_CONTROLLER::setTransitions()
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::attributesTHT.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::attributesSMD.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::attributesVirtual.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showCopperThickness.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showBoundingBoxes.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::renderShadows.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::proceduralTextures.MakeEvent() );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -28,7 +28,10 @@
*/
#include "cogl_att_list.h"
#include <macros.h>
#include <wx/glcanvas.h>
#include <fctsys.h>
#include <wx/debug.h>
/**
* Attributes list to be passed to a wxGLCanvas creation.
@ -46,7 +49,7 @@ const int COGL_ATT_LIST::m_openGL_attributes_list[] = {
// Boolean attributes (using itself at padding):
// 0 1
WX_GL_RGBA, WX_GL_RGBA,
WX_GL_RGBA, WX_GL_RGBA,
// 2 3
WX_GL_DOUBLEBUFFER, WX_GL_DOUBLEBUFFER,
@ -78,13 +81,15 @@ int COGL_ATT_LIST::m_openGL_attributes_list_to_use[
arrayDim( COGL_ATT_LIST::m_openGL_attributes_list ) ] = { 0 };
const int *COGL_ATT_LIST::GetAttributesList( bool aUseAntiAliasing )
const int *COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode )
{
wxASSERT( aAntiAliasingMode <= ANTIALIASING_MODE::AA_8X );
memcpy( m_openGL_attributes_list_to_use,
m_openGL_attributes_list,
sizeof( m_openGL_attributes_list_to_use ) );
if( aUseAntiAliasing )
if( aAntiAliasingMode > ANTIALIASING_MODE::AA_NONE )
{
// There is a bug on wxGLCanvas that makes IsDisplaySupported fail
// while testing for antialiasing.
@ -98,8 +103,10 @@ const int *COGL_ATT_LIST::GetAttributesList( bool aUseAntiAliasing )
// Check if the canvas supports multisampling.
if( wxGLCanvas::IsDisplaySupported( m_openGL_attributes_list_to_use ) )
{
// Check for possible sample sizes, start form the top.
int maxSamples = 8; // Any higher doesn't change anything.
static const int aaSamples[4] = {0, 2, 4, 8};
// Check for possible sample sizes, start form the requested.
int maxSamples = aaSamples[static_cast<int>( aAntiAliasingMode )];
m_openGL_attributes_list_to_use[ATT_WX_GL_SAMPLES_OFFSET_DATA] = maxSamples;
@ -113,12 +120,12 @@ const int *COGL_ATT_LIST::GetAttributesList( bool aUseAntiAliasing )
else
{
DBG( printf("GetAttributesList: AntiAliasing is not supported.\n") );
aUseAntiAliasing = false;
aAntiAliasingMode = ANTIALIASING_MODE::AA_NONE;
}
}
// Disable antialising if it failed or was not requested
if( !aUseAntiAliasing )
if( aAntiAliasingMode == ANTIALIASING_MODE::AA_NONE )
{
// Remove multisampling information
// (hoping that the GPU driver will decide what is best)

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -30,10 +30,14 @@
#ifndef _COGL_ATT_LIST_H
#define _COGL_ATT_LIST_H
#include <macros.h>
#include <wx/glcanvas.h>
/// Anti-aliasing options
enum class ANTIALIASING_MODE
{
AA_NONE,
AA_2X,
AA_4X,
AA_8X
};
/**
* Class COGL_ATT_LIST
@ -45,11 +49,11 @@ class COGL_ATT_LIST
public:
/**
* Get a list of attributes to pass to wxGLCanvas
* @param aUseAntiAliasing = if true try to initialize (if is supported) the
* @param aAntiAliasingMode = 0 - disabled; try to initialize (if is supported) the
* list with anti aliasing capabilities
* @return a list of options to be passed in the creation of a EDA_3D_CANVAS class
*/
static const int *GetAttributesList( bool aUseAntiAliasing );
static const int *GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode );
private:
/**