LibrePCB Developers Documentation
|
Helper class to perform coordinate transformation with various types. More...
#include <transform.h>
Public Member Functions | |
Transform (const Point &position=Point(0, 0), const Angle &rotation=Angle(0), bool mirrored=false) noexcept | |
(Default) construdtor More... | |
template<typename T > | |
Transform (const T &obj) | |
Constructor to copy the transformation of an object. More... | |
Transform (const Transform &other) noexcept | |
Copy constructor. More... | |
~Transform () noexcept | |
Destructor. More... | |
const Point & | getPosition () const noexcept |
const Angle & | getRotation () const noexcept |
bool | getMirrored () const noexcept |
void | setPosition (const Point &position) noexcept |
void | setRotation (const Angle &rotation) noexcept |
void | setMirrored (bool mirrored) noexcept |
bool | map (bool mirror) const noexcept |
Map a given mirror state to the transformed coordinate system. More... | |
Angle | mapMirrorable (const Angle &angle) const noexcept |
Map a given angle to the transformed coordinate system. More... | |
Angle | mapNonMirrorable (const Angle &angle) const noexcept |
Map a given angle to the transformed coordinate system. More... | |
Point | map (const Point &point) const noexcept |
Map a given point to the transformed coordinate system. More... | |
Path | map (const Path &path) const noexcept |
Map a given path to the transformed coordinate system. More... | |
NonEmptyPath | map (const NonEmptyPath &path) const noexcept |
Map a given path to the transformed coordinate system. More... | |
const Layer & | map (const Layer &layer) const noexcept |
Map a given layer to the transformed coordinate system. More... | |
template<typename T > | |
T | map (const T &container) const noexcept |
Map all items of a container to the transformed coordinate system. More... | |
template<typename T > | |
T | mapPx (const T &obj) const noexcept |
Map a given Qt object in pixels to the transformed coordinate system. More... | |
bool | operator== (const Transform &rhs) const noexcept |
bool | operator!= (const Transform &rhs) const noexcept |
Transform & | operator= (const Transform &rhs) noexcept |
Private Attributes | |
Point | mPosition |
Angle | mRotation |
bool | mMirrored |
Helper class to perform coordinate transformation with various types.
The class is similar to QTransform
, but with the following differences:
QPointF
).Long story short, this class converts symbol- or footprint coordinates into schematic- resp. board coordinates.
|
inlinenoexcept |
(Default) construdtor
position | Transformation position. |
rotation | Transformation rotation. |
mirrored | Transformation mirror state. |
|
inlineexplicit |
Constructor to copy the transformation of an object.
T | Any type which provides the methods Point get Position() , Angle getRotation() and bool getMirrored() . |
obj | Any object of the given type. The transformation is copied from the provided object. |
Copy constructor.
other | Object to copy. |
|
inlinenoexcept |
Destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Map a given mirror state to the transformed coordinate system.
mirror | The mirror state to map. |
Map a given angle to the transformed coordinate system.
angle | The angle to map. |
Map a given angle to the transformed coordinate system.
angle | The angle to map. |
Map a given point to the transformed coordinate system.
point | The point to map. |
Map a given path to the transformed coordinate system.
path | The path to map. |
|
noexcept |
Map a given path to the transformed coordinate system.
path | The path to map. |
Map a given layer to the transformed coordinate system.
layer | The layer to map. |
|
inlinenoexcept |
Map all items of a container to the transformed coordinate system.
Container | type. |
container | The items to map. |
|
inlinenoexcept |
Map a given Qt object in pixels to the transformed coordinate system.
obj | The Qt object (in pixel coordinates) to map, e.g. QPoint, QPainterPath, ...). |
|
inlinenoexcept |
|
inlinenoexcept |
|
private |
|
private |
|
private |