2020-01-13 01:44:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
|
2023-08-11 17:40:13 +00:00
|
|
|
* Copyright (C) 2023 CERN
|
|
|
|
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-01-13 01:44:19 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EDA_3D_VIEWER_SETTINGS_H_
|
|
|
|
#define EDA_3D_VIEWER_SETTINGS_H_
|
|
|
|
|
2021-12-30 23:02:38 +00:00
|
|
|
#include <3d_enums.h>
|
|
|
|
#include <common_ogl/ogl_attr_list.h>
|
|
|
|
#include <plugins/3dapi/xv3d_types.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <settings/app_settings.h>
|
|
|
|
#include <settings/parameters.h>
|
2023-08-11 17:40:13 +00:00
|
|
|
#include <project/board_project_settings.h>
|
2022-06-06 20:58:00 +00:00
|
|
|
#include "render_settings.h"
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2023-08-11 17:40:13 +00:00
|
|
|
#define FOLLOW_PCB wxT( "follow_pcb_editor" )
|
|
|
|
#define FOLLOW_PLOT_SETTINGS wxT( "follow_plot_settings" )
|
|
|
|
#define LEGACY_PRESET_FLAG wxT( "legacy_preset_flag" )
|
|
|
|
|
|
|
|
|
|
|
|
struct LAYER_PRESET_3D
|
|
|
|
{
|
|
|
|
LAYER_PRESET_3D( const wxString& aName = wxEmptyString );
|
|
|
|
|
|
|
|
LAYER_PRESET_3D( const wxString& aName, const std::bitset<LAYER_3D_END>& aLayers,
|
|
|
|
const std::map<int, KIGFX::COLOR4D>& aColors ) :
|
|
|
|
name( aName ),
|
|
|
|
layers( aLayers ),
|
|
|
|
colors( aColors )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString name; ///< A name for this layer set
|
|
|
|
std::bitset<LAYER_3D_END> layers;
|
|
|
|
std::map<int, KIGFX::COLOR4D> colors;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PARAM_LAYER_PRESET_3D : public PARAM_LAMBDA<nlohmann::json>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PARAM_LAYER_PRESET_3D( const std::string& aPath, std::vector<LAYER_PRESET_3D>* aPresetList );
|
|
|
|
|
|
|
|
private:
|
|
|
|
nlohmann::json presetsToJson();
|
|
|
|
|
|
|
|
void jsonToPresets( const nlohmann::json& aJson );
|
|
|
|
|
|
|
|
std::vector<LAYER_PRESET_3D>* m_presets;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
class EDA_3D_VIEWER_SETTINGS : public APP_SETTINGS_BASE
|
|
|
|
{
|
|
|
|
public:
|
2023-08-11 17:40:13 +00:00
|
|
|
struct AUI_PANELS
|
|
|
|
{
|
|
|
|
int right_panel_width;
|
|
|
|
bool show_layer_manager;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
struct RENDER_SETTINGS
|
|
|
|
{
|
2021-12-30 23:02:38 +00:00
|
|
|
RENDER_ENGINE engine;
|
|
|
|
GRID3D_TYPE grid_type;
|
|
|
|
ANTIALIASING_MODE opengl_AA_mode;
|
|
|
|
MATERIAL_MODE material_mode;
|
|
|
|
|
2020-04-17 21:33:23 +00:00
|
|
|
bool opengl_AA_disableOnMove;
|
|
|
|
bool opengl_thickness_disableOnMove;
|
|
|
|
bool opengl_vias_disableOnMove;
|
|
|
|
bool opengl_holes_disableOnMove;
|
|
|
|
bool opengl_render_bbox_only_OnMove;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool opengl_copper_thickness;
|
2023-09-21 12:07:10 +00:00
|
|
|
bool show_model_bbox;
|
|
|
|
bool show_off_board_silk;
|
|
|
|
bool highlight_on_rollover;
|
2020-09-27 21:23:17 +00:00
|
|
|
KIGFX::COLOR4D opengl_selection_color;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
bool raytrace_anti_aliasing;
|
|
|
|
bool raytrace_backfloor;
|
|
|
|
bool raytrace_post_processing;
|
|
|
|
bool raytrace_procedural_textures;
|
|
|
|
bool raytrace_reflections;
|
|
|
|
bool raytrace_refractions;
|
|
|
|
bool raytrace_shadows;
|
2020-08-15 08:41:34 +00:00
|
|
|
|
2020-09-04 15:12:01 +00:00
|
|
|
int raytrace_nrsamples_shadows;
|
|
|
|
int raytrace_nrsamples_reflections;
|
|
|
|
int raytrace_nrsamples_refractions;
|
|
|
|
|
|
|
|
float raytrace_spread_shadows;
|
|
|
|
float raytrace_spread_reflections;
|
|
|
|
float raytrace_spread_refractions;
|
|
|
|
|
|
|
|
int raytrace_recursivelevel_reflections;
|
|
|
|
int raytrace_recursivelevel_refractions;
|
|
|
|
|
2020-08-15 08:41:34 +00:00
|
|
|
KIGFX::COLOR4D raytrace_lightColorCamera;
|
|
|
|
KIGFX::COLOR4D raytrace_lightColorTop;
|
|
|
|
KIGFX::COLOR4D raytrace_lightColorBottom;
|
|
|
|
std::vector<KIGFX::COLOR4D> raytrace_lightColor;
|
|
|
|
std::vector<int> raytrace_lightElevation; // -90 .. 90
|
|
|
|
std::vector<int> raytrace_lightAzimuth; // 0 .. 359
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_adhesive;
|
|
|
|
bool show_axis;
|
|
|
|
bool show_board_body;
|
|
|
|
bool show_comments;
|
2023-08-11 17:40:13 +00:00
|
|
|
bool show_drawings;
|
|
|
|
bool show_eco1;
|
|
|
|
bool show_eco2;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_footprints_insert;
|
|
|
|
bool show_footprints_normal;
|
|
|
|
bool show_footprints_virtual;
|
2022-09-24 09:25:02 +00:00
|
|
|
bool show_footprints_not_in_posfile;
|
2023-04-10 17:10:42 +00:00
|
|
|
bool show_footprints_dnp;
|
2023-08-11 17:40:13 +00:00
|
|
|
bool show_silkscreen_top;
|
|
|
|
bool show_silkscreen_bottom;
|
|
|
|
bool show_soldermask_top;
|
|
|
|
bool show_soldermask_bottom;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_solderpaste;
|
2023-08-11 17:40:13 +00:00
|
|
|
bool show_copper_top;
|
|
|
|
bool show_copper_bottom;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_zones;
|
2023-08-11 17:40:13 +00:00
|
|
|
bool show_fp_references;
|
|
|
|
bool show_fp_values;
|
|
|
|
bool show_fp_text;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool subtract_mask_from_silk;
|
2023-09-22 13:03:15 +00:00
|
|
|
bool clip_silk_on_via_annuli;
|
2023-09-22 17:31:04 +00:00
|
|
|
bool differentiate_plated_copper;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:58:50 +00:00
|
|
|
struct CAMERA_SETTINGS
|
|
|
|
{
|
2020-06-07 10:42:28 +00:00
|
|
|
bool animation_enabled;
|
|
|
|
int moving_speed_multiplier;
|
|
|
|
double rotation_increment;
|
2021-06-17 11:21:06 +00:00
|
|
|
int projection_mode;
|
2020-04-24 23:58:50 +00:00
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
EDA_3D_VIEWER_SETTINGS();
|
|
|
|
|
|
|
|
virtual ~EDA_3D_VIEWER_SETTINGS() {}
|
|
|
|
|
2023-08-11 17:40:13 +00:00
|
|
|
LAYER_PRESET_3D* FindPreset( const wxString& aName );
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
|
|
|
|
|
2023-08-11 17:40:13 +00:00
|
|
|
public:
|
|
|
|
AUI_PANELS m_AuiPanels;
|
2020-01-13 01:44:19 +00:00
|
|
|
RENDER_SETTINGS m_Render;
|
2020-04-24 23:58:50 +00:00
|
|
|
CAMERA_SETTINGS m_Camera;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2024-02-23 16:06:23 +00:00
|
|
|
bool m_UseStackupColors;
|
2023-08-11 17:40:13 +00:00
|
|
|
std::vector<LAYER_PRESET_3D> m_LayerPresets;
|
|
|
|
wxString m_CurrentPreset;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
protected:
|
|
|
|
virtual std::string getLegacyFrameName() const override { return "Viewer3DFrameName"; }
|
2021-08-02 16:38:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool migrateSchema0to1();
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|