KiCad PCB EDA Suite
Loading...
Searching...
No Matches
edit_tool.cpp File Reference
#include <macros.h>
#include <advanced_config.h>
#include <clipboard.h>
#include <limits>
#include <kiplatform/ui.h>
#include <gal/graphics_abstraction_layer.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <increment.h>
#include <pcb_shape.h>
#include <pcb_group.h>
#include <pcb_point.h>
#include <pcb_target.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_generator.h>
#include <zone.h>
#include <pcb_edit_frame.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <kiway.h>
#include <status_popup.h>
#include <tool/selection_conditions.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
#include <tools/edit_tool.h>
#include <tools/item_modification_routine.h>
#include <tools/pcb_picker_tool.h>
#include <tools/pcb_point_editor.h>
#include <tools/tool_event_utils.h>
#include <tools/pcb_grid_helper.h>
#include <tools/pad_tool.h>
#include <view/view_controls.h>
#include <connectivity/connectivity_algo.h>
#include <pcbnew_id.h>
#include <core/kicad_algo.h>
#include <fix_board_shape.h>
#include <bitmaps.h>
#include <functional>
#include "kicad_clipboard.h"
#include <wx/hyperlink.h>
#include <router/router_tool.h>
#include <dialog_get_footprint_by_name.h>
#include <dialogs/dialog_move_exact.h>
#include <dialogs/dialog_track_via_properties.h>
#include <dialogs/dialog_tablecell_properties.h>
#include <dialogs/dialog_table_properties.h>
#include <dialogs/dialog_multi_unit_entry.h>
#include <dialogs/dialog_unit_entry.h>
#include <pcb_reference_image.h>

Go to the source code of this file.

Classes

class  GATE_SWAP_MENU
 

Functions

static bool itemHasEditableVertices (BOARD_ITEM *aItem)
 
static bool selectionHasEditableVertices (const SELECTION &aSelection)
 
static std::shared_ptr< CONDITIONAL_MENUmakePositioningToolsMenu (TOOL_INTERACTIVE *aTool)
 
static std::shared_ptr< CONDITIONAL_MENUmakeShapeModificationMenu (TOOL_INTERACTIVE *aTool)
 
static std::shared_ptr< ACTION_MENUmakeGateSwapMenu (TOOL_INTERACTIVE *aTool)
 
static FOOTPRINTGetFootprintFromBoardByReference (PCB_BASE_FRAME &aFrame)
 
static std::optional< int > GetRadiusParams (PCB_BASE_EDIT_FRAME &aFrame, const wxString &aTitle, int &aPersitentRadius)
 Prompt the user for a radius and return it.
 
static std::optional< DOGBONE_CORNER_ROUTINE::PARAMETERSGetDogboneParams (PCB_BASE_EDIT_FRAME &aFrame)
 
static std::optional< CHAMFER_PARAMSGetChamferParams (PCB_BASE_EDIT_FRAME &aFrame)
 Prompt the user for chamfer parameters.
 
static void mirrorPad (PAD &aPad, const VECTOR2I &aMirrorPoint, FLIP_DIRECTION aFlipDirection)
 Mirror a pad in the H/V axis passing through a point.
 

Variables

static const std::vector< KICAD_TpadTypes = { PCB_PAD_T }
 
static const std::vector< KICAD_TfootprintTypes = { PCB_FOOTPRINT_T }
 
static const std::vector< KICAD_TgroupTypes = { PCB_GROUP_T }
 
static const std::vector< KICAD_TtrackTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T }
 
static const std::vector< KICAD_TbaseConnectedTypes = { PCB_PAD_T, PCB_VIA_T, PCB_TRACE_T, PCB_ARC_T }
 
static const std::vector< KICAD_TconnectedTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_T }
 
static const std::vector< KICAD_TroutableTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_FOOTPRINT_T }
 

Function Documentation

◆ GetChamferParams()

static std::optional< CHAMFER_PARAMS > GetChamferParams ( PCB_BASE_EDIT_FRAME & aFrame)
static

Prompt the user for chamfer parameters.

Parameters
aFrame
aErrorMsgfilled with an error message if the parameter is invalid somehow
Returns
std::optional<int> the chamfer parameters or std::nullopt if no valid fillet specified

