KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDIT_RELATION Class Reference

#include <edit_relations.h>

Public Member Functions

EDIT_RELATION_KIND Kind () const
 
const EDIT_POINTReference () const
 
const EDIT_POINTSecondaryReference () const
 
const VECTOR2IOrigin () const
 
const VECTOR2IDirection () const
 
void Apply (EDIT_POINT &aHandle, const GRID_HELPER &aGrid) const
 
void Apply (EDIT_LINE &aHandle, const GRID_HELPER &aGrid) const
 

Static Public Member Functions

static std::unique_ptr< EDIT_RELATIONSameX (const EDIT_POINT &aReference)
 
static std::unique_ptr< EDIT_RELATIONSameY (const EDIT_POINT &aReference)
 
static std::unique_ptr< EDIT_RELATIONAngle45 (const EDIT_POINT &aReference)
 
static std::unique_ptr< EDIT_RELATIONAngle90 (const EDIT_POINT &aReference)
 
static std::unique_ptr< EDIT_RELATIONPointOnLine (const EDIT_POINT &aConstrained, const EDIT_POINT &aReference)
 
static std::unique_ptr< EDIT_RELATIONPointOnCircle (const EDIT_POINT &aCenter, const EDIT_POINT &aEnd)
 
static std::unique_ptr< EDIT_RELATIONPerpendicularTranslation (const EDIT_LINE &aLine)
 

Private Member Functions

 EDIT_RELATION (EDIT_RELATION_KIND aKind)
 

Static Private Member Functions

static std::unique_ptr< EDIT_RELATIONmake (EDIT_RELATION_KIND aKind, const EDIT_POINT &aReference)
 

Private Attributes

EDIT_RELATION_KIND m_kind
 
const EDIT_POINTm_reference = nullptr
 
const EDIT_POINTm_secondaryReference = nullptr
 
VECTOR2I m_origin
 
VECTOR2I m_direction
 

Detailed Description

Definition at line 68 of file edit_relations.h.

Constructor & Destructor Documentation

◆ EDIT_RELATION()

EDIT_RELATION::EDIT_RELATION ( EDIT_RELATION_KIND aKind)
inlineexplicitprivate

Definition at line 89 of file edit_relations.h.

References m_kind.

Referenced by make(), and PerpendicularTranslation().

Member Function Documentation

◆ Angle45()

◆ Angle90()

std::unique_ptr< EDIT_RELATION > EDIT_RELATION::Angle90 ( const EDIT_POINT & aReference)
static

Definition at line 56 of file edit_relations.cpp.

References ANGLE_STEP_90, and make().

Referenced by PCB_POINT_EDITOR::setAltConstraint().

◆ Apply() [1/2]

void EDIT_RELATION::Apply ( EDIT_LINE & aHandle,
const GRID_HELPER & aGrid ) const

◆ Apply() [2/2]

◆ Direction()

const VECTOR2I & EDIT_RELATION::Direction ( ) const
inline

Definition at line 83 of file edit_relations.h.

References m_direction.

Referenced by authoredSnapRelation(), and getConstraintDirections().

◆ Kind()

EDIT_RELATION_KIND EDIT_RELATION::Kind ( ) const
inline

◆ make()

std::unique_ptr< EDIT_RELATION > EDIT_RELATION::make ( EDIT_RELATION_KIND aKind,
const EDIT_POINT & aReference )
staticprivate

Definition at line 30 of file edit_relations.cpp.

References EDIT_RELATION().

Referenced by Angle45(), Angle90(), PointOnCircle(), PointOnLine(), SameX(), and SameY().

◆ Origin()

const VECTOR2I & EDIT_RELATION::Origin ( ) const
inline

Definition at line 82 of file edit_relations.h.

References m_origin.

Referenced by authoredSnapRelation().

◆ PerpendicularTranslation()

◆ PointOnCircle()

std::unique_ptr< EDIT_RELATION > EDIT_RELATION::PointOnCircle ( const EDIT_POINT & aCenter,
const EDIT_POINT & aEnd )
static

Definition at line 71 of file edit_relations.cpp.

References make(), and POINT_ON_CIRCLE.

◆ PointOnLine()

◆ Reference()

const EDIT_POINT * EDIT_RELATION::Reference ( ) const
inline

Definition at line 80 of file edit_relations.h.

References m_reference.

Referenced by authoredSnapRelation(), and SCH_POINT_EDITOR::Main().

◆ SameX()

std::unique_ptr< EDIT_RELATION > EDIT_RELATION::SameX ( const EDIT_POINT & aReference)
static

Definition at line 38 of file edit_relations.cpp.

References make(), and SAME_X.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SameY()

std::unique_ptr< EDIT_RELATION > EDIT_RELATION::SameY ( const EDIT_POINT & aReference)
static

Definition at line 44 of file edit_relations.cpp.

References make(), and SAME_Y.

◆ SecondaryReference()

const EDIT_POINT * EDIT_RELATION::SecondaryReference ( ) const
inline

Definition at line 81 of file edit_relations.h.

References m_secondaryReference.

Referenced by authoredSnapRelation().

Member Data Documentation

◆ m_direction

VECTOR2I EDIT_RELATION::m_direction
private

Definition at line 100 of file edit_relations.h.

Referenced by Apply(), Apply(), and Direction().

◆ m_kind

EDIT_RELATION_KIND EDIT_RELATION::m_kind
private

Definition at line 96 of file edit_relations.h.

Referenced by Apply(), Apply(), EDIT_RELATION(), and Kind().

◆ m_origin

VECTOR2I EDIT_RELATION::m_origin
private

Definition at line 99 of file edit_relations.h.

Referenced by Apply(), and Origin().

◆ m_reference

const EDIT_POINT* EDIT_RELATION::m_reference = nullptr
private

Definition at line 97 of file edit_relations.h.

Referenced by Apply(), and Reference().

◆ m_secondaryReference

const EDIT_POINT* EDIT_RELATION::m_secondaryReference = nullptr
private

Definition at line 98 of file edit_relations.h.

Referenced by Apply(), and SecondaryReference().


The documentation for this class was generated from the following files: