Treat sketch mode module items and board items the same.

This commit is contained in:
Jeff Young 2020-05-26 23:21:38 +01:00
parent 6ef6284924
commit d99febba6c
19 changed files with 112 additions and 124 deletions

View File

@ -45,18 +45,17 @@ 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_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_DisplayModTextFill, true ) );
&m_FootprintViewerDisplayOptions.m_DisplayTextFill, true ) );
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.graphic_items_fill",
&m_FootprintViewerDisplayOptions.m_DisplayDrawItemsFill, true ) );
&m_FootprintViewerDisplayOptions.m_DisplayGraphicsFill, true ) );
m_params.emplace_back( new PARAM<bool>( "footprint_viewer.auto_zoom",
&m_FootprintViewerAutoZoom, false ) );

View File

@ -223,8 +223,8 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddSeparator();
m_optionsToolBar->Add( PCB_ACTIONS::showPadNumbers, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::padDisplayMode, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleTextOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleEdgeOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::textOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::graphicsOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Realize();
}
@ -500,8 +500,8 @@ void DISPLAY_FOOTPRINTS_FRAME::SyncToolbars()
m_optionsToolBar->Toggle( PCB_ACTIONS::showPadNumbers, opts.m_DisplayPadNum );
m_optionsToolBar->Toggle( PCB_ACTIONS::padDisplayMode, !opts.m_DisplayPadFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleTextOutlines, !opts.m_DisplayModTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleEdgeOutlines, !opts.m_DisplayModEdgeFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::textOutlines, !opts.m_DisplayTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::graphicsOutlines, !opts.m_DisplayGraphicsFill );
m_optionsToolBar->Refresh();
}

View File

@ -65,8 +65,8 @@ public:
bool m_DisplayViaFill;
bool m_DisplayPadNum; // show pads numbers
bool m_DisplayPadIsol;
bool m_DisplayModEdgeFill; // How to display module drawings ( sketch/ filled )
bool m_DisplayModTextFill; // How to display module texts ( sketch/ filled )
bool m_DisplayGraphicsFill; // How to display module drawings ( sketch/ filled )
bool m_DisplayTextFill; // How to display module 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.
@ -79,7 +79,6 @@ public:
* 3 show netnames on tracks and pads
*/
bool m_DisplayDrawItemsFill; // How to display graphic items on board ( sketch/ filled )
bool m_ContrastModeDisplay;
int m_MaxLinksShowed; // in track creation: number of hairwires shown
bool m_ShowModuleRatsnest; // When moving a footprint: allows displaying a ratsnest

View File

@ -80,7 +80,6 @@ public:
* 3 show netnames on tracks and pads
*/
bool m_DisplayDrawItemsFill; // How to display graphic items on board ( sketch/ filled )
bool m_ContrastModeDisplay;
int m_MaxLinksShowed; // in track creation: number of hairwires shown
bool m_Show_Module_Ratsnest; // When moving a footprint: allows displaying a ratsnest

View File

@ -69,11 +69,11 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "editing.use_45_degree_graphic_segments",
&m_Use45DegreeGraphicSegments, false ) );
m_params.emplace_back( new PARAM<bool>( "pcb_display.footprint_text",
&m_Display.m_DisplayModTextFill, true ) );
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_DisplayDrawItemsFill, true ) );
&m_Display.m_DisplayGraphicsFill, true ) );
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
&m_Display.m_DisplayPadFill, true ) );

View File

@ -160,8 +160,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
auto sketchPadsCondition = [ this ] ( const SELECTION& aSel ) {
return !GetDisplayOptions().m_DisplayPadFill;
};
auto sketchEdgesCondition = [ this ] ( const SELECTION& aSel ) {
return !GetDisplayOptions().m_DisplayModEdgeFill;
auto sketchGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
return !GetDisplayOptions().m_DisplayGraphicsFill;
};
auto contrastModeCondition = [ this ] ( const SELECTION& aSel ) {
return !GetDisplayOptions().m_ContrastModeDisplay;
@ -201,8 +201,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
drawingModeSubMenu->SetTitle( _( "&Drawing Mode" ) );
drawingModeSubMenu->SetIcon( add_zone_xpm );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::padDisplayMode, sketchPadsCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleEdgeOutlines, sketchEdgesCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::padDisplayMode, sketchPadsCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::graphicsOutlines, sketchGraphicsCondition );
viewMenu->AddMenu( drawingModeSubMenu );
// Contrast Mode Submenu

View File

@ -325,15 +325,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
};
auto sketchGraphicsCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return !disp_opt.m_DisplayDrawItemsFill;
return !disp_opt.m_DisplayGraphicsFill;
};
auto sketchModuleEdgeOutlinesCondition = [ &disp_opt ]( const SELECTION &aSel )
auto sketchTextOutlinesCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return !disp_opt.m_DisplayModEdgeFill;
};
auto sketchModuleTextOutlinesCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return !disp_opt.m_DisplayModTextFill;
return !disp_opt.m_DisplayTextFill;
};
viewMenu->AddCheckItem( PCB_ACTIONS::showLayersManager, layersPaletteShownCondition );
@ -383,9 +379,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::trackDisplayMode, sketchTracksCondition );
drawingModeSubMenu->AddSeparator();
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::graphicDisplayMode, sketchGraphicsCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleEdgeOutlines, sketchModuleEdgeOutlinesCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleTextOutlines, sketchModuleTextOutlinesCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::graphicsOutlines, sketchGraphicsCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::textOutlines, sketchTextOutlinesCondition );
viewMenu->AddMenu( drawingModeSubMenu );

View File

@ -38,8 +38,8 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
m_DisplayPadNum = true;
m_DisplayPadIsol = true;
m_DisplayModEdgeFill = FILLED;
m_DisplayModTextFill = FILLED;
m_DisplayGraphicsFill = FILLED;
m_DisplayTextFill = FILLED;
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled
m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
@ -50,7 +50,6 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads */
m_DisplayDrawItemsFill = FILLED;
m_ContrastModeDisplay = false;
m_MaxLinksShowed = 3; // in track creation: number of hairwires shown
m_ShowModuleRatsnest = true; // When moving a footprint: allows displaying a ratsnest

View File

