KiCad PCB EDA Suite
|
#include <pcb_origin_transforms.h>
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 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 > | |
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_FRAME & | m_pcbBaseFrame |
Definition at line 32 of file pcb_origin_transforms.h.
|
inherited |
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.
PCB_ORIGIN_TRANSFORMS::PCB_ORIGIN_TRANSFORMS | ( | PCB_BASE_FRAME & | aPcbBaseFrame | ) |
Definition at line 33 of file pcb_origin_transforms.cpp.
|
overridevirtual |
Definition at line 37 of file pcb_origin_transforms.cpp.
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 75 of file origin_transforms.cpp.
|
overridevirtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 93 of file pcb_origin_transforms.cpp.
References FromDisplayAbsX(), FromDisplayAbsY(), FromDisplayRelX(), and FromDisplayRelY().
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 69 of file origin_transforms.cpp.
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 72 of file origin_transforms.cpp.
|
overridevirtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 75 of file pcb_origin_transforms.cpp.
References FromDisplayAbsX(), FromDisplayAbsY(), FromDisplayRelX(), and FromDisplayRelY().
|
inlineinherited |
Definition at line 101 of file origin_transforms.h.
References ORIGIN_TRANSFORMS::ABS_X_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD, and ORIGIN_TRANSFORMS::FromDisplay().
Referenced by FromDisplayAbsX(), FromDisplayAbsY(), and PCB_POINT_EDITOR::movePoint().
|
inline |
Definition at line 160 of file pcb_origin_transforms.h.
References FromDisplayAbsX(), and FromDisplayAbsY().
|
inlinestaticprotectedinherited |
Definition at line 167 of file origin_transforms.h.
|
inline |
Definition at line 134 of file pcb_origin_transforms.h.
References ORIGIN_TRANSFORMS::FromDisplayAbs(), getUserXOrigin(), and invertXAxis().
Referenced by FromDisplay(), and FromDisplayAbs().
|
inline |
Definition at line 140 of file pcb_origin_transforms.h.
References ORIGIN_TRANSFORMS::FromDisplayAbs(), getUserYOrigin(), and invertYAxis().
Referenced by FromDisplay(), and FromDisplayAbs().
|
inlineinherited |
Definition at line 111 of file origin_transforms.h.
References ORIGIN_TRANSFORMS::FromDisplay(), ORIGIN_TRANSFORMS::REL_X_COORD, and ORIGIN_TRANSFORMS::REL_Y_COORD.
Referenced by FromDisplayRelX(), and FromDisplayRelY().
|
inline |
Definition at line 182 of file pcb_origin_transforms.h.
References FromDisplayRelX(), and FromDisplayRelY().
|
inlinestaticprotectedinherited |
Definition at line 137 of file origin_transforms.h.
|
inline |
Definition at line 107 of file pcb_origin_transforms.h.
References ORIGIN_TRANSFORMS::FromDisplayRel(), and invertXAxis().
Referenced by FromDisplay(), and FromDisplayRel().
|
inline |
Definition at line 113 of file pcb_origin_transforms.h.
References ORIGIN_TRANSFORMS::FromDisplayRel(), and invertYAxis().
Referenced by FromDisplay(), and FromDisplayRel().
|
protected |
Definition at line 111 of file pcb_origin_transforms.cpp.
References PCB_BASE_FRAME::GetUserOrigin(), m_pcbBaseFrame, and VECTOR2< T >::x.
Referenced by FromDisplayAbsX(), and ToDisplayAbsX().
|
protected |
Definition at line 116 of file pcb_origin_transforms.cpp.
References PCB_BASE_FRAME::GetUserOrigin(), m_pcbBaseFrame, and VECTOR2< T >::y.
Referenced by FromDisplayAbsY(), and ToDisplayAbsY().
|
protected |
Definition at line 121 of file pcb_origin_transforms.cpp.
References FRAME_PCB_EDITOR, PCB_BASE_FRAME::GetFootprintEditorSettings(), EDA_BASE_FRAME::GetFrameType(), PCB_BASE_FRAME::GetPcbNewSettings(), PCBNEW_SETTINGS::m_Display, FOOTPRINT_EDITOR_SETTINGS::m_DisplayInvertXAxis, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertXAxis, and m_pcbBaseFrame.
Referenced by FromDisplayAbsX(), FromDisplayRelX(), ToDisplayAbsX(), and ToDisplayRelX().
|
protected |
Definition at line 129 of file pcb_origin_transforms.cpp.
References FRAME_PCB_EDITOR, PCB_BASE_FRAME::GetFootprintEditorSettings(), EDA_BASE_FRAME::GetFrameType(), PCB_BASE_FRAME::GetPcbNewSettings(), PCBNEW_SETTINGS::m_Display, FOOTPRINT_EDITOR_SETTINGS::m_DisplayInvertYAxis, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertYAxis, and m_pcbBaseFrame.
Referenced by FromDisplayAbsY(), FromDisplayRelY(), ToDisplayAbsY(), and ToDisplayRelY().
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 66 of file origin_transforms.cpp.
|
overridevirtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 58 of file pcb_origin_transforms.cpp.
References ToDisplayAbsX(), ToDisplayAbsY(), ToDisplayRelX(), and ToDisplayRelY().
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 60 of file origin_transforms.cpp.
|
virtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 63 of file origin_transforms.cpp.
|
overridevirtual |
Reimplemented from ORIGIN_TRANSFORMS.
Definition at line 40 of file pcb_origin_transforms.cpp.
References ToDisplayAbsX(), ToDisplayAbsY(), ToDisplayRelX(), and ToDisplayRelY().
Referenced by PCB_BASE_FRAME::MessageTextFromCoord().
|
inlineinherited |
Definition at line 80 of file origin_transforms.h.
References ORIGIN_TRANSFORMS::ABS_X_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD, and ORIGIN_TRANSFORMS::ToDisplay().
Referenced by PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_POINT_EDITOR::movePoint(), ToDisplayAbsX(), and ToDisplayAbsY().
|
inline |
Definition at line 149 of file pcb_origin_transforms.h.
References ToDisplayAbsX(), and ToDisplayAbsY().
|
inlinestaticprotectedinherited |
Definition at line 150 of file origin_transforms.h.
|
inline |
Definition at line 122 of file pcb_origin_transforms.h.
References getUserXOrigin(), invertXAxis(), and ORIGIN_TRANSFORMS::ToDisplayAbs().
Referenced by ToDisplay(), ToDisplayAbs(), and PCB_BASE_FRAME::UpdateStatusBar().
|
inline |
Definition at line 128 of file pcb_origin_transforms.h.
References getUserYOrigin(), invertYAxis(), and ORIGIN_TRANSFORMS::ToDisplayAbs().
Referenced by ToDisplay(), ToDisplayAbs(), and PCB_BASE_FRAME::UpdateStatusBar().
|
inlineinherited |
Definition at line 90 of file origin_transforms.h.
References ORIGIN_TRANSFORMS::REL_X_COORD, ORIGIN_TRANSFORMS::REL_Y_COORD, and ORIGIN_TRANSFORMS::ToDisplay().
Referenced by ToDisplayRelX(), and ToDisplayRelY().
|
inline |
Definition at line 171 of file pcb_origin_transforms.h.
References ToDisplayRelX(), and ToDisplayRelY().
|
inlinestaticprotectedinherited |
Definition at line 123 of file origin_transforms.h.
|
inline |
Transform a 2-D coordinate point referenced to the internal origin to the equivalent point referenced to the user-selected display origin.
aValue | a point referenced to the internal origin |
aValue | a point referenced to the user-selected display origin |
This is initially intended to handle axis inversion of a delta between two display points, but could be extended to handle other transforms.
aValue | a 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.
aValue | a delta referenced to the user-selected display 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().
|
inline |
Definition at line 101 of file pcb_origin_transforms.h.
References invertYAxis(), and ORIGIN_TRANSFORMS::ToDisplayRel().
Referenced by ToDisplay(), ToDisplayRel(), and PCB_BASE_FRAME::UpdateStatusBar().
|
protected |
Definition at line 200 of file pcb_origin_transforms.h.
Referenced by getUserXOrigin(), getUserYOrigin(), invertXAxis(), and invertYAxis().