Remove some more duplicated preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/10112
This commit is contained in:
parent
eac65635be
commit
5e4a704155
|
@ -554,7 +554,6 @@ set( PCB_COMMON_SRCS
|
|||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/legacy/legacy_plugin.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_display_options.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
|
||||
|
|
|
@ -34,7 +34,6 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
|||
m_ActiveLayer( UNDEFINED_LAYER ),
|
||||
m_ContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL ),
|
||||
m_NetColorMode( NET_COLOR_MODE::RATSNEST ),
|
||||
m_RatsnestMode( RATSNEST_MODE::ALL ),
|
||||
m_AutoTrackWidth( true ),
|
||||
m_ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ),
|
||||
m_TrackOpacity( 1.0 ),
|
||||
|
@ -165,10 +164,6 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
|||
&m_NetColorMode, NET_COLOR_MODE::RATSNEST, NET_COLOR_MODE::OFF,
|
||||
NET_COLOR_MODE::ALL ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_ENUM<RATSNEST_MODE>( "board.ratsnest_display_mode",
|
||||
&m_RatsnestMode, RATSNEST_MODE::ALL, RATSNEST_MODE::ALL,
|
||||
RATSNEST_MODE::VISIBLE ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "board.auto_track_width",
|
||||
&m_AutoTrackWidth, true ) );
|
||||
|
||||
|
|
|
@ -49,21 +49,7 @@ CVPCB_SETTINGS::CVPCB_SETTINGS() :
|
|||
|
||||
addParamsForWindow( &m_FootprintViewer, "footprint_viewer" );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.pad_fill",
|
||||
&m_FootprintViewerDisplayOptions.m_DisplayPadFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.pad_numbers",
|
||||
&m_FootprintViewerDisplayOptions.m_DisplayPadNum, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.footprint_text_fill",
|
||||
&m_FootprintViewerDisplayOptions.m_DisplayTextFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.graphic_items_fill",
|
||||
&m_FootprintViewerDisplayOptions.m_DisplayGraphicsFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<double>( "footprint_viewer.zoom",
|
||||
&m_FootprintViewerZoom, 1.0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<double>( "footprint_viewer.zoom", &m_FootprintViewerZoom, 1.0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -94,15 +94,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
|||
|
||||
LoadSettings( config() );
|
||||
|
||||
// Initialize some display options
|
||||
auto displ_opts = GetDisplayOptions();
|
||||
displ_opts.m_DisplayPadClearance = false; // Pad clearance has no meaning here
|
||||
displ_opts.m_DisplayPadNoConnects = false; // Nor do connections
|
||||
|
||||
// Track and via clearance has no meaning here.
|
||||
displ_opts.m_ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
|
||||
SetDisplayOptions( displ_opts );
|
||||
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),
|
||||
|
|
|
@ -153,15 +153,11 @@ public:
|
|||
|
||||
/**
|
||||
* Returns the BOARD_DESIGN_SETTINGS for the open project.
|
||||
*
|
||||
* Overloaded in FOOTPRINT_EDIT_FRAME.
|
||||
*/
|
||||
virtual BOARD_DESIGN_SETTINGS& GetDesignSettings() const;
|
||||
|
||||
/**
|
||||
* Helper to retrieve the current color settings.
|
||||
*
|
||||
* @return a pointer to the active COLOR_SETTINGS.
|
||||
*/
|
||||
virtual COLOR_SETTINGS* GetColorSettings( bool aForceRefresh = false ) const override
|
||||
{
|
||||
|
@ -170,6 +166,7 @@ public:
|
|||
}
|
||||
|
||||
PCBNEW_SETTINGS& Settings() { return *m_settings; }
|
||||
const PCBNEW_SETTINGS& Settings() const { return *m_settings; }
|
||||
|
||||
void SetDrawBgColor( const COLOR4D& aColor ) override;
|
||||
|
||||
|
@ -191,16 +188,12 @@ public:
|
|||
|
||||
/**
|
||||
* Return the #PCB_PLOT_PARAMS for the BOARD owned by this frame.
|
||||
*
|
||||
* Overloaded in FOOTPRINT_EDIT_FRAME.
|
||||
*/
|
||||
virtual const PCB_PLOT_PARAMS& GetPlotSettings() const;
|
||||
virtual void SetPlotSettings( const PCB_PLOT_PARAMS& aSettings );
|
||||
|
||||
/**
|
||||
* Set the #m_Pcb member in such as way as to ensure deleting any previous #BOARD.
|
||||
*
|
||||
* @param aBoard is the #BOARD to put into the frame.
|
||||
*/
|
||||
virtual void SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* 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,99 +22,41 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pcb_display_options.h
|
||||
* @brief Definition of PCB_DISPLAY_OPTIONS class
|
||||
*/
|
||||
|
||||
#ifndef PCB_DISPLAY_OPTIONS_H_
|
||||
#define PCB_DISPLAY_OPTIONS_H_
|
||||
|
||||
#include <project/board_project_settings.h>
|
||||
|
||||
enum TRACE_CLEARANCE_DISPLAY_MODE_T
|
||||
{
|
||||
DO_NOT_SHOW_CLEARANCE = 0,
|
||||
SHOW_TRACK_CLEARANCE_WHILE_ROUTING,
|
||||
SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING,
|
||||
SHOW_WHILE_ROUTING_OR_DRAGGING,
|
||||
SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Container for display options like enable/disable some optional drawings.
|
||||
*/
|
||||
class PCB_DISPLAY_OPTIONS
|
||||
{
|
||||
public:
|
||||
PCB_DISPLAY_OPTIONS();
|
||||
PCB_DISPLAY_OPTIONS()
|
||||
{
|
||||
m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
|
||||
m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
m_NetColorMode = NET_COLOR_MODE::RATSNEST;
|
||||
|
||||
/**
|
||||
* The set of values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option.
|
||||
*
|
||||
* This parameter controls how to show tracks and vias clearance area.
|
||||
*/
|
||||
bool m_DisplayPadFill;
|
||||
bool m_DisplayViaFill;
|
||||
bool m_DisplayPadNum; // show pads numbers
|
||||
bool m_DisplayPadClearance;
|
||||
bool m_DisplayPadNoConnects;
|
||||
bool m_DisplayGraphicsFill; // How to display fp drawings ( sketch/ filled )
|
||||
bool m_DisplayTextFill; // How to display fp texts ( sketch/ filled )
|
||||
bool m_DisplayPcbTrackFill; // false : tracks are show in sketch mode, true = filled.
|
||||
|
||||
/// How trace clearances are displayed. @see TRACE_CLEARANCE_DISPLAY_MODE_T.
|
||||
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode;
|
||||
m_TrackOpacity = 1.0;
|
||||
m_ViaOpacity = 1.0;
|
||||
m_PadOpacity = 1.0;
|
||||
m_ZoneOpacity = 1.0;
|
||||
}
|
||||
|
||||
/// @see ZONE_DISPLAY_MODE - stored in the project
|
||||
ZONE_DISPLAY_MODE m_ZoneDisplayMode;
|
||||
|
||||
int m_DisplayNetNamesMode; /* 0 do not show netnames,
|
||||
* 1 show netnames on pads
|
||||
* 2 show netnames on tracks
|
||||
* 3 show netnames on tracks and pads
|
||||
*/
|
||||
ZONE_DISPLAY_MODE m_ZoneDisplayMode;
|
||||
|
||||
/// How inactive layers are displayed. @see HIGH_CONTRAST_MODE - stored in the project
|
||||
HIGH_CONTRAST_MODE m_ContrastModeDisplay;
|
||||
|
||||
/// How to use color overrides on specific nets and netclasses
|
||||
NET_COLOR_MODE m_NetColorMode;
|
||||
|
||||
/// Ratsnest draw mode (all layers vs only visible layers)
|
||||
RATSNEST_MODE m_RatsnestMode;
|
||||
|
||||
int m_MaxLinksShowed; // in track creation: number of airwires shown
|
||||
bool m_ShowModuleRatsnest; // When moving a footprint: allows displaying a ratsnest
|
||||
bool m_ShowGlobalRatsnest; // If true, show all
|
||||
bool m_DisplayRatsnestLinesCurved; // Airwires can be drawn as straight lines (false)
|
||||
// or curved lines (true)
|
||||
NET_COLOR_MODE m_NetColorMode;
|
||||
|
||||
// These opacity overrides multiply with any opacity in the base layer color
|
||||
|
||||
double m_TrackOpacity; ///< Opacity override for all tracks
|
||||
double m_ViaOpacity; ///< Opacity override for all types of via
|
||||
double m_PadOpacity; ///< Opacity override for SMD pads and PTHs
|
||||
double m_ZoneOpacity; ///< Opacity override for filled zone areas
|
||||
|
||||
/**
|
||||
* The set of values for DISPLAY_OPTIONS.DisplayOrigin parameter option.
|
||||
*
|
||||
* This parameter controls what is used as the origin point for location values
|
||||
*/
|
||||
enum PCB_DISPLAY_ORIGIN_OPTIONS_T {
|
||||
PCB_ORIGIN_PAGE = 0,
|
||||
PCB_ORIGIN_AUX,
|
||||
PCB_ORIGIN_GRID,
|
||||
};
|
||||
|
||||
/// Which origin is used for display transforms
|
||||
PCB_DISPLAY_ORIGIN_OPTIONS_T m_DisplayOrigin;
|
||||
bool m_DisplayInvertXAxis; //< true: Invert the X axis for display
|
||||
bool m_DisplayInvertYAxis; //< true: Invert the Y axis for display
|
||||
|
||||
bool m_Live3DRefresh; ///< If true, 3D viewer will redraw on every modification operation
|
||||
double m_TrackOpacity; ///< Opacity override for all tracks
|
||||
double m_ViaOpacity; ///< Opacity override for all types of via
|
||||
double m_PadOpacity; ///< Opacity override for SMD pads and PTHs
|
||||
double m_ZoneOpacity; ///< Opacity override for filled zone areas
|
||||
};
|
||||
|
||||
#endif // PCBSTRUCT_H_
|
||||
|
|
|
@ -63,10 +63,7 @@ public:
|
|||
|
||||
bool SaveToFile( const wxString& aDirectory = "", bool aForce = false ) override;
|
||||
|
||||
void SetProject( PROJECT* aProject )
|
||||
{
|
||||
m_project = aProject;
|
||||
}
|
||||
void SetProject( PROJECT* aProject ) { m_project = aProject; }
|
||||
|
||||
void SaveFileState( const wxString& aFileName, const WINDOW_SETTINGS* aWindowCfg, bool aOpen );
|
||||
|
||||
|
@ -116,9 +113,6 @@ public:
|
|||
/// The current net color mode
|
||||
NET_COLOR_MODE m_NetColorMode;
|
||||
|
||||
/// The current ratsnest draw mode
|
||||
RATSNEST_MODE m_RatsnestMode;
|
||||
|
||||
/// The current setting for whether to automatically adjust track widths to match
|
||||
bool m_AutoTrackWidth;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -32,6 +33,7 @@
|
|||
#include <tools/pcb_tool_base.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
#include <connectivity/connectivity_data.h>
|
||||
#include <pcbnew_settings.h>
|
||||
|
||||
#include <functional>
|
||||
using namespace std::placeholders;
|
||||
|
@ -443,7 +445,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
if( aSetDirtyBit )
|
||||
frame->OnModify();
|
||||
else
|
||||
frame->Update3DView( true, frame->GetDisplayOptions().m_Live3DRefresh );
|
||||
frame->Update3DView( true, frame->Settings().m_Display.m_Live3DRefresh );
|
||||
}
|
||||
|
||||
clear();
|
||||
|
|
|
@ -76,7 +76,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
PAD* pad = nullptr;
|
||||
BOARD* pcb = GetBoard();
|
||||
|
||||
CROSS_PROBING_SETTINGS& crossProbingSettings = GetPcbNewSettings()->m_CrossProbing;
|
||||
CROSS_PROBING_SETTINGS& crossProbingSettings = Settings().m_CrossProbing;
|
||||
|
||||
KIGFX::VIEW* view = m_toolManager->GetView();
|
||||
KIGFX::RENDER_SETTINGS* renderSettings = view->GetPainter()->GetSettings();
|
||||
|
|
|
@ -156,8 +156,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
|
|||
|
||||
DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES()
|
||||
{
|
||||
m_frame->GetPcbNewSettings()->m_FootprintTextShownColumns =
|
||||
m_itemsGrid->GetShownColumns().ToStdString();
|
||||
m_frame->Settings().m_FootprintTextShownColumns = m_itemsGrid->GetShownColumns().ToStdString();
|
||||
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_itemsGrid->DestroyTable( m_texts );
|
||||
|
|
|
@ -325,14 +325,14 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
|||
|
||||
// fix the pad render mode (filled/not filled)
|
||||
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
|
||||
bool sketchMode = m_cbShowPadOutline->IsChecked();
|
||||
settings->SetSketchMode( LAYER_PADS_TH, sketchMode );
|
||||
settings->SetSketchMode( LAYER_PAD_FR, sketchMode );
|
||||
settings->SetSketchMode( LAYER_PAD_BK, sketchMode );
|
||||
settings->SetSketchModeGraphicItems( sketchMode );
|
||||
|
||||
if( m_cbShowPadOutline->IsChecked() )
|
||||
settings->m_ForcePadSketchModeOn = true;
|
||||
else
|
||||
settings->m_ForcePadSketchModeOff = true;
|
||||
|
||||
settings->SetHighContrast( false );
|
||||
settings->SetContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL );
|
||||
settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
|
||||
// gives a non null grid size (0.001mm) because GAL layer does not like a 0 size grid:
|
||||
double gridsize = 0.001 * IU_PER_MM;
|
||||
|
@ -769,16 +769,15 @@ void DIALOG_PAD_PROPERTIES::onChangePadMode( wxCommandEvent& event )
|
|||
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
||||
|
||||
// fix the pad render mode (filled/not filled)
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings =
|
||||
static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
|
||||
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
|
||||
|
||||
settings->SetSketchMode( LAYER_PADS_TH, m_sketchPreview );
|
||||
settings->SetSketchMode( LAYER_PAD_FR, m_sketchPreview );
|
||||
settings->SetSketchMode( LAYER_PAD_BK, m_sketchPreview );
|
||||
settings->SetSketchModeGraphicItems( m_sketchPreview );
|
||||
if( m_cbShowPadOutline->IsChecked() )
|
||||
settings->m_ForcePadSketchModeOn = true;
|
||||
else
|
||||
settings->m_ForcePadSketchModeOff = true;
|
||||
|
||||
settings->SetHighContrast( false );
|
||||
settings->SetContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL );
|
||||
settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
|
||||
redraw();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <widgets/gal_options_panel.h>
|
||||
|
||||
|
||||
static const UTIL::CFG_MAP<TRACE_CLEARANCE_DISPLAY_MODE_T> clearanceModeMap =
|
||||
static const UTIL::CFG_MAP<TRACK_CLEARANCE_MODE> clearanceModeMap =
|
||||
{
|
||||
{ SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING, 2 }, // Default
|
||||
{ DO_NOT_SHOW_CLEARANCE, 0 },
|
||||
|
|
|
@ -40,9 +40,9 @@ void PANEL_PCBNEW_DISPLAY_ORIGIN::loadPCBSettings( PCBNEW_SETTINGS* aCfg )
|
|||
|
||||
switch( aCfg->m_Display.m_DisplayOrigin )
|
||||
{
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: origin = 0; break;
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = 1; break;
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID: origin = 2; break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE: origin = 0; break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_AUX: origin = 1; break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_GRID: origin = 2; break;
|
||||
}
|
||||
|
||||
m_DisplayOrigin->SetSelection( origin );
|
||||
|
@ -67,9 +67,9 @@ bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataFromWindow()
|
|||
|
||||
switch( m_DisplayOrigin->GetSelection() )
|
||||
{
|
||||
case 0: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE; break;
|
||||
case 1: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX; break;
|
||||
case 2: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID; break;
|
||||
case 0: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE; break;
|
||||
case 1: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_ORIGIN::PCB_ORIGIN_AUX; break;
|
||||
case 2: cfg->m_Display.m_DisplayOrigin = PCB_DISPLAY_ORIGIN::PCB_ORIGIN_GRID; break;
|
||||
}
|
||||
|
||||
cfg->m_Display.m_DisplayInvertXAxis = m_XAxisDirection->GetSelection() != 0;
|
||||
|
|
|
@ -91,15 +91,6 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
|
|||
m_params.emplace_back( new PARAM<bool>( "editing.fp_use_45_degree_limit",
|
||||
&m_Use45Limit, false ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcb_display.text_fill",
|
||||
&m_Display.m_DisplayTextFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcb_display.graphic_items_fill",
|
||||
&m_Display.m_DisplayGraphicsFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
|
||||
&m_Display.m_DisplayPadFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAYER_PRESET( "pcb_display.layer_presets", &m_LayerPresets ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "pcb_display.active_layer_preset",
|
||||
|
|
|
@ -109,7 +109,7 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( std::shared_ptr<FOOTPRINT> aFootp
|
|||
// Ensure we are not using the high contrast mode to display the selected footprint
|
||||
KIGFX::PAINTER* painter = GetView()->GetPainter();
|
||||
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
|
||||
settings->SetContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL );
|
||||
settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
|
||||
GetView()->Add( m_currentFootprint.get() );
|
||||
GetView()->SetVisible( m_currentFootprint.get(), true );
|
||||
|
|
|
@ -737,7 +737,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent )
|
|||
for( PAD* pad : newFootprint->Pads() )
|
||||
{
|
||||
// Set the pads ratsnest settings to the global settings
|
||||
pad->SetLocalRatsnestVisible( pcbframe->GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||
pad->SetLocalRatsnestVisible( pcbframe->Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
// Pads in the library all have orphaned nets. Replace with Default.
|
||||
pad->SetNetCode( 0 );
|
||||
|
@ -746,8 +746,10 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent )
|
|||
// Put it on FRONT layer,
|
||||
// (Can be stored flipped if the lib is an archive built from a board)
|
||||
if( newFootprint->IsFlipped() )
|
||||
{
|
||||
newFootprint->Flip( newFootprint->GetPosition(),
|
||||
pcbframe->Settings().m_FlipLeftRight );
|
||||
}
|
||||
|
||||
KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetCanvas()->GetViewControls();
|
||||
VECTOR2D cursorPos = viewControls->GetCursorPosition();
|
||||
|
|
|
@ -132,13 +132,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 );
|
||||
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
|
||||
|
||||
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
|
||||
|
||||
disp_opts.m_DisplayPadClearance = true;
|
||||
disp_opts.m_DisplayPadNoConnects = false;
|
||||
disp_opts.m_DisplayPadNum = true;
|
||||
SetDisplayOptions( disp_opts );
|
||||
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),
|
||||
|
|
|
@ -107,15 +107,8 @@ public:
|
|||
* @return force the text rotation to be always between -90 .. 90 deg. Otherwise the text
|
||||
* is not easy to read if false, the text rotation is free.
|
||||
*/
|
||||
bool IsKeepUpright() const
|
||||
{
|
||||
return m_keepUpright;
|
||||
}
|
||||
|
||||
void SetKeepUpright( bool aKeepUpright )
|
||||
{
|
||||
m_keepUpright = aKeepUpright;
|
||||
}
|
||||
bool IsKeepUpright() const { return m_keepUpright; }
|
||||
void SetKeepUpright( bool aKeepUpright ) { m_keepUpright = aKeepUpright; }
|
||||
|
||||
/// Rotate text, in footprint editor
|
||||
/// (for instance in footprint rotation transform)
|
||||
|
@ -207,7 +200,7 @@ public:
|
|||
int aError, ERROR_LOC aErrorLoc ) const;
|
||||
|
||||
// @copydoc BOARD_ITEM::GetEffectiveShape
|
||||
virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
|
||||
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
|
||||
|
||||
wxString GetClass() const override
|
||||
{
|
||||
|
@ -233,18 +226,13 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
/* Note: orientation in 1/10 deg relative to the footprint
|
||||
* Physical orient is m_Orient + m_Parent->m_Orient
|
||||
*/
|
||||
TEXT_TYPE m_Type; ///< 0=ref, 1=val, etc.
|
||||
|
||||
TEXT_TYPE m_Type; ///< 0=ref, 1=val, etc.
|
||||
|
||||
wxPoint m_Pos0; ///< text coordinates relative to the footprint anchor, orient 0.
|
||||
///< text coordinate ref point is the text center
|
||||
wxPoint m_Pos0; ///< text coordinates relative to the footprint anchor, orient 0.
|
||||
///< text coordinate ref point is the text center
|
||||
|
||||
bool m_keepUpright; ///< if true, keep rotation angle between -90 .. 90 deg.
|
||||
///< to keep the text more easy to read
|
||||
|
||||
};
|
||||
|
||||
#endif // FP_TEXT_H
|
||||
|
|
|
@ -169,7 +169,7 @@ FOOTPRINT* BOARD_NETLIST_UPDATER::addNewFootprint( COMPONENT* aComponent )
|
|||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
// Set the pads ratsnest settings to the global settings
|
||||
pad->SetLocalRatsnestVisible( m_frame->GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||
pad->SetLocalRatsnestVisible( m_frame->Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
// Pads in the library all have orphaned nets. Replace with Default.
|
||||
pad->SetNetCode( 0 );
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <widgets/appearance_controls.h>
|
||||
#include <dialogs/dialog_grid_settings.h>
|
||||
#include <dialogs/eda_view_switcher.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <collectors.h>
|
||||
|
@ -245,7 +244,7 @@ void PCB_BASE_EDIT_FRAME::SetObjectVisible( GAL_LAYER_ID aLayer, bool aVisible )
|
|||
|
||||
COLOR_SETTINGS* PCB_BASE_EDIT_FRAME::GetColorSettings( bool aForceRefresh ) const
|
||||
{
|
||||
return Pgm().GetSettingsManager().GetColorSettings( GetPcbNewSettings()->m_ColorTheme );
|
||||
return Pgm().GetSettingsManager().GetColorSettings( Settings().m_ColorTheme );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -473,15 +473,14 @@ const wxPoint& PCB_BASE_FRAME::GetAuxOrigin() const
|
|||
|
||||
const wxPoint PCB_BASE_FRAME::GetUserOrigin() const
|
||||
{
|
||||
auto& displ_opts = GetDisplayOptions();
|
||||
wxPoint origin( 0, 0 );
|
||||
|
||||
switch( displ_opts.m_DisplayOrigin )
|
||||
switch( Settings().m_Display.m_DisplayOrigin )
|
||||
{
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: break;
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = GetAuxOrigin(); break;
|
||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID: origin = GetGridOrigin(); break;
|
||||
default: wxASSERT( false ); break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE: break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_AUX: origin = GetAuxOrigin(); break;
|
||||
case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_GRID: origin = GetGridOrigin(); break;
|
||||
default: wxASSERT( false ); break;
|
||||
}
|
||||
|
||||
return origin;
|
||||
|
@ -779,10 +778,7 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
|||
PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
m_displayOptions = cfg->m_Display;
|
||||
m_polarCoords = cfg->m_PolarCoords;
|
||||
}
|
||||
|
||||
wxASSERT( GetCanvas() );
|
||||
|
||||
|
@ -818,10 +814,7 @@ void PCB_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
|||
PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->m_Display = m_displayOptions;
|
||||
cfg->m_PolarCoords = m_polarCoords;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <pcb_display_options.h>
|
||||
#include <eda_text.h>
|
||||
|
||||
PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
|
||||
{
|
||||
m_DisplayPadFill = FILLED;
|
||||
m_DisplayViaFill = FILLED;
|
||||
m_DisplayPadNum = true;
|
||||
m_DisplayPadClearance = true;
|
||||
m_DisplayPadNoConnects = true;
|
||||
|
||||
m_DisplayGraphicsFill = FILLED;
|
||||
m_DisplayTextFill = FILLED;
|
||||
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled
|
||||
m_ShowTrackClearanceMode = SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING;
|
||||
|
||||
m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
|
||||
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
|
||||
* 1 show netnames on pads
|
||||
* 2 show netnames on tracks
|
||||
* 3 show netnames on tracks and pads */
|
||||
m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
m_NetColorMode = NET_COLOR_MODE::RATSNEST;
|
||||
m_RatsnestMode = RATSNEST_MODE::ALL;
|
||||
m_MaxLinksShowed = 3; // in track creation: number of hairwires shown
|
||||
m_ShowModuleRatsnest = true; // When moving a footprint: allows displaying a ratsnest
|
||||
m_DisplayRatsnestLinesCurved = false;
|
||||
m_ShowGlobalRatsnest = true;
|
||||
|
||||
m_TrackOpacity = 1.0;
|
||||
m_ViaOpacity = 1.0;
|
||||
m_PadOpacity = 1.0;
|
||||
m_ZoneOpacity = 1.0;
|
||||
|
||||
m_DisplayOrigin = PCB_ORIGIN_PAGE;
|
||||
m_DisplayInvertXAxis = false;
|
||||
m_DisplayInvertYAxis = false;
|
||||
m_Live3DRefresh = false;
|
||||
}
|
|
@ -39,7 +39,6 @@
|
|||
#include <dialog_footprint_properties.h>
|
||||
#include <dialogs/dialog_exchange_footprints.h>
|
||||
#include <dialog_board_setup.h>
|
||||
#include <convert_to_biu.h>
|
||||
#include <invoke_pcb_dialog.h>
|
||||
#include <board.h>
|
||||
#include <board_design_settings.h>
|
||||
|
@ -90,9 +89,7 @@
|
|||
#include <python/scripting/pcb_scripting_tool.h>
|
||||
#include <gestfich.h>
|
||||
#include <executable_names.h>
|
||||
#include <netlist_reader/board_netlist_updater.h>
|
||||
#include <netlist_reader/netlist_reader.h>
|
||||
#include <netlist_reader/pcb_netlist.h>
|
||||
#include <wx/socket.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <dialog_drc.h> // for DIALOG_DRC_WINDOW_NAME definition
|
||||
|
@ -672,13 +669,13 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
auto globalRatsnestCond =
|
||||
[this] (const SELECTION& )
|
||||
{
|
||||
return GetDisplayOptions().m_ShowGlobalRatsnest;
|
||||
return Settings().m_Display.m_ShowGlobalRatsnest;
|
||||
};
|
||||
|
||||
auto curvedRatsnestCond =
|
||||
[this] (const SELECTION& )
|
||||
{
|
||||
return GetDisplayOptions().m_DisplayRatsnestLinesCurved;
|
||||
return Settings().m_Display.m_DisplayRatsnestLinesCurved;
|
||||
};
|
||||
|
||||
auto netHighlightCond =
|
||||
|
@ -1020,25 +1017,6 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
|
|||
|
||||
Kiway().CommonSettingsChanged( false, true );
|
||||
|
||||
const PCB_DISPLAY_OPTIONS& opts = GetDisplayOptions();
|
||||
|
||||
if( opts.m_ShowTrackClearanceMode || opts.m_DisplayPadClearance )
|
||||
{
|
||||
// Update clearance outlines
|
||||
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
|
||||
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool
|
||||
{
|
||||
PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( aItem );
|
||||
PAD* pad = dynamic_cast<PAD*>( aItem );
|
||||
|
||||
// PCB_TRACK is the base class of PCB_VIA and PCB_ARC so we don't need
|
||||
// to check them independently
|
||||
|
||||
return ( track && opts.m_ShowTrackClearanceMode )
|
||||
|| ( pad && opts.m_DisplayPadClearance );
|
||||
} );
|
||||
}
|
||||
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
UpdateUserInterface();
|
||||
|
@ -1130,7 +1108,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
|||
{
|
||||
// Clearances could be layer-dependent so redraw them when the active layer
|
||||
// is changed
|
||||
if( GetDisplayOptions().m_DisplayPadClearance )
|
||||
if( Settings().m_Display.m_DisplayPadClearance )
|
||||
{
|
||||
// Round-corner rects are expensive to draw, but are mostly found on
|
||||
// SMD pads which only need redrawing on an active-to-not-active
|
||||
|
@ -1151,7 +1129,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
|||
{
|
||||
// Clearances could be layer-dependent so redraw them when the active layer
|
||||
// is changed
|
||||
if( GetDisplayOptions().m_ShowTrackClearanceMode )
|
||||
if( Settings().m_Display.m_ShowTrackClearanceMode )
|
||||
{
|
||||
// Tracks aren't particularly expensive to draw, but it's an easy check.
|
||||
return track->IsOnLayer( oldLayer ) || track->IsOnLayer( aLayer );
|
||||
|
@ -1211,7 +1189,7 @@ void PCB_EDIT_FRAME::onBoardLoaded()
|
|||
// Sync layer and item visibility
|
||||
GetCanvas()->SyncLayersVisibility( m_pcb );
|
||||
|
||||
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||
SetElementVisibility( LAYER_RATSNEST, Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
m_appearancePanel->OnBoardChanged();
|
||||
|
||||
|
@ -1314,7 +1292,7 @@ void PCB_EDIT_FRAME::OnModify( )
|
|||
{
|
||||
PCB_BASE_FRAME::OnModify();
|
||||
|
||||
Update3DView( true, GetDisplayOptions().m_Live3DRefresh );
|
||||
Update3DView( true, Settings().m_Display.m_Live3DRefresh );
|
||||
|
||||
if( !GetTitle().StartsWith( "*" ) )
|
||||
UpdateTitle();
|
||||
|
@ -1761,8 +1739,8 @@ void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
|
|||
auto* painter = static_cast<KIGFX::PCB_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
||||
auto* renderSettings = painter->GetSettings();
|
||||
renderSettings->LoadDisplayOptions( GetDisplayOptions() );
|
||||
SetElementVisibility( LAYER_NO_CONNECTS, GetDisplayOptions().m_DisplayPadNoConnects );
|
||||
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||
SetElementVisibility( LAYER_NO_CONNECTS, Settings().m_Display.m_DisplayPadNoConnects );
|
||||
SetElementVisibility( LAYER_RATSNEST, Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
|
||||
GetGalDisplayOptions().ReadWindowSettings( cfg->m_Window );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019-2020 Reece R. Pollack <reece@his.com>
|
||||
* Copyright (C) 1992-2019 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
|
||||
|
@ -24,15 +24,13 @@
|
|||
|
||||
#include <wx/debug.h> // for wxASSERT
|
||||
#include <pcb_base_frame.h>
|
||||
#include <pcb_display_options.h>
|
||||
#include <pcbnew_settings.h>
|
||||
#include <pcb_origin_transforms.h>
|
||||
|
||||
using COORD_TYPE = ORIGIN_TRANSFORMS::COORD_TYPES_T;
|
||||
|
||||
PCB_ORIGIN_TRANSFORMS::PCB_ORIGIN_TRANSFORMS( PCB_BASE_FRAME& aPcbBaseFrame )
|
||||
: m_pcbBaseFrame( aPcbBaseFrame ),
|
||||
m_invertXAxis( aPcbBaseFrame.GetDisplayOptions().m_DisplayInvertXAxis ),
|
||||
m_invertYAxis( aPcbBaseFrame.GetDisplayOptions().m_DisplayInvertYAxis )
|
||||
PCB_ORIGIN_TRANSFORMS::PCB_ORIGIN_TRANSFORMS( PCB_BASE_FRAME& aPcbBaseFrame ) :
|
||||
m_pcbBaseFrame( aPcbBaseFrame )
|
||||
{}
|
||||
|
||||
PCB_ORIGIN_TRANSFORMS::~PCB_ORIGIN_TRANSFORMS()
|
||||
|
@ -56,8 +54,7 @@ long long int PCB_ORIGIN_TRANSFORMS::ToDisplay( long long int aValue,
|
|||
return value;
|
||||
}
|
||||
|
||||
double PCB_ORIGIN_TRANSFORMS::ToDisplay( double aValue,
|
||||
COORD_TYPES_T aCoordType ) const
|
||||
double PCB_ORIGIN_TRANSFORMS::ToDisplay( double aValue, COORD_TYPES_T aCoordType ) const
|
||||
{
|
||||
double value = aValue;
|
||||
|
||||
|
@ -92,8 +89,7 @@ long long int PCB_ORIGIN_TRANSFORMS::FromDisplay( long long int aValue,
|
|||
return value;
|
||||
}
|
||||
|
||||
double PCB_ORIGIN_TRANSFORMS::FromDisplay( double aValue,
|
||||
COORD_TYPES_T aCoordType ) const
|
||||
double PCB_ORIGIN_TRANSFORMS::FromDisplay( double aValue, COORD_TYPES_T aCoordType ) const
|
||||
{
|
||||
double value = aValue;
|
||||
|
||||
|
@ -111,13 +107,22 @@ double PCB_ORIGIN_TRANSFORMS::FromDisplay( double aValue,
|
|||
}
|
||||
|
||||
|
||||
int PCB_ORIGIN_TRANSFORMS::GetUserXOrigin() const
|
||||
int PCB_ORIGIN_TRANSFORMS::getUserXOrigin() const
|
||||
{
|
||||
return m_pcbBaseFrame.GetUserOrigin().x;
|
||||
}
|
||||
|
||||
int PCB_ORIGIN_TRANSFORMS::GetUserYOrigin() const
|
||||
int PCB_ORIGIN_TRANSFORMS::getUserYOrigin() const
|
||||
{
|
||||
return m_pcbBaseFrame.GetUserOrigin().y;
|
||||
}
|
||||
|
||||
bool PCB_ORIGIN_TRANSFORMS::invertXAxis() const
|
||||
{
|
||||
return m_pcbBaseFrame.Settings().m_Display.m_DisplayInvertXAxis;
|
||||
}
|
||||
|
||||
bool PCB_ORIGIN_TRANSFORMS::invertYAxis() const
|
||||
{
|
||||
return m_pcbBaseFrame.Settings().m_Display.m_DisplayInvertYAxis;
|
||||
}
|
||||
|
|
|
@ -94,25 +94,25 @@ public:
|
|||
template<typename T>
|
||||
T ToDisplayRelX( T aInternalValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::ToDisplayRel( aInternalValue, m_invertXAxis );
|
||||
return ORIGIN_TRANSFORMS::ToDisplayRel( aInternalValue, invertXAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T ToDisplayRelY( T aInternalValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::ToDisplayRel( aInternalValue, m_invertYAxis );
|
||||
return ORIGIN_TRANSFORMS::ToDisplayRel( aInternalValue, invertYAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T FromDisplayRelX( T aDisplayValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::FromDisplayRel( aDisplayValue, m_invertXAxis );
|
||||
return ORIGIN_TRANSFORMS::FromDisplayRel( aDisplayValue, invertXAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T FromDisplayRelY( T aDisplayValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::FromDisplayRel( aDisplayValue, m_invertYAxis );
|
||||
return ORIGIN_TRANSFORMS::FromDisplayRel( aDisplayValue, invertYAxis() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,25 +121,25 @@ public:
|
|||
template<typename T>
|
||||
T ToDisplayAbsX( T aInternalValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::ToDisplayAbs( aInternalValue, GetUserXOrigin(), m_invertXAxis );
|
||||
return ORIGIN_TRANSFORMS::ToDisplayAbs( aInternalValue, getUserXOrigin(), invertXAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T ToDisplayAbsY( T aInternalValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::ToDisplayAbs( aInternalValue, GetUserYOrigin(), m_invertYAxis );
|
||||
return ORIGIN_TRANSFORMS::ToDisplayAbs( aInternalValue, getUserYOrigin(), invertYAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T FromDisplayAbsX( T aDisplayValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::FromDisplayAbs( aDisplayValue, GetUserXOrigin(), m_invertXAxis );
|
||||
return ORIGIN_TRANSFORMS::FromDisplayAbs( aDisplayValue, getUserXOrigin(), invertXAxis() );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T FromDisplayAbsY( T aDisplayValue ) const
|
||||
{
|
||||
return ORIGIN_TRANSFORMS::FromDisplayAbs( aDisplayValue, GetUserYOrigin(), m_invertYAxis );
|
||||
return ORIGIN_TRANSFORMS::FromDisplayAbs( aDisplayValue, getUserYOrigin(), invertYAxis() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,13 +190,14 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
int GetUserXOrigin() const;
|
||||
int GetUserYOrigin() const;
|
||||
int getUserXOrigin() const;
|
||||
int getUserYOrigin() const;
|
||||
|
||||
bool invertXAxis() const;
|
||||
bool invertYAxis() const;
|
||||
|
||||
protected:
|
||||
const PCB_BASE_FRAME& m_pcbBaseFrame;
|
||||
const bool& m_invertXAxis;
|
||||
const bool& m_invertYAxis;
|
||||
};
|
||||
|
||||
#endif // PCB_ORIGIN_TRANSFORMS_H_
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <pcb_dimension.h>
|
||||
#include <pcb_target.h>
|
||||
#include <advanced_config.h>
|
||||
#include <core/arraydim.h>
|
||||
|
||||
#include <layer_ids.h>
|
||||
#include <pcb_painter.h>
|
||||
|
@ -66,21 +65,19 @@ using namespace KIGFX;
|
|||
PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
|
||||
{
|
||||
m_backgroundColor = COLOR4D( 0.0, 0.0, 0.0, 1.0 );
|
||||
m_zoneOutlines = true;
|
||||
m_zoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
|
||||
m_sketchGraphics = false;
|
||||
m_sketchText = false;
|
||||
m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
|
||||
m_netColorMode = NET_COLOR_MODE::RATSNEST;
|
||||
m_contrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
|
||||
m_DrawIndividualViaLayers = false;
|
||||
|
||||
m_trackOpacity = 1.0;
|
||||
m_viaOpacity = 1.0;
|
||||
m_padOpacity = 1.0;
|
||||
m_zoneOpacity = 1.0;
|
||||
|
||||
// By default everything should be displayed as filled
|
||||
for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
|
||||
m_sketchMode[i] = false;
|
||||
m_ForceClearanceDisplayOff = false;
|
||||
m_ForcePadSketchModeOff = false;
|
||||
m_ForcePadSketchModeOn = false;
|
||||
|
||||
SetDashLengthRatio( 12 ); // From ISO 128-2
|
||||
SetGapLengthRatio( 3 ); // From ISO 128-2
|
||||
|
@ -138,22 +135,9 @@ void PCB_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
|
|||
void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions )
|
||||
{
|
||||
m_hiContrastEnabled = aOptions.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL;
|
||||
m_sketchGraphics = !aOptions.m_DisplayGraphicsFill;
|
||||
m_sketchText = !aOptions.m_DisplayTextFill;
|
||||
|
||||
// Whether to draw tracks, vias & pads filled or as outlines
|
||||
m_sketchMode[LAYER_PADS_TH] = !aOptions.m_DisplayPadFill;
|
||||
m_sketchMode[LAYER_VIA_THROUGH] = !aOptions.m_DisplayViaFill;
|
||||
m_sketchMode[LAYER_VIA_BBLIND] = !aOptions.m_DisplayViaFill;
|
||||
m_sketchMode[LAYER_VIA_MICROVIA] = !aOptions.m_DisplayViaFill;
|
||||
m_sketchMode[LAYER_TRACKS] = !aOptions.m_DisplayPcbTrackFill;
|
||||
|
||||
// Zone display settings
|
||||
m_zoneDisplayMode = aOptions.m_ZoneDisplayMode;
|
||||
|
||||
m_contrastModeDisplay = aOptions.m_ContrastModeDisplay;
|
||||
|
||||
m_netColorMode = aOptions.m_NetColorMode;
|
||||
m_ZoneDisplayMode = aOptions.m_ZoneDisplayMode;
|
||||
m_ContrastModeDisplay = aOptions.m_ContrastModeDisplay;
|
||||
m_netColorMode = aOptions.m_NetColorMode;
|
||||
|
||||
m_trackOpacity = aOptions.m_TrackOpacity;
|
||||
m_viaOpacity = aOptions.m_ViaOpacity;
|
||||
|
@ -338,7 +322,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
|||
|
||||
if( !isActive )
|
||||
{
|
||||
if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN || IsNetnameLayer( aLayer ) )
|
||||
if( m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN || IsNetnameLayer( aLayer ) )
|
||||
color = COLOR4D::CLEAR;
|
||||
else
|
||||
color = color.Mix( m_layerColors[LAYER_PCB_BACKGROUND], m_hiContrastFactor );
|
||||
|
@ -636,7 +620,7 @@ void PCB_PAINTER::draw( const PCB_TRACK* aTrack, int aLayer )
|
|||
else if( IsCopperLayer( aLayer ) )
|
||||
{
|
||||
// Draw a regular track
|
||||
bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayPcbTrackFill;
|
||||
m_gal->SetStrokeColor( color );
|
||||
m_gal->SetFillColor( color );
|
||||
m_gal->SetIsStroke( outline_mode );
|
||||
|
@ -647,7 +631,8 @@ void PCB_PAINTER::draw( const PCB_TRACK* aTrack, int aLayer )
|
|||
}
|
||||
|
||||
// Clearance lines
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode == SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS )
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode == SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS
|
||||
&& !m_pcbSettings.m_ForceClearanceDisplayOff )
|
||||
{
|
||||
int clearance = aTrack->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
|
||||
|
||||
|
@ -677,7 +662,7 @@ void PCB_PAINTER::draw( const PCB_ARC* aArc, int aLayer )
|
|||
else if( IsCopperLayer( aLayer ) )
|
||||
{
|
||||
// Draw a regular track
|
||||
bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayPcbTrackFill;
|
||||
m_gal->SetStrokeColor( color );
|
||||
m_gal->SetFillColor( color );
|
||||
m_gal->SetIsStroke( outline_mode );
|
||||
|
@ -688,7 +673,8 @@ void PCB_PAINTER::draw( const PCB_ARC* aArc, int aLayer )
|
|||
}
|
||||
|
||||
// Clearance lines
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode >= SHOW_TRACK_CLEARANCE_WHILE_ROUTING )
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode >= SHOW_TRACK_CLEARANCE_WHILE_ROUTING
|
||||
&& !m_pcbSettings.m_ForceClearanceDisplayOff )
|
||||
{
|
||||
int clearance = aArc->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
|
||||
|
||||
|
@ -800,19 +786,10 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
return;
|
||||
}
|
||||
|
||||
bool sketchMode = false;
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayViaFill;
|
||||
|
||||
switch( aVia->GetViaType() )
|
||||
if( outline_mode )
|
||||
{
|
||||
case VIATYPE::THROUGH: sketchMode = m_pcbSettings.m_sketchMode[LAYER_VIA_THROUGH]; break;
|
||||
case VIATYPE::BLIND_BURIED: sketchMode = m_pcbSettings.m_sketchMode[LAYER_VIA_BBLIND]; break;
|
||||
case VIATYPE::MICROVIA: sketchMode = m_pcbSettings.m_sketchMode[LAYER_VIA_MICROVIA]; break;
|
||||
default: wxASSERT( false ); break;
|
||||
}
|
||||
|
||||
if( sketchMode )
|
||||
{
|
||||
// Outline mode
|
||||
m_gal->SetIsStroke( true );
|
||||
m_gal->SetIsFill( false );
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
|
@ -820,7 +797,6 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
}
|
||||
else
|
||||
{
|
||||
// Filled mode
|
||||
m_gal->SetIsFill( true );
|
||||
m_gal->SetIsStroke( false );
|
||||
m_gal->SetFillColor( color );
|
||||
|
@ -830,7 +806,7 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
{
|
||||
m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 );
|
||||
}
|
||||
else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.GetDrawIndividualViaLayers() )
|
||||
else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.m_DrawIndividualViaLayers )
|
||||
{
|
||||
m_gal->DrawCircle( center, aVia->GetWidth() / 2.0 );
|
||||
}
|
||||
|
@ -843,20 +819,20 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
|
||||
double radius = aVia->GetWidth() / 2.0;
|
||||
|
||||
if( !sketchMode )
|
||||
if( !outline_mode )
|
||||
m_gal->SetLineWidth( ( aVia->GetWidth() - aVia->GetDrillValue() ) / 2.0 );
|
||||
|
||||
m_gal->DrawArc( center, radius, M_PI * -0.375, M_PI * 0.375 );
|
||||
m_gal->DrawArc( center, radius, M_PI * 0.625, M_PI * 1.375 );
|
||||
|
||||
if( sketchMode )
|
||||
if( outline_mode )
|
||||
m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerTop ) );
|
||||
else
|
||||
m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerTop ) );
|
||||
|
||||
m_gal->DrawArc( center, radius, M_PI * 1.375, M_PI * 1.625 );
|
||||
|
||||
if( sketchMode )
|
||||
if( outline_mode )
|
||||
m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
|
||||
else
|
||||
m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
|
||||
|
@ -865,8 +841,9 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
}
|
||||
|
||||
// Clearance lines
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode >= SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING
|
||||
&& aLayer != LAYER_VIA_HOLES )
|
||||
if( pcbconfig()->m_Display.m_ShowTrackClearanceMode == SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS
|
||||
&& aLayer != LAYER_VIA_HOLES
|
||||
&& !m_pcbSettings.m_ForceClearanceDisplayOff )
|
||||
{
|
||||
PCB_LAYER_ID activeLayer = m_pcbSettings.GetActiveLayer();
|
||||
double radius;
|
||||
|
@ -1029,7 +1006,14 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
return;
|
||||
}
|
||||
|
||||
if( m_pcbSettings.m_sketchMode[LAYER_PADS_TH] )
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayPadFill;
|
||||
|
||||
if( m_pcbSettings.m_ForcePadSketchModeOff )
|
||||
outline_mode = false;
|
||||
else if( m_pcbSettings.m_ForcePadSketchModeOn )
|
||||
outline_mode = true;
|
||||
|
||||
if( outline_mode )
|
||||
{
|
||||
// Outline mode
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -1080,7 +1064,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
std::shared_ptr<SHAPE_COMPOUND> shapes;
|
||||
|
||||
// Drawing components of compound shapes in outline mode produces a mess.
|
||||
bool simpleShapes = !m_pcbSettings.m_sketchMode[LAYER_PADS_TH];
|
||||
bool simpleShapes = !outline_mode;
|
||||
|
||||
if( simpleShapes )
|
||||
{
|
||||
|
@ -1267,7 +1251,8 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
}
|
||||
|
||||
if( pcbconfig()->m_Display.m_DisplayPadClearance
|
||||
&& ( aLayer == LAYER_PAD_FR || aLayer == LAYER_PAD_BK || aLayer == LAYER_PADS_TH ) )
|
||||
&& ( aLayer == LAYER_PAD_FR || aLayer == LAYER_PAD_BK || aLayer == LAYER_PADS_TH )
|
||||
&& !m_pcbSettings.m_ForceClearanceDisplayOff )
|
||||
{
|
||||
/* Showing the clearance area is not obvious.
|
||||
* - A pad can be removed from some copper layers.
|
||||
|
@ -1333,11 +1318,11 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
||||
{
|
||||
const COLOR4D& color = m_pcbSettings.GetColor( aShape, aShape->GetLayer() );
|
||||
bool sketch = m_pcbSettings.m_sketchGraphics;
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayGraphicsFill;
|
||||
int thickness = getLineThickness( aShape->GetWidth() );
|
||||
PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle();
|
||||
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
|
@ -1352,7 +1337,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
switch( aShape->GetShape() )
|
||||
{
|
||||
case SHAPE_T::SEGMENT:
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
|
||||
}
|
||||
|
@ -1370,7 +1355,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
{
|
||||
std::vector<wxPoint> pts = aShape->GetRectCorners();
|
||||
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
m_gal->DrawSegment( pts[0], pts[1], thickness );
|
||||
m_gal->DrawSegment( pts[1], pts[2], thickness );
|
||||
|
@ -1411,7 +1396,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
double endAngle;
|
||||
aShape->CalcArcAngles( startAngle, endAngle );
|
||||
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(),
|
||||
DEG2RAD( startAngle ), DEG2RAD( endAngle ), thickness,
|
||||
|
@ -1430,7 +1415,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
}
|
||||
|
||||
case SHAPE_T::CIRCLE:
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() - thickness / 2 );
|
||||
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() + thickness / 2 );
|
||||
|
@ -1460,7 +1445,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
m_gal->Rotate( -parentFootprint->GetOrientationRadians() );
|
||||
}
|
||||
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
|
||||
{
|
||||
|
@ -1502,7 +1487,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
}
|
||||
|
||||
case SHAPE_T::BEZIER:
|
||||
if( sketch )
|
||||
if( outline_mode )
|
||||
{
|
||||
std::vector<VECTOR2D> output;
|
||||
std::vector<VECTOR2D> pointCtrl;
|
||||
|
@ -1540,7 +1525,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( !sketch )
|
||||
if( !outline_mode )
|
||||
{
|
||||
m_gal->SetIsFill( true );
|
||||
m_gal->SetIsStroke( false );
|
||||
|
@ -1572,17 +1557,12 @@ void PCB_PAINTER::draw( const PCB_TEXT* aText, int aLayer )
|
|||
|
||||
const COLOR4D& color = m_pcbSettings.GetColor( aText, aText->GetLayer() );
|
||||
VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayTextFill;
|
||||
|
||||
if( m_pcbSettings.m_sketchText || m_pcbSettings.m_sketchMode[aLayer] )
|
||||
{
|
||||
// Outline mode
|
||||
if( outline_mode )
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Filled mode
|
||||
m_gal->SetLineWidth( getLineThickness( aText->GetEffectiveTextPenWidth() ) );
|
||||
}
|
||||
|
||||
m_gal->SetStrokeColor( color );
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -1601,17 +1581,12 @@ void PCB_PAINTER::draw( const FP_TEXT* aText, int aLayer )
|
|||
|
||||
const COLOR4D& color = m_pcbSettings.GetColor( aText, aLayer );
|
||||
VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayTextFill;
|
||||
|
||||
if( m_pcbSettings.m_sketchText )
|
||||
{
|
||||
// Outline mode
|
||||
if( outline_mode )
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Filled mode
|
||||
m_gal->SetLineWidth( getLineThickness( aText->GetEffectiveTextPenWidth() ) );
|
||||
}
|
||||
|
||||
m_gal->SetStrokeColor( color );
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -1738,12 +1713,12 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
|
|||
|
||||
COLOR4D color = m_pcbSettings.GetColor( aZone, layer );
|
||||
std::deque<VECTOR2D> corners;
|
||||
ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_zoneDisplayMode;
|
||||
ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_ZoneDisplayMode;
|
||||
|
||||
// Draw the outline
|
||||
const SHAPE_POLY_SET* outline = aZone->Outline();
|
||||
|
||||
if( m_pcbSettings.m_zoneOutlines && outline && outline->OutlineCount() > 0 )
|
||||
if( !m_pcbSettings.m_isPrinting && outline && outline->OutlineCount() > 0 )
|
||||
{
|
||||
m_gal->SetStrokeColor( color.a > 0.0 ? color.WithAlpha( 1.0 ) : color );
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -1816,16 +1791,12 @@ void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer )
|
|||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
|
||||
if( m_pcbSettings.m_sketchGraphics )
|
||||
{
|
||||
// Outline mode
|
||||
bool outline_mode = !pcbconfig()->m_Display.m_DisplayGraphicsFill;
|
||||
|
||||
if( outline_mode )
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Filled mode
|
||||
m_gal->SetLineWidth( getLineThickness( aDimension->GetLineThickness() ) );
|
||||
}
|
||||
|
||||
// Draw dimension shapes
|
||||
// TODO(JE) lift this out
|
||||
|
@ -1854,18 +1825,12 @@ void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer )
|
|||
|
||||
// Draw text
|
||||
const PCB_TEXT& text = aDimension->Text();
|
||||
VECTOR2D position( text.GetTextPos().x, text.GetTextPos().y );
|
||||
VECTOR2D position( text.GetTextPos().x, text.GetTextPos().y );
|
||||
|
||||
if( m_pcbSettings.m_sketchText )
|
||||
{
|
||||
// Outline mode
|
||||
if( outline_mode )
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Filled mode
|
||||
m_gal->SetLineWidth( getLineThickness( text.GetEffectiveTextPenWidth() ) );
|
||||
}
|
||||
|
||||
m_gal->SetTextAttributes( &text );
|
||||
m_gal->StrokeText( text.GetShownText(), position, text.GetTextAngleRadians() );
|
||||
|
|
|
@ -83,47 +83,6 @@ public:
|
|||
|
||||
bool GetShowPageLimits() const override;
|
||||
|
||||
/**
|
||||
* Turn on/off sketch mode for given item layer.
|
||||
*
|
||||
* @param aItemLayer is the item layer that is changed.
|
||||
* @param aEnabled decides if it is drawn in sketch mode (true for sketched mode,
|
||||
* false for filled mode).
|
||||
*/
|
||||
inline void SetSketchMode( int aItemLayer, bool aEnabled )
|
||||
{
|
||||
m_sketchMode[aItemLayer] = aEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sketch mode setting for a given item layer.
|
||||
*
|
||||
* @param aItemLayer is the item layer that is changed.
|
||||
*/
|
||||
inline bool GetSketchMode( int aItemLayer ) const
|
||||
{
|
||||
return m_sketchMode[aItemLayer];
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off sketch mode for graphic items (DRAWSEGMENTs, texts).
|
||||
*
|
||||
* @param aEnabled decides if it is drawn in sketch mode (true for sketched mode,
|
||||
* false for filled mode).
|
||||
*/
|
||||
inline void SetSketchModeGraphicItems( bool aEnabled )
|
||||
{
|
||||
m_sketchGraphics = aEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off drawing outline and hatched lines for zones.
|
||||
*/
|
||||
void EnableZoneOutlines( bool aEnabled )
|
||||
{
|
||||
m_zoneOutlines = aEnabled;
|
||||
}
|
||||
|
||||
inline bool IsBackgroundDark() const override
|
||||
{
|
||||
auto luma = m_layerColors[ LAYER_PCB_BACKGROUND ].GetBrightness();
|
||||
|
@ -142,20 +101,6 @@ public:
|
|||
|
||||
const COLOR4D& GetCursorColor() override { return m_layerColors[ LAYER_CURSOR ]; }
|
||||
|
||||
/**
|
||||
* Switch the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
|
||||
* to control how the non active layers are shown
|
||||
*/
|
||||
void SetContrastModeDisplay( HIGH_CONTRAST_MODE aMode ) { m_contrastModeDisplay = aMode; }
|
||||
|
||||
/**
|
||||
* @return the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN ).
|
||||
*/
|
||||
HIGH_CONTRAST_MODE GetContrastModeDisplay() { return m_contrastModeDisplay; }
|
||||
|
||||
bool GetDrawIndividualViaLayers() const { return m_drawIndividualViaLayers; }
|
||||
void SetDrawIndividualViaLayers( bool aFlag ) { m_drawIndividualViaLayers = aFlag; }
|
||||
|
||||
NET_COLOR_MODE GetNetColorMode() const { return m_netColorMode; }
|
||||
void SetNetColorMode( NET_COLOR_MODE aMode ) { m_netColorMode = aMode; }
|
||||
|
||||
|
@ -166,25 +111,21 @@ public:
|
|||
std::set<int>& GetHiddenNets() { return m_hiddenNets; }
|
||||
const std::set<int>& GetHiddenNets() const { return m_hiddenNets; }
|
||||
|
||||
void SetZoneDisplayMode( ZONE_DISPLAY_MODE mode ) { m_zoneDisplayMode = mode; }
|
||||
public:
|
||||
bool m_ForceClearanceDisplayOff;
|
||||
bool m_ForcePadSketchModeOff;
|
||||
bool m_ForcePadSketchModeOn;
|
||||
|
||||
ZONE_DISPLAY_MODE m_ZoneDisplayMode;
|
||||
HIGH_CONTRAST_MODE m_ContrastModeDisplay;
|
||||
bool m_DrawIndividualViaLayers;
|
||||
|
||||
protected:
|
||||
///< Maximum font size for netnames (and other dynamically shown strings)
|
||||
static const double MAX_FONT_SIZE;
|
||||
|
||||
bool m_sketchMode[GAL_LAYER_ID_END];
|
||||
bool m_sketchGraphics;
|
||||
bool m_sketchText;
|
||||
|
||||
bool m_zoneOutlines;
|
||||
|
||||
bool m_drawIndividualViaLayers = false;
|
||||
|
||||
ZONE_DISPLAY_MODE m_zoneDisplayMode;
|
||||
HIGH_CONTRAST_MODE m_contrastModeDisplay;
|
||||
|
||||
///< How to display nets and netclasses with color overrides
|
||||
NET_COLOR_MODE m_netColorMode;
|
||||
NET_COLOR_MODE m_netColorMode;
|
||||
|
||||
///< Overrides for specific netclass colors
|
||||
std::map<wxString, KIGFX::COLOR4D> m_netclassColors;
|
||||
|
|
|
@ -34,13 +34,11 @@
|
|||
#include <project.h>
|
||||
#include <widgets/appearance_controls.h>
|
||||
#include <widgets/panel_selection_filter.h>
|
||||
#include <widgets/paged_dialog.h>
|
||||
#include <project/net_settings.h>
|
||||
#include <project/project_file.h>
|
||||
#include <project/project_local_settings.h>
|
||||
|
||||
|
||||
|
||||
bool PCB_EDIT_FRAME::LoadProjectSettings()
|
||||
{
|
||||
PROJECT_FILE& project = Prj().GetProjectFile();
|
||||
|
@ -54,9 +52,7 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
|
|||
Prj().GetProjectPath());
|
||||
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
|
||||
{
|
||||
ShowInfoBarError( _( "Error loading drawing sheet." ), true );
|
||||
}
|
||||
|
||||
// Load render settings that aren't stored in PCB_DISPLAY_OPTIONS
|
||||
|
||||
|
@ -105,7 +101,6 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
|
|||
PCB_DISPLAY_OPTIONS opts = GetDisplayOptions();
|
||||
opts.m_ContrastModeDisplay = localSettings.m_ContrastModeDisplay;
|
||||
opts.m_NetColorMode = localSettings.m_NetColorMode;
|
||||
opts.m_RatsnestMode = localSettings.m_RatsnestMode;
|
||||
opts.m_TrackOpacity = localSettings.m_TrackOpacity;
|
||||
opts.m_ViaOpacity = localSettings.m_ViaOpacity;
|
||||
opts.m_PadOpacity = localSettings.m_PadOpacity;
|
||||
|
@ -159,7 +154,6 @@ void PCB_EDIT_FRAME::SaveProjectSettings()
|
|||
|
||||
localSettings.m_ContrastModeDisplay = displayOpts.m_ContrastModeDisplay;
|
||||
localSettings.m_NetColorMode = displayOpts.m_NetColorMode;
|
||||
localSettings.m_RatsnestMode = displayOpts.m_RatsnestMode;
|
||||
localSettings.m_TrackOpacity = displayOpts.m_TrackOpacity;
|
||||
localSettings.m_ViaOpacity = displayOpts.m_ViaOpacity;
|
||||
localSettings.m_PadOpacity = displayOpts.m_PadOpacity;
|
||||
|
|
|
@ -261,8 +261,8 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter )
|
|||
break;
|
||||
}
|
||||
|
||||
painter.GetSettings()->SetDrawIndividualViaLayers(
|
||||
m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE );
|
||||
painter.GetSettings()->m_DrawIndividualViaLayers =
|
||||
m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,9 +289,7 @@ KIGFX::PCB_PRINT_PAINTER::PCB_PRINT_PAINTER( GAL* aGal ) :
|
|||
PCB_PAINTER( aGal ),
|
||||
m_drillMarkReal( false ),
|
||||
m_drillMarkSize( 0 )
|
||||
{
|
||||
m_pcbSettings.EnableZoneOutlines( false );
|
||||
}
|
||||
{ }
|
||||
|
||||
|
||||
int KIGFX::PCB_PRINT_PAINTER::getDrillShape( const PAD* aPad ) const
|
||||
|
|
|
@ -181,13 +181,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
|||
m_params.emplace_back( new PARAM<bool>( "pcb_display.via_fill",
|
||||
&m_Display.m_DisplayViaFill, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "pcb_display.zone_mode",
|
||||
&m_Display.m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED,
|
||||
ZONE_DISPLAY_MODE::SHOW_TRIANGULATION, ZONE_DISPLAY_MODE::SHOW_FILLED ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "pcb_display.origin_mode",
|
||||
reinterpret_cast<int*>( &m_Display.m_DisplayOrigin ),
|
||||
PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE ) );
|
||||
PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_x_axis",
|
||||
&m_Display.m_DisplayInvertXAxis, false ) );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -29,6 +29,7 @@ namespace PNS
|
|||
class ROUTING_SETTINGS;
|
||||
}
|
||||
|
||||
|
||||
enum class MAGNETIC_OPTIONS
|
||||
{
|
||||
NO_EFFECT = 0,
|
||||
|
@ -36,20 +37,21 @@ enum class MAGNETIC_OPTIONS
|
|||
CAPTURE_ALWAYS
|
||||
};
|
||||
|
||||
|
||||
struct MAGNETIC_SETTINGS
|
||||
{
|
||||
MAGNETIC_OPTIONS pads;
|
||||
MAGNETIC_OPTIONS tracks;
|
||||
bool graphics;
|
||||
|
||||
MAGNETIC_SETTINGS()
|
||||
: pads( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
||||
tracks( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
||||
graphics( false )
|
||||
{
|
||||
}
|
||||
MAGNETIC_SETTINGS() :
|
||||
pads( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
||||
tracks( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
||||
graphics( false )
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
enum class TRACK_DRAG_ACTION
|
||||
{
|
||||
MOVE,
|
||||
|
@ -57,6 +59,25 @@ enum class TRACK_DRAG_ACTION
|
|||
DRAG_FREE_ANGLE
|
||||
};
|
||||
|
||||
|
||||
enum TRACK_CLEARANCE_MODE
|
||||
{
|
||||
DO_NOT_SHOW_CLEARANCE = 0,
|
||||
SHOW_TRACK_CLEARANCE_WHILE_ROUTING,
|
||||
SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING,
|
||||
SHOW_WHILE_ROUTING_OR_DRAGGING,
|
||||
SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS
|
||||
};
|
||||
|
||||
|
||||
enum PCB_DISPLAY_ORIGIN
|
||||
{
|
||||
PCB_ORIGIN_PAGE = 0,
|
||||
PCB_ORIGIN_AUX,
|
||||
PCB_ORIGIN_GRID,
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<std::pair<wxString, bool>> ACTION_PLUGIN_SETTINGS_LIST;
|
||||
|
||||
|
||||
|
@ -227,6 +248,35 @@ public:
|
|||
double thermal_relief_copper_width;
|
||||
};
|
||||
|
||||
struct DISPLAY_OPTIONS
|
||||
{
|
||||
bool m_DisplayPadFill;
|
||||
bool m_DisplayViaFill;
|
||||
bool m_DisplayGraphicsFill;
|
||||
bool m_DisplayTextFill;
|
||||
bool m_DisplayPcbTrackFill;
|
||||
|
||||
TRACK_CLEARANCE_MODE m_ShowTrackClearanceMode;
|
||||
bool m_DisplayPadClearance;
|
||||
|
||||
int m_DisplayNetNamesMode;
|
||||
bool m_DisplayPadNum;
|
||||
bool m_DisplayPadNoConnects;
|
||||
|
||||
RATSNEST_MODE m_RatsnestMode;
|
||||
|
||||
int m_MaxLinksShowed;
|
||||
bool m_ShowModuleRatsnest;
|
||||
bool m_ShowGlobalRatsnest;
|
||||
bool m_DisplayRatsnestLinesCurved;
|
||||
|
||||
PCB_DISPLAY_ORIGIN m_DisplayOrigin;
|
||||
bool m_DisplayInvertXAxis;
|
||||
bool m_DisplayInvertYAxis;
|
||||
|
||||
bool m_Live3DRefresh;
|
||||
};
|
||||
|
||||
PCBNEW_SETTINGS();
|
||||
|
||||
virtual ~PCBNEW_SETTINGS();
|
||||
|
@ -269,7 +319,7 @@ public:
|
|||
|
||||
WINDOW_SETTINGS m_FootprintWizard;
|
||||
|
||||
PCB_DISPLAY_OPTIONS m_Display;
|
||||
DISPLAY_OPTIONS m_Display;
|
||||
|
||||
MAGNETIC_SETTINGS m_MagneticItems;
|
||||
|
||||
|
|
|
@ -3469,6 +3469,7 @@ FOOTPRINT* PCB_PARSER::parseFOOTPRINT_unchecked( wxArrayString* aInitialComments
|
|||
|
||||
case T_allow_missing_courtyard:
|
||||
attributes |= FP_ALLOW_MISSING_COURTYARD;
|
||||
break;
|
||||
|
||||
case T_allow_soldermask_bridges:
|
||||
attributes |= FP_ALLOW_SOLDERMASK_BRIDGES;
|
||||
|
|
|
@ -89,7 +89,7 @@ void RATSNEST_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
LSET visibleLayers;
|
||||
|
||||
// If we are in "other layers off" mode, the active layer is the only visible layer
|
||||
if( rs->GetContrastModeDisplay() == HIGH_CONTRAST_MODE::HIDDEN )
|
||||
if( rs->m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN )
|
||||
{
|
||||
visibleLayers.set( rs->GetPrimaryHighContrastLayer() );
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <pcbnew_settings.h>
|
||||
|
||||
#include "pns_kicad_iface.h"
|
||||
|
||||
|
@ -856,7 +857,6 @@ PNS_KICAD_IFACE::PNS_KICAD_IFACE()
|
|||
m_tool = nullptr;
|
||||
m_view = nullptr;
|
||||
m_previewItems = nullptr;
|
||||
m_dispOptions = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1422,7 +1422,9 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aClearance, bool
|
|||
{
|
||||
pitem->SetClearance( aClearance );
|
||||
|
||||
switch( m_dispOptions->m_ShowTrackClearanceMode )
|
||||
auto* settings = static_cast<PCBNEW_SETTINGS*>( m_tool->GetManager()->GetSettings() );
|
||||
|
||||
switch( settings->m_Display.m_ShowTrackClearanceMode )
|
||||
{
|
||||
case SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS:
|
||||
case SHOW_WHILE_ROUTING_OR_DRAGGING:
|
||||
|
@ -1722,9 +1724,3 @@ void PNS_KICAD_IFACE::SetHostTool( PCB_TOOL_BASE* aTool )
|
|||
m_tool = aTool;
|
||||
m_commit = std::make_unique<BOARD_COMMIT>( m_tool );
|
||||
}
|
||||
|
||||
|
||||
void PNS_KICAD_IFACE::SetDisplayOptions( const PCB_DISPLAY_OPTIONS* aDispOptions )
|
||||
{
|
||||
m_dispOptions = aDispOptions;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,6 @@ public:
|
|||
~PNS_KICAD_IFACE();
|
||||
|
||||
void SetHostTool( PCB_TOOL_BASE* aTool );
|
||||
void SetDisplayOptions( const PCB_DISPLAY_OPTIONS* aDispOptions );
|
||||
|
||||
void SetView( KIGFX::VIEW* aView );
|
||||
void EraseView() override;
|
||||
|
@ -141,7 +140,6 @@ private:
|
|||
|
||||
PCB_TOOL_BASE* m_tool;
|
||||
std::unique_ptr<BOARD_COMMIT> m_commit;
|
||||
const PCB_DISPLAY_OPTIONS* m_dispOptions;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ void TOOL_BASE::Reset( RESET_REASON aReason )
|
|||
m_iface->SetBoard( board() );
|
||||
m_iface->SetView( getView() );
|
||||
m_iface->SetHostTool( this );
|
||||
m_iface->SetDisplayOptions( &( frame()->GetDisplayOptions() ) );
|
||||
|
||||
m_router = new ROUTER;
|
||||
m_router->SetInterface( m_iface );
|
||||
|
@ -187,7 +186,7 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, b
|
|||
|
||||
ITEM* rv = nullptr;
|
||||
|
||||
bool highContrast = ( displayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
|
||||
bool highContrast = ( frame()->GetDisplayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
|
||||
|
||||
for( int i = 0; i < candidateCount; i++ )
|
||||
{
|
||||
|
|
|
@ -1085,7 +1085,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
|
|||
|
||||
for( PAD* pad : fp->Pads() )
|
||||
{
|
||||
pad->SetLocalRatsnestVisible( m_frame->GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||
pad->SetLocalRatsnestVisible( m_frame->Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
// Pads in the library all have orphaned nets. Replace with Default.
|
||||
pad->SetNetCode( 0 );
|
||||
|
|
|
@ -878,7 +878,7 @@ int BOARD_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent )
|
|||
m_frame->SendMessageToEESCHEMA( nullptr );
|
||||
|
||||
// Update 3D viewer highlighting
|
||||
m_frame->Update3DView( false, frame()->GetDisplayOptions().m_Live3DRefresh );
|
||||
m_frame->Update3DView( false, frame()->Settings().m_Display.m_Live3DRefresh );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
m_probingSchToPcb = false;
|
||||
|
||||
bool request3DviewRedraw = frame()->GetDisplayOptions().m_Live3DRefresh;
|
||||
bool request3DviewRedraw = frame()->Settings().m_Display.m_Live3DRefresh;
|
||||
|
||||
if( item && item->Type() != PCB_FOOTPRINT_T )
|
||||
request3DviewRedraw = false;
|
||||
|
@ -1159,7 +1159,6 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
|
|||
picker->SetClickHandler(
|
||||
[this, board]( const VECTOR2D& pt ) -> bool
|
||||
{
|
||||
const PCB_DISPLAY_OPTIONS& opt = displayOptions();
|
||||
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
||||
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
@ -1179,7 +1178,7 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
|
|||
for( FOOTPRINT* fp : board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : fp->Pads() )
|
||||
pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
|
||||
pad->SetLocalRatsnestVisible( displayOptions().m_ShowGlobalRatsnest );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1211,14 +1210,12 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
|
|||
picker->SetFinalizeHandler(
|
||||
[this, board]( int aCondition )
|
||||
{
|
||||
const PCB_DISPLAY_OPTIONS& opt = displayOptions();
|
||||
|
||||
if( aCondition != PCB_PICKER_TOOL::END_ACTIVATE )
|
||||
{
|
||||
for( FOOTPRINT* fp : board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : fp->Pads() )
|
||||
pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
|
||||
pad->SetLocalRatsnestVisible( displayOptions().m_ShowGlobalRatsnest );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -783,7 +783,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
|
|||
bool lock45 = false;
|
||||
bool eatFirstMouseUp = true;
|
||||
bool hasRedrawn3D = false;
|
||||
bool allowRedraw3D = editFrame->GetDisplayOptions().m_Live3DRefresh;
|
||||
bool allowRedraw3D = editFrame->Settings().m_Display.m_Live3DRefresh;
|
||||
|
||||
// Prime the pump
|
||||
m_toolMgr->RunAction( ACTIONS::refreshPreview );
|
||||
|
@ -1988,7 +1988,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
|
|||
// Make sure the rotation is from the right reference point
|
||||
selCenter += translation;
|
||||
|
||||
if( !frame()->GetDisplayOptions().m_DisplayInvertYAxis )
|
||||
if( !frame()->Settings().m_Display.m_DisplayInvertYAxis )
|
||||
rotation *= -1.0;
|
||||
|
||||
// When editing footprints, all items have the same parent
|
||||
|
|
|
@ -125,10 +125,7 @@ template<class T> void Flip( T& aValue )
|
|||
|
||||
int PCB_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayPcbTrackFill );
|
||||
m_frame->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayPcbTrackFill );
|
||||
|
||||
for( PCB_TRACK* track : board()->Tracks() )
|
||||
{
|
||||
|
@ -144,21 +141,17 @@ int PCB_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::ToggleRatsnest( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
if( aEvent.IsAction( &PCB_ACTIONS::showRatsnest ) )
|
||||
{
|
||||
// N.B. Do not disable the Ratsnest layer here. We use it for local ratsnest
|
||||
Flip( opts.m_ShowGlobalRatsnest );
|
||||
m_frame->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_ShowGlobalRatsnest );
|
||||
getEditFrame<PCB_EDIT_FRAME>()->SetElementVisibility( LAYER_RATSNEST,
|
||||
opts.m_ShowGlobalRatsnest );
|
||||
displayOptions().m_ShowGlobalRatsnest );
|
||||
|
||||
}
|
||||
else if( aEvent.IsAction( &PCB_ACTIONS::ratsnestLineMode ) )
|
||||
{
|
||||
Flip( opts.m_DisplayRatsnestLinesCurved );
|
||||
m_frame->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayRatsnestLinesCurved );
|
||||
}
|
||||
|
||||
canvas()->RedrawRatsnest();
|
||||
|
@ -170,10 +163,7 @@ int PCB_CONTROL::ToggleRatsnest( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayViaFill );
|
||||
m_frame->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayViaFill );
|
||||
|
||||
for( PCB_TRACK* track : board()->Tracks() )
|
||||
{
|
||||
|
@ -236,7 +226,7 @@ void PCB_CONTROL::unfilledZoneCheck()
|
|||
|
||||
int PCB_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||
|
||||
// Apply new display options to the GAL canvas
|
||||
if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayFilled ) )
|
||||
|
@ -282,7 +272,7 @@ int PCB_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||
|
||||
opts.m_ContrastModeDisplay = opts.m_ContrastModeDisplay == HIGH_CONTRAST_MODE::NORMAL
|
||||
? HIGH_CONTRAST_MODE::DIMMED
|
||||
|
@ -296,7 +286,7 @@ int PCB_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||
|
||||
switch( opts.m_ContrastModeDisplay )
|
||||
{
|
||||
|
@ -313,7 +303,7 @@ int PCB_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::NetColorModeCycle( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||
|
||||
switch( opts.m_NetColorMode )
|
||||
{
|
||||
|
@ -330,24 +320,20 @@ int PCB_CONTROL::NetColorModeCycle( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_CONTROL::RatsnestModeCycle( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
if( !opts.m_ShowGlobalRatsnest )
|
||||
if( !displayOptions().m_ShowGlobalRatsnest )
|
||||
{
|
||||
opts.m_ShowGlobalRatsnest = true;
|
||||
opts.m_RatsnestMode = RATSNEST_MODE::ALL;
|
||||
displayOptions().m_ShowGlobalRatsnest = true;
|
||||
displayOptions().m_RatsnestMode = RATSNEST_MODE::ALL;
|
||||
}
|
||||
else if( opts.m_RatsnestMode == RATSNEST_MODE::ALL )
|
||||
else if( displayOptions().m_RatsnestMode == RATSNEST_MODE::ALL )
|
||||
{
|
||||
opts.m_RatsnestMode = RATSNEST_MODE::VISIBLE;
|
||||
displayOptions().m_RatsnestMode = RATSNEST_MODE::VISIBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
opts.m_ShowGlobalRatsnest = false;
|
||||
displayOptions().m_ShowGlobalRatsnest = false;
|
||||
}
|
||||
|
||||
m_frame->SetDisplayOptions( opts );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 Ian McInerney <ian.s.mcinerney at ieee.org>
|
||||
* 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
|
||||
|
@ -146,37 +146,37 @@ bool PCB_EDITOR_CONDITIONS::hasItemsFunc( const SELECTION& aSelection, PCB_BASE_
|
|||
|
||||
bool PCB_EDITOR_CONDITIONS::padNumberDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayPadNum;
|
||||
return aFrame->Settings().m_Display.m_DisplayPadNum;
|
||||
}
|
||||
|
||||
|
||||
bool PCB_EDITOR_CONDITIONS::padFillDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayPadFill;
|
||||
return aFrame->Settings().m_Display.m_DisplayPadFill;
|
||||
}
|
||||
|
||||
|
||||
bool PCB_EDITOR_CONDITIONS::textFillDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayTextFill;
|
||||
return aFrame->Settings().m_Display.m_DisplayTextFill;
|
||||
}
|
||||
|
||||
|
||||
bool PCB_EDITOR_CONDITIONS::graphicsFillDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayGraphicsFill;
|
||||
return aFrame->Settings().m_Display.m_DisplayGraphicsFill;
|
||||
}
|
||||
|
||||
|
||||
bool PCB_EDITOR_CONDITIONS::viaFillDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayViaFill;
|
||||
return aFrame->Settings().m_Display.m_DisplayViaFill;
|
||||
}
|
||||
|
||||
|
||||
bool PCB_EDITOR_CONDITIONS::trackFillDisplayFunc( const SELECTION& aSelection, PCB_BASE_FRAME* aFrame )
|
||||
{
|
||||
return aFrame->GetDisplayOptions().m_DisplayPcbTrackFill;
|
||||
return aFrame->Settings().m_Display.m_DisplayPcbTrackFill;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-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
|
||||
|
@ -295,9 +295,9 @@ void PCB_TOOL_BASE::setTransitions()
|
|||
}
|
||||
|
||||
|
||||
const PCB_DISPLAY_OPTIONS& PCB_TOOL_BASE::displayOptions() const
|
||||
PCBNEW_SETTINGS::DISPLAY_OPTIONS& PCB_TOOL_BASE::displayOptions() const
|
||||
{
|
||||
return frame()->GetDisplayOptions();
|
||||
return frame()->GetPcbNewSettings()->m_Display;
|
||||
}
|
||||
|
||||
PCB_DRAW_PANEL_GAL* PCB_TOOL_BASE::canvas() const
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -34,7 +34,7 @@
|
|||
#include <view/view_group.h>
|
||||
#include <pcb_view.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
|
||||
#include <pcbnew_settings.h>
|
||||
#include <functional>
|
||||
#include <tool/tool_menu.h>
|
||||
|
||||
|
@ -169,7 +169,7 @@ protected:
|
|||
return board()->GetFirstFootprint();
|
||||
}
|
||||
|
||||
const PCB_DISPLAY_OPTIONS& displayOptions() const;
|
||||
PCBNEW_SETTINGS::DISPLAY_OPTIONS& displayOptions() const;
|
||||
|
||||
PCB_DRAW_PANEL_GAL* canvas() const;
|
||||
|
||||
|
@ -179,7 +179,6 @@ protected:
|
|||
|
||||
protected:
|
||||
bool m_isFootprintEditor;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-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
|
||||
|
@ -90,10 +90,7 @@ template<class T> void Flip( T& aValue )
|
|||
|
||||
int PCB_VIEWER_TOOLS::ShowPadNumbers( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
auto opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayPadNum );
|
||||
frame()->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayPadNum );
|
||||
|
||||
for( FOOTPRINT* fp : board()->Footprints() )
|
||||
{
|
||||
|
@ -109,10 +106,7 @@ int PCB_VIEWER_TOOLS::ShowPadNumbers( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_VIEWER_TOOLS::PadDisplayMode( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
auto opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayPadFill );
|
||||
frame()->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayPadFill );
|
||||
|
||||
for( FOOTPRINT* fp : board()->Footprints() )
|
||||
{
|
||||
|
@ -128,10 +122,7 @@ int PCB_VIEWER_TOOLS::PadDisplayMode( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayGraphicsFill );
|
||||
frame()->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayGraphicsFill );
|
||||
|
||||
for( FOOTPRINT* fp : board()->Footprints() )
|
||||
{
|
||||
|
@ -160,10 +151,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_VIEWER_TOOLS::TextOutlines( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opts = displayOptions();
|
||||
|
||||
Flip( opts.m_DisplayTextFill );
|
||||
frame()->SetDisplayOptions( opts );
|
||||
Flip( displayOptions().m_DisplayTextFill );
|
||||
|
||||
for( FOOTPRINT* fp : board()->Footprints() )
|
||||
{
|
||||
|
@ -213,8 +201,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
bool originSet = false;
|
||||
EDA_UNITS units = frame()->GetUserUnits();
|
||||
KIGFX::PREVIEW::RULER_ITEM ruler( twoPtMgr, units,
|
||||
frame()->GetDisplayOptions().m_DisplayInvertXAxis,
|
||||
frame()->GetDisplayOptions().m_DisplayInvertYAxis );
|
||||
displayOptions().m_DisplayInvertXAxis,
|
||||
displayOptions().m_DisplayInvertYAxis );
|
||||
|
||||
view.Add( &ruler );
|
||||
view.SetVisible( &ruler, false );
|
||||
|
@ -328,8 +316,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( evt->IsAction( &ACTIONS::updatePreferences ) )
|
||||
{
|
||||
ruler.UpdateDir( frame()->GetDisplayOptions().m_DisplayInvertXAxis,
|
||||
frame()->GetDisplayOptions().m_DisplayInvertYAxis );
|
||||
ruler.UpdateDir( displayOptions().m_DisplayInvertXAxis,
|
||||
displayOptions().m_DisplayInvertYAxis );
|
||||
|
||||
view.Update( &ruler, KIGFX::GEOMETRY );
|
||||
canvas()->Refresh();
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <board.h>
|
||||
#include <tool/tool_interactive.h>
|
||||
#include <pcbnew_settings.h>
|
||||
|
||||
class PCB_BASE_FRAME;
|
||||
|
||||
|
@ -94,9 +95,9 @@ protected:
|
|||
return static_cast<KIGFX::PCB_VIEW*>( getView() );
|
||||
}
|
||||
|
||||
const PCB_DISPLAY_OPTIONS& displayOptions() const
|
||||
PCBNEW_SETTINGS::DISPLAY_OPTIONS& displayOptions() const
|
||||
{
|
||||
return frame()->GetDisplayOptions();
|
||||
return frame()->GetPcbNewSettings()->m_Display;
|
||||
}
|
||||
|
||||
PCB_DRAW_PANEL_GAL* canvas() const
|
||||
|
|
|
@ -1196,10 +1196,7 @@ void APPEARANCE_CONTROLS::setVisibleObjects( GAL_SET aLayers )
|
|||
{
|
||||
// Ratsnest visibility is controlled by the ratsnest option, and not by the preset
|
||||
if( m_frame->IsType( FRAME_PCB_EDITOR ) )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opt = m_frame->GetDisplayOptions();
|
||||
aLayers.set( LAYER_RATSNEST, opt.m_ShowGlobalRatsnest );
|
||||
}
|
||||
aLayers.set( LAYER_RATSNEST, m_frame->Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
|
||||
m_frame->GetBoard()->SetVisibleElements( aLayers );
|
||||
}
|
||||
|
@ -1267,16 +1264,16 @@ void APPEARANCE_CONTROLS::UpdateDisplayOptions()
|
|||
|
||||
if( !m_isFpEditor )
|
||||
{
|
||||
if( !options.m_ShowGlobalRatsnest )
|
||||
if( !m_frame->Settings().m_Display.m_ShowGlobalRatsnest )
|
||||
m_rbRatsnestNone->SetValue( true );
|
||||
else if( options.m_RatsnestMode == RATSNEST_MODE::ALL )
|
||||
else if( m_frame->Settings().m_Display.m_RatsnestMode == RATSNEST_MODE::ALL )
|
||||
m_rbRatsnestAllLayers->SetValue( true );
|
||||
else
|
||||
m_rbRatsnestVisLayers->SetValue( true );
|
||||
|
||||
wxASSERT( m_objectSettingsMap.count( LAYER_RATSNEST ) );
|
||||
APPEARANCE_SETTING* ratsnest = m_objectSettingsMap.at( LAYER_RATSNEST );
|
||||
ratsnest->ctl_visibility->SetValue( options.m_ShowGlobalRatsnest );
|
||||
ratsnest->ctl_visibility->SetValue( m_frame->Settings().m_Display.m_ShowGlobalRatsnest );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1929,9 +1926,7 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i
|
|||
|
||||
if( m_frame->IsType( FRAME_PCB_EDITOR ) )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS opt = m_frame->GetDisplayOptions();
|
||||
opt.m_ShowGlobalRatsnest = isVisible;
|
||||
m_frame->SetDisplayOptions( opt );
|
||||
m_frame->Settings().m_Display.m_ShowGlobalRatsnest = isVisible;
|
||||
m_frame->GetBoard()->SetElementVisibility( aLayer, isVisible );
|
||||
m_frame->GetCanvas()->RedrawRatsnest();
|
||||
}
|
||||
|
@ -2902,24 +2897,21 @@ void APPEARANCE_CONTROLS::onNetColorMode( wxCommandEvent& aEvent )
|
|||
|
||||
void APPEARANCE_CONTROLS::onRatsnestMode( wxCommandEvent& aEvent )
|
||||
{
|
||||
PCB_DISPLAY_OPTIONS options = m_frame->GetDisplayOptions();
|
||||
|
||||
if( m_rbRatsnestAllLayers->GetValue() )
|
||||
{
|
||||
options.m_ShowGlobalRatsnest = true;
|
||||
options.m_RatsnestMode = RATSNEST_MODE::ALL;
|
||||
m_frame->Settings().m_Display.m_ShowGlobalRatsnest = true;
|
||||
m_frame->Settings().m_Display.m_RatsnestMode = RATSNEST_MODE::ALL;
|
||||
}
|
||||
else if( m_rbRatsnestVisLayers->GetValue() )
|
||||
{
|
||||
options.m_ShowGlobalRatsnest = true;
|
||||
options.m_RatsnestMode = RATSNEST_MODE::VISIBLE;
|
||||
m_frame->Settings().m_Display.m_ShowGlobalRatsnest = true;
|
||||
m_frame->Settings().m_Display.m_RatsnestMode = RATSNEST_MODE::VISIBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
options.m_ShowGlobalRatsnest = false;
|
||||
m_frame->Settings().m_Display.m_ShowGlobalRatsnest = false;
|
||||
}
|
||||
|
||||
m_frame->SetDisplayOptions( options );
|
||||
m_frame->GetCanvas()->RedrawRatsnest();
|
||||
passOnFocus();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue