Cleanup.
This commit is contained in:
parent
29db6152b3
commit
da71a51029
|
@ -32,16 +32,11 @@
|
|||
#include <dialog_drc.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <base_units.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <view/view.h>
|
||||
#include <collectors.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
|
||||
/* class DIALOG_DRC_CONTROL: a dialog to set DRC parameters (clearance, min cooper size)
|
||||
* and run DRC tests
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* 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
|
||||
|
@ -33,8 +33,6 @@
|
|||
#include <dialog_helpers.h>
|
||||
#include <richio.h>
|
||||
#include <filter_reader.h>
|
||||
#include <gr_basic.h>
|
||||
#include <macros.h>
|
||||
#include <base_units.h>
|
||||
#include <validators.h>
|
||||
#include <dialog_text_entry.h>
|
||||
|
@ -50,9 +48,6 @@ static wxSize ShapeSize;
|
|||
static int PolyShapeType;
|
||||
|
||||
|
||||
///> An inductor pattern temporarily used during mu-wave inductor creation
|
||||
static MWAVE::INDUCTOR_PATTERN s_inductor_pattern;
|
||||
|
||||
MODULE* PCB_EDIT_FRAME::CreateMuWaveBaseFootprint( const wxString& aValue,
|
||||
int aTextSize, int aPadCount )
|
||||
{
|
||||
|
@ -208,7 +203,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
|
|||
std::vector<wxPoint> polyPoints;
|
||||
polyPoints.reserve( numPoints );
|
||||
|
||||
polyPoints.push_back( wxPoint( 0, 0 ) );
|
||||
polyPoints.emplace_back( wxPoint( 0, 0 ) );
|
||||
|
||||
int theta = -angle / 2;
|
||||
|
||||
|
@ -282,7 +277,6 @@ private:
|
|||
* Each line is the X Y coord (normalized units from 0 to 1)
|
||||
*/
|
||||
void ReadDataShapeDescr( wxCommandEvent& event );
|
||||
void AcceptOptions( wxCommandEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@ -321,10 +315,7 @@ MWAVE_POLYGONAL_SHAPE_DLG::MWAVE_POLYGONAL_SHAPE_DLG( PCB_EDIT_FRAME* parent,
|
|||
_( "Read Shape Description File..." ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
wxString shapelist[3] =
|
||||
{
|
||||
_( "Normal" ), _( "Symmetrical" ), _( "Mirrored" )
|
||||
};
|
||||
wxString shapelist[] = { _( "Normal" ), _( "Symmetrical" ), _( "Mirrored" ) };
|
||||
|
||||
m_ShapeOptionCtrl = new wxRadioBox( this, -1, _( "Shape Option" ),
|
||||
wxDefaultPosition, wxDefaultSize, 3,
|
||||
|
@ -359,10 +350,9 @@ void MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr( wxCommandEvent& event )
|
|||
static wxString lastpath; // To remember the last open path during a session
|
||||
wxString mask = wxFileSelectorDefaultWildcardStr;
|
||||
|
||||
wxString FullFileName = EDA_FILE_SELECTOR( _( "Read descr shape file" ),
|
||||
lastpath, FullFileName,
|
||||
wxEmptyString, mask,
|
||||
this, wxFD_OPEN, true );
|
||||
wxString FullFileName = EDA_FILE_SELECTOR( _( "Read descr shape file" ), lastpath,
|
||||
FullFileName, wxEmptyString, mask, this,
|
||||
wxFD_OPEN, true );
|
||||
if( FullFileName.IsEmpty() )
|
||||
return;
|
||||
|
||||
|
@ -501,21 +491,21 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
|
|||
polyPoints.reserve( PolyEdges.size() + 2 );
|
||||
|
||||
// Init start point coord:
|
||||
polyPoints.push_back( wxPoint( offset.x, 0 ) );
|
||||
polyPoints.emplace_back( wxPoint( offset.x, 0 ) );
|
||||
|
||||
wxPoint last_coordinate;
|
||||
|
||||
for( unsigned ii = 0; ii < PolyEdges.size(); ii++ ) // Copy points
|
||||
for( wxRealPoint& pt: PolyEdges ) // Copy points
|
||||
{
|
||||
last_coordinate.x = KiROUND( PolyEdges[ii].x * ShapeScaleX );
|
||||
last_coordinate.y = -KiROUND( PolyEdges[ii].y * ShapeScaleY );
|
||||
last_coordinate.x = KiROUND( pt.x * ShapeScaleX );
|
||||
last_coordinate.y = -KiROUND( pt.y * ShapeScaleY );
|
||||
last_coordinate += offset;
|
||||
polyPoints.push_back( last_coordinate );
|
||||
}
|
||||
|
||||
// finish the polygonal shape
|
||||
if( last_coordinate.y != 0 )
|
||||
polyPoints.push_back( wxPoint( last_coordinate.x, 0 ) );
|
||||
polyPoints.emplace_back( wxPoint( last_coordinate.x, 0 ) );
|
||||
|
||||
switch( PolyShapeType )
|
||||
{
|
||||
|
@ -524,7 +514,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
|
|||
break;
|
||||
|
||||
case 1: // Symmetric shape: add the symmetric (mirrored) shape
|
||||
for( int ndx = polyPoints.size() - 1; ndx >= 0; --ndx )
|
||||
for( int ndx = (int) polyPoints.size() - 1; ndx >= 0; --ndx )
|
||||
{
|
||||
wxPoint pt = polyPoints[ndx];
|
||||
pt.y = -pt.y; // mirror about X axis
|
||||
|
|
|
@ -202,8 +202,6 @@ private:
|
|||
///> of edit reference point).
|
||||
VECTOR2I m_cursor;
|
||||
|
||||
KIGFX::PREVIEW::RULER_ITEM* m_ruler;
|
||||
|
||||
///> Returns the right modification point (e.g. for rotation), depending on the number of
|
||||
///> selected items.
|
||||
bool updateModificationPoint( PCBNEW_SELECTION& aSelection );
|
||||
|
|
|
@ -1254,7 +1254,7 @@ int PCB_EDITOR_CONTROL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
|
|||
picker->SetClickHandler( std::bind( showLocalRatsnest, m_toolMgr, board,
|
||||
opt->m_ShowGlobalRatsnest, _1 ) );
|
||||
|
||||
picker->SetFinalizeHandler( [ this, board, opt ]( int aCondition )
|
||||
picker->SetFinalizeHandler( [ board, opt ]( int aCondition )
|
||||
{
|
||||
if( aCondition != PCBNEW_PICKER_TOOL::END_ACTIVATE )
|
||||
{
|
||||
|
|
|
@ -23,12 +23,8 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "edit_tool.h"
|
||||
#include "grid_helper.h"
|
||||
#include "pcb_actions.h"
|
||||
#include "pcb_editor_control.h"
|
||||
#include "pcbnew_control.h"
|
||||
#include "pcbnew_picker_tool.h"
|
||||
#include "selection_tool.h"
|
||||
|
@ -48,7 +44,6 @@
|
|||
#include <kicad_plugin.h>
|
||||
#include <kiway.h>
|
||||
#include <origin_viewitem.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <pcb_screen.h>
|
||||
|
@ -56,7 +51,6 @@
|
|||
#include <properties.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <view/view_controls.h>
|
||||
|
||||
#include <functional>
|
||||
#include <footprint_viewer_frame.h>
|
||||
|
||||
|
@ -486,27 +480,6 @@ int PCBNEW_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
// Miscellaneous
|
||||
static bool deleteItem( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
|
||||
{
|
||||
SELECTION_TOOL* selectionTool = aToolMgr->GetTool<SELECTION_TOOL>();
|
||||
wxCHECK( selectionTool, false );
|
||||
|
||||
aToolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
||||
const PCBNEW_SELECTION& selection = selectionTool->RequestSelection(
|
||||
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector )
|
||||
{ EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED ); } );
|
||||
|
||||
if( selection.Empty() )
|
||||
return true;
|
||||
|
||||
aToolMgr->RunAction( PCB_ACTIONS::remove, true );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#define HITTEST_THRESHOLD_PIXELS 5
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue