diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index c2f56702ba..0558e161ce 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -26,7 +26,7 @@ #include "board_adapter.h" #include #include -#include <3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.h> +#include <3d_rendering/raytracing/shapes2D/polygon_2d.h> #include #include #include <3d_math.h> @@ -81,7 +81,7 @@ BOARD_ADAPTER::BOARD_ADAPTER() : if( PgmOrNull() ) m_colors = Pgm().GetSettingsManager().GetColorSettings(); - m_renderEngine = RENDER_ENGINE::OPENGL_LEGACY; + m_renderEngine = RENDER_ENGINE::OPENGL; m_materialMode = MATERIAL_MODE::NORMAL; m_boardPos = wxPoint(); diff --git a/3d-viewer/3d_canvas/board_adapter.h b/3d-viewer/3d_canvas/board_adapter.h index 4bb18cee38..a29a8e4c29 100644 --- a/3d-viewer/3d_canvas/board_adapter.h +++ b/3d-viewer/3d_canvas/board_adapter.h @@ -27,9 +27,9 @@ #include #include -#include "../3d_rendering/3d_render_raytracing/accelerators/container_2d.h" -#include "../3d_rendering/3d_render_raytracing/accelerators/container_3d.h" -#include "../3d_rendering/3d_render_raytracing/shapes3D/bbox_3d.h" +#include "../3d_rendering/raytracing/accelerators/container_2d.h" +#include "../3d_rendering/raytracing/accelerators/container_3d.h" +#include "../3d_rendering/raytracing/shapes3D/bbox_3d.h" #include "../3d_rendering/camera.h" #include "../3d_enums.h" #include "../3d_cache/3d_cache.h" diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 4ddf4f4516..016eb3b734 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -30,10 +30,10 @@ * board_items_to_polygon_shape_transform.cpp */ -#include "../3d_rendering/3d_render_raytracing/shapes2D/ring_2d.h" -#include "../3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.h" -#include "../3d_rendering/3d_render_raytracing/shapes2D/round_segment_2d.h" -#include "../3d_rendering/3d_render_raytracing/shapes2D/triangle_2d.h" +#include "../3d_rendering/raytracing/shapes2D/ring_2d.h" +#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h" +#include "../3d_rendering/raytracing/shapes2D/round_segment_2d.h" +#include "../3d_rendering/raytracing/shapes2D/triangle_2d.h" #include #include #include diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 744a2af9b7..e2bfb3a858 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -32,9 +32,9 @@ */ #include "board_adapter.h" -#include "../3d_rendering/3d_render_raytracing/shapes2D/ring_2d.h" -#include "../3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.h" -#include "../3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.h" +#include "../3d_rendering/raytracing/shapes2D/ring_2d.h" +#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h" +#include "../3d_rendering/raytracing/shapes3D/cylinder_3d.h" #include #include @@ -205,8 +205,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) BVH_CONTAINER_2D *layerContainer = new BVH_CONTAINER_2D; m_layerMap[curr_layer_id] = layerContainer; - if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) && m_renderEngine == RENDER_ENGINE::OPENGL ) { SHAPE_POLY_SET* layerPoly = new SHAPE_POLY_SET; m_layers_poly[curr_layer_id] = layerPoly; @@ -419,8 +418,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } // Creates vertical outline contours of the tracks and add it to the poly of the layer - if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) && m_renderEngine == RENDER_ENGINE::OPENGL ) { for( PCB_LAYER_ID curr_layer_id : layer_id ) { @@ -560,8 +558,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } // Add footprints PADs poly contours (vertical outlines) - if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) && m_renderEngine == RENDER_ENGINE::OPENGL ) { for( PCB_LAYER_ID curr_layer_id : layer_id ) { @@ -641,8 +638,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } // Add graphic item on copper layers to poly contours (vertical outlines) - if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) && m_renderEngine == RENDER_ENGINE::OPENGL ) { for( PCB_LAYER_ID cur_layer_id : layer_id ) { @@ -729,7 +725,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) + && m_renderEngine == RENDER_ENGINE::OPENGL && layerPolyContainer != m_layers_poly.end() ) { auto mut_it = layer_lock.find( layer ); @@ -755,8 +751,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) if( aStatusReporter ) aStatusReporter->Report( _( "Simplifying copper layers polygons" ) ); - if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) - && ( m_renderEngine == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) && m_renderEngine == RENDER_ENGINE::OPENGL ) { if( GetFlag( FL_RENDER_PLATED_PADS_AS_PLATED ) && GetFlag( FL_USE_REALISTIC_MODE ) ) { diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index da11e45571..0db97f0514 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -29,8 +29,8 @@ #include "../common_ogl/ogl_utils.h" #include "eda_3d_canvas.h" #include -#include <3d_rendering/3d_render_raytracing/render_3d_raytrace.h> -#include <3d_rendering/legacy/render_3d_legacy.h> +#include <3d_rendering/raytracing/render_3d_raytrace.h> +#include <3d_rendering/opengl/render_3d_opengl.h> #include <3d_viewer_id.h> #include #include @@ -127,15 +127,15 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList, m_is_currently_painting.clear(); m_3d_render_raytracing = new RENDER_3D_RAYTRACE( this, m_boardAdapter, m_camera ); - m_3d_render_ogl_legacy = new RENDER_3D_LEGACY( this, m_boardAdapter, m_camera ); + m_3d_render_opengl = new RENDER_3D_OPENGL( this, m_boardAdapter, m_camera ); wxASSERT( m_3d_render_raytracing != nullptr ); - wxASSERT( m_3d_render_ogl_legacy != nullptr ); + wxASSERT( m_3d_render_opengl != nullptr ); auto busy_indicator_factory = []() { return std::make_unique(); }; m_3d_render_raytracing->SetBusyIndicatorFactory( busy_indicator_factory ); - m_3d_render_ogl_legacy->SetBusyIndicatorFactory( busy_indicator_factory ); + m_3d_render_opengl->SetBusyIndicatorFactory( busy_indicator_factory ); RenderEngineChanged(); @@ -185,8 +185,8 @@ void EDA_3D_CANVAS::releaseOpenGL() delete m_3d_render_raytracing; m_3d_render_raytracing = nullptr; - delete m_3d_render_ogl_legacy; - m_3d_render_ogl_legacy = nullptr; + delete m_3d_render_opengl; + m_3d_render_opengl = nullptr; // This is just a copy of a pointer, can safely be set to NULL. m_3d_render = nullptr; @@ -430,13 +430,13 @@ void EDA_3D_CANVAS::DoRePaint() // Don't attend to ray trace if OpenGL doesn't support it. if( !m_opengl_supports_raytracing ) { - m_3d_render = m_3d_render_ogl_legacy; + m_3d_render = m_3d_render_opengl; m_render_raytracing_was_requested = false; - m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY ); + m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL ); } // Check if a raytacing was requested and need to switch to raytracing mode - if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) { const bool was_camera_changed = m_camera.ParametersChanged(); @@ -447,7 +447,7 @@ void EDA_3D_CANVAS::DoRePaint() && m_render_raytracing_was_requested ) { m_render_raytracing_was_requested = false; - m_3d_render = m_3d_render_ogl_legacy; + m_3d_render = m_3d_render_opengl; } } @@ -485,8 +485,8 @@ void EDA_3D_CANVAS::DoRePaint() bool reloadRaytracingForIntersectionCalculations = false; - if( ( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) - && m_3d_render_ogl_legacy->IsReloadRequestPending() ) + if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL + && m_3d_render_opengl->IsReloadRequestPending() ) { reloadRaytracingForIntersectionCalculations = true; } @@ -692,8 +692,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) m_camera.SetCurMousePosition( nativePosition ); - if( !event.Dragging() && - ( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( !event.Dragging() && m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) { STATUSBAR_REPORTER reporter( m_parentStatusBar, static_cast( EDA_3D_VIEWER_STATUSBAR::HOVERED_ITEM ) ); @@ -706,7 +705,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) { if( rollOverItem != m_currentRollOverItem ) { - m_3d_render_ogl_legacy->SetCurrentRollOverItem( rollOverItem ); + m_3d_render_opengl->SetCurrentRollOverItem( rollOverItem ); m_currentRollOverItem = rollOverItem; Request_refresh(); @@ -771,10 +770,9 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) } else { - if( ( m_currentRollOverItem != nullptr ) && - ( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) ) + if( m_currentRollOverItem && m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) { - m_3d_render_ogl_legacy->SetCurrentRollOverItem( nullptr ); + m_3d_render_opengl->SetCurrentRollOverItem( nullptr ); Request_refresh(); reporter.Report( "" ); @@ -1108,9 +1106,9 @@ void EDA_3D_CANVAS::RenderEngineChanged() { switch( m_boardAdapter.GetRenderEngine() ) { - case RENDER_ENGINE::OPENGL_LEGACY: m_3d_render = m_3d_render_ogl_legacy; break; - case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break; - default: m_3d_render = nullptr; break; + case RENDER_ENGINE::OPENGL: m_3d_render = m_3d_render_opengl; break; + case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break; + default: m_3d_render = nullptr; break; } if( m_3d_render ) diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.h b/3d-viewer/3d_canvas/eda_3d_canvas.h index 99bf4e7421..b02b0b342c 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.h +++ b/3d-viewer/3d_canvas/eda_3d_canvas.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -27,7 +27,7 @@ #include #include "board_adapter.h" -#include "3d_rendering/3d_render_raytracing/accelerators/accelerator_3d.h" +#include "3d_rendering/raytracing/accelerators/accelerator_3d.h" #include "3d_rendering/render_3d_base.h" #include "3d_cache/3d_cache.h" #include @@ -39,7 +39,7 @@ class WX_INFOBAR; class wxStatusBar; class BOARD; class RENDER_3D_RAYTRACE; -class RENDER_3D_LEGACY; +class RENDER_3D_OPENGL; /** @@ -97,7 +97,7 @@ public: } /** - * @return the current render ( a RENDER_3D_RAYTRACE* or a RENDER_3D_LEGACY* render ) + * @return the current render ( a RENDER_3D_RAYTRACE* or a RENDER_3D_OPENGL* render ) */ RENDER_3D_BASE* GetCurrentRender() const { return m_3d_render; } @@ -267,7 +267,7 @@ private: CAMERA& m_camera; RENDER_3D_BASE* m_3d_render; RENDER_3D_RAYTRACE* m_3d_render_raytracing; - RENDER_3D_LEGACY* m_3d_render_ogl_legacy; + RENDER_3D_OPENGL* m_3d_render_opengl; static const float m_delta_move_step_factor; // Step factor to used with cursor on // relation to the current zoom diff --git a/3d-viewer/3d_enums.h b/3d-viewer/3d_enums.h index aaf9fe6a59..b535c72f53 100644 --- a/3d-viewer/3d_enums.h +++ b/3d-viewer/3d_enums.h @@ -109,7 +109,7 @@ enum class GRID3D_TYPE /// Render engine mode enum class RENDER_ENGINE { - OPENGL_LEGACY, + OPENGL, RAYTRACING, }; diff --git a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp index 9e8af5e2a3..3e5f3a69de 100644 --- a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp @@ -28,9 +28,9 @@ */ #include -#include "3d_rendering/legacy/3d_model.h" +#include "3d_rendering/opengl/3d_model.h" #include "eda_3d_model_viewer.h" -#include "../3d_rendering/legacy/ogl_legacy_utils.h" +#include "../3d_rendering/opengl/opengl_utils.h" #include "../3d_cache/3d_cache.h" #include #include diff --git a/3d-viewer/3d_rendering/camera.h b/3d-viewer/3d_rendering/camera.h index d213aa9006..eb2e745fdf 100644 --- a/3d-viewer/3d_rendering/camera.h +++ b/3d-viewer/3d_rendering/camera.h @@ -30,7 +30,7 @@ #ifndef CAMERA_H #define CAMERA_H -#include "../3d_rendering/3d_render_raytracing/ray.h" +#include "../3d_rendering/raytracing/ray.h" #include // for wxSize #include diff --git a/3d-viewer/3d_rendering/legacy/3d_model.cpp b/3d-viewer/3d_rendering/opengl/3d_model.cpp similarity index 99% rename from 3d-viewer/3d_rendering/legacy/3d_model.cpp rename to 3d-viewer/3d_rendering/opengl/3d_model.cpp index 9da8d1ddb2..c3604dacf0 100644 --- a/3d-viewer/3d_rendering/legacy/3d_model.cpp +++ b/3d-viewer/3d_rendering/opengl/3d_model.cpp @@ -31,7 +31,7 @@ #include // Must be included first #include "3d_model.h" -#include "ogl_legacy_utils.h" +#include "opengl_utils.h" #include "../common_ogl/ogl_utils.h" #include "../3d_math.h" #include diff --git a/3d-viewer/3d_rendering/legacy/3d_model.h b/3d-viewer/3d_rendering/opengl/3d_model.h similarity index 97% rename from 3d-viewer/3d_rendering/legacy/3d_model.h rename to 3d-viewer/3d_rendering/opengl/3d_model.h index 055a47a7db..baf93483d9 100644 --- a/3d-viewer/3d_rendering/legacy/3d_model.h +++ b/3d-viewer/3d_rendering/opengl/3d_model.h @@ -23,18 +23,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file 3d_model.h - * @brief Implement a legacy 3D model render. - */ - #ifndef _MODEL_3D_H_ #define _MODEL_3D_H_ #include #include #include "../../common_ogl/openGL_includes.h" -#include "../3d_render_raytracing/shapes3D/bbox_3d.h" +#include "../raytracing/shapes3D/bbox_3d.h" #include "../../3d_enums.h" #include diff --git a/3d-viewer/3d_rendering/legacy/create_scene.cpp b/3d-viewer/3d_rendering/opengl/create_scene.cpp similarity index 96% rename from 3d-viewer/3d_rendering/legacy/create_scene.cpp rename to 3d-viewer/3d_rendering/opengl/create_scene.cpp index db84b09175..30190e992d 100644 --- a/3d-viewer/3d_rendering/legacy/create_scene.cpp +++ b/3d-viewer/3d_rendering/opengl/create_scene.cpp @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "render_3d_legacy.h" -#include "ogl_legacy_utils.h" +#include "render_3d_opengl.h" +#include "opengl_utils.h" #include #include #include "../../3d_math.h" @@ -34,9 +34,9 @@ #include -void RENDER_3D_LEGACY::addObjectTriangles( const FILLED_CIRCLE_2D* aFilledCircle, - TRIANGLE_DISPLAY_LIST* aDstLayer, - float aZtop, float aZbot ) +void RENDER_3D_OPENGL::addObjectTriangles( const FILLED_CIRCLE_2D* aFilledCircle, + TRIANGLE_DISPLAY_LIST* aDstLayer, float aZtop, + float aZbot ) { const SFVEC2F& center = aFilledCircle->GetCenter(); const float radius = aFilledCircle->GetRadius() * 2.0f; // Double because the render triangle @@ -64,7 +64,7 @@ void RENDER_3D_LEGACY::addObjectTriangles( const FILLED_CIRCLE_2D* aFilledCircle } -void RENDER_3D_LEGACY::addObjectTriangles( const POLYGON_4PT_2D* aPoly, +void RENDER_3D_OPENGL::addObjectTriangles( const POLYGON_4PT_2D* aPoly, TRIANGLE_DISPLAY_LIST* aDstLayer, float aZtop, float aZbot ) { @@ -78,7 +78,7 @@ void RENDER_3D_LEGACY::addObjectTriangles( const POLYGON_4PT_2D* aPoly, } -void RENDER_3D_LEGACY::generateRing( const SFVEC2F& aCenter, float aInnerRadius, +void RENDER_3D_OPENGL::generateRing( const SFVEC2F& aCenter, float aInnerRadius, float aOuterRadius, unsigned int aNr_sides_per_circle, std::vector< SFVEC2F >& aInnerContourResult, std::vector< SFVEC2F >& aOuterContourResult, @@ -112,9 +112,8 @@ void RENDER_3D_LEGACY::generateRing( const SFVEC2F& aCenter, float aInnerRadius, } -void RENDER_3D_LEGACY::addObjectTriangles( const RING_2D* aRing, - TRIANGLE_DISPLAY_LIST* aDstLayer, - float aZtop, float aZbot ) +void RENDER_3D_OPENGL::addObjectTriangles( const RING_2D* aRing, TRIANGLE_DISPLAY_LIST* aDstLayer, + float aZtop, float aZbot ) { const SFVEC2F& center = aRing->GetCenter(); const float inner = aRing->GetInnerRadius(); @@ -147,7 +146,7 @@ void RENDER_3D_LEGACY::addObjectTriangles( const RING_2D* aRing, } -void RENDER_3D_LEGACY::addObjectTriangles( const TRIANGLE_2D* aTri, +void RENDER_3D_OPENGL::addObjectTriangles( const TRIANGLE_2D* aTri, TRIANGLE_DISPLAY_LIST* aDstLayer, float aZtop, float aZbot ) { @@ -159,7 +158,7 @@ void RENDER_3D_LEGACY::addObjectTriangles( const TRIANGLE_2D* aTri, } -void RENDER_3D_LEGACY::addObjectTriangles( const ROUND_SEGMENT_2D* aSeg, +void RENDER_3D_OPENGL::addObjectTriangles( const ROUND_SEGMENT_2D* aSeg, TRIANGLE_DISPLAY_LIST* aDstLayer, float aZtop, float aZbot ) { @@ -244,7 +243,7 @@ void RENDER_3D_LEGACY::addObjectTriangles( const ROUND_SEGMENT_2D* aSeg, } -OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateHoles( const LIST_OBJECT2D& aListHolesObject2d, +OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateHoles( const LIST_OBJECT2D& aListHolesObject2d, const SHAPE_POLY_SET& aPoly, float aZtop, float aZbot, bool aInvertFaces, const BVH_CONTAINER_2D* aThroughHoles ) @@ -277,7 +276,7 @@ OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateHoles( const LIST_OBJECT2D& aListH break; default: - wxFAIL_MSG( "RENDER_3D_LEGACY::generateHoles: Object type is not implemented" ); + wxFAIL_MSG( "RENDER_3D_OPENGL::generateHoles: Object type is not implemented" ); break; } } @@ -300,7 +299,7 @@ OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateHoles( const LIST_OBJECT2D& aListH } -OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateLayerList( const BVH_CONTAINER_2D* aContainer, +OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateLayerList( const BVH_CONTAINER_2D* aContainer, const SHAPE_POLY_SET* aPolyList, PCB_LAYER_ID aLayerId, const BVH_CONTAINER_2D* aThroughHoles ) @@ -359,7 +358,7 @@ OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateLayerList( const BVH_CONTAINER_2D* break; default: - wxFAIL_MSG( "RENDER_3D_LEGACY: Object type is not implemented" ); + wxFAIL_MSG( "RENDER_3D_OPENGL: Object type is not implemented" ); break; } } @@ -375,7 +374,7 @@ OPENGL_RENDER_LIST* RENDER_3D_LEGACY::generateLayerList( const BVH_CONTAINER_2D* } -OPENGL_RENDER_LIST* RENDER_3D_LEGACY::createBoard( const SHAPE_POLY_SET& aBoardPoly, +OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardPoly, const BVH_CONTAINER_2D* aThroughHoles ) { OPENGL_RENDER_LIST* dispLists = nullptr; @@ -431,7 +430,7 @@ OPENGL_RENDER_LIST* RENDER_3D_LEGACY::createBoard( const SHAPE_POLY_SET& aBoardP } -void RENDER_3D_LEGACY::reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter ) +void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningReporter ) { m_reloadRequested = false; @@ -662,9 +661,9 @@ void RENDER_3D_LEGACY::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo } -void RENDER_3D_LEGACY::addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, const SFVEC2F& v0, - const SFVEC2F& v1, const SFVEC2F& v2, - float top, float bot ) +void RENDER_3D_OPENGL::addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, const SFVEC2F& v0, + const SFVEC2F& v1, const SFVEC2F& v2, float top, + float bot ) { aDst->m_layer_bot_triangles->AddTriangle( SFVEC3F( v0.x, v0.y, bot ), SFVEC3F( v1.x, v1.y, bot ), @@ -676,8 +675,7 @@ void RENDER_3D_LEGACY::addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, co } -void RENDER_3D_LEGACY::getLayerZPos( PCB_LAYER_ID aLayerID, float& aOutZtop, - float& aOutZbot ) const +void RENDER_3D_OPENGL::getLayerZPos( PCB_LAYER_ID aLayerID, float& aOutZtop, float& aOutZbot ) const { aOutZbot = m_boardAdapter.GetLayerBottomZPos( aLayerID ); aOutZtop = m_boardAdapter.GetLayerTopZPos( aLayerID ); @@ -691,7 +689,7 @@ void RENDER_3D_LEGACY::getLayerZPos( PCB_LAYER_ID aLayerID, float& aOutZtop, } -void RENDER_3D_LEGACY::generateCylinder( const SFVEC2F& aCenter, float aInnerRadius, +void RENDER_3D_OPENGL::generateCylinder( const SFVEC2F& aCenter, float aInnerRadius, float aOuterRadius, float aZtop, float aZbot, unsigned int aNr_sides_per_circle, TRIANGLE_DISPLAY_LIST* aDstLayer ) @@ -725,7 +723,7 @@ void RENDER_3D_LEGACY::generateCylinder( const SFVEC2F& aCenter, float aInnerRad } -void RENDER_3D_LEGACY::generateViasAndPads() +void RENDER_3D_OPENGL::generateViasAndPads() { if( !m_boardAdapter.GetBoard() ) return; @@ -869,7 +867,7 @@ void RENDER_3D_LEGACY::generateViasAndPads() } -void RENDER_3D_LEGACY::Load3dModelsIfNeeded() +void RENDER_3D_OPENGL::Load3dModelsIfNeeded() { if( m_3dModelMap.size() > 0 ) return; @@ -887,7 +885,7 @@ void RENDER_3D_LEGACY::Load3dModelsIfNeeded() } -void RENDER_3D_LEGACY::load3dModels( REPORTER* aStatusReporter ) +void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter ) { if( !m_boardAdapter.GetBoard() ) return; diff --git a/3d-viewer/3d_rendering/legacy/layer_triangles.cpp b/3d-viewer/3d_rendering/opengl/layer_triangles.cpp similarity index 99% rename from 3d-viewer/3d_rendering/legacy/layer_triangles.cpp rename to 3d-viewer/3d_rendering/opengl/layer_triangles.cpp index 2c0751ed2d..4d47f2ca98 100644 --- a/3d-viewer/3d_rendering/legacy/layer_triangles.cpp +++ b/3d-viewer/3d_rendering/opengl/layer_triangles.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,13 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file clayer_triangles.cpp - */ - - #include "layer_triangles.h" -#include "../3d_render_raytracing/ray.h" +#include "../raytracing/ray.h" #include // For the wxASSERT #include diff --git a/3d-viewer/3d_rendering/legacy/layer_triangles.h b/3d-viewer/3d_rendering/opengl/layer_triangles.h similarity index 96% rename from 3d-viewer/3d_rendering/legacy/layer_triangles.h rename to 3d-viewer/3d_rendering/opengl/layer_triangles.h index 836a96956c..93ade70970 100644 --- a/3d-viewer/3d_rendering/legacy/layer_triangles.h +++ b/3d-viewer/3d_rendering/opengl/layer_triangles.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,18 +22,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file layer_triangles.h - */ - -#ifndef TRIANGLE_DISPLAY_LIST_H_ -#define TRIANGLE_DISPLAY_LIST_H_ +#ifndef TRIANGLE_DISPLAY_LIST_H +#define TRIANGLE_DISPLAY_LIST_H #include "../../common_ogl/openGL_includes.h" #include #include #include -#include <3d_render_raytracing/accelerators/container_2d.h> +#include #include #include @@ -245,4 +241,4 @@ private: bool m_draw_it_transparent; }; -#endif // TRIANGLE_DISPLAY_LIST_H_ +#endif // TRIANGLE_DISPLAY_LIST_H diff --git a/3d-viewer/3d_rendering/legacy/ogl_legacy_utils.cpp b/3d-viewer/3d_rendering/opengl/opengl_utils.cpp similarity index 98% rename from 3d-viewer/3d_rendering/legacy/ogl_legacy_utils.cpp rename to 3d-viewer/3d_rendering/opengl/opengl_utils.cpp index 94141b4cd5..f8930e3b0b 100644 --- a/3d-viewer/3d_rendering/legacy/ogl_legacy_utils.cpp +++ b/3d-viewer/3d_rendering/opengl/opengl_utils.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,14 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file ogl_legacy_utils.cpp - * @brief - */ - - #include "../../common_ogl/openGL_includes.h" -#include "ogl_legacy_utils.h" +#include "opengl_utils.h" #include #include // For the wxASSERT diff --git a/3d-viewer/3d_rendering/legacy/ogl_legacy_utils.h b/3d-viewer/3d_rendering/opengl/opengl_utils.h similarity index 86% rename from 3d-viewer/3d_rendering/legacy/ogl_legacy_utils.h rename to 3d-viewer/3d_rendering/opengl/opengl_utils.h index 72bdcef931..c260896bef 100644 --- a/3d-viewer/3d_rendering/legacy/ogl_legacy_utils.h +++ b/3d-viewer/3d_rendering/opengl/opengl_utils.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,16 +22,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file ogl_legacy_utils.h - * @brief - */ +#ifndef OPENGL_UTILS_H +#define OPENGL_UTILS_H -#ifndef OGL_LEGACY_UTILS_H_ -#define OGL_LEGACY_UTILS_H_ - -#include "../3d_render_raytracing/shapes3D/bbox_3d.h" -#include "../3d_render_raytracing/shapes2D/round_segment_2d.h" +#include "../raytracing/shapes3D/bbox_3d.h" +#include "../raytracing/shapes2D/round_segment_2d.h" /** * Draw a round arrow. @@ -70,4 +65,4 @@ void DrawHalfOpenCylinder( unsigned int aNrSidesPerCircle ); */ void DrawSegment( const ROUND_SEGMENT_2D& aSegment, unsigned int aNrSidesPerCircle ); -#endif // OGL_LEGACY_UTILS_H_ +#endif // OPENGL_UTILS_H diff --git a/3d-viewer/3d_rendering/legacy/render_3d_legacy.cpp b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp similarity index 96% rename from 3d-viewer/3d_rendering/legacy/render_3d_legacy.cpp rename to 3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp index 5da3c27b45..73e50af625 100644 --- a/3d-viewer/3d_rendering/legacy/render_3d_legacy.cpp +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.cpp @@ -24,8 +24,8 @@ #include // Must be included first -#include "render_3d_legacy.h" -#include "ogl_legacy_utils.h" +#include "render_3d_opengl.h" +#include "opengl_utils.h" #include "common_ogl/ogl_utils.h" #include #include <3d_math.h> @@ -39,10 +39,11 @@ */ #define UNITS3D_TO_UNITSPCB (IU_PER_MM) -RENDER_3D_LEGACY::RENDER_3D_LEGACY( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) : +RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, + CAMERA& aCamera ) : RENDER_3D_BASE( aCanvas, aAdapter, aCamera ) { - wxLogTrace( m_logTrace, wxT( "RENDER_3D_LEGACY::RENDER_3D_LEGACY" ) ); + wxLogTrace( m_logTrace, wxT( "RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) ); m_layers.clear(); m_outerLayerHoles.clear(); @@ -70,9 +71,9 @@ RENDER_3D_LEGACY::RENDER_3D_LEGACY( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdap } -RENDER_3D_LEGACY::~RENDER_3D_LEGACY() +RENDER_3D_OPENGL::~RENDER_3D_OPENGL() { - wxLogTrace( m_logTrace, wxT( "RENDER_3D_LEGACY::~RENDER_3D_LEGACY" ) ); + wxLogTrace( m_logTrace, wxT( "RENDER_3D_OPENGL::RENDER_3D_OPENGL" ) ); freeAllLists(); @@ -80,13 +81,13 @@ RENDER_3D_LEGACY::~RENDER_3D_LEGACY() } -int RENDER_3D_LEGACY::GetWaitForEditingTimeOut() +int RENDER_3D_OPENGL::GetWaitForEditingTimeOut() { return 50; // ms } -void RENDER_3D_LEGACY::SetCurWindowSize( const wxSize& aSize ) +void RENDER_3D_OPENGL::SetCurWindowSize( const wxSize& aSize ) { if( m_windowSize != aSize ) { @@ -98,7 +99,7 @@ void RENDER_3D_LEGACY::SetCurWindowSize( const wxSize& aSize ) } -void RENDER_3D_LEGACY::setLightFront( bool enabled ) +void RENDER_3D_OPENGL::setLightFront( bool enabled ) { if( enabled ) glEnable( GL_LIGHT0 ); @@ -107,7 +108,7 @@ void RENDER_3D_LEGACY::setLightFront( bool enabled ) } -void RENDER_3D_LEGACY::setLightTop( bool enabled ) +void RENDER_3D_OPENGL::setLightTop( bool enabled ) { if( enabled ) glEnable( GL_LIGHT1 ); @@ -116,7 +117,7 @@ void RENDER_3D_LEGACY::setLightTop( bool enabled ) } -void RENDER_3D_LEGACY::setLightBottom( bool enabled ) +void RENDER_3D_OPENGL::setLightBottom( bool enabled ) { if( enabled ) glEnable( GL_LIGHT2 ); @@ -125,7 +126,7 @@ void RENDER_3D_LEGACY::setLightBottom( bool enabled ) } -void RENDER_3D_LEGACY::render3dArrows() +void RENDER_3D_OPENGL::render3dArrows() { const float arrow_size = RANGE_SCALE_3D * 0.30f; @@ -164,7 +165,7 @@ void RENDER_3D_LEGACY::render3dArrows() } -void RENDER_3D_LEGACY::setupMaterials() +void RENDER_3D_OPENGL::setupMaterials() { m_materials = {}; @@ -313,7 +314,7 @@ void RENDER_3D_LEGACY::setupMaterials() } -void RENDER_3D_LEGACY::setLayerMaterial( PCB_LAYER_ID aLayerID ) +void RENDER_3D_OPENGL::setLayerMaterial( PCB_LAYER_ID aLayerID ) { switch( aLayerID ) { @@ -390,7 +391,7 @@ void RENDER_3D_LEGACY::setLayerMaterial( PCB_LAYER_ID aLayerID ) } -SFVEC4F RENDER_3D_LEGACY::getLayerColor( PCB_LAYER_ID aLayerID ) +SFVEC4F RENDER_3D_OPENGL::getLayerColor( PCB_LAYER_ID aLayerID ) { SFVEC4F layerColor = m_boardAdapter.GetLayerColor( aLayerID ); @@ -494,13 +495,13 @@ void init_lights( void ) } -void RENDER_3D_LEGACY::setCopperMaterial() +void RENDER_3D_OPENGL::setCopperMaterial() { OglSetMaterial( m_materials.m_NonPlatedCopper, 1.0f ); } -void RENDER_3D_LEGACY::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id ) +void RENDER_3D_OPENGL::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id ) { glEnable( GL_POLYGON_OFFSET_FILL ); glPolygonOffset(-0.1f, -2.0f ); @@ -508,13 +509,13 @@ void RENDER_3D_LEGACY::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id ) } -void RENDER_3D_LEGACY::unsetDepthOffset() +void RENDER_3D_OPENGL::unsetDepthOffset() { glDisable( GL_POLYGON_OFFSET_FILL ); } -void RENDER_3D_LEGACY::renderBoardBody( bool aSkipRenderHoles ) +void RENDER_3D_OPENGL::renderBoardBody( bool aSkipRenderHoles ) { m_materials.m_EpoxyBoard.m_Diffuse = m_boardAdapter.m_BoardBodyColor; @@ -542,7 +543,7 @@ void RENDER_3D_LEGACY::renderBoardBody( bool aSkipRenderHoles ) } -bool RENDER_3D_LEGACY::Redraw( bool aIsMoving, REPORTER* aStatusReporter, +bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) { // Initialize OpenGL @@ -973,7 +974,7 @@ bool RENDER_3D_LEGACY::Redraw( bool aIsMoving, REPORTER* aStatusReporter, } -bool RENDER_3D_LEGACY::initializeOpenGL() +bool RENDER_3D_OPENGL::initializeOpenGL() { glEnable( GL_LINE_SMOOTH ); glShadeModel( GL_SMOOTH ); @@ -1016,7 +1017,7 @@ bool RENDER_3D_LEGACY::initializeOpenGL() } -void RENDER_3D_LEGACY::setArrowMaterial() +void RENDER_3D_OPENGL::setArrowMaterial() { glEnable( GL_COLOR_MATERIAL ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); @@ -1035,7 +1036,7 @@ void RENDER_3D_LEGACY::setArrowMaterial() } -void RENDER_3D_LEGACY::freeAllLists() +void RENDER_3D_OPENGL::freeAllLists() { if( glIsList( m_grid ) ) glDeleteLists( m_grid, 1 ); @@ -1117,7 +1118,7 @@ void RENDER_3D_LEGACY::freeAllLists() } -void RENDER_3D_LEGACY::renderSolderMaskLayer( PCB_LAYER_ID aLayerID, float aZPosition, +void RENDER_3D_OPENGL::renderSolderMaskLayer( PCB_LAYER_ID aLayerID, float aZPosition, bool aDrawMiddleSegments, bool aSkipRenderHoles ) { wxASSERT( (aLayerID == B_Mask) || (aLayerID == F_Mask) ); @@ -1175,7 +1176,7 @@ void RENDER_3D_LEGACY::renderSolderMaskLayer( PCB_LAYER_ID aLayerID, float aZPos } -void RENDER_3D_LEGACY::render3dModelsSelected( bool aRenderTopOrBot, bool aRenderTransparentOnly, +void RENDER_3D_OPENGL::render3dModelsSelected( bool aRenderTopOrBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly ) { if( !m_boardAdapter.GetBoard() ) @@ -1214,7 +1215,7 @@ void RENDER_3D_LEGACY::render3dModelsSelected( bool aRenderTopOrBot, bool aRende } -void RENDER_3D_LEGACY::render3dModels( bool aRenderTopOrBot, bool aRenderTransparentOnly ) +void RENDER_3D_OPENGL::render3dModels( bool aRenderTopOrBot, bool aRenderTransparentOnly ) { if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) ) render3dModelsSelected( aRenderTopOrBot, aRenderTransparentOnly, true ); @@ -1223,7 +1224,7 @@ void RENDER_3D_LEGACY::render3dModels( bool aRenderTopOrBot, bool aRenderTranspa } -void RENDER_3D_LEGACY::renderFootprint( const FOOTPRINT* aFootprint, bool aRenderTransparentOnly, +void RENDER_3D_OPENGL::renderFootprint( const FOOTPRINT* aFootprint, bool aRenderTransparentOnly, bool aIsSelected ) { if( !aFootprint->Models().empty() ) @@ -1324,7 +1325,7 @@ void RENDER_3D_LEGACY::renderFootprint( const FOOTPRINT* aFootprint, bool aRende } -void RENDER_3D_LEGACY::generate3dGrid( GRID3D_TYPE aGridType ) +void RENDER_3D_OPENGL::generate3dGrid( GRID3D_TYPE aGridType ) { if( glIsList( m_grid ) ) glDeleteLists( m_grid, 1 ); diff --git a/3d-viewer/3d_rendering/legacy/render_3d_legacy.h b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h similarity index 91% rename from 3d-viewer/3d_rendering/legacy/render_3d_legacy.h rename to 3d-viewer/3d_rendering/opengl/render_3d_opengl.h index 53b6fbb935..183eebbeef 100644 --- a/3d-viewer/3d_rendering/legacy/render_3d_legacy.h +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,22 +22,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file render_3d_legacy.h - */ - -#ifndef RENDER_3D_LEGACY_H_ -#define RENDER_3D_LEGACY_H_ +#ifndef RENDER_3D_OPENGL_H +#define RENDER_3D_OPENGL_H #include "../render_3d_base.h" #include "layer_triangles.h" -#include "../3d_render_raytracing/shapes2D/polygon_2d.h" -#include "../3d_render_raytracing/shapes2D/triangle_2d.h" -#include "../3d_render_raytracing/shapes2D/4pt_polygon_2d.h" -#include "../3d_render_raytracing/shapes2D/filled_circle_2d.h" -#include "../3d_render_raytracing/shapes2D/ring_2d.h" -#include "../3d_render_raytracing/shapes2D/round_segment_2d.h" +#include "../raytracing/shapes2D/polygon_2d.h" +#include "../raytracing/shapes2D/triangle_2d.h" +#include "../raytracing/shapes2D/4pt_polygon_2d.h" +#include "../raytracing/shapes2D/filled_circle_2d.h" +#include "../raytracing/shapes2D/ring_2d.h" +#include "../raytracing/shapes2D/round_segment_2d.h" #include "3d_model.h" @@ -53,14 +49,14 @@ typedef std::map< wxString, MODEL_3D* > MAP_3DMODEL; #define SIZE_OF_CIRCLE_TEXTURE 1024 /** - * Object to render the board using openGL legacy mode. + * Object to render the board using openGL. */ -class RENDER_3D_LEGACY : public RENDER_3D_BASE +class RENDER_3D_OPENGL : public RENDER_3D_BASE { public: - explicit RENDER_3D_LEGACY( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ); + explicit RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ); - ~RENDER_3D_LEGACY(); + ~RENDER_3D_OPENGL(); void SetCurWindowSize( const wxSize& aSize ) override; bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override; @@ -220,4 +216,4 @@ private: ///< outline. }; -#endif // RENDER_3D_LEGACY_H_ +#endif // RENDER_3D_OPENGL_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.cpp b/3d-viewer/3d_rendering/raytracing/PerlinNoise.cpp similarity index 98% rename from 3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.cpp rename to 3d-viewer/3d_rendering/raytracing/PerlinNoise.cpp index d10fbc1696..aa7fd85ba2 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.cpp +++ b/3d-viewer/3d_rendering/raytracing/PerlinNoise.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016 Mario Luzeiro - * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-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 @@ -40,8 +40,6 @@ #include "PerlinNoise.h" #include -#include -#include #include #include #include diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.h b/3d-viewer/3d_rendering/raytracing/PerlinNoise.h similarity index 97% rename from 3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.h rename to 3d-viewer/3d_rendering/raytracing/PerlinNoise.h index 614e587379..132c9e3e2c 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/PerlinNoise.h +++ b/3d-viewer/3d_rendering/raytracing/PerlinNoise.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016 Mario Luzeiro - * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-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 diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/accelerator_3d.cpp b/3d-viewer/3d_rendering/raytracing/accelerators/accelerator_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/accelerator_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/accelerators/accelerator_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/accelerator_3d.h b/3d-viewer/3d_rendering/raytracing/accelerators/accelerator_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/accelerator_3d.h rename to 3d-viewer/3d_rendering/raytracing/accelerators/accelerator_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_packet_traversal.cpp b/3d-viewer/3d_rendering/raytracing/accelerators/bvh_packet_traversal.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_packet_traversal.cpp rename to 3d-viewer/3d_rendering/raytracing/accelerators/bvh_packet_traversal.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_pbrt.cpp b/3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_pbrt.cpp rename to 3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_pbrt.h b/3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/bvh_pbrt.h rename to 3d-viewer/3d_rendering/raytracing/accelerators/bvh_pbrt.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_2d.cpp b/3d-viewer/3d_rendering/raytracing/accelerators/container_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/accelerators/container_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_2d.h b/3d-viewer/3d_rendering/raytracing/accelerators/container_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_2d.h rename to 3d-viewer/3d_rendering/raytracing/accelerators/container_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_3d.cpp b/3d-viewer/3d_rendering/raytracing/accelerators/container_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/accelerators/container_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_3d.h b/3d-viewer/3d_rendering/raytracing/accelerators/container_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/container_3d.h rename to 3d-viewer/3d_rendering/raytracing/accelerators/container_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/create_scene.cpp rename to 3d-viewer/3d_rendering/raytracing/create_scene.cpp index 9d82465046..29c610827e 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,11 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file 3d-viewer/3d_rendering/3d_render_raytracing/create_scene.cpp - */ - - #include "render_3d_raytrace.h" #include "shapes3D/plane_3d.h" #include "shapes3D/round_segment_3d.h" diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/frustum.cpp b/3d-viewer/3d_rendering/raytracing/frustum.cpp similarity index 97% rename from 3d-viewer/3d_rendering/3d_render_raytracing/frustum.cpp rename to 3d-viewer/3d_rendering/raytracing/frustum.cpp index 099c49e298..03d5d6f7bc 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/frustum.cpp +++ b/3d-viewer/3d_rendering/raytracing/frustum.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2017 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,10 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file frustum.cpp - */ - #include "frustum.h" diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/frustum.h b/3d-viewer/3d_rendering/raytracing/frustum.h similarity index 96% rename from 3d-viewer/3d_rendering/3d_render_raytracing/frustum.h rename to 3d-viewer/3d_rendering/raytracing/frustum.h index 9850160194..cd73f9c701 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/frustum.h +++ b/3d-viewer/3d_rendering/raytracing/frustum.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/hitinfo.h b/3d-viewer/3d_rendering/raytracing/hitinfo.h similarity index 95% rename from 3d-viewer/3d_rendering/3d_render_raytracing/hitinfo.h rename to 3d-viewer/3d_rendering/raytracing/hitinfo.h index e5f865c790..177cf86f73 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/hitinfo.h +++ b/3d-viewer/3d_rendering/raytracing/hitinfo.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,11 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file hitinfo.h - * @brief - */ - #ifndef _HITINFO_H_ #define _HITINFO_H_ diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/light.h b/3d-viewer/3d_rendering/raytracing/light.h similarity index 97% rename from 3d-viewer/3d_rendering/3d_render_raytracing/light.h rename to 3d-viewer/3d_rendering/raytracing/light.h index ae78b15b80..3a10605370 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/light.h +++ b/3d-viewer/3d_rendering/raytracing/light.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -27,8 +27,8 @@ * @brief Declare and implement light sources. */ -#ifndef _LIGHT_H_ -#define _LIGHT_H_ +#ifndef LIGHT_H +#define LIGHT_H #include "ray.h" #include "hitinfo.h" @@ -145,4 +145,4 @@ private: }; -#endif // _LIGHT_H_ +#endif // LIGHT_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/material.cpp b/3d-viewer/3d_rendering/raytracing/material.cpp similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/material.cpp rename to 3d-viewer/3d_rendering/raytracing/material.cpp index fea7a613ad..677d1a5e56 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/material.cpp +++ b/3d-viewer/3d_rendering/raytracing/material.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2020 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,10 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file material.cpp - */ - #include "material.h" #include <3d_math.h> #include diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/material.h b/3d-viewer/3d_rendering/raytracing/material.h similarity index 98% rename from 3d-viewer/3d_rendering/3d_render_raytracing/material.h rename to 3d-viewer/3d_rendering/raytracing/material.h index c7b19482c2..046fdce354 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/material.h +++ b/3d-viewer/3d_rendering/raytracing/material.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,12 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file material.h - */ - -#ifndef _MATERIAL_H_ -#define _MATERIAL_H_ +#ifndef MATERIAL_H +#define MATERIAL_H #include "ray.h" #include "hitinfo.h" @@ -395,4 +391,4 @@ public: const SFVEC3F& aLightColor, float aShadowAttenuationFactor ) const override; }; -#endif // _MATERIAL_H_ +#endif // MATERIAL_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.cpp b/3d-viewer/3d_rendering/raytracing/mortoncodes.cpp similarity index 98% rename from 3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.cpp rename to 3d-viewer/3d_rendering/raytracing/mortoncodes.cpp index c3d2fdd419..99e97d9f4f 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.cpp +++ b/3d-viewer/3d_rendering/raytracing/mortoncodes.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h b/3d-viewer/3d_rendering/raytracing/mortoncodes.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h rename to 3d-viewer/3d_rendering/raytracing/mortoncodes.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp b/3d-viewer/3d_rendering/raytracing/ray.cpp similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp rename to 3d-viewer/3d_rendering/raytracing/ray.cpp index 2f673fbf7a..4a6de55f10 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp +++ b/3d-viewer/3d_rendering/raytracing/ray.cpp @@ -22,12 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file ray.cpp - * @brief - */ - - #include "ray.h" #include "../../3d_fastmath.h" #include diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/ray.h b/3d-viewer/3d_rendering/raytracing/ray.h similarity index 96% rename from 3d-viewer/3d_rendering/3d_render_raytracing/ray.h rename to 3d-viewer/3d_rendering/raytracing/ray.h index 5ff48fccf5..ab6a5a45e8 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/ray.h +++ b/3d-viewer/3d_rendering/raytracing/ray.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2017 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,13 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file ray.h - * @brief - */ - -#ifndef _RAY_H_ -#define _RAY_H_ +#ifndef RAY_H +#define RAY_H #include @@ -165,4 +160,4 @@ struct RAY4 #endif -#endif // _RAY_H_ +#endif // RAY_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/raypacket.cpp b/3d-viewer/3d_rendering/raytracing/raypacket.cpp similarity index 98% rename from 3d-viewer/3d_rendering/3d_render_raytracing/raypacket.cpp rename to 3d-viewer/3d_rendering/raytracing/raypacket.cpp index dc27f7345e..0e98f466c8 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/raypacket.cpp +++ b/3d-viewer/3d_rendering/raytracing/raypacket.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -22,11 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file raypacket.cpp - * @brief - */ - #include "raypacket.h" #include "../3d_fastmath.h" #include diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/raypacket.h b/3d-viewer/3d_rendering/raytracing/raypacket.h similarity index 93% rename from 3d-viewer/3d_rendering/3d_render_raytracing/raypacket.h rename to 3d-viewer/3d_rendering/raytracing/raypacket.h index 076dfbd65b..9d6e76456f 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/raypacket.h +++ b/3d-viewer/3d_rendering/raytracing/raypacket.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,13 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file raypacket.h - * @brief - */ - -#ifndef _RAYPACKET_H_ -#define _RAYPACKET_H_ +#ifndef RAYPACKET_H +#define RAYPACKET_H #include "ray.h" #include "frustum.h" @@ -65,4 +60,4 @@ void RAYPACKET_InitRays_with2DDisplacement( const CAMERA& aCamera, const SFVEC2F const SFVEC2F& a2DWindowsPosDisplacementFactor, RAY* aRayPck ); -#endif // _RAYPACKET_H_ +#endif // RAYPACKET_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.cpp b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.cpp rename to 3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp index ae42701a8c..b3a8143675 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.cpp +++ b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp @@ -22,10 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file render_3d_raytrace.cpp - */ - #include // Must be included first #include @@ -297,7 +293,7 @@ void RENDER_3D_RAYTRACE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter ) if( m_cameraLight ) m_cameraLight->SetDirection( -m_camera.GetDir() ); - if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) { // Set all pixels of PBO transparent (Alpha to 0) // This way it will draw the full buffer but only shows the updated ( diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.h b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.h similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.h rename to 3d-viewer/3d_rendering/raytracing/render_3d_raytrace.h index eba7781bc3..aab9a22466 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/render_3d_raytrace.h +++ b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.h @@ -22,10 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file render_3d_raytrace.h - */ - #ifndef RENDER_3D_RAYTRACE_H #define RENDER_3D_RAYTRACE_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/4pt_polygon_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/4pt_polygon_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/4pt_polygon_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/4pt_polygon_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/4pt_polygon_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/4pt_polygon_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/4pt_polygon_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/4pt_polygon_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/bbox_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/bbox_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/bbox_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/bbox_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/bbox_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/bbox_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/bbox_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/bbox_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/filled_circle_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/filled_circle_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/filled_circle_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/filled_circle_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/filled_circle_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/layer_item_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/layer_item_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/layer_item_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/layer_item_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/layer_item_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/object_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/object_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/object_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/object_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/object_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/object_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/object_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/object_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/polygon_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/polygon_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/polygon_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/polygon_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/ring_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/ring_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/ring_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/ring_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/ring_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/ring_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/ring_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/ring_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/round_segment_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/round_segment_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/round_segment_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/round_segment_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/round_segment_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/round_segment_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/round_segment_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/round_segment_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/triangle_2d.cpp b/3d-viewer/3d_rendering/raytracing/shapes2D/triangle_2d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/triangle_2d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes2D/triangle_2d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/triangle_2d.h b/3d-viewer/3d_rendering/raytracing/shapes2D/triangle_2d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/triangle_2d.h rename to 3d-viewer/3d_rendering/raytracing/shapes2D/triangle_2d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d_ray.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d_ray.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/bbox_3d_ray.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/bbox_3d_ray.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/cylinder_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/cylinder_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/cylinder_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/cylinder_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/dummy_block_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/dummy_block_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/dummy_block_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/dummy_block_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/dummy_block_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/dummy_block_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/dummy_block_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/dummy_block_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.cpp similarity index 99% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.cpp index 41a2d651da..1072298b79 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.cpp +++ b/3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,10 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file layer_item_3d.cpp - */ - #include "layer_item_3d.h" #include "3d_fastmath.h" #include diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.h similarity index 90% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.h index f38fd53d39..0a9a642604 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/layer_item_3d.h +++ b/3d-viewer/3d_rendering/raytracing/shapes3D/layer_item_3d.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-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 @@ -22,12 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file layer_item_3d.h - */ - -#ifndef _LAYER_ITEM_H_ -#define _LAYER_ITEM_H_ +#ifndef LAYER_ITEM_H +#define LAYER_ITEM_H #include "object_3d.h" #include "../shapes2D/object_2d.h" @@ -52,4 +48,4 @@ private: SFVEC3F m_diffusecolor; }; -#endif // _LAYER_ITEM_H_ +#endif // LAYER_ITEM_H diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/object_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/object_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/object_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/object_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/object_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/object_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/object_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/object_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/plane_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/plane_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/plane_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/plane_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/plane_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/plane_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/plane_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/plane_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/round_segment_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/round_segment_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/round_segment_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/round_segment_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/round_segment_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/round_segment_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/round_segment_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/round_segment_3d.h diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/triangle_3d.cpp b/3d-viewer/3d_rendering/raytracing/shapes3D/triangle_3d.cpp similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/triangle_3d.cpp rename to 3d-viewer/3d_rendering/raytracing/shapes3D/triangle_3d.cpp diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/triangle_3d.h b/3d-viewer/3d_rendering/raytracing/shapes3D/triangle_3d.h similarity index 100% rename from 3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/triangle_3d.h rename to 3d-viewer/3d_rendering/raytracing/shapes3D/triangle_3d.h diff --git a/3d-viewer/3d_rendering/test_cases.cpp b/3d-viewer/3d_rendering/test_cases.cpp index b5cf54a05f..2e7a1249da 100644 --- a/3d-viewer/3d_rendering/test_cases.cpp +++ b/3d-viewer/3d_rendering/test_cases.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-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 @@ -28,12 +28,12 @@ * @brief it run only once and only in debug build */ -#include "3d_render_raytracing/frustum.h" -#include "3d_render_raytracing/shapes2D/bbox_2d.h" -#include "3d_render_raytracing/shapes2D/filled_circle_2d.h" -#include "3d_render_raytracing/shapes2D/polygon_2d.h" -#include "3d_render_raytracing/shapes2D/round_segment_2d.h" -#include "3d_render_raytracing/shapes3D/bbox_3d.h" +#include "raytracing/frustum.h" +#include "raytracing/shapes2D/bbox_2d.h" +#include "raytracing/shapes2D/filled_circle_2d.h" +#include "raytracing/shapes2D/polygon_2d.h" +#include "raytracing/shapes2D/round_segment_2d.h" +#include "raytracing/shapes3D/bbox_3d.h" #include //#ifdef DEBUG diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index 884a226337..c8cc21ae0a 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -195,7 +195,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions() auto raytracingCondition = [this]( const SELECTION& aSel ) { - return m_boardAdapter.GetRenderEngine() != RENDER_ENGINE::OPENGL_LEGACY; + return m_boardAdapter.GetRenderEngine() != RENDER_ENGINE::OPENGL; }; RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW, @@ -265,14 +265,14 @@ void EDA_3D_VIEWER_FRAME::NewDisplay( bool aForceImmediateRedraw ) void EDA_3D_VIEWER_FRAME::Redraw() { // Only update in OpenGL for an interactive interaction - if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) m_canvas->Request_refresh( true ); } void EDA_3D_VIEWER_FRAME::refreshRender() { - if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::OPENGL ) m_canvas->Request_refresh(); else NewDisplay( true ); @@ -351,10 +351,10 @@ void EDA_3D_VIEWER_FRAME::OnRenderEngineSelection( wxCommandEvent &event ) { const RENDER_ENGINE old_engine = m_boardAdapter.GetRenderEngine(); - if( old_engine == RENDER_ENGINE::OPENGL_LEGACY ) + if( old_engine == RENDER_ENGINE::OPENGL ) m_boardAdapter.SetRenderEngine( RENDER_ENGINE::RAYTRACING ); else - m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY ); + m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL ); wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s ", ( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ) ? "Raytrace" : @@ -370,7 +370,7 @@ void EDA_3D_VIEWER_FRAME::OnDisableRayTracing( wxCommandEvent& aEvent ) wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::%s disabling ray tracing.", __WXFUNCTION__ ); m_disable_ray_tracing = true; - m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY ); + m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL ); } @@ -506,7 +506,7 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg ) "EDA_3D_VIEWER_FRAME::LoadSettings render setting Ray Trace" : "EDA_3D_VIEWER_FRAME::LoadSettings render setting OpenGL" ); #else - m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY ); + m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL ); #endif m_boardAdapter.SetMaterialMode( static_cast( cfg->m_Render.material_mode ) ); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp index fc7ceb04cc..34d13cfb81 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp @@ -38,8 +38,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() m_Camera() { m_params.emplace_back( new PARAM( "render.engine", &m_Render.engine, - static_cast( RENDER_ENGINE::OPENGL_LEGACY ), - static_cast( RENDER_ENGINE::OPENGL_LEGACY ), + static_cast( RENDER_ENGINE::OPENGL ), + static_cast( RENDER_ENGINE::OPENGL ), static_cast( RENDER_ENGINE::RAYTRACING ) ) ); m_params.emplace_back( new PARAM( "render.grid_type", &m_Render.grid_type, diff --git a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp index 2be8ea9ba2..d71d9f92c0 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp @@ -29,7 +29,7 @@ #include #include #include "eda_3d_actions.h" -#include <3d_rendering/legacy/render_3d_legacy.h> +#include <3d_rendering/opengl/render_3d_opengl.h> bool EDA_3D_CONTROLLER::Init() @@ -162,7 +162,7 @@ int EDA_3D_CONTROLLER::RotateView( const TOOL_EVENT& aEvent ) default: wxFAIL; break; } - if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL ) m_canvas->Request_refresh(); else m_canvas->RenderRaytracingRequest(); @@ -190,7 +190,7 @@ int EDA_3D_CONTROLLER::ToggleOrtho( const TOOL_EVENT& aEvent ) { m_camera->ToggleProjection(); - if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL ) m_canvas->Request_refresh(); else m_canvas->RenderRaytracingRequest(); @@ -218,7 +218,7 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent ) case FL_RENDER_RAYTRACING_REFRACTIONS: case FL_RENDER_RAYTRACING_REFLECTIONS: case FL_RENDER_RAYTRACING_ANTI_ALIASING: - if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL ) m_canvas->Request_refresh(); else m_canvas->RenderRaytracingRequest(); @@ -229,9 +229,9 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent ) case FL_FP_ATTRIBUTES_NORMAL_INSERT: case FL_FP_ATTRIBUTES_VIRTUAL: // Loading 3D shapes can be needed if not yet loaded - if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL_LEGACY ) + if( m_boardAdapter->GetRenderEngine() == RENDER_ENGINE::OPENGL ) { - RENDER_3D_LEGACY* render = static_cast< RENDER_3D_LEGACY* > ( m_canvas->GetCurrentRender() ); + RENDER_3D_OPENGL* render = static_cast( m_canvas->GetCurrentRender() ); render->Load3dModelsIfNeeded(); m_canvas->Request_refresh(); } diff --git a/3d-viewer/CMakeLists.txt b/3d-viewer/CMakeLists.txt index 3b12b36c40..a19e4a0860 100644 --- a/3d-viewer/CMakeLists.txt +++ b/3d-viewer/CMakeLists.txt @@ -15,8 +15,8 @@ include_directories( ) # directories -set( DIR_DLG 3d_cache/dialogs ) -set( DIR_RAY 3d_rendering/3d_render_raytracing ) +set( DIR_DLG dialogs ) +set( DIR_RAY 3d_rendering/raytracing ) set( DIR_RAY_ACC ${DIR_RAY}/accelerators ) set( DIR_RAY_2D ${DIR_RAY}/shapes2D ) set( DIR_RAY_3D ${DIR_RAY}/shapes3D ) @@ -39,11 +39,11 @@ set(3D-VIEWER_SRCS 3d_canvas/eda_3d_canvas.cpp 3d_canvas/eda_3d_canvas_pivot.cpp 3d_model_viewer/eda_3d_model_viewer.cpp - 3d_rendering/legacy/3d_model.cpp - 3d_rendering/legacy/ogl_legacy_utils.cpp - 3d_rendering/legacy/create_scene.cpp - 3d_rendering/legacy/render_3d_legacy.cpp - 3d_rendering/legacy/layer_triangles.cpp + 3d_rendering/opengl/3d_model.cpp + 3d_rendering/opengl/opengl_utils.cpp + 3d_rendering/opengl/create_scene.cpp + 3d_rendering/opengl/render_3d_opengl.cpp + 3d_rendering/opengl/layer_triangles.cpp ${DIR_RAY_ACC}/accelerator_3d.cpp ${DIR_RAY_ACC}/bvh_packet_traversal.cpp ${DIR_RAY_ACC}/bvh_pbrt.cpp diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index 49f2aa7159..09ae26889b 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -204,7 +204,7 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings() if( cfg ) { - m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL_LEGACY ); + m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL ); m_boardAdapter.SetFlag( FL_USE_REALISTIC_MODE, cfg->m_Render.realistic ); m_boardAdapter.SetMaterialMode( static_cast( cfg->m_Render.material_mode ) ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index 105d633f69..79ec9abbc6 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -39,7 +39,7 @@ #include #include #include -#include "3d_rendering/legacy/3d_model.h" +#include "3d_rendering/opengl/3d_model.h" #include "filename_resolver.h" #include #include "dialogs/panel_preview_3d_model.h"