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

#include <pcb_origin_transforms.h>

Inheritance diagram for PCB_ORIGIN_TRANSFORMS:
ORIGIN_TRANSFORMS

Public Types

enum  COORD_TYPES_T {
  NOT_A_COORD , ABS_X_COORD , ABS_Y_COORD , REL_X_COORD ,
  REL_Y_COORD
}
 The supported Display Origin Transform types. More...
 

Public Member Functions

 PCB_ORIGIN_TRANSFORMS (PCB_BASE_FRAME &aPcbBaseFrame)
 
virtual ~PCB_ORIGIN_TRANSFORMS () override
 
virtual long long int ToDisplay (long long int aValue, COORD_TYPES_T aCoordType) const override
 
virtual double ToDisplay (double aValue, COORD_TYPES_T aCoordType) const override
 
virtual long long int FromDisplay (long long int aValue, COORD_TYPES_T aCoordType) const override
 
virtual double FromDisplay (double aValue, COORD_TYPES_T aCoordType) const override
 
template<typename T>
T ToDisplayRelX (T aInternalValue) const
 Transform a 2-D coordinate point referenced to the internal origin to the equivalent point referenced to the user-selected display origin.
 
template<typename T>
T ToDisplayRelY (T aInternalValue) const
 
template<typename T>
T FromDisplayRelX (T aDisplayValue) const
 
template<typename T>
T FromDisplayRelY (T aDisplayValue) const
 
template<typename T>
T ToDisplayAbsX (T aInternalValue) const
 
template<typename T>
T ToDisplayAbsY (T aInternalValue) const
 
template<typename T>
T FromDisplayAbsX (T aDisplayValue) const
 
template<typename T>
T FromDisplayAbsY (T aDisplayValue) const
 
template<typename T>
T ToDisplayAbs (T aInternalValue) const
 
template<typename T>
T FromDisplayAbs (T aDisplayValue) const
 
template<typename T>
T ToDisplayRel (T aInternalValue) const
 
template<typename T>
T FromDisplayRel (T aDisplayValue) const
 
virtual int ToDisplay (int aValue, COORD_TYPES_T aCoordType) const
 
virtual int FromDisplay (int aValue, COORD_TYPES_T aCoordType) const
 
template<class T>
T ToDisplayAbs (const T &aValue) const
 
template<class T>
T ToDisplayRel (const T &aValue) const
 
template<class T>
T FromDisplayAbs (const T &aValue) const
 
template<class T>
T FromDisplayRel (const T &aValue) const
 

Protected Member Functions

int getUserXOrigin () const
 
int getUserYOrigin () const
 
bool invertXAxis () const
 
bool invertYAxis () const
 

Static Protected Member Functions

template<class T>
static T ToDisplayAbs (T aInternalValue, int aUserOrigin, bool aInvertAxis)
 
template<class T>
static T ToDisplayRel (T aInternalValue, bool aInvertAxis)
 
template<class T>
static T FromDisplayAbs (T aDisplayValue, int aUserOrigin, bool aInvertAxis)
 
template<class T>
static T FromDisplayRel (T aDisplayValue, bool aInvertAxis)
 

Protected Attributes

const PCB_BASE_FRAMEm_pcbBaseFrame
 

Detailed Description

Definition at line 32 of file pcb_origin_transforms.h.

Member Enumeration Documentation

◆ COORD_TYPES_T

The supported Display Origin Transform types.

Absolute coordinates require both translation and direction inversion. Relative coordinates require only direction inversion.

Enumerator
NOT_A_COORD 
ABS_X_COORD 
ABS_Y_COORD 
REL_X_COORD 
REL_Y_COORD 

Definition at line 48 of file origin_transforms.h.

Constructor & Destructor Documentation

◆ PCB_ORIGIN_TRANSFORMS()

PCB_ORIGIN_TRANSFORMS::PCB_ORIGIN_TRANSFORMS ( PCB_BASE_FRAME & aPcbBaseFrame)

Definition at line 33 of file pcb_origin_transforms.cpp.

References m_pcbBaseFrame.

◆ ~PCB_ORIGIN_TRANSFORMS()

