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 >
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. More...
 
template<typename T >
ToDisplayRelY (T aInternalValue) const
 
template<typename T >
FromDisplayRelX (T aDisplayValue) const
 
template<typename T >
FromDisplayRelY (T aDisplayValue) const
 
template<typename T >
ToDisplayAbsX (T aInternalValue) const
 
template<typename T >
ToDisplayAbsY (T aInternalValue) const
 
template<typename T >
FromDisplayAbsX (T aDisplayValue) const
 
template<typename T >
FromDisplayAbsY (T aDisplayValue) const
 
template<typename T >
ToDisplayAbs (T aInternalValue) const
 
template<typename T >
FromDisplayAbs (T aDisplayValue) const
 
template<typename T >
ToDisplayRel (T aInternalValue) const
 
template<typename T >
FromDisplayRel (T aDisplayValue) const
 
virtual int ToDisplay (int aValue, COORD_TYPES_T aCoordType) const
 
virtual long long int ToDisplay (long long int aValue, COORD_TYPES_T aCoordType) const
 
virtual double ToDisplay (double aValue, COORD_TYPES_T aCoordType) const
 
virtual int FromDisplay (int aValue, COORD_TYPES_T aCoordType) const
 
virtual long long int FromDisplay (long long int aValue, COORD_TYPES_T aCoordType) const
 
virtual double FromDisplay (double aValue, COORD_TYPES_T aCoordType) const
 
template<class T >
ToDisplayAbs (const T &aValue) const
 
template<class T >
ToDisplayRel (const T &aValue) const
 
template<class T >
FromDisplayAbs (const T &aValue) const
 
template<class 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.

◆ ~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/5]

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

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 75 of file origin_transforms.cpp.

◆ FromDisplay() [2/5]

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() [3/5]

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() [4/5]

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

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 72 of file origin_transforms.cpp.

◆ FromDisplay() [5/5]

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<typename T >
T PCB_ORIGIN_TRANSFORMS::FromDisplayAbs ( aDisplayValue) const
inline

Definition at line 160 of file pcb_origin_transforms.h.

References FromDisplayAbsX(), and FromDisplayAbsY().

◆ FromDisplayAbs() [3/3]

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

Definition at line 167 of file origin_transforms.h.

◆ FromDisplayAbsX()

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

◆ FromDisplayAbsY()

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

◆ FromDisplayRel() [1/3]

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

◆ FromDisplayRel() [2/3]

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

Definition at line 182 of file pcb_origin_transforms.h.

References FromDisplayRelX(), and FromDisplayRelY().

◆ FromDisplayRel() [3/3]

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

Definition at line 137 of file origin_transforms.h.

◆ FromDisplayRelX()

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

Definition at line 107 of file pcb_origin_transforms.h.

References ORIGIN_TRANSFORMS::FromDisplayRel(), and invertXAxis().

Referenced by FromDisplay(), and FromDisplayRel().

◆ FromDisplayRelY()

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

Definition at line 113 of file pcb_origin_transforms.h.

References ORIGIN_TRANSFORMS::FromDisplayRel(), and invertYAxis().

Referenced by FromDisplay(), and FromDisplayRel().

◆ getUserXOrigin()

int PCB_ORIGIN_TRANSFORMS::getUserXOrigin ( ) const
protected

◆ getUserYOrigin()

int PCB_ORIGIN_TRANSFORMS::getUserYOrigin ( ) const
protected

◆ invertXAxis()

◆ invertYAxis()

◆ ToDisplay() [1/5]

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

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 66 of file origin_transforms.cpp.

◆ ToDisplay() [2/5]

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() [3/5]

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() [4/5]

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

Reimplemented from ORIGIN_TRANSFORMS.

Definition at line 63 of file origin_transforms.cpp.

◆ ToDisplay() [5/5]

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

◆ ToDisplayAbs() [1/3]

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

◆ ToDisplayAbs() [2/3]

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

Definition at line 149 of file pcb_origin_transforms.h.

References ToDisplayAbsX(), and ToDisplayAbsY().

◆ ToDisplayAbs() [3/3]

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

Definition at line 150 of file origin_transforms.h.

◆ ToDisplayAbsX()

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

◆ ToDisplayAbsY()

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

◆ ToDisplayRel() [1/3]

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

◆ ToDisplayRel() [2/3]

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

Definition at line 171 of file pcb_origin_transforms.h.

References ToDisplayRelX(), and ToDisplayRelY().

◆ ToDisplayRel() [3/3]

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

Definition at line 123 of file origin_transforms.h.

◆ ToDisplayRelX()

template<typename T >
T PCB_ORIGIN_TRANSFORMS::ToDisplayRelX ( 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(), and ORIGIN_TRANSFORMS::ToDisplayRel().

Referenced by ToDisplay(), ToDisplayRel(), and PCB_BASE_FRAME::UpdateStatusBar().

◆ ToDisplayRelY()

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

Member Data Documentation

◆ m_pcbBaseFrame

const PCB_BASE_FRAME& PCB_ORIGIN_TRANSFORMS::m_pcbBaseFrame
protected

Definition at line 200 of file pcb_origin_transforms.h.

Referenced by getUserXOrigin(), getUserYOrigin(), invertXAxis(), and invertYAxis().


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