@ -58,9 +58,8 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
m_zoneOutlines = true;
m_displayZone = DZ_SHOW_FILLED;
m_clearance = CL_NONE;
m_sketchBoardGfx = false;
m_sketchFpGfx = false;
m_sketchFpTxtfx = false;
m_sketchGraphics = false;
m_sketchText = false;
m_selectionCandidateColor = COLOR4D( 0.0, 1.0, 0.0, 0.75 );
// By default everything should be displayed as filled
@ -130,9 +129,8 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOption
{
m_hiContrastEnabled = aOptions.m_ContrastModeDisplay;
m_padNumbers = aOptions.m_DisplayPadNum;
m_sketchBoardGfx = !aOptions.m_DisplayDrawItemsFill;
m_sketchFpGfx = !aOptions.m_DisplayModEdgeFill;
m_sketchFpTxtfx = !aOptions.m_DisplayModTextFill;
m_sketchGraphics = !aOptions.m_DisplayGraphicsFill;
m_sketchText = !aOptions.m_DisplayTextFill;
m_curvedRatsnestlines = aOptions.m_DisplayRatsnestLinesCurved;
m_globalRatsnestlines = aOptions.m_ShowGlobalRatsnest;
@ -899,9 +897,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment, int aLayer )
{
const COLOR4D& color = m_pcbSettings.GetColor( aSegment, aSegment->GetLayer() );
bool sketch = ( aSegment->Type() == PCB_LINE_T && m_pcbSettings.m_sketchBoardGfx )
|| ( aSegment->Type() == PCB_MODULE_EDGE_T && m_pcbSettings.m_sketchFpGfx );
bool sketch = m_pcbSettings.m_sketchGraphics;
int thickness = getLineThickness( aSegment->GetWidth() );
VECTOR2D start( aSegment->GetStart() );
VECTOR2D end( aSegment->GetEnd() );
@ -1011,7 +1007,7 @@ void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
const COLOR4D& color = m_pcbSettings.GetColor( aText, aText->GetLayer() );
VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
if( m_pcbSettings.m_sketchMode[aLayer] )
if( m_pcbSettings.m_sketchText || m_pcbSettings.m_sketchMode[aLayer] )
{
// Outline mode
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
@ -1033,17 +1029,14 @@ void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
{
wxString shownText( aText->GetShownText() );
if( shownText.Length() == 0 )
return;
bool sketch = m_pcbSettings.m_sketchFpTxtfx;
const COLOR4D& color = m_pcbSettings.GetColor( aText, aLayer );
VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
// Currently, draw text routines do not know the true outline mode.
// so draw the text in "line" mode (no thickness)
if( sketch )
if( m_pcbSettings.m_sketchText )
{
// Outline mode
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
@ -1169,7 +1162,17 @@ void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
m_gal->SetStrokeColor( strokeColor );
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
m_gal->SetLineWidth( getLineThickness( aDimension->GetWidth() ) );
if( m_pcbSettings.m_sketchGraphics )
{
// Outline mode
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
}
else
{
// Filled mode
m_gal->SetLineWidth( getLineThickness( aDimension->GetWidth() ) );
}
// Draw an arrow
m_gal->DrawLine( VECTOR2D( aDimension->m_crossBarO ), VECTOR2D( aDimension->m_crossBarF ) );
@ -1186,7 +1189,17 @@ void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
TEXTE_PCB& text = aDimension->Text();
VECTOR2D position( text.GetTextPos().x, text.GetTextPos().y );
m_gal->SetLineWidth( getLineThickness( text.GetEffectiveTextPenWidth() ) );
if( m_pcbSettings.m_sketchText )
{
// 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() );
}

View File

@ -130,7 +130,7 @@ public:
*/
inline void SetSketchModeGraphicItems( bool aEnabled )
{
m_sketchBoardGfx = aEnabled;
m_sketchGraphics = aEnabled;
}
/**
@ -170,14 +170,11 @@ protected:
///> Flag determining if items on a given layer should be drawn as an outline or a filled item
bool m_sketchMode[GAL_LAYER_ID_END];
///> Flag determining if board graphic items should be outlined or stroked
bool m_sketchBoardGfx;
///> Flag determining if graphic items should be outlined or stroked
bool m_sketchGraphics;
///> Flag determining if footprint graphic items should be outlined or stroked
bool m_sketchFpGfx;
///> Flag determining if footprint text items should be outlined or stroked
bool m_sketchFpTxtfx;
///> Flag determining if text items should be outlined or stroked
bool m_sketchText;
///> Flag determining if pad numbers should be visible
bool m_padNumbers;

View File

@ -104,16 +104,16 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back( new PARAM<double>( "grid.user.size_y", &m_UserGrid.size_y, 0.01 ) );
m_params.emplace_back( new PARAM<bool>(
"pcb_display.graphic_items_fill", &m_Display.m_DisplayDrawItemsFill, true ) );
"pcb_display.graphic_items_fill", &m_Display.m_DisplayGraphicsFill, true ) );
m_params.emplace_back( new PARAM<int>(
"pcb_display.max_links_shown", &m_Display.m_MaxLinksShowed, 3, 0, 15 ) );
m_params.emplace_back( new PARAM<bool>(
"pcb_display.footprint_edge_fill", &m_Display.m_DisplayModEdgeFill, true ) );
"pcb_display.graphics_fill", &m_Display.m_DisplayGraphicsFill, true ) );
m_params.emplace_back( new PARAM<bool>(
"pcb_display.footprint_text_fill", &m_Display.m_DisplayModTextFill, true ) );
"pcb_display.text_fill", &m_Display.m_DisplayTextFill, true ) );
m_params.emplace_back( new PARAM<int>(
"pcb_display.net_names_mode", &m_Display.m_DisplayNetNamesMode, 3, 0, 3 ) );

View File

@ -182,8 +182,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddSeparator();
m_optionsToolBar->Add( PCB_ACTIONS::padDisplayMode, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleTextOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleEdgeOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::graphicsOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::textOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( ACTIONS::highContrastMode, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->AddSeparator();
@ -241,8 +241,8 @@ void FOOTPRINT_EDIT_FRAME::SyncToolbars()
m_optionsToolBar->Toggle( ACTIONS::imperialUnits, GetUserUnits() == EDA_UNITS::INCHES );
m_optionsToolBar->Toggle( ACTIONS::togglePolarCoords, GetShowPolarCoords() );
m_optionsToolBar->Toggle( PCB_ACTIONS::padDisplayMode, !opts.m_DisplayPadFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleTextOutlines, !opts.m_DisplayModTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleEdgeOutlines, !opts.m_DisplayModEdgeFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::textOutlines, !opts.m_DisplayTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::graphicsOutlines, !opts.m_DisplayGraphicsFill );
m_optionsToolBar->Toggle( ACTIONS::highContrastMode, opts.m_ContrastModeDisplay );
m_optionsToolBar->Toggle( PCB_ACTIONS::toggleFootprintTree, IsSearchTreeShown() );
m_optionsToolBar->Refresh();

View File

@ -120,8 +120,8 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddSeparator();
m_optionsToolBar->Add( PCB_ACTIONS::showPadNumbers, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::padDisplayMode, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleTextOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::moduleEdgeOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::textOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::graphicsOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Realize();
}
@ -148,8 +148,8 @@ void FOOTPRINT_VIEWER_FRAME::SyncToolbars()
m_optionsToolBar->Toggle( PCB_ACTIONS::showPadNumbers, opts.m_DisplayPadNum );
m_optionsToolBar->Toggle( PCB_ACTIONS::padDisplayMode, !opts.m_DisplayPadFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleTextOutlines, !opts.m_DisplayModTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::moduleEdgeOutlines, !opts.m_DisplayModEdgeFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::textOutlines, !opts.m_DisplayTextFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::graphicsOutlines, !opts.m_DisplayGraphicsFill );
m_optionsToolBar->Refresh();
}

View File

@ -683,19 +683,14 @@ TOOL_ACTION PCB_ACTIONS::viaDisplayMode( "pcbnew.Control.viaDisplayMode",
_( "Sketch Vias" ), _( "Show vias in outline mode" ),
via_sketch_xpm );
TOOL_ACTION PCB_ACTIONS::graphicDisplayMode( "pcbnew.Control.graphicDisplayMode",
TOOL_ACTION PCB_ACTIONS::graphicsOutlines( "pcbnew.Control.graphicOutlines",
AS_GLOBAL, 0, "",
_( "Sketch Board Graphic Items" ), _( "Show board graphic items in outline mode" ),
show_graphics_mode_xpm );
TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.Control.graphicOutlines",
AS_GLOBAL, 0, "",
_( "Sketch Footprint Graphic Items" ), _( "Show footprint graphic items in outline mode" ),
_( "Sketch Graphic Items" ), _( "Show graphic items in outline mode" ),
show_mod_edge_xpm );
TOOL_ACTION PCB_ACTIONS::moduleTextOutlines( "pcbnew.Control.fpTextOutlines",
TOOL_ACTION PCB_ACTIONS::textOutlines( "pcbnew.Control.textOutlines",
AS_GLOBAL, 0, "",
_( "Line Mode Footprint Text Items" ), _( "Show footprint texts in line mode" ),
_( "Sketch Text Items" ), _( "Show footprint texts in line mode" ),
text_sketch_xpm );
TOOL_ACTION PCB_ACTIONS::showPadNumbers( "pcbnew.Control.showPadNumbers",

View File

@ -222,7 +222,6 @@ public:
static TOOL_ACTION trackDisplayMode;
static TOOL_ACTION padDisplayMode;
static TOOL_ACTION viaDisplayMode;
static TOOL_ACTION graphicDisplayMode;
static TOOL_ACTION zoneDisplayEnable;
static TOOL_ACTION zoneDisplayDisable;
static TOOL_ACTION zoneDisplayOutlines;
@ -363,11 +362,10 @@ public:
static TOOL_ACTION createArray;
/// Display module edges as outlines
static TOOL_ACTION moduleEdgeOutlines;
static TOOL_ACTION graphicsOutlines;
/// Display module texts as lines // JEY TODO: if we're going to keep this, it needs
// to be all text, not just module text....
static TOOL_ACTION moduleTextOutlines;
/// Display texts as lines
static TOOL_ACTION textOutlines;
// Pad tools

View File

@ -135,49 +135,65 @@ int PCB_VIEWER_TOOLS::PadDisplayMode( const TOOL_EVENT& aEvent )
}
int PCB_VIEWER_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
PCB_DISPLAY_OPTIONS opts = displayOptions();
Flip( opts.m_DisplayModEdgeFill );
Flip( opts.m_DisplayGraphicsFill );
frame()->SetDisplayOptions( opts );
view()->UpdateDisplayOptions( opts );
for( auto module : board()->Modules() )
for( MODULE* module : board()->Modules() )
{
for( auto item : module->GraphicalItems() )
for( BOARD_ITEM* item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
view()->Update( item, KIGFX::GEOMETRY );
}
}
for( BOARD_ITEM* item : board()->Drawings() )
{
KICAD_T t = item->Type();
if( t == PCB_LINE_T || t == PCB_DIMENSION_T || t == PCB_TARGET_T )
view()->Update( item, KIGFX::GEOMETRY );
}
canvas()->Refresh();
return 0;
}
int PCB_VIEWER_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
int PCB_VIEWER_TOOLS::TextOutlines( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
PCB_DISPLAY_OPTIONS opts = displayOptions();
Flip( opts.m_DisplayModTextFill );
Flip( opts.m_DisplayTextFill );
frame()->SetDisplayOptions( opts );
view()->UpdateDisplayOptions( opts );
for( auto module : board()->Modules() )
for( MODULE* module : board()->Modules() )
{
view()->Update( &module->Reference(), KIGFX::GEOMETRY );
view()->Update( &module->Value(), KIGFX::GEOMETRY );
for( auto item : module->GraphicalItems() )
for( BOARD_ITEM* item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T )
view()->Update( item, KIGFX::GEOMETRY );
}
}
for( BOARD_ITEM* item : board()->Drawings() )
{
KICAD_T t = item->Type();
if( t == PCB_TEXT_T || t == PCB_DIMENSION_T )
view()->Update( item, KIGFX::GEOMETRY );
}
canvas()->Refresh();
return 0;
@ -318,15 +334,14 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
void PCB_VIEWER_TOOLS::setTransitions()
{
Go( &PCB_VIEWER_TOOLS::Show3DViewer, ACTIONS::show3DViewer.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::Show3DViewer, ACTIONS::show3DViewer.MakeEvent() );
// Display modes
Go( &PCB_VIEWER_TOOLS::ShowPadNumbers, PCB_ACTIONS::showPadNumbers.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::PadDisplayMode, PCB_ACTIONS::padDisplayMode.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::ModuleEdgeOutlines, PCB_ACTIONS::moduleEdgeOutlines.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::ModuleTextOutlines, PCB_ACTIONS::moduleTextOutlines.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::ZoomAutomatically,
PCB_ACTIONS::zoomFootprintAutomatically.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::ShowPadNumbers, PCB_ACTIONS::showPadNumbers.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::PadDisplayMode, PCB_ACTIONS::padDisplayMode.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::GraphicOutlines, PCB_ACTIONS::graphicsOutlines.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::TextOutlines, PCB_ACTIONS::textOutlines.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::ZoomAutomatically, PCB_ACTIONS::zoomFootprintAutomatically.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::MeasureTool, ACTIONS::measureTool.MakeEvent() );
Go( &PCB_VIEWER_TOOLS::MeasureTool, ACTIONS::measureTool.MakeEvent() );
}

View File

@ -57,8 +57,8 @@ public:
// Display modes
int ShowPadNumbers( const TOOL_EVENT& aEvent );
int PadDisplayMode( const TOOL_EVENT& aEvent );
int ModuleEdgeOutlines( const TOOL_EVENT& aEvent );
int ModuleTextOutlines( const TOOL_EVENT& aEvent );
int GraphicOutlines( const TOOL_EVENT& aEvent );
int TextOutlines( const TOOL_EVENT& aEvent );
int ZoomAutomatically( const TOOL_EVENT& aEvent );
/// Show the 3D viewer

View File

@ -189,25 +189,6 @@ int PCBNEW_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent )
}
int PCBNEW_CONTROL::GraphicDisplayMode( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
Flip( opts.m_DisplayDrawItemsFill );
m_frame->SetDisplayOptions( opts );
view()->UpdateDisplayOptions( opts );
for( auto item : board()->Drawings() )
{
view()->Update( item, KIGFX::GEOMETRY );
}
canvas()->Refresh();
return 0;
}
int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
@ -1066,7 +1047,6 @@ void PCBNEW_CONTROL::setTransitions()
Go( &PCBNEW_CONTROL::ToggleRatsnest, PCB_ACTIONS::showRatsnest.MakeEvent() );
Go( &PCBNEW_CONTROL::ToggleRatsnest, PCB_ACTIONS::ratsnestLineMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ViaDisplayMode, PCB_ACTIONS::viaDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::GraphicDisplayMode, PCB_ACTIONS::graphicDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() );

View File

@ -59,7 +59,6 @@ public:
int ZoneDisplayMode( const TOOL_EVENT& aEvent );
int TrackDisplayMode( const TOOL_EVENT& aEvent );
int ViaDisplayMode( const TOOL_EVENT& aEvent );
int GraphicDisplayMode( const TOOL_EVENT& aEvent );
int HighContrastMode( const TOOL_EVENT& aEvent );
// Layer control