PCB_ORIGIN_TRANSFORMS::~PCB_ORIGIN_TRANSFORMS ( )
overridevirtual

Definition at line 37 of file pcb_origin_transforms.cpp.

Member Function Documentation

◆ FromDisplay() [1/3]

double PCB_ORIGIN_TRANSFORMS::FromDisplay ( double aValue,
COORD_TYPES_T aCoordType ) const
overridevirtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 93 of file pcb_origin_transforms.cpp.

References FromDisplayAbsX(), FromDisplayAbsY(), FromDisplayRelX(), and FromDisplayRelY().

◆ FromDisplay() [2/3]

int ORIGIN_TRANSFORMS::FromDisplay ( int aValue,
COORD_TYPES_T aCoordType ) const
virtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 69 of file origin_transforms.cpp.

◆ FromDisplay() [3/3]

long long int PCB_ORIGIN_TRANSFORMS::FromDisplay ( long long int aValue,
COORD_TYPES_T aCoordType ) const
overridevirtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 75 of file pcb_origin_transforms.cpp.

References FromDisplayAbsX(), FromDisplayAbsY(), FromDisplayRelX(), and FromDisplayRelY().

◆ FromDisplayAbs() [1/3]

template<class T>
T ORIGIN_TRANSFORMS::FromDisplayAbs ( const T & aValue) const
inlineinherited

◆ FromDisplayAbs() [2/3]

template<class T>
static T ORIGIN_TRANSFORMS::FromDisplayAbs ( T aDisplayValue,
int aUserOrigin,
bool aInvertAxis )
inlinestaticprotectedinherited

Definition at line 167 of file origin_transforms.h.

References T.

◆ FromDisplayAbs() [3/3]

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayAbs ( T aDisplayValue) const
inline

Definition at line 160 of file pcb_origin_transforms.h.

References FromDisplayAbsX(), FromDisplayAbsY(), and T.

◆ FromDisplayAbsX()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayAbsX ( T aDisplayValue) const
inline

◆ FromDisplayAbsY()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayAbsY ( T aDisplayValue) const
inline

◆ FromDisplayRel() [1/3]

template<class T>
T ORIGIN_TRANSFORMS::FromDisplayRel ( const T & aValue) const
inlineinherited

◆ FromDisplayRel() [2/3]

template<class T>
static T ORIGIN_TRANSFORMS::FromDisplayRel ( T aDisplayValue,
bool aInvertAxis )
inlinestaticprotectedinherited

Definition at line 137 of file origin_transforms.h.

References T.

◆ FromDisplayRel() [3/3]

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayRel ( T aDisplayValue) const
inline

Definition at line 182 of file pcb_origin_transforms.h.

References FromDisplayRelX(), FromDisplayRelY(), and T.

◆ FromDisplayRelX()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayRelX ( T aDisplayValue) const
inline

◆ FromDisplayRelY()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::FromDisplayRelY ( T aDisplayValue) const
inline

◆ getUserXOrigin()

int PCB_ORIGIN_TRANSFORMS::getUserXOrigin ( ) const
protected

Definition at line 111 of file pcb_origin_transforms.cpp.

References m_pcbBaseFrame.

Referenced by FromDisplayAbsX(), and ToDisplayAbsX().

◆ getUserYOrigin()

int PCB_ORIGIN_TRANSFORMS::getUserYOrigin ( ) const
protected

Definition at line 116 of file pcb_origin_transforms.cpp.

References m_pcbBaseFrame.

Referenced by FromDisplayAbsY(), and ToDisplayAbsY().

◆ invertXAxis()

bool PCB_ORIGIN_TRANSFORMS::invertXAxis ( ) const
protected

◆ invertYAxis()

bool PCB_ORIGIN_TRANSFORMS::invertYAxis ( ) const
protected

◆ ToDisplay() [1/3]

double PCB_ORIGIN_TRANSFORMS::ToDisplay ( double aValue,
COORD_TYPES_T aCoordType ) const
overridevirtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 58 of file pcb_origin_transforms.cpp.

References ToDisplayAbsX(), ToDisplayAbsY(), ToDisplayRelX(), and ToDisplayRelY().

