KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_point_editor.cpp File Reference
#include <functional>
#include <memory>
#include <algorithm>
#include <limits>
#include <advanced_config.h>
#include <kiplatform/ui.h>
#include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h>
#include <geometry/corner_operations.h>
#include <geometry/geometry_utils.h>
#include <geometry/seg.h>
#include <geometry/vector_utils.h>
#include <math/util.h>
#include <confirm.h>
#include <tool/tool_manager.h>
#include <tool/point_editor_behavior.h>
#include <tool/selection_conditions.h>
#include <preview_items/angle_item.h>
#include <preview_items/simple_overlay_item.h>
#include <gal/painter.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
#include <tools/pcb_point_editor.h>
#include <tools/pcb_grid_helper.h>
#include <tools/block_drag_capability.h>
#include <tools/block_drag_dependents.h>
#include <tools/block_drag_displacement.h>
#include <tools/block_drag_pick.h>
#include <tools/block_drag_validation.h>
#include <tools/generator_tool.h>
#include <tools/zone_filler_tool.h>
#include <router/router_tool.h>
#include <router/pns_router.h>
#include <router/pns_block_dragger.h>
#include <router/router_status_view_item.h>
#include <router/pns_drag_algo.h>
#include <router/pns_kicad_iface.h>
#include <dialogs/dialog_unit_entry.h>
#include <board_commit.h>
#include <pcb_edit_frame.h>
#include <pcb_reference_image.h>
#include <pcb_generator.h>
#include <pcb_group.h>
#include <pcb_dimension.h>
#include <pcb_barcode.h>
#include <pcb_grid_item.h>
#include <pcb_textbox.h>
#include <pcb_tablecell.h>
#include <pcb_table.h>
#include <pad.h>
#include <zone.h>
#include <zone_filler.h>
#include <footprint.h>
#include <board.h>
#include <constraints/board_constraint_adapter.h>
#include <constraints/constraint_builder.h>
#include <constraints/pcb_constraint.h>
#include <footprint_editor_settings.h>
#include <connectivity/connectivity_data.h>
#include <progress_reporter.h>
#include <layer_ids.h>
#include <preview_items/preview_utils.h>

Go to the source code of this file.

Classes

class  RECT_RADIUS_TEXT_ITEM
 
class  RECTANGLE_POINT_EDIT_BEHAVIOR
 
class  ZONE_POINT_EDIT_BEHAVIOR
 Looks the outline up on every call instead of holding a reference to it, because undoing a commit gives the zone a new SHAPE_POLY_SET while this object lives on. More...
 
class  GENERATOR_POLY_POINT_EDIT_BEHAVIOR
 
class  BARCODE_POINT_EDIT_BEHAVIOR
 
class  GRID_POINT_EDIT_BEHAVIOR
 
class  PCB_TABLECELL_POINT_EDIT_BEHAVIOR
 
class  PAD_POINT_EDIT_BEHAVIOR
 
class  GENERATOR_POINT_EDIT_BEHAVIOR
 Point editor behavior for the PCB_GENERATOR class. More...
 
class  DIM_ALIGNED_TEXT_UPDATER
 Class to help update the text position of a dimension when the crossbar changes. More...
 
class  ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR
 This covers both aligned and the orthogonal sub-type. More...
 
class  DIM_CENTER_POINT_EDIT_BEHAVIOR
 
class  DIM_RADIAL_POINT_EDIT_BEHAVIOR
 
class  DIM_LEADER_POINT_EDIT_BEHAVIOR
 
class  TEXTBOX_POINT_EDIT_BEHAVIOR
 A textbox is edited as a rectnagle when it is orthogonally aligned. More...
 
class  SHAPE_GROUP_POINT_EDIT_BEHAVIOR
 
class  BLOCK_DRAG_SESSION
 The block drag gesture, with the state it holds while it runs. More...
 

Enumerations

enum  RECT_POINTS {
  RECT_TOP_LEFT , RECT_TOP_RIGHT , RECT_BOT_RIGHT , RECT_BOT_LEFT ,
  RECT_CENTER , RECT_RADIUS , RECT_MAX_POINTS
}
 
enum  RECT_LINES { RECT_TOP , RECT_RIGHT , RECT_BOT , RECT_LEFT }
 
enum  DIMENSION_POINTS {
  DIM_START , DIM_END , DIM_TEXT , DIM_CROSSBARSTART ,
  DIM_CROSSBAREND , DIM_KNEE = DIM_CROSSBARSTART , DIM_ALIGNED_MAX = DIM_CROSSBAREND + 1 , DIM_CENTER_MAX = DIM_END + 1 ,
  DIM_RADIAL_MAX = DIM_KNEE + 1 , DIM_LEADER_MAX = DIM_TEXT + 1
}
 
enum  TEXTBOX_POINT_COUNT { WHEN_RECTANGLE = RECT_MAX_POINTS , WHEN_POLYGON = 0 }
 Text boxes have different point counts depending on their orientation. More...
 

Functions

static void appendDirection (std::vector< VECTOR2I > &aDirections, const VECTOR2I &aDirection)
 
static std::vector< VECTOR2I > getConstraintDirections (EDIT_RELATION *aRelation)
 
static std::optional< CONSTRAINT_MEMBER > constraintMemberForEditPoint (PCB_SHAPE *aShape, EDIT_POINTS *aPoints, EDIT_POINT *aEditedPoint)
 
static VECTOR2I snapCorner (const VECTOR2I &aPrev, const VECTOR2I &aNext, const VECTOR2I &aGuess, double aAngleDeg)
 
static void blockDragPassNavigation (TOOL_EVENT *aEvent)
 
static bool blockDragAllowsCommand (const TOOL_EVENT &aEvent)
 
static void blockDragAppendConstraintCoMembers (BOARD *aBoard, std::vector< BOARD_ITEM * > &aItems)
 
static wxString blockDragDrcRefusal ()
 The release refuses a DRC violation unless the user forces it, and says so the same way wherever it is refused.
 
static std::pair< bool, SHAPE_POLY_SET::VERTEX_INDEX > findVertex (SHAPE_POLY_SET &aPolySet, const EDIT_POINT &aPoint)
 

Variables

static const TOOL_ACTION *const blockDragNavigationActions []
 
static const TOOL_ACTION *const blockDragSafeActions []
 

Enumeration Type Documentation

◆ DIMENSION_POINTS

Enumerator
DIM_START 
DIM_END 
DIM_TEXT 
DIM_CROSSBARSTART 
DIM_CROSSBAREND 
DIM_KNEE 
DIM_ALIGNED_MAX 
DIM_CENTER_MAX 
DIM_RADIAL_MAX 
DIM_LEADER_MAX 

Definition at line 212 of file pcb_point_editor.cpp.

◆ RECT_LINES

enum RECT_LINES
Enumerator
RECT_TOP 
RECT_RIGHT 
RECT_BOT 
RECT_LEFT 

Definition at line 149 of file pcb_point_editor.cpp.

◆ RECT_POINTS

Enumerator
RECT_TOP_LEFT 
RECT_TOP_RIGHT 
RECT_BOT_RIGHT 
RECT_BOT_LEFT 
RECT_CENTER 
RECT_RADIUS 
RECT_MAX_POINTS 

Definition at line 136 of file pcb_point_editor.cpp.

◆ TEXTBOX_POINT_COUNT

Text boxes have different point counts depending on their orientation.

Enumerator
WHEN_RECTANGLE 
WHEN_POLYGON 

Definition at line 229 of file pcb_point_editor.cpp.

Function Documentation

◆ appendDirection()

static void appendDirection ( std::vector< VECTOR2I > & aDirections,
const VECTOR2I & aDirection )
static

Definition at line 89 of file pcb_point_editor.cpp.

References VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by getConstraintDirections().

◆ blockDragAllowsCommand()

static bool blockDragAllowsCommand ( const TOOL_EVENT & aEvent)
static

