20 #ifndef LIBREPCB_ANGLE_H 21 #define LIBREPCB_ANGLE_H 26 #include "../fileio/sexpression.h" 79 Q_DECLARE_TR_FUNCTIONS(
Angle)
101 explicit Angle(qint32 microdegrees) noexcept
398 Q_UNUSED(fileFormat);
403 stream << angle.
toDeg();
408 stream << QString(
"Angle(%1°)").arg(angle.
toDeg());
412 inline uint
qHash(
const Angle& key, uint seed = 0) noexcept {
424 #endif // LIBREPCB_ANGLE_H bool operator==(const Angle &rhs) const
Definition: angle.h:356
The Version class represents a version number in the format "1.42.7".
Definition: version.h:60
static Angle deg180() noexcept
180 degrees
Definition: angle.h:304
QDataStream & operator<<(QDataStream &stream, const AttributeKey &obj)
Definition: attributekey.h:110
Angle mappedTo180deg() const noexcept
Get an Angle object which is mapped to [-180..+180[ degrees.
Definition: angle.cpp:66
uint qHash(const Angle &key, uint seed=0) noexcept
Definition: angle.h:412
bool operator==(qint32 rhs) const
Definition: angle.h:359
QString toDegString() const noexcept
Get the angle in degrees as a QString.
Definition: angle.cpp:40
static Angle deg90() noexcept
90 degrees
Definition: angle.h:302
bool operator>(const Angle &rhs) const
Definition: angle.h:340
Angle & operator+=(const Angle &rhs)
Definition: angle.h:314
qreal toRad() const noexcept
Get the angle in radians.
Definition: angle.h:200
bool operator<(qint32 rhs) const
Definition: angle.h:347
SExpression serialize(const HAlign &obj)
Definition: alignment.h:76
Definition: airwiresbuilder.cpp:32
void setAngleDeg(qreal degrees) noexcept
Set the angle in degrees.
Definition: angle.h:134
Angle & makeAbs() noexcept
Make the angle absolute (mMicrodegrees >= 0)
Definition: angle.cpp:50
void setAngleMicroDeg(qint32 microdegrees) noexcept
Set the angle in microdegrees.
Definition: angle.h:116
qreal toDeg() const noexcept
Get the Angle in degrees.
Definition: angle.h:184
static Angle fromDeg(qreal degrees) noexcept
Get an Angle object with a specific angle.
Definition: angle.cpp:82
Angle operator+(const Angle &rhs) const
Definition: angle.h:322
Angle operator*(qint32 rhs) const
Definition: angle.h:332
~Angle() noexcept
Destructor.
Definition: angle.h:107
HAlign deserialize(const SExpression &sexpr, const Version &fileFormat)
Definition: alignment.h:90
static Angle deg135() noexcept
135 degrees
Definition: angle.h:303
Angle() noexcept
Default Constructor.
Definition: angle.h:87
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
Angle mappedTo0_360deg() const noexcept
Get an Angle object which is mapped to [0..360[ degrees.
Definition: angle.cpp:55
Angle & operator=(const Angle &rhs)
Definition: angle.h:310
static SExpression createToken(const QString &token)
Definition: sexpression.cpp:290
void setAngleRad(qreal radians) noexcept
Set the angle in radians.
Definition: angle.h:166
Angle operator/(const Angle &rhs) const
Definition: angle.h:333
bool operator!=(qint32 rhs) const
Definition: angle.h:363
Angle & mapTo0_360deg() noexcept
Map this Angle object to [0..360[ degrees.
Definition: angle.cpp:61
static Angle deg0() noexcept
0 degrees
Definition: angle.h:300
static Angle deg315() noexcept
315 degrees
Definition: angle.h:307
static qint32 degStringToMicrodeg(const QString °rees)
Convert an angle from a QString (in degrees) to an integer (in microdegrees)
Definition: angle.cpp:102
Angle operator*(const Angle &rhs) const
Definition: angle.h:329
bool operator!=(const Angle &rhs) const
Definition: angle.h:360
qint32 mMicrodegrees
the angle in microdegrees
Definition: angle.h:384
bool operator>=(const Angle &rhs) const
Definition: angle.h:348
Angle operator/(qint32 rhs) const
Definition: angle.h:336
Angle(const Angle &angle) noexcept
Copy Constructor.
Definition: angle.h:94
static Angle deg225() noexcept
225 degrees
Definition: angle.h:305
Angle operator-() const
Definition: angle.h:325
static Angle fromRad(qreal radians) noexcept
Get an Angle object with a specific angle.
Definition: angle.cpp:94
bool operator<=(qint32 rhs) const
Definition: angle.h:355
Angle & mapTo180deg() noexcept
Map this Angle object to [-180..+180[ degrees.
Definition: angle.cpp:72
bool operator<=(const Angle &rhs) const
Definition: angle.h:352
static Angle deg45() noexcept
45 degrees
Definition: angle.h:301
Angle abs() const noexcept
Get an Angle object with absolute value (mMicrodegrees >= 0)
Definition: angle.cpp:44
bool operator>(qint32 rhs) const
Definition: angle.h:343
void setAngleDeg(const QString °rees)
Set the angle in degrees, represented in a QString.
Definition: angle.h:148
static Angle deg270() noexcept
270 degrees
Definition: angle.h:306
Angle(qint32 microdegrees) noexcept
Constructor with an angle in microdegrees.
Definition: angle.h:101
Angle operator-(const Angle &rhs) const
Definition: angle.h:326
bool operator>=(qint32 rhs) const
Definition: angle.h:351
const QString & getValue() const
Definition: sexpression.cpp:77
The SExpression class.
Definition: sexpression.h:72
qint32 toMicroDeg() const noexcept
Get the angle in microdegrees.
Definition: angle.h:177
uint qHash(const AttributeKey &key, uint seed=0) noexcept
Definition: attributekey.h:120
Angle & operator-=(const Angle &rhs)
Definition: angle.h:318
Angle operator%(const Angle &rhs) const
Definition: angle.h:337
bool operator<(const Angle &rhs) const
Definition: angle.h:344