Definition at line 1689 of file edit_tool.cpp.

References _, WX_UNIT_ENTRY_DIALOG::GetValue(), pcbIUScale, and DIALOG_SHIM::ShowModal().

Referenced by EDIT_TOOL::ModifyLines().

◆ GetDogboneParams()

static std::optional< DOGBONE_CORNER_ROUTINE::PARAMETERS > GetDogboneParams ( PCB_BASE_EDIT_FRAME & aFrame)
static

◆ GetFootprintFromBoardByReference()

static FOOTPRINT * GetFootprintFromBoardByReference ( PCB_BASE_FRAME & aFrame)
static
Returns
a reference to the footprint found by its reference on the current board. The reference is entered by the user from a dialog (by awxTextCtlr, or a list of available references)

Definition at line 713 of file edit_tool.cpp.

References BOARD::Footprints(), PCB_BASE_FRAME::GetBoard(), DIALOG_GET_FOOTPRINT_BY_NAME::GetValue(), and DIALOG_SHIM::ShowModal().

Referenced by EDIT_TOOL::GetAndPlace().

◆ GetRadiusParams()

static std::optional< int > GetRadiusParams ( PCB_BASE_EDIT_FRAME & aFrame,
const wxString & aTitle,
int & aPersitentRadius )
static

Prompt the user for a radius and return it.

Parameters
aFrame
aTitlethe title of the dialog
aPersitentRadiusthe last used radius
Returns
std::optional<int> the radius or std::nullopt if no valid radius specified

Definition at line 1625 of file edit_tool.cpp.

References _, WX_UNIT_ENTRY_DIALOG::GetValue(), and DIALOG_SHIM::ShowModal().

Referenced by EDIT_TOOL::ModifyLines().

◆ itemHasEditableVertices()

static bool itemHasEditableVertices ( BOARD_ITEM * aItem)
static

◆ makeGateSwapMenu()

static std::shared_ptr< ACTION_MENU > makeGateSwapMenu ( TOOL_INTERACTIVE * aTool)
static

Definition at line 451 of file edit_tool.cpp.

Referenced by EDIT_TOOL::Init().

◆ makePositioningToolsMenu()

static std::shared_ptr< CONDITIONAL_MENU > makePositioningToolsMenu ( TOOL_INTERACTIVE * aTool)
static

◆ makeShapeModificationMenu()

◆ mirrorPad()

static void mirrorPad ( PAD & aPad,
const VECTOR2I & aMirrorPoint,
FLIP_DIRECTION aFlipDirection )
static

◆ selectionHasEditableVertices()

static bool selectionHasEditableVertices ( const SELECTION & aSelection)
static

Variable Documentation

◆ baseConnectedTypes

const std::vector<KICAD_T> baseConnectedTypes = { PCB_PAD_T, PCB_VIA_T, PCB_TRACE_T, PCB_ARC_T }
static

Definition at line 123 of file edit_tool.cpp.

Referenced by EDIT_TOOL::DragArcTrack(), and EDIT_TOOL::FilletTracks().

◆ connectedTypes

const std::vector<KICAD_T> connectedTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_T }
static

Definition at line 125 of file edit_tool.cpp.

◆ footprintTypes

const std::vector<KICAD_T> footprintTypes = { PCB_FOOTPRINT_T }
static

Definition at line 117 of file edit_tool.cpp.

Referenced by EDIT_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().

◆ groupTypes

const std::vector<KICAD_T> groupTypes = { PCB_GROUP_T }
static

Definition at line 119 of file edit_tool.cpp.

Referenced by EDIT_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().

◆ padTypes

const std::vector<KICAD_T> padTypes = { PCB_PAD_T }
static

Definition at line 115 of file edit_tool.cpp.

Referenced by CONVERT_TOOL::Init(), EDIT_TOOL::Init(), and PAD_TOOL::Init().

◆ routableTypes

const std::vector<KICAD_T> routableTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_FOOTPRINT_T }
static

Definition at line 127 of file edit_tool.cpp.

Referenced by EDIT_TOOL::Init().

◆ trackTypes

const std::vector<KICAD_T> trackTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T }
static