KiCad PCB EDA Suite
Loading...
Searching...
No Matches
point_editor_behavior.cpp File Reference
#include "tool/point_editor_behavior.h"
#include <algorithm>
#include <advanced_config.h>
#include <commit.h>
#include <geometry/shape_poly_set.h>
#include <math/util.h>
#include <reference_image.h>

Go to the source code of this file.

Functions

static void editArcEndpointKeepTangent (EDA_SHAPE &aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCursor)
 Move an end point of the arc, while keeping the tangent at the other endpoint.
 
static void editArcCenterKeepEndpoints (EDA_SHAPE &aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
 Move the arc center but keep endpoint locations.
 
static void editArcEndpointKeepCenterAndRadius (EDA_SHAPE &aArc, const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
 
static void editArcMidKeepEndpoints (EDA_SHAPE &aArc, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCursor)
 Move the mid point of the arc, while keeping the angle.
 
ARC_EDIT_MODE IncrementArcEditMode (ARC_EDIT_MODE aMode)
 

Function Documentation

◆ editArcCenterKeepEndpoints()

static void editArcCenterKeepEndpoints ( EDA_SHAPE & aArc,
const VECTOR2I & aCenter,
const VECTOR2I & aStart,
const VECTOR2I & aMid,
const VECTOR2I & aEnd )
static

Move the arc center but keep endpoint locations.

Definition at line 524 of file point_editor_behavior.cpp.

References SEG::A, SEG::B, VECTOR2< int32_t >::ECOORD_MAX, SEG::IntersectLines(), EDA_SHAPE::SetCenter(), and SEG::SquaredDistance().

Referenced by EDA_ARC_POINT_EDIT_BEHAVIOR::UpdateItem().

◆ editArcEndpointKeepCenterAndRadius()

static void editArcEndpointKeepCenterAndRadius ( EDA_SHAPE & aArc,
const VECTOR2I & aCenter,
const VECTOR2I & aStart,
const VECTOR2I & aMid,
const VECTOR2I & aEnd )
static

◆ editArcEndpointKeepTangent()

static void editArcEndpointKeepTangent ( EDA_SHAPE & aArc,
const VECTOR2I & aCenter,
const VECTOR2I & aStart,
const VECTOR2I & aMid,
const VECTOR2I & aEnd,
const VECTOR2I & aCursor )
static

◆ editArcMidKeepEndpoints()

static void editArcMidKeepEndpoints ( EDA_SHAPE & aArc,
const VECTOR2I & aStart,
const VECTOR2I & aEnd,
const VECTOR2I & aCursor )
static

Move the mid point of the arc, while keeping the angle.

Definition at line 703 of file point_editor_behavior.cpp.

References EDA_SHAPE::GetArcMid(), IsStraightArc(), SEG::NearestPoint(), VECTOR2< T >::Resize(), and EDA_SHAPE::SetArcGeometry().

Referenced by EDA_ARC_POINT_EDIT_BEHAVIOR::UpdateItem().

◆ IncrementArcEditMode()