KiCad PCB EDA Suite
Loading...
Searching...
No Matches
graphic_edit_tool.cpp File Reference
#include <tools/graphic_edit_tool.h>
#include <board_commit.h>
#include <board.h>
#include <gal/graphics_abstraction_layer.h>
#include <gal/painter.h>
#include <geometry/circle.h>
#include <geometry/seg.h>
#include <pcb_shape.h>
#include <preview_items/construction_geom.h>
#include <render_settings.h>
#include <tool/actions.h>
#include <tool/tool_manager.h>
#include <tools/graphic_extend.h>
#include <tools/graphic_trim.h>
#include <tools/hover_picker.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_picker_tool.h>
#include <tools/pcb_selection_tool.h>
#include <algorithm>
#include <cmath>
#include <limits>

Go to the source code of this file.

Functions

static double outlineProximity (const BOARD_ITEM &aItem, const VECTOR2I &aPointer)
 How far aPointer is from the shape's outline.
 
static void applyGeometry (PCB_SHAPE &aShape, const GRAPHIC_EDIT_GEOMETRY &aGeometry)
 
static KIGFX::CONSTRUCTION_GEOM::DRAWABLE drawable (const GRAPHIC_EDIT_GEOMETRY &aGeometry)
 
static wxString refusalMessage (GRAPHIC_EDIT_REFUSAL aRefusal, const wxString &aNoResult)
 aNoResult carries wording only the operation can supply.
 

Function Documentation

◆ applyGeometry()

◆ drawable()

◆ outlineProximity()

static double outlineProximity ( const BOARD_ITEM & aItem,
const VECTOR2I & aPointer )
static

How far aPointer is from the shape's outline.

A fill does not count as a hit, so a shape drawn over another does not swallow it.

Definition at line 46 of file graphic_edit_tool.cpp.

References std::abs(), ARC, CIRCLE, SEG::Distance(), VECTOR2< T >::Distance(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetRectCorners(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), GraphicEditArc(), GraphicEditShape(), SHAPE_ARC::NearestPoint(), RECTANGLE, and SEGMENT.

Referenced by GRAPHIC_EDIT_TOOL::runInteractive().

◆ refusalMessage()

static wxString refusalMessage ( GRAPHIC_EDIT_REFUSAL aRefusal,
const wxString & aNoResult )
static

aNoResult carries wording only the operation can supply.

Definition at line 123 of file graphic_edit_tool.cpp.

References _, AMBIGUOUS, DEGENERATE, and LOCKED_SOURCE.

Referenced by GRAPHIC_EDIT_TOOL::runInteractive().