KiCad PCB EDA Suite
|
A class to perform either relative or absolute display origin transforms for a single axis of a point. More...
#include <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 | |
ORIGIN_TRANSFORMS () | |
virtual | ~ORIGIN_TRANSFORMS () |
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 |
Static Protected Member Functions | |
template<class T > | |
static T | ToDisplayRel (T aInternalValue, bool aInvertAxis) |
template<class T > | |
static T | FromDisplayRel (T aDisplayValue, bool aInvertAxis) |
template<class T > | |
static T | ToDisplayAbs (T aInternalValue, int aUserOrigin, bool aInvertAxis) |
template<class T > | |
static T | FromDisplayAbs (T aDisplayValue, int aUserOrigin, bool aInvertAxis) |
A class to perform either relative or absolute display origin transforms for a single axis of a point.
The coordinate argument is transformed between an offset from the internal origin and an offset from the user-specified origin and coordinate direction.
The functions are templated to allow use with any size scalar parameter: an int, a long long int, or a double.
Definition at line 39 of file origin_transforms.h.
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.
ORIGIN_TRANSFORMS::ORIGIN_TRANSFORMS | ( | ) |
Definition at line 28 of file origin_transforms.cpp.
|
virtual |
Definition at line 31 of file origin_transforms.cpp.
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.
Definition at line 65 of file origin_transforms.cpp.
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS.
Definition at line 53 of file origin_transforms.cpp.
References FromDisplay().
Referenced by FromDisplay(), FromDisplayAbs(), FromDisplayRel(), UNIT_BINDER::GetDoubleValue(), and UNIT_BINDER::GetValue().
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.
Definition at line 59 of file origin_transforms.cpp.
|
inline |
Definition at line 101 of file origin_transforms.h.
References ABS_X_COORD, ABS_Y_COORD, and FromDisplay().
Referenced by PCB_ORIGIN_TRANSFORMS::FromDisplayAbsX(), PCB_ORIGIN_TRANSFORMS::FromDisplayAbsY(), and PCB_POINT_EDITOR::movePoint().
|
inlinestaticprotected |
Definition at line 167 of file origin_transforms.h.
|
inline |
Definition at line 111 of file origin_transforms.h.
References FromDisplay(), REL_X_COORD, and REL_Y_COORD.
Referenced by PCB_ORIGIN_TRANSFORMS::FromDisplayRelX(), and PCB_ORIGIN_TRANSFORMS::FromDisplayRelY().
|
inlinestaticprotected |
Definition at line 137 of file origin_transforms.h.
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.
Definition at line 47 of file origin_transforms.cpp.
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS.
Definition at line 35 of file origin_transforms.cpp.
References ToDisplay().
Referenced by PGPROPERTY_DISTANCE::DistanceToString(), UNIT_BINDER::getTextForDoubleValue(), UNIT_BINDER::getTextForValue(), UNIT_BINDER::SetDoubleValue(), UNIT_BINDER::SetValue(), ToDisplay(), ToDisplayAbs(), and ToDisplayRel().
|
virtual |
Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.
Definition at line 41 of file origin_transforms.cpp.
|
inline |
Definition at line 80 of file origin_transforms.h.
References ABS_X_COORD, ABS_Y_COORD, and ToDisplay().
Referenced by PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_POINT_EDITOR::movePoint(), PCB_ORIGIN_TRANSFORMS::ToDisplayAbsX(), and PCB_ORIGIN_TRANSFORMS::ToDisplayAbsY().
|
inlinestaticprotected |
Definition at line 150 of file origin_transforms.h.
|
inline |
Definition at line 90 of file origin_transforms.h.
References REL_X_COORD, REL_Y_COORD, and ToDisplay().
Referenced by PCB_ORIGIN_TRANSFORMS::ToDisplayRelX(), and PCB_ORIGIN_TRANSFORMS::ToDisplayRelY().
|
inlinestaticprotected |
Definition at line 123 of file origin_transforms.h.