KiCad PCB EDA Suite
pcb_point_editor.cpp File Reference
#include <functional>
#include <memory>
#include <advanced_config.h>
#include <tool/tool_manager.h>
#include <view/view_controls.h>
#include <geometry/seg.h>
#include <confirm.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 <board_commit.h>
#include <pcb_edit_frame.h>
#include <fp_shape.h>
#include <fp_textbox.h>
#include <pcb_bitmap.h>
#include <pcb_dimension.h>
#include <pcb_textbox.h>
#include <pad.h>
#include <zone.h>
#include <footprint.h>
#include <footprint_editor_settings.h>
#include <connectivity/connectivity_data.h>
#include <progress_reporter.h>

Go to the source code of this file.

Enumerations

enum  SEG_POINTS { SEG_START , SEG_END }
 
enum  RECT_POINTS { RECT_TOP_LEFT , RECT_TOP_RIGHT , RECT_BOT_RIGHT , RECT_BOT_LEFT }
 
enum  RECT_LINES { RECT_TOP , RECT_RIGHT , RECT_BOT , RECT_LEFT }
 
enum  ARC_POINTS {
  ARC_CENTER , ARC_START , ARC_END , ARC_CENTER ,
  ARC_START , ARC_MID , ARC_END
}
 
enum  CIRCLE_POINTS { CIRC_CENTER , CIRC_END , CIRC_CENTER , CIRC_END }
 
enum  BEZIER_CURVE_POINTS { BEZIER_CURVE_START , BEZIER_CURVE_CONTROL_POINT1 , BEZIER_CURVE_CONTROL_POINT2 , BEZIER_CURVE_END }
 
enum  DIMENSION_POINTS {
  DIM_START , DIM_END , DIM_TEXT , DIM_CROSSBARSTART ,
  DIM_CROSSBAREND , DIM_KNEE = DIM_CROSSBARSTART
}
 

Functions

static std::pair< bool, SHAPE_POLY_SET::VERTEX_INDEXfindVertex (SHAPE_POLY_SET &aPolySet, const EDIT_POINT &aPoint)
 

Enumeration Type Documentation

◆ ARC_POINTS

enum ARC_POINTS
Enumerator
ARC_CENTER 
ARC_START 
ARC_END 
ARC_CENTER 
ARC_START 
ARC_MID 
ARC_END 

Definition at line 74 of file pcb_point_editor.cpp.

75{
77};
@ ARC_MID
@ ARC_START
@ ARC_END
@ ARC_CENTER

◆ BEZIER_CURVE_POINTS

Enumerator
BEZIER_CURVE_START 
BEZIER_CURVE_CONTROL_POINT1 
BEZIER_CURVE_CONTROL_POINT2 
BEZIER_CURVE_END 

Definition at line 86 of file pcb_point_editor.cpp.

◆ CIRCLE_POINTS

Enumerator
CIRC_CENTER 
CIRC_END 
CIRC_CENTER 
CIRC_END 

Definition at line 80 of file pcb_point_editor.cpp.

81{
83};
@ CIRC_END
@ CIRC_CENTER

◆ DIMENSION_POINTS

Enumerator
DIM_START 
DIM_END 
DIM_TEXT 
DIM_CROSSBARSTART 
DIM_CROSSBAREND 
DIM_KNEE 

Definition at line 95 of file pcb_point_editor.cpp.

96{
98 DIM_END,
103};
@ DIM_KNEE
@ DIM_TEXT
@ DIM_CROSSBAREND
@ DIM_END
@ DIM_START
@ DIM_CROSSBARSTART

◆ RECT_LINES

enum RECT_LINES
Enumerator
RECT_TOP 
RECT_RIGHT 
RECT_BOT 
RECT_LEFT 

Definition at line 68 of file pcb_point_editor.cpp.

69{
71};
@ RECT_RIGHT
@ RECT_LEFT
@ RECT_BOT
@ RECT_TOP

◆ RECT_POINTS

Enumerator
RECT_TOP_LEFT 
RECT_TOP_RIGHT 
RECT_BOT_RIGHT 
RECT_BOT_LEFT 

Definition at line 62 of file pcb_point_editor.cpp.

63{
65};
@ RECT_BOT_LEFT
@ RECT_BOT_RIGHT
@ RECT_TOP_RIGHT
@ RECT_TOP_LEFT

◆ SEG_POINTS

enum SEG_POINTS
Enumerator
SEG_START 
SEG_END 

Definition at line 56 of file pcb_point_editor.cpp.

57{
59};
@ SEG_END
@ SEG_START

Function Documentation

◆ findVertex()

static std::pair< bool, SHAPE_POLY_SET::VERTEX_INDEX > findVertex ( SHAPE_POLY_SET aPolySet,
const EDIT_POINT aPoint 
)
static

Definition at line 2128 of file pcb_point_editor.cpp.

2129{
2130 for( auto it = aPolySet.IterateWithHoles(); it; ++it )
2131 {
2132 auto vertexIdx = it.GetIndex();
2133
2134 if( aPolySet.CVertex( vertexIdx ) == aPoint.GetPosition() )
2135 return std::make_pair( true, vertexIdx );
2136 }
2137
2138 return std::make_pair( false, SHAPE_POLY_SET::VERTEX_INDEX() );
2139}
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
Definition: edit_points.h:71
ITERATOR IterateWithHoles(int aOutline)
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...

References SHAPE_POLY_SET::CVertex(), EDIT_POINT::GetPosition(), and SHAPE_POLY_SET::IterateWithHoles().

Referenced by PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), and PNS::LINE::Walkaround().