KiCad PCB EDA Suite
EC_HORIZONTAL Class Reference

Class EC_HORIZONTAL. More...

#include <edit_constraints.h>

Inheritance diagram for EC_HORIZONTAL:
EDIT_CONSTRAINT< EDIT_POINT >

Public Member Functions

 EC_HORIZONTAL (EDIT_POINT &aConstrained, const EDIT_POINT &aConstrainer)
 Constructor. More...
 
virtual void Apply (EDIT_POINT &aHandle) override
 > More...
 
void Apply ()
 Function Apply() More...
 

Protected Attributes

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

Private Attributes

const EDIT_POINTm_constrainer
 Point that imposes the constraint. More...
 

Detailed Description

Class EC_HORIZONTAL.

EDIT_CONSTRAINT that imposes a constraint that two points have to have the same Y coordinate.

Definition at line 107 of file edit_constraints.h.

Constructor & Destructor Documentation

EC_HORIZONTAL::EC_HORIZONTAL ( EDIT_POINT aConstrained,
const EDIT_POINT aConstrainer 
)
inline

Constructor.

Parameters
aConstrainedis the point that is put under constrain.
aConstraineris the point that is the source of the constrain.

Definition at line 116 of file edit_constraints.h.

116  :
117  EDIT_CONSTRAINT<EDIT_POINT>( aConstrained ), m_constrainer( aConstrainer )
118  {}
const EDIT_POINT & m_constrainer
Point that imposes the constraint.

Member Function Documentation

void EDIT_CONSTRAINT< EDIT_POINT >::Apply ( )
inlineinherited

Function Apply()

Corrects coordinates of the constrained edit handle.

Definition at line 66 of file edit_constraints.h.

67  {
69  }
void Apply()
Function Apply()
EDIT_POINT & m_constrained
Point that is constrained by rules implemented by Apply()
void EC_HORIZONTAL::Apply ( EDIT_POINT aHandle)
overridevirtual

>

Function Apply() Corrects coordinates of the constrained edit handle.

Implements EDIT_CONSTRAINT< EDIT_POINT >.

Definition at line 40 of file edit_constraints.cpp.

References EDIT_POINT::GetPosition(), m_constrainer, EDIT_POINT::SetPosition(), and VECTOR2< T >::y.

41 {
42  VECTOR2I point = aHandle.GetPosition();
43  point.y = m_constrainer.GetPosition().y;
44  aHandle.SetPosition( point );
45 }
const EDIT_POINT & m_constrainer
Point that imposes the constraint.
virtual VECTOR2I GetPosition() const
Function GetPosition()
Definition: edit_points.h:65
virtual void SetPosition(const VECTOR2I &aPosition)
Function SetPosition()
Definition: edit_points.h:97

Member Data Documentation

EDIT_POINT & EDIT_CONSTRAINT< EDIT_POINT >::m_constrained
protectedinherited

Point that is constrained by rules implemented by Apply()

Definition at line 72 of file edit_constraints.h.

Referenced by EC_LINE::EC_LINE().

const EDIT_POINT& EC_HORIZONTAL::m_constrainer
private

Point that imposes the constraint.

Definition at line 124 of file edit_constraints.h.

Referenced by Apply().


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