◆ ToDisplay() [2/3]

int ORIGIN_TRANSFORMS::ToDisplay ( int aValue,
COORD_TYPES_T aCoordType ) const
virtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 60 of file origin_transforms.cpp.

◆ ToDisplay() [3/3]

long long int PCB_ORIGIN_TRANSFORMS::ToDisplay ( long long int aValue,
COORD_TYPES_T aCoordType ) const
overridevirtual

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 40 of file pcb_origin_transforms.cpp.

References ToDisplayAbsX(), ToDisplayAbsY(), ToDisplayRelX(), and ToDisplayRelY().

◆ ToDisplayAbs() [1/3]

template<class T>
T ORIGIN_TRANSFORMS::ToDisplayAbs ( const T & aValue) const
inlineinherited

◆ ToDisplayAbs() [2/3]

template<class T>
static T ORIGIN_TRANSFORMS::ToDisplayAbs ( T aInternalValue,
int aUserOrigin,
bool aInvertAxis )
inlinestaticprotectedinherited

Definition at line 150 of file origin_transforms.h.

References T.

◆ ToDisplayAbs() [3/3]

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayAbs ( T aInternalValue) const
inline

Definition at line 149 of file pcb_origin_transforms.h.

References T, ToDisplayAbsX(), and ToDisplayAbsY().

◆ ToDisplayAbsX()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayAbsX ( T aInternalValue) const
inline

◆ ToDisplayAbsY()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayAbsY ( T aInternalValue) const
inline

◆ ToDisplayRel() [1/3]

template<class T>
T ORIGIN_TRANSFORMS::ToDisplayRel ( const T & aValue) const
inlineinherited

◆ ToDisplayRel() [2/3]

template<class T>
static T ORIGIN_TRANSFORMS::ToDisplayRel ( T aInternalValue,
bool aInvertAxis )
inlinestaticprotectedinherited

Definition at line 123 of file origin_transforms.h.

References T.

◆ ToDisplayRel() [3/3]

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayRel ( T aInternalValue) const
inline

Definition at line 171 of file pcb_origin_transforms.h.

References T, ToDisplayRelX(), and ToDisplayRelY().

◆ ToDisplayRelX()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayRelX ( T aInternalValue) const
inline

Transform a 2-D coordinate point referenced to the internal origin to the equivalent point referenced to the user-selected display origin.

Parameters
aValuea point referenced to the internal origin
Returns
the point re-referenced to the user-selected display origin Transform a 2-D coordinate point referenced to the user-selected display origin to the equivalent point referenced to the internal origin.
Parameters
aValuea point referenced to the user-selected display origin
Returns
the point re-referenced to the internal origin Transform a relative 2-D coordinate delta referenced to the user-selected display origin to the equivalent delta referenced to the internal origin.

This is initially intended to handle axis inversion of a delta between two display points, but could be extended to handle other transforms.

Parameters
aValuea delta referenced to the internal origin
Returns
the delta re-referenced to the user-selected display origin Transform a relative 2-D coordinate delta referenced to the user-selected display origin to the equivalent delta referenced to the internal origin.

This is initially intended to handle axis inversion of a delta between two display points, but could be extended to handle other transforms.

Parameters
aValuea delta referenced to the user-selected display origin
Returns
the delta re-referenced to the internal origin

Definition at line 95 of file pcb_origin_transforms.h.

References invertXAxis(), T, and ORIGIN_TRANSFORMS::ToDisplayRel().

Referenced by ToDisplay(), ToDisplay(), and ToDisplayRel().

◆ ToDisplayRelY()

template<typename T>
T PCB_ORIGIN_TRANSFORMS::ToDisplayRelY ( T aInternalValue) const
inline

Definition at line 101 of file pcb_origin_transforms.h.

References invertYAxis(), T, and ORIGIN_TRANSFORMS::ToDisplayRel().

Referenced by ToDisplay(), ToDisplay(), and ToDisplayRel().

Member Data Documentation

◆ m_pcbBaseFrame

const PCB_BASE_FRAME& PCB_ORIGIN_TRANSFORMS::m_pcbBaseFrame
protected

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