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

A class to perform either relative or absolute display origin transforms for a single axis of a point. More...

#include <origin_transforms.h>

Inheritance diagram for ORIGIN_TRANSFORMS:
PCB_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

 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 >
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
 

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)
 

Detailed Description

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.

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

◆ ORIGIN_TRANSFORMS()

ORIGIN_TRANSFORMS::ORIGIN_TRANSFORMS ( )

Definition at line 28 of file origin_transforms.cpp.

◆ ~ORIGIN_TRANSFORMS()

ORIGIN_TRANSFORMS::~ORIGIN_TRANSFORMS ( )
virtual

Definition at line 31 of file origin_transforms.cpp.

Member Function Documentation

◆ FromDisplay() [1/3]

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

Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.

Definition at line 65 of file origin_transforms.cpp.

◆ FromDisplay() [2/3]

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

◆ FromDisplay() [3/3]

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

Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.

Definition at line 59 of file origin_transforms.cpp.

◆ FromDisplayAbs() [1/2]

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

◆ FromDisplayAbs() [2/2]

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

Definition at line 167 of file origin_transforms.h.

◆ FromDisplayRel() [1/2]

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

◆ FromDisplayRel() [2/2]

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

Definition at line 137 of file origin_transforms.h.

◆ ToDisplay() [1/3]

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

Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.

Definition at line 47 of file origin_transforms.cpp.

◆ ToDisplay() [2/3]

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

◆ ToDisplay() [3/3]

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

Reimplemented in PCB_ORIGIN_TRANSFORMS, and PCB_ORIGIN_TRANSFORMS.

Definition at line 41 of file origin_transforms.cpp.

◆ ToDisplayAbs() [1/2]

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

◆ ToDisplayAbs() [2/2]

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

Definition at line 150 of file origin_transforms.h.

◆ ToDisplayRel() [1/2]

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

◆ ToDisplayRel() [2/2]

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

Definition at line 123 of file origin_transforms.h.


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