KiCad PCB EDA Suite
EDIT_CONSTRAINT< EDIT_TYPE > Class Template Referenceabstract

Describe constraints between two edit handles. More...

#include <edit_constraints.h>

Public Member Functions

 EDIT_CONSTRAINT (EDIT_TYPE &aConstrained)
 
virtual ~EDIT_CONSTRAINT ()
 
virtual void Apply (EDIT_TYPE &aHandle, const GRID_HELPER &aGrid)=0
 Correct coordinates of the constrained edit handle. More...
 
void Apply (const GRID_HELPER &aGrid)
 Correct coordinates of the constrained edit handle. More...
 

Protected Attributes

EDIT_TYPE & m_constrained
 Point that is constrained by rules implemented by Apply(). More...
 

Detailed Description

template<class EDIT_TYPE>
class EDIT_CONSTRAINT< EDIT_TYPE >

Describe constraints between two edit handles.

After the constrained handle is changed, Apply() has to be called to fix its coordinates according to the implemented constraint.

Definition at line 62 of file edit_constraints.h.

Constructor & Destructor Documentation

◆ EDIT_CONSTRAINT()

template<class EDIT_TYPE >
EDIT_CONSTRAINT< EDIT_TYPE >::EDIT_CONSTRAINT ( EDIT_TYPE &  aConstrained)
inline
Parameters
aConstrainedis EDIT_POINT to which the constraint is applied.

Definition at line 68 of file edit_constraints.h.

68 :
69 m_constrained( aConstrained )
70 {};
EDIT_TYPE & m_constrained
Point that is constrained by rules implemented by Apply().

◆ ~EDIT_CONSTRAINT()

template<class EDIT_TYPE >
virtual EDIT_CONSTRAINT< EDIT_TYPE >::~EDIT_CONSTRAINT ( )
inlinevirtual

Definition at line 72 of file edit_constraints.h.

72{};

Member Function Documentation

◆ Apply() [1/2]

template<class EDIT_TYPE >
void EDIT_CONSTRAINT< EDIT_TYPE >::Apply ( const GRID_HELPER aGrid)
inline

Correct coordinates of the constrained edit handle.

Definition at line 82 of file edit_constraints.h.

83 {
84 Apply( m_constrained, aGrid );
85 }
virtual void Apply(EDIT_TYPE &aHandle, const GRID_HELPER &aGrid)=0
Correct coordinates of the constrained edit handle.

References EDIT_CONSTRAINT< EDIT_TYPE >::Apply(), and EDIT_CONSTRAINT< EDIT_TYPE >::m_constrained.

◆ Apply() [2/2]

template<class EDIT_TYPE >
virtual void EDIT_CONSTRAINT< EDIT_TYPE >::Apply ( EDIT_TYPE &  aHandle,
const GRID_HELPER aGrid 
)
pure virtual

Correct coordinates of the constrained edit handle.

Implemented in EC_CONVERGING, EC_PERPLINE, EC_VERTICAL, EC_HORIZONTAL, EC_45DEGREE, EC_LINE, and EC_CIRCLE.

Referenced by EDIT_CONSTRAINT< EDIT_TYPE >::Apply(), and EC_CONVERGING::Apply().

Member Data Documentation

◆ m_constrained

template<class EDIT_TYPE >
EDIT_TYPE& EDIT_CONSTRAINT< EDIT_TYPE >::m_constrained
protected

Point that is constrained by rules implemented by Apply().

Definition at line 88 of file edit_constraints.h.

Referenced by EDIT_CONSTRAINT< EDIT_TYPE >::Apply().


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