From 0c37e3c44395783bdda389236d050d00970ed28d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 23 Aug 2023 14:04:31 +0100 Subject: [PATCH] Remove realistic-mode (and duplicated settings from preferences). Most of these settings are now available in the appearances panel. It was concluded in a Zulip discussion that any missing items can be added back in time if people find they need them (ie: complain). Also hooks up 3DViewer to the common language framework. --- 3d-viewer/3d_canvas/board_adapter.cpp | 8 +- 3d-viewer/3d_canvas/create_layer_items.cpp | 35 +- 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 13 +- .../3d_rendering/opengl/create_scene.cpp | 78 +- .../3d_rendering/opengl/render_3d_opengl.cpp | 360 ++-- .../3d_rendering/opengl/render_3d_opengl.h | 1 - .../3d_rendering/raytracing/create_scene.cpp | 79 +- 3d-viewer/3d_viewer/3d_menubar.cpp | 43 +- 3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp | 47 +- 3d-viewer/3d_viewer/eda_3d_viewer_frame.h | 3 +- .../3d_viewer/eda_3d_viewer_settings.cpp | 2 - 3d-viewer/3d_viewer/tools/eda_3d_actions.cpp | 2 +- .../3d_viewer/tools/eda_3d_controller.cpp | 3 - 3d-viewer/CMakeLists.txt | 2 - 3d-viewer/dialogs/appearance_controls_3D.cpp | 28 +- 3d-viewer/dialogs/appearance_controls_3D.h | 12 + 3d-viewer/dialogs/panel_3D_colors.cpp | 128 -- 3d-viewer/dialogs/panel_3D_colors.h | 42 - 3d-viewer/dialogs/panel_3D_colors_base.cpp | 153 -- 3d-viewer/dialogs/panel_3D_colors_base.fbp | 1662 ----------------- 3d-viewer/dialogs/panel_3D_colors_base.h | 70 - .../dialogs/panel_3D_display_options.cpp | 57 - .../dialogs/panel_3D_display_options_base.cpp | 72 +- .../dialogs/panel_3D_display_options_base.fbp | 825 +------- .../dialogs/panel_3D_display_options_base.h | 19 +- 3d-viewer/dialogs/panel_preview_3d_model.cpp | 2 - common/eda_base_frame.cpp | 1 - common/reporter.cpp | 2 +- include/frame_type.h | 1 - pcbnew/pcb_base_frame.cpp | 5 + pcbnew/pcbnew.cpp | 4 - 31 files changed, 275 insertions(+), 3484 deletions(-) delete mode 100644 3d-viewer/dialogs/panel_3D_colors.cpp delete mode 100644 3d-viewer/dialogs/panel_3D_colors.h delete mode 100644 3d-viewer/dialogs/panel_3D_colors_base.cpp delete mode 100644 3d-viewer/dialogs/panel_3D_colors_base.fbp delete mode 100644 3d-viewer/dialogs/panel_3D_colors_base.h diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index b3938ebbeb..05cd615fa5 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -251,8 +251,6 @@ bool BOARD_ADAPTER::Is3dLayerEnabled( PCB_LAYER_ID aLayer, case Cmts_User: return aVisibilityFlags.test( LAYER_3D_USER_COMMENTS ); case Eco1_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO1 ); case Eco2_User: return aVisibilityFlags.test( LAYER_3D_USER_ECO2 ); - case Edge_Cuts: return !m_Cfg->m_Render.realistic && !m_Cfg->m_Render.show_board_body; - case Margin: return !m_Cfg->m_Render.realistic; default: return m_board && m_board->IsLayerVisible( aLayer ); } } @@ -330,11 +328,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR BOX2I bbbox; if( m_board ) - { - bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() - && m_Cfg->m_Render.realistic - && haveOutline ); - } + bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline ); // Gives a non null size to avoid issues in zoom / scale calculations if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) ) diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 0b3d433ce1..96eab431ec 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -215,7 +215,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } } - if( m_Cfg->m_Render.renderPlatedPadsAsPlated && m_Cfg->m_Render.realistic ) + if( m_Cfg->m_Render.renderPlatedPadsAsPlated ) { m_frontPlatedPadPolys = new SHAPE_POLY_SET; m_backPlatedPadPolys = new SHAPE_POLY_SET; @@ -314,9 +314,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) hole_inner_radius + thickness, *track ) ); - if( m_Cfg->m_Render.clip_silk_on_via_annulus - && m_Cfg->m_Render.realistic - && ring_radius > 0.0 ) + if( m_Cfg->m_Render.clip_silk_on_via_annulus && ring_radius > 0.0 ) { m_throughHoleAnnularRings.Add( new FILLED_CIRCLE_2D( via_center, ring_radius, @@ -406,7 +404,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) TransformCircleToPolygon( m_throughHoleViaOdPolys, via->GetStart(), hole_outer_radius, maxError, ERROR_INSIDE ); - if( m_Cfg->m_Render.clip_silk_on_via_annulus && m_Cfg->m_Render.realistic ) + if( m_Cfg->m_Render.clip_silk_on_via_annulus ) { TransformCircleToPolygon( m_throughHoleAnnularRingPolys, via->GetStart(), hole_outer_ring_radius, maxError, ERROR_INSIDE ); @@ -468,7 +466,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) m_throughHoleOds.Add( createPadWithDrill( pad, inflate ) ); - if( m_Cfg->m_Render.clip_silk_on_via_annulus && m_Cfg->m_Render.realistic ) + if( m_Cfg->m_Render.clip_silk_on_via_annulus ) m_throughHoleAnnularRings.Add( createPadWithDrill( pad, inflate ) ); m_throughHoleIds.Add( createPadWithDrill( pad, 0 ) ); @@ -493,7 +491,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) if( pad->GetAttribute () != PAD_ATTRIB::NPTH ) { - if( m_Cfg->m_Render.clip_silk_on_via_annulus && m_Cfg->m_Render.realistic ) + if( m_Cfg->m_Render.clip_silk_on_via_annulus ) { pad->TransformHoleToPolygon( m_throughHoleAnnularRingPolys, inflate, maxError, ERROR_INSIDE ); @@ -505,7 +503,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) else { // If not plated, no copper. - if( m_Cfg->m_Render.clip_silk_on_via_annulus && m_Cfg->m_Render.realistic ) + if( m_Cfg->m_Render.clip_silk_on_via_annulus ) { pad->TransformHoleToPolygon( m_throughHoleAnnularRingPolys, 0, maxError, ERROR_INSIDE ); @@ -517,9 +515,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } } - const bool renderPlatedPadsAsPlated = m_Cfg->m_Render.renderPlatedPadsAsPlated - && m_Cfg->m_Render.realistic; - // Add footprints PADs objects to containers for( PCB_LAYER_ID layer : layer_ids ) { @@ -530,14 +525,15 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // ADD PADS for( FOOTPRINT* footprint : m_board->Footprints() ) { - addPads( footprint, layerContainer, layer, renderPlatedPadsAsPlated, false ); + addPads( footprint, layerContainer, layer, m_Cfg->m_Render.renderPlatedPadsAsPlated, + false ); // Micro-wave footprints may have items on copper layers addFootprintShapes( footprint, layerContainer, layer, visibilityFlags ); } } - if( renderPlatedPadsAsPlated ) + if( m_Cfg->m_Render.renderPlatedPadsAsPlated ) { // ADD PLATED PADS for( FOOTPRINT* footprint : m_board->Footprints() ) @@ -565,13 +561,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Note: NPTH pads are not drawn on copper layers when the pad has same shape as // its hole footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE, - true, renderPlatedPadsAsPlated, false ); + true, m_Cfg->m_Render.renderPlatedPadsAsPlated, + false ); transformFPShapesToPolySet( footprint, layer, *layerPoly ); } } - if( renderPlatedPadsAsPlated ) + if( m_Cfg->m_Render.renderPlatedPadsAsPlated ) { // ADD PLATED PADS contours for( FOOTPRINT* footprint : m_board->Footprints() ) @@ -749,7 +746,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) if( m_Cfg->m_Render.opengl_copper_thickness && m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL ) { - if( renderPlatedPadsAsPlated ) + if( m_Cfg->m_Render.renderPlatedPadsAsPlated ) { if( m_frontPlatedPadPolys && ( m_layers_poly.find( F_Cu ) != m_layers_poly.end() ) ) { @@ -777,7 +774,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) std::vector &selected_layer_id = layer_ids; std::vector layer_id_without_F_and_B; - if( renderPlatedPadsAsPlated ) + if( m_Cfg->m_Render.renderPlatedPadsAsPlated ) { layer_id_without_F_and_B.clear(); layer_id_without_F_and_B.reserve( layer_ids.size() ); @@ -887,9 +884,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) Dwgs_User, Cmts_User, Eco1_User, - Eco2_User, - Edge_Cuts, - Margin + Eco2_User }; for( LSEQ seq = LSET::AllNonCuMask().Seq( techLayerList, arrayDim( techLayerList ) ); diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 60f2eb5a13..e4fb0140f0 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -547,16 +547,13 @@ void EDA_3D_CANVAS::DoRePaint() GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glRC ); - if( !activityReporter.HasMessage() ) + if( m_mouse_was_moved || m_camera_is_moving ) { - if( m_mouse_was_moved || m_camera_is_moving ) - { - // Calculation time in milliseconds - const double calculation_time = (double)( GetRunningMicroSecs() - strtime) / 1e3; + // Calculation time in milliseconds + const double calculation_time = (double)( GetRunningMicroSecs() - strtime) / 1e3; - activityReporter.Report( wxString::Format( _( "Last render time %.0f ms" ), - calculation_time ) ); - } + activityReporter.Report( wxString::Format( _( "Last render time %.0f ms" ), + calculation_time ) ); } // This will reset the flag of camera parameters changed diff --git a/3d-viewer/3d_rendering/opengl/create_scene.cpp b/3d-viewer/3d_rendering/opengl/create_scene.cpp index cae7eac280..a98b9eee0b 100644 --- a/3d-viewer/3d_rendering/opengl/create_scene.cpp +++ b/3d-viewer/3d_rendering/opengl/create_scene.cpp @@ -24,7 +24,6 @@ */ #include "render_3d_opengl.h" -#include "opengl_utils.h" #include #include #include "../../3d_math.h" @@ -33,7 +32,6 @@ #include #include // To use GetRunningMicroSecs or another profiling utility #include -#include #include @@ -468,20 +466,17 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo // Create Board m_board = createBoard( m_boardAdapter.GetBoardPoly(), &m_boardAdapter.GetThroughHoleIds() ); - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - m_antiBoardPolys.RemoveAllContours(); - m_antiBoardPolys.NewOutline(); - m_antiBoardPolys.Append( VECTOR2I( -INT_MAX/2, -INT_MAX/2 ) ); - m_antiBoardPolys.Append( VECTOR2I( INT_MAX/2, -INT_MAX/2 ) ); - m_antiBoardPolys.Append( VECTOR2I( INT_MAX/2, INT_MAX/2 ) ); - m_antiBoardPolys.Append( VECTOR2I( -INT_MAX/2, INT_MAX/2 ) ); - m_antiBoardPolys.Outline( 0 ).SetClosed( true ); + m_antiBoardPolys.RemoveAllContours(); + m_antiBoardPolys.NewOutline(); + m_antiBoardPolys.Append( VECTOR2I( -INT_MAX/2, -INT_MAX/2 ) ); + m_antiBoardPolys.Append( VECTOR2I( INT_MAX/2, -INT_MAX/2 ) ); + m_antiBoardPolys.Append( VECTOR2I( INT_MAX/2, INT_MAX/2 ) ); + m_antiBoardPolys.Append( VECTOR2I( -INT_MAX/2, INT_MAX/2 ) ); + m_antiBoardPolys.Outline( 0 ).SetClosed( true ); - m_antiBoardPolys.BooleanSubtract( m_boardAdapter.GetBoardPoly(), - SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); - m_antiBoard = createBoard( m_antiBoardPolys ); - } + m_antiBoardPolys.BooleanSubtract( m_boardAdapter.GetBoardPoly(), + SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); + m_antiBoard = createBoard( m_antiBoardPolys ); SHAPE_POLY_SET board_poly_with_holes = m_boardAdapter.GetBoardPoly().CloneDropTriangulation(); board_poly_with_holes.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(), @@ -500,11 +495,8 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo SHAPE_POLY_SET outerPolyTHT = m_boardAdapter.GetThroughHoleOdPolys().CloneDropTriangulation(); - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - outerPolyTHT.BooleanIntersection( m_boardAdapter.GetBoardPoly(), - SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); - } + outerPolyTHT.BooleanIntersection( m_boardAdapter.GetBoardPoly(), + SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); m_outerThroughHoles = generateHoles( m_boardAdapter.GetThroughHoleOds().GetList(), outerPolyTHT, 1.0f, 0.0f, false, @@ -514,8 +506,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo m_boardAdapter.GetThroughHoleViaOds().GetList(), m_boardAdapter.GetThroughHoleViaOdPolys(), 1.0f, 0.0f, false ); - if( m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus && - m_boardAdapter.m_Cfg->m_Render.realistic ) + if( m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus ) { m_outerThroughHoleRings = generateHoles( m_boardAdapter.GetThroughHoleAnnularRings().GetList(), @@ -593,31 +584,28 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo { polyListSubtracted = *map_poly.at( layer_id );; - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - polyListSubtracted.BooleanIntersection( m_boardAdapter.GetBoardPoly(), - SHAPE_POLY_SET::PM_FAST ); + polyListSubtracted.BooleanIntersection( m_boardAdapter.GetBoardPoly(), + SHAPE_POLY_SET::PM_FAST ); - if( layer_id != B_Mask && layer_id != F_Mask ) + if( layer_id != B_Mask && layer_id != F_Mask ) + { + polyListSubtracted.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(), + SHAPE_POLY_SET::PM_FAST ); + polyListSubtracted.BooleanSubtract( m_boardAdapter.GetOuterNonPlatedThroughHolePoly(), + SHAPE_POLY_SET::PM_FAST ); + } + + if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk ) + { + if( layer_id == B_SilkS && map_poly.find( B_Mask ) != map_poly.end() ) { - polyListSubtracted.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(), - SHAPE_POLY_SET::PM_FAST ); - polyListSubtracted.BooleanSubtract( m_boardAdapter.GetOuterNonPlatedThroughHolePoly(), + polyListSubtracted.BooleanSubtract( *map_poly.at( B_Mask ), SHAPE_POLY_SET::PM_FAST ); } - - if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk ) + else if( layer_id == F_SilkS && map_poly.find( F_Mask ) != map_poly.end() ) { - if( layer_id == B_SilkS && map_poly.find( B_Mask ) != map_poly.end() ) - { - polyListSubtracted.BooleanSubtract( *map_poly.at( B_Mask ), - SHAPE_POLY_SET::PM_FAST ); - } - else if( layer_id == F_SilkS && map_poly.find( F_Mask ) != map_poly.end() ) - { - polyListSubtracted.BooleanSubtract( *map_poly.at( F_Mask ), - SHAPE_POLY_SET::PM_FAST ); - } + polyListSubtracted.BooleanSubtract( *map_poly.at( F_Mask ), + SHAPE_POLY_SET::PM_FAST ); } } @@ -632,8 +620,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo } - if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated - && m_boardAdapter.m_Cfg->m_Render.realistic ) + if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) { const SHAPE_POLY_SET* frontPlatedPadPolys = m_boardAdapter.GetFrontPlatedPadPolys(); const SHAPE_POLY_SET* backPlatedPadPolys = m_boardAdapter.GetBackPlatedPadPolys(); @@ -861,8 +848,7 @@ void RENDER_3D_OPENGL::generateViasAndPads() // Subtract the holes tht_outer_holes_poly.BooleanSubtract( tht_inner_holes_poly, SHAPE_POLY_SET::PM_FAST ); - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - tht_outer_holes_poly.BooleanSubtract( m_antiBoardPolys, SHAPE_POLY_SET::PM_FAST ); + tht_outer_holes_poly.BooleanSubtract( m_antiBoardPolys, SHAPE_POLY_SET::PM_FAST ); CONTAINER_2D holesContainer; diff --git a/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp index cce8f7bc3a..7d7946a977 100644 --- a/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp @@ -175,148 +175,90 @@ void RENDER_3D_OPENGL::setupMaterials() { m_materials = {}; - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - // http://devernay.free.fr/cours/opengl/materials.html + // http://devernay.free.fr/cours/opengl/materials.html - // Plated copper - // Copper material mixed with the copper color - m_materials.m_Copper.m_Ambient = SFVEC3F( m_boardAdapter.m_CopperColor.r * 0.1f, - m_boardAdapter.m_CopperColor.g * 0.1f, - m_boardAdapter.m_CopperColor.b * 0.1f); + // Plated copper + // Copper material mixed with the copper color + m_materials.m_Copper.m_Ambient = SFVEC3F( m_boardAdapter.m_CopperColor.r * 0.1f, + m_boardAdapter.m_CopperColor.g * 0.1f, + m_boardAdapter.m_CopperColor.b * 0.1f); - m_materials.m_Copper.m_Specular = SFVEC3F( m_boardAdapter.m_CopperColor.r * 0.75f + 0.25f, - m_boardAdapter.m_CopperColor.g * 0.75f + 0.25f, - m_boardAdapter.m_CopperColor.b * 0.75f + 0.25f ); + m_materials.m_Copper.m_Specular = SFVEC3F( m_boardAdapter.m_CopperColor.r * 0.75f + 0.25f, + m_boardAdapter.m_CopperColor.g * 0.75f + 0.25f, + m_boardAdapter.m_CopperColor.b * 0.75f + 0.25f ); - // This guess the material type(ex: copper vs gold) to determine the - // shininess factor between 0.1 and 0.4 - float shininessfactor = 0.40f - mapf( fabs( m_boardAdapter.m_CopperColor.r - - m_boardAdapter.m_CopperColor.g ), - 0.15f, 1.00f, - 0.00f, 0.30f ); + // This guess the material type(ex: copper vs gold) to determine the + // shininess factor between 0.1 and 0.4 + float shininessfactor = 0.40f - mapf( fabs( m_boardAdapter.m_CopperColor.r - + m_boardAdapter.m_CopperColor.g ), + 0.15f, 1.00f, + 0.00f, 0.30f ); - m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f; - m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f; + m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - // Non plated copper (raw copper) - m_materials.m_NonPlatedCopper.m_Ambient = SFVEC3F( 0.191f, 0.073f, 0.022f ); - m_materials.m_NonPlatedCopper.m_Diffuse = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, - 50.0f / 255.0f ); - m_materials.m_NonPlatedCopper.m_Specular = SFVEC3F( 0.256f, 0.137f, 0.086f ); - m_materials.m_NonPlatedCopper.m_Shininess = 0.1f * 128.0f; - m_materials.m_NonPlatedCopper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + // Non plated copper (raw copper) + m_materials.m_NonPlatedCopper.m_Ambient = SFVEC3F( 0.191f, 0.073f, 0.022f ); + m_materials.m_NonPlatedCopper.m_Diffuse = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, + 50.0f / 255.0f ); + m_materials.m_NonPlatedCopper.m_Specular = SFVEC3F( 0.256f, 0.137f, 0.086f ); + m_materials.m_NonPlatedCopper.m_Shininess = 0.1f * 128.0f; + m_materials.m_NonPlatedCopper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - // Paste material mixed with paste color - m_materials.m_Paste.m_Ambient = SFVEC3F( m_boardAdapter.m_SolderPasteColor.r, - m_boardAdapter.m_SolderPasteColor.g, - m_boardAdapter.m_SolderPasteColor.b ); + // Paste material mixed with paste color + m_materials.m_Paste.m_Ambient = SFVEC3F( m_boardAdapter.m_SolderPasteColor.r, + m_boardAdapter.m_SolderPasteColor.g, + m_boardAdapter.m_SolderPasteColor.b ); - m_materials.m_Paste.m_Specular = SFVEC3F( m_boardAdapter.m_SolderPasteColor.r * - m_boardAdapter.m_SolderPasteColor.r, - m_boardAdapter.m_SolderPasteColor.g * - m_boardAdapter.m_SolderPasteColor.g, - m_boardAdapter.m_SolderPasteColor.b * - m_boardAdapter.m_SolderPasteColor.b ); + m_materials.m_Paste.m_Specular = SFVEC3F( m_boardAdapter.m_SolderPasteColor.r * + m_boardAdapter.m_SolderPasteColor.r, + m_boardAdapter.m_SolderPasteColor.g * + m_boardAdapter.m_SolderPasteColor.g, + m_boardAdapter.m_SolderPasteColor.b * + m_boardAdapter.m_SolderPasteColor.b ); - m_materials.m_Paste.m_Shininess = 0.1f * 128.0f; - m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + m_materials.m_Paste.m_Shininess = 0.1f * 128.0f; + m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - // Silk screen material mixed with silk screen color - m_materials.m_SilkSTop.m_Ambient = SFVEC3F( m_boardAdapter.m_SilkScreenColorTop.r, - m_boardAdapter.m_SilkScreenColorTop.g, - m_boardAdapter.m_SilkScreenColorTop.b ); + // Silk screen material mixed with silk screen color + m_materials.m_SilkSTop.m_Ambient = SFVEC3F( m_boardAdapter.m_SilkScreenColorTop.r, + m_boardAdapter.m_SilkScreenColorTop.g, + m_boardAdapter.m_SilkScreenColorTop.b ); - m_materials.m_SilkSTop.m_Specular = SFVEC3F( - m_boardAdapter.m_SilkScreenColorTop.r * m_boardAdapter.m_SilkScreenColorTop.r + - 0.10f, - m_boardAdapter.m_SilkScreenColorTop.g * m_boardAdapter.m_SilkScreenColorTop.g + - 0.10f, - m_boardAdapter.m_SilkScreenColorTop.b * m_boardAdapter.m_SilkScreenColorTop.b + - 0.10f ); + m_materials.m_SilkSTop.m_Specular = SFVEC3F( + m_boardAdapter.m_SilkScreenColorTop.r * m_boardAdapter.m_SilkScreenColorTop.r + 0.10f, + m_boardAdapter.m_SilkScreenColorTop.g * m_boardAdapter.m_SilkScreenColorTop.g + 0.10f, + m_boardAdapter.m_SilkScreenColorTop.b * m_boardAdapter.m_SilkScreenColorTop.b + 0.10f ); - m_materials.m_SilkSTop.m_Shininess = 0.078125f * 128.0f; - m_materials.m_SilkSTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + m_materials.m_SilkSTop.m_Shininess = 0.078125f * 128.0f; + m_materials.m_SilkSTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - // Silk screen material mixed with silk screen color - m_materials.m_SilkSBot.m_Ambient = SFVEC3F( m_boardAdapter.m_SilkScreenColorBot.r, - m_boardAdapter.m_SilkScreenColorBot.g, - m_boardAdapter.m_SilkScreenColorBot.b ); + // Silk screen material mixed with silk screen color + m_materials.m_SilkSBot.m_Ambient = SFVEC3F( m_boardAdapter.m_SilkScreenColorBot.r, + m_boardAdapter.m_SilkScreenColorBot.g, + m_boardAdapter.m_SilkScreenColorBot.b ); - m_materials.m_SilkSBot.m_Specular = SFVEC3F( - m_boardAdapter.m_SilkScreenColorBot.r * m_boardAdapter.m_SilkScreenColorBot.r + - 0.10f, - m_boardAdapter.m_SilkScreenColorBot.g * m_boardAdapter.m_SilkScreenColorBot.g + - 0.10f, - m_boardAdapter.m_SilkScreenColorBot.b * m_boardAdapter.m_SilkScreenColorBot.b + - 0.10f ); + m_materials.m_SilkSBot.m_Specular = SFVEC3F( + m_boardAdapter.m_SilkScreenColorBot.r * m_boardAdapter.m_SilkScreenColorBot.r + 0.10f, + m_boardAdapter.m_SilkScreenColorBot.g * m_boardAdapter.m_SilkScreenColorBot.g + 0.10f, + m_boardAdapter.m_SilkScreenColorBot.b * m_boardAdapter.m_SilkScreenColorBot.b + 0.10f ); - m_materials.m_SilkSBot.m_Shininess = 0.078125f * 128.0f; - m_materials.m_SilkSBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + m_materials.m_SilkSBot.m_Shininess = 0.078125f * 128.0f; + m_materials.m_SilkSBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f; - m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); + m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f; + m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - // Epoxy material - m_materials.m_EpoxyBoard.m_Ambient = SFVEC3F( 117.0f / 255.0f, 97.0f / 255.0f, - 47.0f / 255.0f ); + // Epoxy material + m_materials.m_EpoxyBoard.m_Ambient = SFVEC3F( 117.0f / 255.0f, 97.0f / 255.0f, + 47.0f / 255.0f ); - m_materials.m_EpoxyBoard.m_Specular = SFVEC3F( 18.0f / 255.0f, 3.0f / 255.0f, - 20.0f / 255.0f ); + m_materials.m_EpoxyBoard.m_Specular = SFVEC3F( 18.0f / 255.0f, 3.0f / 255.0f, + 20.0f / 255.0f ); - m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f; - m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - } - else // Technical Mode - { - const SFVEC3F matAmbientColor = SFVEC3F( 0.10f ); - const SFVEC3F matSpecularColor = SFVEC3F( 0.10f ); - const float matShininess = 0.1f * 128.0f; - - // Copper material - m_materials.m_Copper.m_Ambient = matAmbientColor; - m_materials.m_Copper.m_Specular = matSpecularColor; - m_materials.m_Copper.m_Shininess = matShininess; - m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Paste material - m_materials.m_Paste.m_Ambient = matAmbientColor; - m_materials.m_Paste.m_Specular = matSpecularColor; - m_materials.m_Paste.m_Shininess = matShininess; - m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Silk screen material - m_materials.m_SilkSTop.m_Ambient = matAmbientColor; - m_materials.m_SilkSTop.m_Specular = matSpecularColor; - m_materials.m_SilkSTop.m_Shininess = matShininess; - m_materials.m_SilkSTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Silk screen material - m_materials.m_SilkSBot.m_Ambient = matAmbientColor; - m_materials.m_SilkSBot.m_Specular = matSpecularColor; - m_materials.m_SilkSBot.m_Shininess = matShininess; - m_materials.m_SilkSBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Solder mask material - m_materials.m_SolderMask.m_Ambient = matAmbientColor; - m_materials.m_SolderMask.m_Specular = matSpecularColor; - m_materials.m_SolderMask.m_Shininess = matShininess; - m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Epoxy material - m_materials.m_EpoxyBoard.m_Ambient = matAmbientColor; - m_materials.m_EpoxyBoard.m_Specular = matSpecularColor; - m_materials.m_EpoxyBoard.m_Shininess = matShininess; - m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - - // Gray material (used for example in technical vias and pad holes) - m_materials.m_GrayMaterial.m_Ambient = SFVEC3F( 0.8f, 0.8f, 0.8f ); - m_materials.m_GrayMaterial.m_Diffuse = SFVEC3F( 0.3f, 0.3f, 0.3f ); - m_materials.m_GrayMaterial.m_Specular = SFVEC3F( 0.4f, 0.4f, 0.4f ); - m_materials.m_GrayMaterial.m_Shininess = 0.01f * 128.0f; - m_materials.m_GrayMaterial.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); - } + m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f; + m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f ); } @@ -327,20 +269,18 @@ void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID ) case F_Mask: case B_Mask: { - const SFVEC4F layerColor = getLayerColor( aLayerID ); + const SFVEC4F layerColor = aLayerID == F_Mask ? m_boardAdapter.m_SolderMaskColorTop + : m_boardAdapter.m_SolderMaskColorBot; m_materials.m_SolderMask.m_Diffuse = layerColor; // Convert Opacity to Transparency m_materials.m_SolderMask.m_Transparency = 1.0f - layerColor.a; - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - m_materials.m_SolderMask.m_Ambient = m_materials.m_SolderMask.m_Diffuse * 0.3f; + m_materials.m_SolderMask.m_Ambient = m_materials.m_SolderMask.m_Diffuse * 0.3f; - m_materials.m_SolderMask.m_Specular = - m_materials.m_SolderMask.m_Diffuse * m_materials.m_SolderMask.m_Diffuse; - } + m_materials.m_SolderMask.m_Specular = m_materials.m_SolderMask.m_Diffuse + * m_materials.m_SolderMask.m_Diffuse; OglSetMaterial( m_materials.m_SolderMask, 1.0f ); break; @@ -348,17 +288,17 @@ void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID ) case B_Paste: case F_Paste: - m_materials.m_Paste.m_Diffuse = getLayerColor( aLayerID ); + m_materials.m_Paste.m_Diffuse = m_boardAdapter.m_SolderPasteColor; OglSetMaterial( m_materials.m_Paste, 1.0f ); break; case B_SilkS: - m_materials.m_SilkSBot.m_Diffuse = getLayerColor( aLayerID ); + m_materials.m_SilkSBot.m_Diffuse = m_boardAdapter.m_SilkScreenColorBot; OglSetMaterial( m_materials.m_SilkSBot, 1.0f ); break; case F_SilkS: - m_materials.m_SilkSTop.m_Diffuse = getLayerColor( aLayerID ); + m_materials.m_SilkSTop.m_Diffuse = m_boardAdapter.m_SilkScreenColorTop; OglSetMaterial( m_materials.m_SilkSTop, 1.0f ); break; @@ -374,7 +314,18 @@ void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID ) case F_CrtYd: case B_Fab: case F_Fab: - m_materials.m_Plastic.m_Diffuse = getLayerColor( aLayerID ); + switch( aLayerID ) + { + case Dwgs_User: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_UserDrawingsColor; break; + case Cmts_User: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_UserCommentsColor; break; + case Eco1_User: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_ECO1Color; break; + case Eco2_User: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_ECO2Color; break; + case Edge_Cuts: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_UserDrawingsColor; break; + case Margin: m_materials.m_Plastic.m_Diffuse = m_boardAdapter.m_UserDrawingsColor; break; + default: + m_materials.m_Plastic.m_Diffuse = m_boardAdapter.GetLayerColor( aLayerID ); + break; + } m_materials.m_Plastic.m_Ambient = SFVEC3F( m_materials.m_Plastic.m_Diffuse.r * 0.05f, m_materials.m_Plastic.m_Diffuse.g * 0.05f, @@ -390,82 +341,14 @@ void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID ) break; default: - m_materials.m_Copper.m_Diffuse = getLayerColor( aLayerID ); + m_materials.m_Copper.m_Diffuse = m_boardAdapter.m_CopperColor; OglSetMaterial( m_materials.m_Copper, 1.0f ); break; } } -SFVEC4F RENDER_3D_OPENGL::getLayerColor( PCB_LAYER_ID aLayerID ) -{ - SFVEC4F layerColor = m_boardAdapter.GetLayerColor( aLayerID ); - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - switch( aLayerID ) - { - case B_Adhes: - case F_Adhes: - break; - - case B_Mask: - layerColor = m_boardAdapter.m_SolderMaskColorBot; - break; - case F_Mask: - layerColor = m_boardAdapter.m_SolderMaskColorTop; - break; - - case B_Paste: - case F_Paste: - layerColor = m_boardAdapter.m_SolderPasteColor; - break; - - case B_SilkS: - layerColor = m_boardAdapter.m_SilkScreenColorBot; - break; - case F_SilkS: - layerColor = m_boardAdapter.m_SilkScreenColorTop; - break; - - case Dwgs_User: - layerColor = m_boardAdapter.m_UserDrawingsColor; - break; - case Cmts_User: - layerColor = m_boardAdapter.m_UserCommentsColor; - break; - case Eco1_User: - layerColor = m_boardAdapter.m_ECO1Color; - break; - case Eco2_User: - layerColor = m_boardAdapter.m_ECO2Color; - break; - - case Edge_Cuts: - case Margin: - layerColor = m_boardAdapter.m_UserDrawingsColor; - break; - break; - - case B_CrtYd: - case F_CrtYd: - break; - - case B_Fab: - case F_Fab: - break; - - default: - layerColor = m_boardAdapter.m_CopperColor; - break; - } - } - - return layerColor; -} - - -void init_lights( void ) +void init_lights() { // Setup light // https://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml @@ -660,15 +543,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, bool drawMiddleSegments = !skipThickness; - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - // Draw vias and pad holes with copper material - setLayerMaterial( B_Cu ); - } - else - { - OglSetMaterial( m_materials.m_GrayMaterial, 1.0f ); - } + setLayerMaterial( B_Cu ); if( !( skipRenderVias || skipRenderHoles ) && m_vias ) m_vias->DrawAll(); @@ -703,15 +578,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, if( ( layer_id >= F_Cu ) && ( layer_id <= B_Cu ) ) { - if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated - && m_boardAdapter.m_Cfg->m_Render.realistic ) - { + if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) setCopperMaterial(); - } else - { setLayerMaterial( layer_id ); - } if( skipRenderHoles ) { @@ -817,7 +687,6 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, OPENGL_RENDER_LIST* throughHolesOuter = m_outerThroughHoles; if( m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus - && m_boardAdapter.m_Cfg->m_Render.realistic && ( layer_id == B_SilkS || layer_id == F_SilkS ) ) { throughHolesOuter = m_outerThroughHoleRings; @@ -850,7 +719,6 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, } } else if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk - && m_boardAdapter.m_Cfg->m_Render.realistic && ( ( layer_id == B_SilkS && m_layers.find( B_Mask ) != m_layers.end() ) || ( layer_id == F_SilkS && m_layers.find( F_Mask ) != m_layers.end() ) ) ) { @@ -865,13 +733,11 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, else if( throughHolesOuter ) { pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, nullptr, - throughHolesOuter, - anti_board ); + throughHolesOuter, anti_board ); } else { - pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, - anti_board ); + pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, anti_board ); } } @@ -1348,9 +1214,7 @@ void RENDER_3D_OPENGL::renderOpaqueModels( const glm::mat4 &aCameraViewMatrix ) MODEL_3D::BeginDrawMulti( false ); for( const MODELTORENDER& mtr : renderList ) - { renderModel( aCameraViewMatrix, mtr, selColor, nullptr ); - } MODEL_3D::EndDrawMulti(); } @@ -1364,9 +1228,7 @@ void RENDER_3D_OPENGL::renderOpaqueModels( const glm::mat4 &aCameraViewMatrix ) MODEL_3D::BeginDrawMulti( true ); for( const MODELTORENDER& mtr : renderList ) - { renderModel( aCameraViewMatrix, mtr, selColor, nullptr ); - } MODEL_3D::EndDrawMulti(); } @@ -1413,10 +1275,11 @@ void RENDER_3D_OPENGL::renderTransparentModels( const glm::mat4 &aCameraViewMatr // Sort from back to front std::sort( transparentModelList.begin(), transparentModelList.end(), - [&]( std::pair& a, - std::pair& b ) { - return a.second > b.second; - } ); + [&]( std::pair& a, + std::pair& b ) + { + return a.second > b.second; + } ); // Start rendering calls glPushMatrix(); @@ -1472,12 +1335,9 @@ void RENDER_3D_OPENGL::renderModel( const glm::mat4 &aCameraViewMatrix, glLoadMatrixf( glm::value_ptr( modelviewMatrix ) ); - aModelToRender.m_model->Draw( aModelToRender.m_isTransparent, - aModelToRender.m_opacity, - aModelToRender.m_isSelected, - aSelColor, - &aModelToRender.m_modelWorldMat, - aCameraWorldPos ); + aModelToRender.m_model->Draw( aModelToRender.m_isTransparent, aModelToRender.m_opacity, + aModelToRender.m_isSelected, aSelColor, + &aModelToRender.m_modelWorldMat, aCameraWorldPos ); if( m_boardAdapter.m_Cfg->m_Render.opengl_show_model_bbox ) { @@ -1500,9 +1360,7 @@ void RENDER_3D_OPENGL::renderModel( const glm::mat4 &aCameraViewMatrix, glEnable( GL_LIGHTING ); if( !wasBlendEnabled ) - { glDisable( GL_BLEND ); - } } } @@ -1541,21 +1399,13 @@ void RENDER_3D_OPENGL::generate3dGrid( GRID3D_TYPE aGridType ) switch( aGridType ) { + case GRID3D_TYPE::GRID_1MM: griSizeMM = 1.0; break; + case GRID3D_TYPE::GRID_2P5MM: griSizeMM = 2.5; break; + case GRID3D_TYPE::GRID_5MM: griSizeMM = 5.0; break; + case GRID3D_TYPE::GRID_10MM: griSizeMM = 10.0; break; + default: - case GRID3D_TYPE::NONE: - return; - case GRID3D_TYPE::GRID_1MM: - griSizeMM = 1.0; - break; - case GRID3D_TYPE::GRID_2P5MM: - griSizeMM = 2.5; - break; - case GRID3D_TYPE::GRID_5MM: - griSizeMM = 5.0; - break; - case GRID3D_TYPE::GRID_10MM: - griSizeMM = 10.0; - break; + case GRID3D_TYPE::NONE: return; } glNormal3f( 0.0, 0.0, 1.0 ); diff --git a/3d-viewer/3d_rendering/opengl/render_3d_opengl.h b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h index 667ed49ad9..a3ff00083d 100644 --- a/3d-viewer/3d_rendering/opengl/render_3d_opengl.h +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h @@ -189,7 +189,6 @@ private: void unsetDepthOffset(); void setLayerMaterial( PCB_LAYER_ID aLayerID ); - SFVEC4F getLayerColor( PCB_LAYER_ID aLayerID ); bool initializeOpenGL(); OPENGL_RENDER_LIST* createBoard( const SHAPE_POLY_SET& aBoardPoly, diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index 4558a01406..d9e6115d6f 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -275,7 +275,6 @@ void RENDER_3D_RAYTRACE::createItemsFromContainer( const BVH_CONTAINER_2D* aCont // rather than the at the outer edge of the copper plating. const BVH_CONTAINER_2D& throughHoleOuter = m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus - && m_boardAdapter.m_Cfg->m_Render.realistic && ( aLayer_id == B_SilkS || aLayer_id == F_SilkS ) ? m_boardAdapter.GetThroughHoleAnnularRings() : m_boardAdapter.GetThroughHoleOds(); @@ -305,7 +304,6 @@ void RENDER_3D_RAYTRACE::createItemsFromContainer( const BVH_CONTAINER_2D* aCont const MAP_CONTAINER_2D_BASE& mapLayers = m_boardAdapter.GetLayerMap(); if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk - && m_boardAdapter.m_Cfg->m_Render.realistic && ( ( aLayer_id == B_SilkS && mapLayers.find( B_Mask ) != mapLayers.end() ) || ( aLayer_id == F_SilkS && mapLayers.find( F_Mask ) != mapLayers.end() ) ) ) { @@ -587,32 +585,17 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe case B_Paste: case F_Paste: materialLayer = &m_materials.m_Paste; - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - layerColor = m_boardAdapter.m_SolderPasteColor; - else - layerColor = m_boardAdapter.GetLayerColor( layer_id ); - + layerColor = m_boardAdapter.m_SolderPasteColor; break; case B_SilkS: materialLayer = &m_materials.m_SilkS; - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - layerColor = m_boardAdapter.m_SilkScreenColorBot; - else - layerColor = m_boardAdapter.GetLayerColor( layer_id ); - + layerColor = m_boardAdapter.m_SilkScreenColorBot; break; case F_SilkS: materialLayer = &m_materials.m_SilkS; - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - layerColor = m_boardAdapter.m_SilkScreenColorTop; - else - layerColor = m_boardAdapter.GetLayerColor( layer_id ); - + layerColor = m_boardAdapter.m_SilkScreenColorTop; break; case Dwgs_User: @@ -631,11 +614,6 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe layerColor = m_boardAdapter.m_ECO2Color; break; - case Edge_Cuts: - case Margin: - layerColor = m_boardAdapter.m_UserDrawingsColor; - break; - case B_CrtYd: case F_CrtYd: break; @@ -645,22 +623,15 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe break; default: - if( m_boardAdapter.m_Cfg->m_Render.realistic ) + if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) { - if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) - { - layerColor = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f ); - materialLayer = &m_materials.m_NonPlatedCopper; - } - else - { - layerColor = m_boardAdapter.m_CopperColor; - materialLayer = &m_materials.m_Copper; - } + layerColor = SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f ); + materialLayer = &m_materials.m_NonPlatedCopper; } else { - layerColor = m_boardAdapter.GetLayerColor( layer_id ); + layerColor = m_boardAdapter.m_CopperColor; + materialLayer = &m_materials.m_Copper; } break; @@ -670,8 +641,7 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe } // for each layer on map // Create plated copper - if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated - && m_boardAdapter.m_Cfg->m_Render.realistic ) + if( m_boardAdapter.m_Cfg->m_Render.renderPlatedPadsAsPlated ) { createItemsFromContainer( m_boardAdapter.GetPlatedPadsFront(), F_Cu, &m_materials.m_Copper, m_boardAdapter.m_CopperColor, @@ -724,17 +694,10 @@ void RENDER_3D_RAYTRACE::Reload( REPORTER* aStatusReporter, REPORTER* aWarningRe SFVEC3F layerColor; - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - { - if( layer_id == B_Mask ) - layerColor = m_boardAdapter.m_SolderMaskColorBot; - else - layerColor = m_boardAdapter.m_SolderMaskColorTop; - } + if( layer_id == B_Mask ) + layerColor = m_boardAdapter.m_SolderMaskColorBot; else - { - layerColor = m_boardAdapter.GetLayerColor( layer_id ); - } + layerColor = m_boardAdapter.m_SolderMaskColorTop; const float zLayerMin = m_boardAdapter.GetLayerBottomZPos( layer_id ); const float zLayerMax = m_boardAdapter.GetLayerTopZPos( layer_id ); @@ -1029,15 +992,7 @@ void RENDER_3D_RAYTRACE::insertHole( const PCB_VIA* aVia ) LAYER_ITEM* objPtr = new LAYER_ITEM( ring, topZ, botZ ); objPtr->SetMaterial( &m_materials.m_Copper ); - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - objPtr->SetColor( ConvertSRGBToLinear( m_boardAdapter.m_CopperColor ) ); - else if( aVia->GetViaType() == VIATYPE::MICROVIA ) - objPtr->SetColor( ConvertSRGBToLinear( m_boardAdapter.GetItemColor( LAYER_VIA_MICROVIA ) ) ); - else if( aVia->GetViaType() == VIATYPE::BLIND_BURIED ) - objPtr->SetColor( ConvertSRGBToLinear( m_boardAdapter.GetItemColor( LAYER_VIA_BBLIND ) ) ); - else - objPtr->SetColor( ConvertSRGBToLinear( m_boardAdapter.GetItemColor( LAYER_VIAS ) ) ); + objPtr->SetColor( ConvertSRGBToLinear( m_boardAdapter.m_CopperColor ) ); m_objectContainer.Add( objPtr ); } @@ -1047,13 +1002,7 @@ void RENDER_3D_RAYTRACE::insertHole( const PAD* aPad ) { const OBJECT_2D* object2d_A = nullptr; - SFVEC3F objColor; - - if( m_boardAdapter.m_Cfg->m_Render.realistic ) - objColor = m_boardAdapter.m_CopperColor; - else - objColor = m_boardAdapter.GetItemColor( LAYER_PADS_TH ); - + SFVEC3F objColor = m_boardAdapter.m_CopperColor; const VECTOR2I drillsize = aPad->GetDrillSize(); const bool hasHole = drillsize.x && drillsize.y; diff --git a/3d-viewer/3d_viewer/3d_menubar.cpp b/3d-viewer/3d_viewer/3d_menubar.cpp index 1b334492a2..fac671e10f 100644 --- a/3d-viewer/3d_viewer/3d_menubar.cpp +++ b/3d-viewer/3d_viewer/3d_menubar.cpp @@ -36,11 +36,12 @@ #include -void EDA_3D_VIEWER_FRAME::CreateMenuBar() +void EDA_3D_VIEWER_FRAME::doReCreateMenuBar() { wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::CreateMenuBar" ) ); COMMON_CONTROL* tool = m_toolManager->GetTool(); + wxMenuBar* oldMenuBar = GetMenuBar(); WX_MENUBAR* menuBar = new WX_MENUBAR(); @@ -82,6 +83,20 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar() viewMenu->Add( ACTIONS::zoomFitScreen ); viewMenu->Add( ACTIONS::zoomRedraw ); + // Grid submenu + ACTION_MENU* gridSubmenu = new ACTION_MENU( false, tool ); + gridSubmenu->SetTitle( _( "3D Grid" ) ); + gridSubmenu->SetIcon( BITMAPS::grid ); + + gridSubmenu->Add( EDA_3D_ACTIONS::noGrid, ACTION_MENU::CHECK); + gridSubmenu->Add( EDA_3D_ACTIONS::show10mmGrid, ACTION_MENU::CHECK); + gridSubmenu->Add( EDA_3D_ACTIONS::show5mmGrid, ACTION_MENU::CHECK); + gridSubmenu->Add( EDA_3D_ACTIONS::show2_5mmGrid, ACTION_MENU::CHECK); + gridSubmenu->Add( EDA_3D_ACTIONS::show1mmGrid, ACTION_MENU::CHECK); + + viewMenu->AppendSeparator(); + viewMenu->Add( gridSubmenu ); + viewMenu->AppendSeparator(); viewMenu->Add( EDA_3D_ACTIONS::rotateXCW ); viewMenu->Add( EDA_3D_ACTIONS::rotateXCCW ); @@ -118,30 +133,7 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar() prefsMenu->Add( _( "Reset to Default Settings" ), ID_MENU3D_RESET_DEFAULTS, BITMAPS::tools ); prefsMenu->AppendSeparator(); - - prefsMenu->Add( EDA_3D_ACTIONS::showTHT, ACTION_MENU::CHECK ); - prefsMenu->Add( EDA_3D_ACTIONS::showSMD, ACTION_MENU::CHECK ); - prefsMenu->Add( EDA_3D_ACTIONS::showVirtual, ACTION_MENU::CHECK ); - prefsMenu->Add( EDA_3D_ACTIONS::showNotInPosFile, ACTION_MENU::CHECK ); - prefsMenu->Add( EDA_3D_ACTIONS::showDNP, ACTION_MENU::CHECK ); - - prefsMenu->AppendSeparator(); - - prefsMenu->Add( EDA_3D_ACTIONS::showAxis, ACTION_MENU::CHECK ); - prefsMenu->Add( EDA_3D_ACTIONS::showBBoxes, ACTION_MENU::CHECK ); - - // Grid submenu - ACTION_MENU* gridSubmenu = new ACTION_MENU( false, tool ); - gridSubmenu->SetTitle( _( "3D Grid" ) ); - gridSubmenu->SetIcon( BITMAPS::grid ); - - gridSubmenu->Add( EDA_3D_ACTIONS::noGrid, ACTION_MENU::CHECK); - gridSubmenu->Add( EDA_3D_ACTIONS::show10mmGrid, ACTION_MENU::CHECK); - gridSubmenu->Add( EDA_3D_ACTIONS::show5mmGrid, ACTION_MENU::CHECK); - gridSubmenu->Add( EDA_3D_ACTIONS::show2_5mmGrid, ACTION_MENU::CHECK); - gridSubmenu->Add( EDA_3D_ACTIONS::show1mmGrid, ACTION_MENU::CHECK); - - prefsMenu->Add( gridSubmenu ); + AddMenuLanguageList( prefsMenu, tool ); //-- Menubar ------------------------------------------------------------- // @@ -152,4 +144,5 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar() AddStandardHelpMenu( menuBar ); SetMenuBar( menuBar ); + delete oldMenuBar; } diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index ea91417fb6..a054739b67 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -146,7 +146,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent // Run the viewer control tool, it is supposed to be always active m_toolManager->InvokeTool( "3DViewer.Control" ); - CreateMenuBar(); + ReCreateMenuBar(); ReCreateMainToolbar(); m_infoBar = new WX_INFOBAR( this, &m_auimgr ); @@ -581,24 +581,19 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg ) if( cfg->m_CurrentPreset == LEGACY_PRESET_FLAG ) { - COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); + wxString legacyColorsPresetName = _( "legacy colors" ); - if( colors->GetUseBoardStackupColors() ) + if( !cfg->FindPreset( legacyColorsPresetName ) ) + { + cfg->m_LayerPresets.emplace_back( legacyColorsPresetName, + GetAdapter().GetVisibleLayers(), + GetAdapter().GetLayerColors() ); + } + + if( Pgm().GetSettingsManager().GetColorSettings()->GetUseBoardStackupColors() ) cfg->m_CurrentPreset = FOLLOW_PCB; else - cfg->m_CurrentPreset = wxEmptyString; - - if( cfg->m_Render.realistic ) - { - // These settings are no longer dependent on realistic mode in 8.0 (you can use - // view presets to design whatever combinations you want), but we should at least - // default them to the same values as 7.0. - cfg->m_Render.show_comments = false; - cfg->m_Render.show_drawings = false; - cfg->m_Render.show_eco1 = false; - cfg->m_Render.show_eco2 = false; - cfg->m_Render.show_board_body = false; - } + cfg->m_CurrentPreset = legacyColorsPresetName; } m_boardAdapter.InitSettings( nullptr, nullptr ); @@ -655,6 +650,26 @@ void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex } +void EDA_3D_VIEWER_FRAME::ShowChangedLanguage() +{ + EDA_BASE_FRAME::ShowChangedLanguage(); + + SetTitle( _( "3D Viewer" ) ); + ReCreateMainToolbar(); + + if( m_appearancePanel ) + { + wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel ); + lm_pane_info.Caption( _( "Appearance" ) ); + + m_appearancePanel->OnLanguageChanged(); + } + + SetStatusText( wxEmptyString, ACTIVITY ); + SetStatusText( wxEmptyString, HOVERED_ITEM ); +} + + void EDA_3D_VIEWER_FRAME::ToggleAppearanceManager() { SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.h b/3d-viewer/3d_viewer/eda_3d_viewer_frame.h index 57cfeb5442..f651ab521d 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.h +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.h @@ -119,6 +119,7 @@ public: * from the PCB frame because the 3D viewer isn't updated via the #KIWAY. */ void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; + void ShowChangedLanguage() override; APPEARANCE_CONTROLS_3D* GetAppearanceManager() { return m_appearancePanel; } @@ -147,7 +148,7 @@ private: void OnActivate( wxActivateEvent& event ); void OnSetFocus( wxFocusEvent& event ); - void CreateMenuBar(); + void doReCreateMenuBar() override; void ReCreateMainToolbar(); /** diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp index 645ed3436b..742d2e7bf9 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp @@ -314,8 +314,6 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() : &m_Render.raytrace_lightAzimuth, default_azimuth ) ); - m_params.emplace_back( new PARAM( "render.realistic", - &m_Render.realistic, true ) ); m_params.emplace_back( new PARAM( "render.show_adhesive", &m_Render.show_adhesive, true ) ); m_params.emplace_back( new PARAM( "render.show_axis", diff --git a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp index 7adc2ee17b..83b7454fa2 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp @@ -351,7 +351,7 @@ TOOL_ACTION EDA_3D_ACTIONS::showBBoxes( TOOL_ACTION_ARGS() .Name( "3DViewer.Control.showBoundingBoxes" ) .Scope( AS_GLOBAL ) .MenuText( _( "Show Model Bounding Boxes" ) ) - .Tooltip( _( "Show 3D model bounding boxes" ) ) + .Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) ) .Icon( BITMAPS::ortho ) .Flags( AF_NONE ) ); diff --git a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp index 5b51e26f6f..1b2028d4d3 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp @@ -388,9 +388,6 @@ void EDA_3D_CONTROLLER::setTransitions() Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showVirtual.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showNotInPosFile.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showDNP.MakeEvent() ); - Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showVirtual.MakeEvent() ); - Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showBBoxes.MakeEvent() ); - Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showAxis.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleLayersManager,EDA_3D_ACTIONS::showLayersManager.MakeEvent() ); } diff --git a/3d-viewer/CMakeLists.txt b/3d-viewer/CMakeLists.txt index 2b42123a8e..5b6b556ad7 100644 --- a/3d-viewer/CMakeLists.txt +++ b/3d-viewer/CMakeLists.txt @@ -98,8 +98,6 @@ set(3D-VIEWER_SRCS dialogs/dialog_select_3d_model.cpp dialogs/panel_preview_3d_model_base.cpp dialogs/panel_preview_3d_model.cpp - dialogs/panel_3D_colors.cpp - dialogs/panel_3D_colors_base.cpp dialogs/panel_3D_display_options.cpp dialogs/panel_3D_display_options_base.cpp dialogs/panel_3D_opengl_options.cpp diff --git a/3d-viewer/dialogs/appearance_controls_3D.cpp b/3d-viewer/dialogs/appearance_controls_3D.cpp index 0435381dc1..a6f44520b2 100644 --- a/3d-viewer/dialogs/appearance_controls_3D.cpp +++ b/3d-viewer/dialogs/appearance_controls_3D.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -60,18 +61,18 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la RR( _HKI( "User.Eco1" ), LAYER_3D_USER_ECO1, _HKI( "Show user ECO1 layer" ) ), RR( _HKI( "User.Eco2" ), LAYER_3D_USER_ECO2, _HKI( "Show user ECO2 layer" ) ), RR(), - RR( _HKI( "Through-hole Models" ), LAYER_3D_TH_MODELS, _HKI( "Show models for 'Through hole' footprints" ) ), - RR( _HKI( "SMD Models" ), LAYER_3D_SMD_MODELS, _HKI( "Show models for 'SMD' footprints" ) ), - RR( _HKI( "Virtual Models" ), LAYER_3D_VIRTUAL_MODELS, _HKI( "Show models for 'Unspecified' footprints" ) ), - RR( _HKI( "Models not in POS File" ), LAYER_3D_MODELS_NOT_IN_POS, _HKI( "Show models even if not in POS file" ) ), - RR( _HKI( "Models marked DNP" ), LAYER_3D_MODELS_MARKED_DNP, _HKI( "Show models even if marked as DNP" ) ), - RR( _HKI( "Model Bounding Boxes" ), LAYER_3D_BOUNDING_BOXES, _HKI( "Show model bounding boxes in realtime renderer" ) ), + RR( _HKI( "Through-hole Models" ), LAYER_3D_TH_MODELS, EDA_3D_ACTIONS::showTHT ), + RR( _HKI( "SMD Models" ), LAYER_3D_SMD_MODELS, EDA_3D_ACTIONS::showSMD ), + RR( _HKI( "Virtual Models" ), LAYER_3D_VIRTUAL_MODELS, EDA_3D_ACTIONS::showVirtual ), + RR( _HKI( "Models not in POS File" ), LAYER_3D_MODELS_NOT_IN_POS, EDA_3D_ACTIONS::showNotInPosFile ), + RR( _HKI( "Models marked DNP" ), LAYER_3D_MODELS_MARKED_DNP, EDA_3D_ACTIONS::showDNP ), + RR( _HKI( "Model Bounding Boxes" ), LAYER_3D_BOUNDING_BOXES, EDA_3D_ACTIONS::showBBoxes ), RR(), RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ), RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ), RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ), RR(), - RR( _HKI( "3D Axis" ), LAYER_3D_AXES, _HKI( "Show 3D axes indicator" ) ), + RR( _HKI( "3D Axis" ), LAYER_3D_AXES, EDA_3D_ACTIONS::showAxis ), RR( _HKI( "Background Start" ), LAYER_3D_BACKGROUND_TOP, _HKI( "Background gradient start color" ) ), RR( _HKI( "Background End" ), LAYER_3D_BACKGROUND_BOTTOM, _HKI( "Background gradient end color" ) ), }; @@ -299,8 +300,12 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl case LAYER_FP_TEXT: // Because Footprint Text is a meta-control that also can disable values/references, // drag them along here so that the user is less likely to be confused. - visibleLayers.set( LAYER_FP_REFERENCES, isVisible ); - visibleLayers.set( LAYER_FP_VALUES, isVisible ); + if( !isVisible ) + { + visibleLayers.set( LAYER_FP_REFERENCES, false ); + visibleLayers.set( LAYER_FP_VALUES, false ); + } + visibleLayers.set( LAYER_FP_TEXT, isVisible ); killFollow = true; break; @@ -310,7 +315,7 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl // In case that user changes Footprint Value/References when the Footprint Text // meta-control is disabled, we should put it back on. if( isVisible ) - OnLayerVisibilityChanged( LAYER_FP_TEXT, isVisible ); + visibleLayers.set( LAYER_FP_TEXT, true ); visibleLayers.set( aLayer, isVisible ); killFollow = true; @@ -403,8 +408,7 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers() COLOR_SWATCH* swatch = new COLOR_SWATCH( m_windowLayers, colors[ layer ], layer, COLOR4D::WHITE, defaultColors[ layer ], SWATCH_SMALL ); - swatch->SetToolTip( _( "Left double click or middle click for color change, " - "right click for menu" ) ); + swatch->SetToolTip( _( "Left double click or middle click to change color" ) ); sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL, 0 ); aSetting->ctl_color = swatch; diff --git a/3d-viewer/dialogs/appearance_controls_3D.h b/3d-viewer/dialogs/appearance_controls_3D.h index 8c1e291569..3eb16134ad 100644 --- a/3d-viewer/dialogs/appearance_controls_3D.h +++ b/3d-viewer/dialogs/appearance_controls_3D.h @@ -27,6 +27,7 @@ #include #include <3d_canvas/board_adapter.h> #include +#include class BITMAP_TOGGLE; @@ -67,6 +68,17 @@ public: { } + APPEARANCE_SETTING_3D( const wxString& aLabel, int aId, const TOOL_ACTION& aAction ) : + id( aId ), + label( aLabel ), + tooltip( aAction.GetTooltip( true ) ), + visible( true ), + spacer( false ), + ctl_visibility( nullptr ), + ctl_color( nullptr ) + { + } + APPEARANCE_SETTING_3D() : id( -1 ), visible( false ), diff --git a/3d-viewer/dialogs/panel_3D_colors.cpp b/3d-viewer/dialogs/panel_3D_colors.cpp deleted file mode 100644 index 2dbd1448c8..0000000000 --- a/3d-viewer/dialogs/panel_3D_colors.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "panel_3D_colors.h" -#include -#include -#include - - -PANEL_3D_COLORS::PANEL_3D_COLORS( wxWindow* aParent ) : - PANEL_3D_COLORS_BASE( aParent ) -{ - m_backgroundTop->SetDefaultColor( BOARD_ADAPTER::g_DefaultBackgroundTop ); - m_backgroundBottom->SetDefaultColor( BOARD_ADAPTER::g_DefaultBackgroundBot ); - - m_silkscreenTop->SetUserColors( &BOARD_ADAPTER::g_SilkColors ); - m_silkscreenTop->SetDefaultColor( BOARD_ADAPTER::g_DefaultSilkscreen ); - m_silkscreenBottom->SetUserColors( &BOARD_ADAPTER::g_SilkColors ); - m_silkscreenBottom->SetDefaultColor( BOARD_ADAPTER::g_DefaultSilkscreen ); - - m_solderMaskTop->SetUserColors( &BOARD_ADAPTER::g_MaskColors ); - m_solderMaskTop->SetDefaultColor( BOARD_ADAPTER::g_DefaultSolderMask ); - m_solderMaskBottom->SetUserColors( &BOARD_ADAPTER::g_MaskColors ); - m_solderMaskBottom->SetDefaultColor( BOARD_ADAPTER::g_DefaultSolderMask ); - - m_solderPaste->SetUserColors( &BOARD_ADAPTER::g_PasteColors ); - m_solderPaste->SetDefaultColor( BOARD_ADAPTER::g_DefaultSolderPaste ); - - m_surfaceFinish->SetUserColors( &BOARD_ADAPTER::g_FinishColors ); - m_surfaceFinish->SetDefaultColor( BOARD_ADAPTER::g_DefaultSurfaceFinish ); - - m_boardBody->SetUserColors( &BOARD_ADAPTER::g_BoardColors ); - m_boardBody->SetDefaultColor( BOARD_ADAPTER::g_DefaultBoardBody ); -} - - -bool PANEL_3D_COLORS::TransferDataToWindow() -{ - COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - - m_backgroundTop->SetSupportsOpacity( false ); - m_backgroundBottom->SetSupportsOpacity( false ); - m_silkscreenTop->SetSupportsOpacity( false ); - m_silkscreenBottom->SetSupportsOpacity( false ); - m_solderMaskTop->SetBackgroundColour( *wxWHITE ); - m_solderMaskBottom->SetBackgroundColour( *wxWHITE ); - m_solderPaste->SetSupportsOpacity( false ); - m_surfaceFinish->SetSupportsOpacity( false ); - m_boardBody->SetBackgroundColour( *wxWHITE ); - - m_backgroundTop->SetSwatchColor( colors->GetColor( LAYER_3D_BACKGROUND_TOP ), false ); - m_backgroundBottom->SetSwatchColor( colors->GetColor( LAYER_3D_BACKGROUND_BOTTOM ), false ); - m_silkscreenTop->SetSwatchColor( colors->GetColor( LAYER_3D_SILKSCREEN_TOP ), false ); - m_silkscreenBottom->SetSwatchColor( colors->GetColor( LAYER_3D_SILKSCREEN_BOTTOM ), false ); - m_solderMaskTop->SetSwatchColor( colors->GetColor( LAYER_3D_SOLDERMASK_TOP ), false ); - m_solderMaskBottom->SetSwatchColor( colors->GetColor( LAYER_3D_SOLDERMASK_BOTTOM ), false ); - m_solderPaste->SetSwatchColor( colors->GetColor( LAYER_3D_SOLDERPASTE ), false ); - m_surfaceFinish->SetSwatchColor( colors->GetColor( LAYER_3D_COPPER_TOP ), false ); - m_boardBody->SetSwatchColor( colors->GetColor( LAYER_3D_BOARD ), false ); - - if( colors->GetUseBoardStackupColors() ) - m_boardStackupRB->SetValue( true ); - else - m_specificColorsRB->SetValue( true ); - - return true; -} - - -bool PANEL_3D_COLORS::TransferDataFromWindow() -{ - COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - - colors->SetColor( LAYER_3D_BACKGROUND_TOP, m_backgroundTop->GetSwatchColor() ); - colors->SetColor( LAYER_3D_BACKGROUND_BOTTOM, m_backgroundBottom->GetSwatchColor() ); - colors->SetColor( LAYER_3D_SILKSCREEN_TOP, m_silkscreenTop->GetSwatchColor() ); - colors->SetColor( LAYER_3D_SILKSCREEN_BOTTOM, m_silkscreenBottom->GetSwatchColor() ); - colors->SetColor( LAYER_3D_SOLDERMASK_TOP, m_solderMaskTop->GetSwatchColor() ); - colors->SetColor( LAYER_3D_SOLDERMASK_BOTTOM, m_solderMaskBottom->GetSwatchColor() ); - colors->SetColor( LAYER_3D_SOLDERPASTE, m_solderPaste->GetSwatchColor() ); - colors->SetColor( LAYER_3D_COPPER_TOP, m_surfaceFinish->GetSwatchColor() ); - colors->SetColor( LAYER_3D_COPPER_BOTTOM, m_surfaceFinish->GetSwatchColor() ); - colors->SetColor( LAYER_3D_BOARD, m_boardBody->GetSwatchColor() ); - - colors->SetUseBoardStackupColors( m_boardStackupRB->GetValue() ); - - Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" ); - - return true; -} - - -void PANEL_3D_COLORS::ResetPanel() -{ - COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - - m_backgroundTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BACKGROUND_TOP ), false ); - m_backgroundBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BACKGROUND_BOTTOM ), false ); - m_silkscreenTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SILKSCREEN_TOP ), false ); - m_silkscreenBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SILKSCREEN_BOTTOM ), false ); - m_solderMaskTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERMASK_TOP ), false ); - m_solderMaskBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERMASK_BOTTOM ), false ); - m_solderPaste->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERPASTE ), false ); - m_surfaceFinish->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_COPPER_TOP ), false ); - m_boardBody->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BOARD ), false ); - - m_boardStackupRB->SetValue( true ); -} \ No newline at end of file diff --git a/3d-viewer/dialogs/panel_3D_colors.h b/3d-viewer/dialogs/panel_3D_colors.h deleted file mode 100644 index 782dc601d1..0000000000 --- a/3d-viewer/dialogs/panel_3D_colors.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PANEL_3D_COLORS_H -#define PANEL_3D_COLORS_H - -#include "panel_3D_colors_base.h" -#include <3d_viewer/eda_3d_viewer_frame.h> - -class PANEL_3D_COLORS : public PANEL_3D_COLORS_BASE -{ -public: - explicit PANEL_3D_COLORS( wxWindow* aParent ); - - bool TransferDataFromWindow() override; - bool TransferDataToWindow() override; - - void ResetPanel() override; -}; - - -#endif // PANEL_3D_COLORS_H \ No newline at end of file diff --git a/3d-viewer/dialogs/panel_3D_colors_base.cpp b/3d-viewer/dialogs/panel_3D_colors_base.cpp deleted file mode 100644 index 1a16d6ac5b..0000000000 --- a/3d-viewer/dialogs/panel_3D_colors_base.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "widgets/color_swatch.h" - -#include "panel_3D_colors_base.h" - -/////////////////////////////////////////////////////////////////////////// - -PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name ) -{ - wxBoxSizer* bSizerMain; - bSizerMain = new wxBoxSizer( wxVERTICAL ); - - m_environmentLable = new wxStaticText( this, wxID_ANY, _("Environment Colors"), wxDefaultPosition, wxDefaultSize, 0 ); - m_environmentLable->Wrap( -1 ); - bSizerMain->Add( m_environmentLable, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 2, 5, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - backgroundTopLabel = new wxStaticText( this, wxID_ANY, _("Background gradient start:"), wxDefaultPosition, wxDefaultSize, 0 ); - backgroundTopLabel->Wrap( -1 ); - fgSizer1->Add( backgroundTopLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_backgroundTop = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_backgroundTop, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - backgroundBotLabel = new wxStaticText( this, wxID_ANY, _("Background gradient end:"), wxDefaultPosition, wxDefaultSize, 0 ); - backgroundBotLabel->Wrap( -1 ); - fgSizer1->Add( backgroundBotLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_backgroundBottom = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_backgroundBottom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - fgSizer1->Add( 0, 6, 1, wxEXPAND, 5 ); - - - fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - solderPasteLabel = new wxStaticText( this, wxID_ANY, _("Solder paste:"), wxDefaultPosition, wxDefaultSize, 0 ); - solderPasteLabel->Wrap( -1 ); - fgSizer1->Add( solderPasteLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_solderPaste = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_solderPaste, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerMain->Add( fgSizer1, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizerMain->Add( 0, 15, 0, wxEXPAND, 5 ); - - m_boardColorsLabel = new wxStaticText( this, wxID_ANY, _("Board Colors"), wxDefaultPosition, wxDefaultSize, 0 ); - m_boardColorsLabel->Wrap( -1 ); - bSizerMain->Add( m_boardColorsLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 ); - - m_boardStackupRB = new wxRadioButton( this, wxID_ANY, _("Use board stackup colors"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerMain->Add( m_boardStackupRB, 0, wxTOP|wxBOTTOM|wxLEFT, 8 ); - - m_specificColorsRB = new wxRadioButton( this, wxID_ANY, _("Use colors:"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerMain->Add( m_specificColorsRB, 0, wxTOP|wxBOTTOM|wxLEFT, 8 ); - - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 0, 2, 5, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - silkscreenTopLabel = new wxStaticText( this, wxID_ANY, _("Silkscreen top:"), wxDefaultPosition, wxDefaultSize, 0 ); - silkscreenTopLabel->Wrap( -1 ); - fgSizer2->Add( silkscreenTopLabel, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 20 ); - - m_silkscreenTop = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_silkscreenTop, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - silkscreenBottomLabel = new wxStaticText( this, wxID_ANY, _("Silkscreen bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); - silkscreenBottomLabel->Wrap( -1 ); - fgSizer2->Add( silkscreenBottomLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 ); - - m_silkscreenBottom = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_silkscreenBottom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - fgSizer2->Add( 0, 6, 1, wxEXPAND, 5 ); - - - fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 ); - - solderMaskTopLabel = new wxStaticText( this, wxID_ANY, _("Solder mask top:"), wxDefaultPosition, wxDefaultSize, 0 ); - solderMaskTopLabel->Wrap( -1 ); - fgSizer2->Add( solderMaskTopLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 ); - - m_solderMaskTop = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_solderMaskTop, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - solderMaskBottomLabel = new wxStaticText( this, wxID_ANY, _("Solder mask bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); - solderMaskBottomLabel->Wrap( -1 ); - fgSizer2->Add( solderMaskBottomLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 ); - - m_solderMaskBottom = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_solderMaskBottom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - fgSizer2->Add( 0, 6, 1, wxEXPAND, 5 ); - - - fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 ); - - surfaceFinishLabel = new wxStaticText( this, wxID_ANY, _("Copper/surface finish:"), wxDefaultPosition, wxDefaultSize, 0 ); - surfaceFinishLabel->Wrap( -1 ); - fgSizer2->Add( surfaceFinishLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 ); - - m_surfaceFinish = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_surfaceFinish, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - fgSizer2->Add( 0, 6, 1, wxEXPAND, 5 ); - - - fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 ); - - boardBodyLabel = new wxStaticText( this, wxID_ANY, _("Board body:"), wxDefaultPosition, wxDefaultSize, 0 ); - boardBodyLabel->Wrap( -1 ); - fgSizer2->Add( boardBodyLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 ); - - m_boardBody = new COLOR_SWATCH( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_boardBody, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bSizerMain->Add( fgSizer2, 1, wxEXPAND|wxLEFT, 8 ); - - - this->SetSizer( bSizerMain ); - this->Layout(); - bSizerMain->Fit( this ); -} - -PANEL_3D_COLORS_BASE::~PANEL_3D_COLORS_BASE() -{ -} diff --git a/3d-viewer/dialogs/panel_3D_colors_base.fbp b/3d-viewer/dialogs/panel_3D_colors_base.fbp deleted file mode 100644 index a2192d77ea..0000000000 --- a/3d-viewer/dialogs/panel_3D_colors_base.fbp +++ /dev/null @@ -1,1662 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - panel_3D_colors_base - 1000 - none - - - 1 - panel_3D_colors_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - 1 - 1 - impl_virtual - - - 0 - wxID_ANY - - - PANEL_3D_COLORS_BASE - - -1,-1 - RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare - - 0 - - - wxTAB_TRAVERSAL - - - bSizerMain - wxVERTICAL - none - - 13 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Environment Colors - 0 - - 0 - - - 0 - - 1 - m_environmentLable - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxTOP|wxBOTTOM|wxLEFT - 0 - - 2 - wxBOTH - - - 0 - -1,-1 - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 5 - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Background gradient start: - 0 - - 0 - - - 0 - - 1 - backgroundTopLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_backgroundTop - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Background gradient end: - 0 - - 0 - - - 0 - - 1 - backgroundBotLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_backgroundBottom - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 1 - - 6 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Solder paste: - 0 - - 0 - - - 0 - - 1 - solderPasteLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_solderPaste - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - - - 5 - wxEXPAND - 0 - - 15 - protected - 0 - - - - 13 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Board Colors - 0 - - 0 - - - 0 - - 1 - m_boardColorsLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 8 - wxTOP|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use board stackup colors - - 0 - - - 0 - - 1 - m_boardStackupRB - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 8 - wxTOP|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use colors: - - 0 - - - 0 - - 1 - m_specificColorsRB - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 8 - wxEXPAND|wxLEFT - 1 - - 2 - wxBOTH - - - 0 - -1,-1 - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 5 - - 20 - wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Silkscreen top: - 0 - - 0 - - - 0 - - 1 - silkscreenTopLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_silkscreenTop - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 20 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Silkscreen bottom: - 0 - - 0 - - - 0 - - 1 - silkscreenBottomLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_silkscreenBottom - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 1 - - 6 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 20 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Solder mask top: - 0 - - 0 - - - 0 - - 1 - solderMaskTopLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_solderMaskTop - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 20 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Solder mask bottom: - 0 - - 0 - - - 0 - - 1 - solderMaskBottomLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_solderMaskBottom - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 1 - - 6 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 20 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copper/surface finish: - 0 - - 0 - - - 0 - - 1 - surfaceFinishLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_surfaceFinish - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 1 - - 6 - protected - 0 - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 20 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Board body: - 0 - - 0 - - - 0 - - 1 - boardBodyLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_boardBody - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - - - - - diff --git a/3d-viewer/dialogs/panel_3D_colors_base.h b/3d-viewer/dialogs/panel_3D_colors_base.h deleted file mode 100644 index 5379736284..0000000000 --- a/3d-viewer/dialogs/panel_3D_colors_base.h +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include -#include -#include -class COLOR_SWATCH; - -#include "widgets/resettable_panel.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class PANEL_3D_COLORS_BASE -/////////////////////////////////////////////////////////////////////////////// -class PANEL_3D_COLORS_BASE : public RESETTABLE_PANEL -{ - private: - - protected: - wxStaticText* m_environmentLable; - wxStaticLine* m_staticline1; - wxStaticText* backgroundTopLabel; - COLOR_SWATCH* m_backgroundTop; - wxStaticText* backgroundBotLabel; - COLOR_SWATCH* m_backgroundBottom; - wxStaticText* solderPasteLabel; - COLOR_SWATCH* m_solderPaste; - wxStaticText* m_boardColorsLabel; - wxStaticLine* m_staticline2; - wxRadioButton* m_boardStackupRB; - wxRadioButton* m_specificColorsRB; - wxStaticText* silkscreenTopLabel; - COLOR_SWATCH* m_silkscreenTop; - wxStaticText* silkscreenBottomLabel; - COLOR_SWATCH* m_silkscreenBottom; - wxStaticText* solderMaskTopLabel; - COLOR_SWATCH* m_solderMaskTop; - wxStaticText* solderMaskBottomLabel; - COLOR_SWATCH* m_solderMaskBottom; - wxStaticText* surfaceFinishLabel; - COLOR_SWATCH* m_surfaceFinish; - wxStaticText* boardBodyLabel; - COLOR_SWATCH* m_boardBody; - - public: - - PANEL_3D_COLORS_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_3D_COLORS_BASE(); - -}; - diff --git a/3d-viewer/dialogs/panel_3D_display_options.cpp b/3d-viewer/dialogs/panel_3D_display_options.cpp index 0c71a7f5f1..17d4abaf89 100644 --- a/3d-viewer/dialogs/panel_3D_display_options.cpp +++ b/3d-viewer/dialogs/panel_3D_display_options.cpp @@ -45,33 +45,8 @@ void PANEL_3D_DISPLAY_OPTIONS::OnCheckEnableAnimation( wxCommandEvent& event ) void PANEL_3D_DISPLAY_OPTIONS::loadViewSettings( EDA_3D_VIEWER_SETTINGS* aCfg ) { // Check/uncheck checkboxes - m_checkBoxRealisticMode->SetValue( aCfg->m_Render.realistic ); - m_checkBoxBoardBody->SetValue( aCfg->m_Render.show_board_body ); m_checkBoxAreas->SetValue( aCfg->m_Render.show_zones ); - if( aCfg->m_Render.show_silkscreen_top == aCfg->m_Render.show_silkscreen_bottom ) - m_checkBoxSilkscreen->SetValue( aCfg->m_Render.show_silkscreen_top ); - else - m_checkBoxSilkscreen->Set3StateValue( wxCHK_UNDETERMINED ); - - if( aCfg->m_Render.show_soldermask_top == aCfg->m_Render.show_soldermask_bottom ) - m_checkBoxSolderMask->SetValue( aCfg->m_Render.show_soldermask_top ); - else - m_checkBoxSolderMask->Set3StateValue( wxCHK_UNDETERMINED ); - - m_checkBoxSolderpaste->SetValue( aCfg->m_Render.show_solderpaste ); - m_checkBoxAdhesive->SetValue( aCfg->m_Render.show_adhesive ); - - if( aCfg->m_Render.show_comments == aCfg->m_Render.show_drawings ) - m_checkBoxComments->SetValue( aCfg->m_Render.show_comments ); - else - m_checkBoxComments->Set3StateValue( wxCHK_UNDETERMINED ); - - if( aCfg->m_Render.show_eco1 == aCfg->m_Render.show_eco2 ) - m_checkBoxECO->SetValue( aCfg->m_Render.show_eco1 ); - else - m_checkBoxECO->Set3StateValue( wxCHK_UNDETERMINED ); - m_checkBoxSubtractMaskFromSilk->SetValue( aCfg->m_Render.subtract_mask_from_silk ); m_checkBoxClipSilkOnViaAnnulus->SetValue( aCfg->m_Render.clip_silk_on_via_annulus ); m_checkBoxRenderPlatedPadsAsPlated->SetValue( aCfg->m_Render.renderPlatedPadsAsPlated ); @@ -101,11 +76,7 @@ bool PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow() { EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings(); - // Set render mode - cfg->m_Render.realistic = m_checkBoxRealisticMode->GetValue(); - // Set visibility of items - cfg->m_Render.show_board_body = m_checkBoxBoardBody->GetValue(); cfg->m_Render.show_zones = m_checkBoxAreas->GetValue(); cfg->m_Render.subtract_mask_from_silk = m_checkBoxSubtractMaskFromSilk->GetValue(); cfg->m_Render.clip_silk_on_via_annulus = m_checkBoxClipSilkOnViaAnnulus->GetValue(); @@ -113,34 +84,6 @@ bool PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow() cfg->m_Render.material_mode = static_cast( m_materialProperties->GetSelection() ); - // Set Layer visibility - if( m_checkBoxSilkscreen->Get3StateValue() != wxCHK_UNDETERMINED ) - { - cfg->m_Render.show_silkscreen_top = m_checkBoxSilkscreen->GetValue(); - cfg->m_Render.show_silkscreen_bottom = m_checkBoxSilkscreen->GetValue(); - } - - if( m_checkBoxSolderMask->Get3StateValue() != wxCHK_UNDETERMINED ) - { - cfg->m_Render.show_soldermask_top = m_checkBoxSolderMask->GetValue(); - cfg->m_Render.show_soldermask_bottom = m_checkBoxSolderMask->GetValue(); - } - - cfg->m_Render.show_solderpaste = m_checkBoxSolderpaste->GetValue(); - cfg->m_Render.show_adhesive = m_checkBoxAdhesive->GetValue(); - - if( m_checkBoxComments->Get3StateValue() != wxCHK_UNDETERMINED ) - { - cfg->m_Render.show_comments = m_checkBoxComments->GetValue(); - cfg->m_Render.show_drawings = m_checkBoxComments->GetValue(); - } - - if( m_checkBoxECO->Get3StateValue() != wxCHK_UNDETERMINED ) - { - cfg->m_Render.show_eco1 = m_checkBoxECO->GetValue( ); - cfg->m_Render.show_eco2 = m_checkBoxECO->GetValue( ); - } - // Camera Options cfg->m_Camera.animation_enabled = m_checkBoxEnableAnimation->GetValue(); cfg->m_Camera.moving_speed_multiplier = m_sliderAnimationSpeed->GetValue(); diff --git a/3d-viewer/dialogs/panel_3D_display_options_base.cpp b/3d-viewer/dialogs/panel_3D_display_options_base.cpp index 97093b3685..36209b1e71 100644 --- a/3d-viewer/dialogs/panel_3D_display_options_base.cpp +++ b/3d-viewer/dialogs/panel_3D_display_options_base.cpp @@ -15,69 +15,11 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, bSizerMain = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bSizer7; - bSizer7 = new wxBoxSizer( wxHORIZONTAL ); + bSizer7 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizeLeft; bSizeLeft = new wxBoxSizer( wxVERTICAL ); - m_boardLayersLabel = new wxStaticText( this, wxID_ANY, _("Board Layers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_boardLayersLabel->Wrap( -1 ); - bSizeLeft->Add( m_boardLayersLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizeLeft->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 1, 4, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - fgSizer1->Add( m_checkBoxSilkscreen, 0, wxLEFT, 5 ); - - m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at solder mask edges"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxSubtractMaskFromSilk, 0, wxLEFT, 25 ); - - m_checkBoxClipSilkOnViaAnnulus = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at via annuli"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxLEFT, 25 ); - - m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - fgSizer1->Add( m_checkBoxSolderMask, 0, wxTOP|wxLEFT, 5 ); - - m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxSolderpaste, 0, wxLEFT, 5 ); - - m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxAdhesive, 0, wxLEFT, 5 ); - - - bSizeLeft->Add( fgSizer1, 0, wxEXPAND|wxALL, 5 ); - - - bSizeLeft->Add( 0, 15, 0, wxEXPAND, 5 ); - - m_userLayersLabel = new wxStaticText( this, wxID_ANY, _("User Layers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_userLayersLabel->Wrap( -1 ); - bSizeLeft->Add( m_userLayersLabel, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 ); - - m_staticline31 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizeLeft->Add( m_staticline31, 0, wxEXPAND|wxBOTTOM, 5 ); - - - bSizeLeft->Add( 0, 5, 0, wxEXPAND, 5 ); - - m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comment and drawing layers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - bSizeLeft->Add( m_checkBoxComments, 0, wxRIGHT|wxLEFT, 10 ); - - - bSizeLeft->Add( 0, 4, 0, wxEXPAND, 5 ); - - m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECO layers"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - bSizeLeft->Add( m_checkBoxECO, 0, wxRIGHT|wxLEFT, 10 ); - - - bSizeLeft->Add( 0, 15, 0, wxEXPAND, 5 ); - m_renderOptionsLabel = new wxStaticText( this, wxID_ANY, _("Render Options"), wxDefaultPosition, wxDefaultSize, 0 ); m_renderOptionsLabel->Wrap( -1 ); bSizeLeft->Add( m_renderOptionsLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); @@ -90,11 +32,11 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_checkBoxBoardBody = new wxCheckBox( this, wxID_ANY, _("Show board body"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_checkBoxBoardBody, 0, wxRIGHT|wxLEFT, 5 ); + m_checkBoxClipSilkOnViaAnnulus = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at via annuli"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxLEFT, 5 ); - m_checkBoxRealisticMode = new wxCheckBox( this, wxID_ANY, _("Realistic mode"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_checkBoxRealisticMode, 0, wxRIGHT|wxLEFT, 5 ); + m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at solder mask edges"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_checkBoxSubtractMaskFromSilk, 0, wxLEFT, 5 ); m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_checkBoxAreas, 0, wxRIGHT|wxLEFT, 5 ); @@ -180,7 +122,7 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, bSizerRight->Add( bSizerSlider, 0, wxEXPAND|wxLEFT, 5 ); - bSizer7->Add( bSizerRight, 0, wxEXPAND, 15 ); + bSizer7->Add( bSizerRight, 0, wxEXPAND|wxTOP, 15 ); bSizerMain->Add( bSizer7, 1, 0, 5 ); @@ -191,14 +133,12 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, bSizerMain->Fit( this ); // Connect Events - m_checkBoxRealisticMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_3D_DISPLAY_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this ); m_checkBoxEnableAnimation->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_3D_DISPLAY_OPTIONS_BASE::OnCheckEnableAnimation ), NULL, this ); } PANEL_3D_DISPLAY_OPTIONS_BASE::~PANEL_3D_DISPLAY_OPTIONS_BASE() { // Disconnect Events - m_checkBoxRealisticMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_3D_DISPLAY_OPTIONS_BASE::OnCheckRealisticMode ), NULL, this ); m_checkBoxEnableAnimation->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_3D_DISPLAY_OPTIONS_BASE::OnCheckEnableAnimation ), NULL, this ); } diff --git a/3d-viewer/dialogs/panel_3D_display_options_base.fbp b/3d-viewer/dialogs/panel_3D_display_options_base.fbp index c701d896e3..e5a5cbcc53 100644 --- a/3d-viewer/dialogs/panel_3D_display_options_base.fbp +++ b/3d-viewer/dialogs/panel_3D_display_options_base.fbp @@ -64,7 +64,7 @@ bSizer7 - wxHORIZONTAL + wxVERTICAL none 20 @@ -75,814 +75,6 @@ bSizeLeft wxVERTICAL none - - 13 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Board Layers - 0 - - 0 - - - 0 - - 1 - m_boardLayersLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 1 - wxBOTH - - - 0 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 4 - - 5 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show silkscreen layers - - 0 - - - 0 - - 1 - m_checkBoxSilkscreen - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 25 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Clip silkscreen at solder mask edges - - 0 - - - 0 - - 1 - m_checkBoxSubtractMaskFromSilk - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 25 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Clip silkscreen at via annuli - - 0 - - - 0 - - 1 - m_checkBoxClipSilkOnViaAnnulus - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxTOP|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show solder mask layers - - 0 - - - 0 - - 1 - m_checkBoxSolderMask - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show solder paste layers - - 0 - - - 0 - - 1 - m_checkBoxSolderpaste - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show adhesive layers - - 0 - - - 0 - - 1 - m_checkBoxAdhesive - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND - 0 - - 15 - protected - 0 - - - - 13 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - User Layers - 0 - - 0 - - - 0 - - 1 - m_userLayersLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline31 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND - 0 - - 5 - protected - 0 - - - - 10 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show comment and drawing layers - - 0 - - - 0 - - 1 - m_checkBoxComments - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 4 - protected - 0 - - - - 10 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show ECO layers - - 0 - - - 0 - - 1 - m_checkBoxECO - 1 - - - protected - 1 - - Resizable - 1 - - wxCHK_3STATE - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 0 - - 15 - protected - 0 - - 13 wxTOP|wxRIGHT|wxLEFT|wxEXPAND @@ -1020,7 +212,7 @@ 4 5 - wxRIGHT|wxLEFT + wxLEFT 0 1 @@ -1051,7 +243,7 @@ 0 0 wxID_ANY - Show board body + Clip silkscreen at via annuli 0 @@ -1059,7 +251,7 @@ 0 1 - m_checkBoxBoardBody + m_checkBoxClipSilkOnViaAnnulus 1 @@ -1084,7 +276,7 @@ 5 - wxRIGHT|wxLEFT + wxLEFT 0 1 @@ -1115,7 +307,7 @@ 0 0 wxID_ANY - Realistic mode + Clip silkscreen at solder mask edges 0 @@ -1123,7 +315,7 @@ 0 1 - m_checkBoxRealisticMode + m_checkBoxSubtractMaskFromSilk 1 @@ -1144,7 +336,6 @@ - OnCheckRealisticMode @@ -1417,7 +608,7 @@ 15 - wxEXPAND + wxEXPAND|wxTOP 0 diff --git a/3d-viewer/dialogs/panel_3D_display_options_base.h b/3d-viewer/dialogs/panel_3D_display_options_base.h index 217cd58109..85d6c64ddd 100644 --- a/3d-viewer/dialogs/panel_3D_display_options_base.h +++ b/3d-viewer/dialogs/panel_3D_display_options_base.h @@ -19,8 +19,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -36,22 +36,10 @@ class PANEL_3D_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL private: protected: - wxStaticText* m_boardLayersLabel; - wxStaticLine* m_staticline2; - wxCheckBox* m_checkBoxSilkscreen; - wxCheckBox* m_checkBoxSubtractMaskFromSilk; - wxCheckBox* m_checkBoxClipSilkOnViaAnnulus; - wxCheckBox* m_checkBoxSolderMask; - wxCheckBox* m_checkBoxSolderpaste; - wxCheckBox* m_checkBoxAdhesive; - wxStaticText* m_userLayersLabel; - wxStaticLine* m_staticline31; - wxCheckBox* m_checkBoxComments; - wxCheckBox* m_checkBoxECO; wxStaticText* m_renderOptionsLabel; wxStaticLine* m_staticline4; - wxCheckBox* m_checkBoxBoardBody; - wxCheckBox* m_checkBoxRealisticMode; + wxCheckBox* m_checkBoxClipSilkOnViaAnnulus; + wxCheckBox* m_checkBoxSubtractMaskFromSilk; wxCheckBox* m_checkBoxAreas; wxCheckBox* m_checkBoxRenderPlatedPadsAsPlated; wxStaticText* m_materialPropertiesLabel; @@ -66,7 +54,6 @@ class PANEL_3D_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL wxSlider* m_sliderAnimationSpeed; // Virtual event handlers, override them in your derived class - virtual void OnCheckRealisticMode( wxCommandEvent& event ) { event.Skip(); } virtual void OnCheckEnableAnimation( wxCommandEvent& event ) { event.Skip(); } diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index cd13d0f85b..0938da4a5e 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -237,7 +237,6 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings() cfg->m_Render.show_solderpaste = m_bodyStyleShowAll; cfg->m_Render.show_zones = m_bodyStyleShowAll; cfg->m_Render.show_board_body = m_bodyStyleShowAll; - cfg->m_Render.realistic = m_bodyStyleShowAll; } } @@ -404,7 +403,6 @@ void PANEL_PREVIEW_3D_MODEL::setBodyStyleView( wxCommandEvent& event ) cfg->m_Render.show_solderpaste = m_bodyStyleShowAll; cfg->m_Render.show_zones = m_bodyStyleShowAll; cfg->m_Render.show_board_body = m_bodyStyleShowAll; - cfg->m_Render.realistic = m_bodyStyleShowAll; m_previewPane->ReloadRequest(); m_previewPane->Refresh(); diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index e85e4dcf06..fd6438f0dd 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1162,7 +1162,6 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_DISPLAY_OPTIONS ), _( "General" ) ); book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_OPENGL ), _( "Realtime Renderer" ) ); book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_RAYTRACING ), _( "Raytracing Renderer" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_COLORS ), _( "Colors" ) ); } catch( ... ) { diff --git a/common/reporter.cpp b/common/reporter.cpp index 3e4d530923..2ffea4d10f 100644 --- a/common/reporter.cpp +++ b/common/reporter.cpp @@ -222,7 +222,7 @@ REPORTER& STATUSBAR_REPORTER::Report( const wxString& aText, SEVERITY aSeverity bool STATUSBAR_REPORTER::HasMessage() const { if( m_statusBar ) - return m_statusBar->GetStatusText().IsEmpty(); + return !m_statusBar->GetStatusText( m_position ).IsEmpty(); return false; } diff --git a/include/frame_type.h b/include/frame_type.h index a161289fcc..d3b0295d18 100644 --- a/include/frame_type.h +++ b/include/frame_type.h @@ -89,7 +89,6 @@ enum FRAME_T PANEL_3DV_DISPLAY_OPTIONS, PANEL_3DV_OPENGL, PANEL_3DV_RAYTRACING, - PANEL_3DV_COLORS, PANEL_GBR_DISPLAY_OPTIONS, PANEL_GBR_EDIT_OPTIONS, diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index ffcd35ec87..cb5eb249b6 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -703,6 +703,11 @@ void PCB_BASE_FRAME::ShowChangedLanguage() // tooltips in toolbars RecreateToolbars(); + + EDA_3D_VIEWER_FRAME* viewer3D = Get3DViewerFrame(); + + if( viewer3D ) + viewer3D->ShowChangedLanguage(); } diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index e47b6a9574..a6372fe376 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -57,7 +57,6 @@ #include #include #include -#include #include #include "invoke_pcb_dialog.h" @@ -236,9 +235,6 @@ static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER case PANEL_3DV_RAYTRACING: return new PANEL_3D_RAYTRACING_OPTIONS( aParent ); - case PANEL_3DV_COLORS: - return new PANEL_3D_COLORS( aParent ); - default: return nullptr; }