Naming conventions.
There's nothing "legacy" about the OpenGL 3D renderer.
This commit is contained in:
parent
0fd762dc25
commit
6c0110ecd3
|
@ -26,7 +26,7 @@
|
|||
#include "board_adapter.h"
|
||||
#include <board_design_settings.h>
|
||||
#include <board_stackup_manager/board_stackup.h>
|
||||
#include <3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.h>
|
||||
#include <3d_rendering/raytracing/shapes2D/polygon_2d.h>
|
||||
#include <board.h>
|
||||
#include <dialogs/dialog_color_picker.h>
|
||||
#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();
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#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"
|
||||
|
|
|
@ -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 <board_adapter.h>
|
||||
#include <board.h>
|
||||
#include <footprint.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 <mrluzeiro@ua.pt>
|
||||
* 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 <board.h>
|
||||
#include <board_design_settings.h>
|
||||
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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 <eda_3d_viewer_frame.h>
|
||||
#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 <board.h>
|
||||
#include <reporter.h>
|
||||
|
@ -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<WX_BUSY_INDICATOR>(); };
|
||||
|
||||
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<int>( 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 )
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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 <atomic>
|
||||
#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 <gal/hidpi_gl_canvas.h>
|
||||
|
@ -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
|
||||
|
|
|
@ -109,7 +109,7 @@ enum class GRID3D_TYPE
|
|||
/// Render engine mode
|
||||
enum class RENDER_ENGINE
|
||||
{
|
||||
OPENGL_LEGACY,
|
||||
OPENGL,
|
||||
RAYTRACING,
|
||||
};
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
*/
|
||||
|
||||
#include <iostream>
|
||||
#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 <wx/dcclient.h>
|
||||
#include <base_units.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 <wx/gdicmn.h> // for wxSize
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <gal/opengl/kiglew.h> // 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 <wx/debug.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 <vector>
|
||||
#include <plugins/3dapi/c3dmodel.h>
|
||||
#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 <wx/chartype.h>
|
|
@ -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 <board.h>
|
||||
#include <footprint.h>
|
||||
#include "../../3d_math.h"
|
||||
|
@ -34,9 +34,9 @@
|
|||
#include <eda_3d_viewer_frame.h>
|
||||
|
||||
|
||||
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;
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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 <wx/debug.h> // For the wxASSERT
|
||||
#include <mutex>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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 <plugins/3dapi/xv3d_types.h>
|
||||
#include <geometry/shape_line_chain.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <3d_render_raytracing/accelerators/container_2d.h>
|
||||
#include <raytracing/accelerators/container_2d.h>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
|
||||
|
@ -245,4 +241,4 @@ private:
|
|||
bool m_draw_it_transparent;
|
||||
};
|
||||
|
||||
#endif // TRIANGLE_DISPLAY_LIST_H_
|
||||
#endif // TRIANGLE_DISPLAY_LIST_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 <mrluzeiro@ua.pt>
|
||||
* 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 <trigo.h>
|
||||
#include <wx/debug.h> // For the wxASSERT
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
#include <gal/opengl/kiglew.h> // 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 <footprint.h>
|
||||
#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 );
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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 <cmath>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <random>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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"
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2017 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* 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"
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-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_
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* 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 <wx/debug.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 <mrluzeiro@ua.pt>
|
||||
* 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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file ray.cpp
|
||||
* @brief
|
||||
*/
|
||||
|
||||
|
||||
#include "ray.h"
|
||||
#include "../../3d_fastmath.h"
|
||||
#include <cstdio>
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2017 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* 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 <plugins/3dapi/xv3d_types.h>
|
||||
|
||||
|
@ -165,4 +160,4 @@ struct RAY4
|
|||
#endif
|
||||
|
||||
|
||||
#endif // _RAY_H_
|
||||
#endif // RAY_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 <mrluzeiro@ua.pt>
|
||||
* 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 <wx/debug.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 <mrluzeiro@ua.pt>
|
||||
* 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
|
|
@ -22,10 +22,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file render_3d_raytrace.cpp
|
||||
*/
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -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 (
|
|
@ -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
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-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 <wx/debug.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 <mrluzeiro@ua.pt>
|
||||
* 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
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 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 <wx/debug.h>
|
||||
|
||||
//#ifdef DEBUG
|
||||
|
|
|
@ -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<MATERIAL_MODE>( cfg->m_Render.material_mode ) );
|
||||
|
|
|
@ -38,8 +38,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
|||
m_Camera()
|
||||
{
|
||||
m_params.emplace_back( new PARAM<int>( "render.engine", &m_Render.engine,
|
||||
static_cast<int>( RENDER_ENGINE::OPENGL_LEGACY ),
|
||||
static_cast<int>( RENDER_ENGINE::OPENGL_LEGACY ),
|
||||
static_cast<int>( RENDER_ENGINE::OPENGL ),
|
||||
static_cast<int>( RENDER_ENGINE::OPENGL ),
|
||||
static_cast<int>( RENDER_ENGINE::RAYTRACING ) ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "render.grid_type", &m_Render.grid_type,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <kiface_base.h>
|
||||
#include <tools/eda_3d_controller.h>
|
||||
#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<RENDER_3D_OPENGL*>( m_canvas->GetCurrentRender() );
|
||||
render->Load3dModelsIfNeeded();
|
||||
m_canvas->Request_refresh();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<MATERIAL_MODE>( cfg->m_Render.material_mode ) );
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <footprint_editor_settings.h>
|
||||
#include <dialog_footprint_properties_fp_editor.h>
|
||||
#include <panel_fp_properties_3d_model.h>
|
||||
#include "3d_rendering/legacy/3d_model.h"
|
||||
#include "3d_rendering/opengl/3d_model.h"
|
||||
#include "filename_resolver.h"
|
||||
#include <pgm_base.h>
|
||||
#include "dialogs/panel_preview_3d_model.h"
|
||||
|
|
Loading…
Reference in New Issue