◆ blockDragAppendConstraintCoMembers()

static void blockDragAppendConstraintCoMembers ( BOARD * aBoard,
std::vector< BOARD_ITEM * > & aItems )
static

◆ blockDragDrcRefusal()

static wxString blockDragDrcRefusal ( )
static

The release refuses a DRC violation unless the user forces it, and says so the same way wherever it is refused.

Definition at line 2939 of file pcb_point_editor.cpp.

References _, KeyNameFromKeyCode(), MD_CTRL, and PSEUDO_WXK_CLICK.

Referenced by BLOCK_DRAG_SESSION::Release().

◆ blockDragPassNavigation()

static void blockDragPassNavigation ( TOOL_EVENT * aEvent)
static

◆ constraintMemberForEditPoint()

◆ findVertex()

◆ getConstraintDirections()

static std::vector< VECTOR2I > getConstraintDirections ( EDIT_RELATION * aRelation)
static

◆ snapCorner()

static VECTOR2I snapCorner ( const VECTOR2I & aPrev,
const VECTOR2I & aNext,
const VECTOR2I & aGuess,
double aAngleDeg )
static

Variable Documentation

◆ blockDragNavigationActions

const TOOL_ACTION* const blockDragNavigationActions[]
static
Initial value:
= {
}
static TOOL_ACTION cursorLeft
Definition actions.h:169
static TOOL_ACTION zoomOutCenter
Definition actions.h:133
static TOOL_ACTION zoomIn
Definition actions.h:130
static TOOL_ACTION cursorLeftFast
Definition actions.h:174
static TOOL_ACTION cursorDown
Definition actions.h:168
static TOOL_ACTION zoomOut
Definition actions.h:131
static TOOL_ACTION cursorRightFast
Definition actions.h:175
static TOOL_ACTION zoomCenter
Definition actions.h:138
static TOOL_ACTION panDown
Definition actions.h:182
static TOOL_ACTION cursorDownFast
Definition actions.h:173
static TOOL_ACTION cursorUpFast
Definition actions.h:172
static TOOL_ACTION panLeft
Definition actions.h:183
static TOOL_ACTION zoomFitScreen
Definition actions.h:139
static TOOL_ACTION panUp
Definition actions.h:181
static TOOL_ACTION zoomFitObjects
Definition actions.h:140
static TOOL_ACTION zoomInCenter
Definition actions.h:132
static TOOL_ACTION panRight
Definition actions.h:184
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition actions.h:167
static TOOL_ACTION cursorRight
Definition actions.h:170

Definition at line 2774 of file pcb_point_editor.cpp.

Referenced by blockDragAllowsCommand(), and blockDragPassNavigation().

◆ blockDragSafeActions

const TOOL_ACTION* const blockDragSafeActions[]
static
Initial value:
= {
}
static TOOL_ACTION gridFastCycle
Definition actions.h:189
static TOOL_ACTION toggleGrid
Definition actions.h:195
static TOOL_ACTION zoomRedraw
Definition actions.h:129
static TOOL_ACTION gridFast1
Definition actions.h:187
static TOOL_ACTION gridPrev
Definition actions.h:191
static TOOL_ACTION togglePolarCoords
Definition actions.h:206
static TOOL_ACTION gridPreset
Definition actions.h:194
static TOOL_ACTION toggleCursor
Definition actions.h:148
static TOOL_ACTION updateMenu
Definition actions.h:268
static TOOL_ACTION cursorClick
Definition actions.h:177
static TOOL_ACTION gridFast2
Definition actions.h:188
static TOOL_ACTION refreshPreview
Definition actions.h:156
static TOOL_ACTION toggleGridOverrides
Definition actions.h:196
static TOOL_ACTION gridNext
Definition actions.h:190
static TOOL_ACTION drag45Degree
static TOOL_ACTION dragFreeAngle

Definition at line 2797 of file pcb_point_editor.cpp.

Referenced by blockDragAllowsCommand().