KiCad PCB EDA Suite
Loading...
Searching...
No Matches
edit_tool.cpp File Reference
#include <macros.h>
#include <advanced_config.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 <pcb_shape.h>
#include <pcb_group.h>
#include <pcb_target.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_generator.h>
#include <pcb_edit_frame.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <kiway.h>
#include <array_creator.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 <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 <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_unit_entry.h>
#include <pcb_reference_image.h>

Go to the source code of this file.

Functions

static std::shared_ptr< CONDITIONAL_MENUmakePositioningToolsMenu (TOOL_INTERACTIVE *aTool)
 
static std::shared_ptr< CONDITIONAL_MENUmakeShapeModificationMenu (TOOL_INTERACTIVE *aTool)
 
static std::optional< int > GetFilletParams (PCB_BASE_EDIT_FRAME &aFrame)
 Prompt the user for the fillet radius and return it.
 
static std::optional< CHAMFER_PARAMSGetChamferParams (PCB_BASE_EDIT_FRAME &aFrame)
 Prompt the user for chamfer parameters.
 
static VECTOR2I mirrorPointX (const VECTOR2I &aPoint, const VECTOR2I &aMirrorPoint)
 Mirror a point about the vertical axis passing through another point.
 
static VECTOR2I mirrorPointY (const VECTOR2I &aPoint, const VECTOR2I &aMirrorPoint)
 Mirror a point about the vertical axis passing through another point.
 
static void mirrorPadX (PAD &aPad, const VECTOR2I &aMirrorPoint)
 Mirror a pad in the vertical axis passing through a point (mirror left to right).
 
static void mirrorPadY (PAD &aPad, const VECTOR2I &aMirrorPoint)
 Mirror a pad in the vertical axis passing through a point (mirror left to right).
 

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
 
static const std::vector< KICAD_TbaseConnectedTypes
 
static const std::vector< KICAD_TconnectedTypes
 
static const std::vector< KICAD_TunroutableTypes
 

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 1217 of file edit_tool.cpp.

References _, WX_UNIT_ENTRY_DIALOG::GetValue(), EDA_IU_SCALE::mmToIU(), and pcbIUScale.

◆ GetFilletParams()

static std::optional< int > GetFilletParams ( PCB_BASE_EDIT_FRAME aFrame)
static

Prompt the user for the fillet radius and return it.

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

Definition at line 1193 of file edit_tool.cpp.

References _, and WX_UNIT_ENTRY_DIALOG::GetValue().

◆ makePositioningToolsMenu()

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

◆ makeShapeModificationMenu()

◆ mirrorPadX()

static void mirrorPadX ( PAD aPad,
const VECTOR2I aMirrorPoint 
)
static

Mirror a pad in the vertical axis passing through a point (mirror left to right).

Definition at line 1980 of file edit_tool.cpp.

References CUSTOM, PAD::FlipPrimitives(), PAD::GetDelta(), PAD::GetOffset(), PAD::GetOrientation(), PAD::GetPosition(), PAD::GetShape(), mirrorPointX(), PAD::SetDelta(), PAD::SetOffset(), PAD::SetOrientation(), PAD::SetPosition(), and VECTOR2< T >::x.

Referenced by EDIT_TOOL::Mirror().

◆ mirrorPadY()

static void mirrorPadY ( PAD aPad,
const VECTOR2I aMirrorPoint 
)
static

Mirror a pad in the vertical axis passing through a point (mirror left to right).

Definition at line 2003 of file edit_tool.cpp.

References CUSTOM, PAD::FlipPrimitives(), PAD::GetDelta(), PAD::GetOffset(), PAD::GetOrientation(), PAD::GetPosition(), PAD::GetShape(), mirrorPointY(), PAD::SetDelta(), PAD::SetOffset(), PAD::SetOrientation(), PAD::SetPosition(), and VECTOR2< T >::y.

Referenced by EDIT_TOOL::Mirror().

◆ mirrorPointX()

static VECTOR2I mirrorPointX ( const VECTOR2I aPoint,
const VECTOR2I aMirrorPoint 
)
static

Mirror a point about the vertical axis passing through another point.

Definition at line 1950 of file edit_tool.cpp.

References VECTOR2< T >::x.

Referenced by mirrorPadX().

◆ mirrorPointY()

static VECTOR2I mirrorPointY ( const VECTOR2I aPoint,
const VECTOR2I aMirrorPoint 
)
static

Mirror a point about the vertical axis passing through another point.

Definition at line 1965 of file edit_tool.cpp.

References VECTOR2< T >::y.

Referenced by mirrorPadY().

Variable Documentation

◆ baseConnectedTypes

const std::vector<KICAD_T> baseConnectedTypes
static
Initial value:
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96

Definition at line 86 of file edit_tool.cpp.

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

◆ connectedTypes

const std::vector<KICAD_T> connectedTypes
static
Initial value:
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107

Definition at line 91 of file edit_tool.cpp.

◆ footprintTypes

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

Definition at line 78 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 80 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 76 of file edit_tool.cpp.

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

◆ trackTypes

const std::vector<KICAD_T> trackTypes
static
Initial value:

Definition at line 82 of file edit_tool.cpp.

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

◆ unroutableTypes

const std::vector<KICAD_T> unroutableTypes
static
Initial value:
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86

Definition at line 97 of file edit_tool.cpp.

Referenced by EDIT_TOOL::Init().