|
KiCad PCB EDA Suite
|
An "orientation", held as an angle constrained to the range [0, 360) degrees. More...
#include <eda_angle.h>
Public Member Functions | |
| EDA_ORIENTATION ()=default | |
| EDA_ORIENTATION (const EDA_ANGLE &aAngle) | |
| EDA_ORIENTATION & | operator= (const EDA_ANGLE &aAngle) |
| Assign a plain angle, normalising it. | |
| bool | operator== (const EDA_ORIENTATION &aOther) const =default |
| EDA_ORIENTATION | operator+ (const EDA_ANGLE &aAngle) const |
| Add an EDA_ANGLE to this orientation, wrapping around the [0, 360) range. | |
| EDA_ORIENTATION | operator- (const EDA_ANGLE &aAngle) const |
| Subtract an EDA_ANGLE from this orientation, wrapping around the [0, 360) range. | |
| EDA_ORIENTATION | operator- () const |
| EDA_ANGLE | operator- (const EDA_ORIENTATION &aOther) const |
| The difference of two orientations is a signed rotation amount, not an orientation. | |
| EDA_ORIENTATION & | operator+= (const EDA_ANGLE &aAngle) |
| EDA_ORIENTATION & | operator-= (const EDA_ANGLE &aAngle) |
| EDA_ANGLE | GetAngle () const |
| void | SetAngle (const EDA_ANGLE &aAngle) |
Private Attributes | |
| EDA_ANGLE | m_angle |
An "orientation", held as an angle constrained to the range [0, 360) degrees.
This makes sure that orientations are always in their normalized form, which keeps equality, serialisation and display stable.
Adding or subtracting EDA_ANGLEs and negation wrap around the [0, 360) range.
There is no meaningful multiplication: e.g. 45 and 405 are the same orientation, yet their halves are 22.5 and 202.5. In the same way that there's no such thing as "3 x East".
Do not use this class for angle magnitudes such as an arc extent or an angular spacing, because those are not constrained to [0, 360). In particular, arc extent has a meaningful value of 360 degrees that is distinct from 0.
Definition at line 472 of file eda_angle.h.
|
default |
Referenced by operator+(), operator+=(), operator-(), operator-(), operator-(), operator-=(), operator=(), and operator==().
|
inlineexplicit |
Definition at line 477 of file eda_angle.h.
References SetAngle().
|
inline |
Definition at line 533 of file eda_angle.h.
References m_angle.
Referenced by ZONE_FILLER::addCopperThievingPattern(), KIGFX::bitmapText(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), PADSTACK::Compare(), TEXT_ATTRIBUTES::Compare(), ComputeMultiLinePinNumberLayout(), PCB_TEXTBOX::Deserialize(), KIFONT::FONT::Draw(), KIGFX::SCH_PAINTER::draw(), drawTicksAlongLine(), PCB_IO_KICAD_SEXPR::format(), KIFONT::OUTLINE_FONT::GetLinesAsGlyphs(), std::hash< TEXT_ATTRIBUTES >::operator()(), operator-(), operator<<(), kiapi::common::PackTextAttributes(), SCH_TEXT::Plot(), DXF_PLOTTER::plotOneLineOfText(), PDF_PLOTTER::PlotText(), SVG_PLOTTER::PlotText(), and KIGFX::PCB_PAINTER::strokeText().
|
inline |
Add an EDA_ANGLE to this orientation, wrapping around the [0, 360) range.
Definition at line 493 of file eda_angle.h.
References EDA_ORIENTATION(), and m_angle.
|
inline |
Definition at line 521 of file eda_angle.h.
References EDA_ORIENTATION(), m_angle, and SetAngle().
|
inline |
Definition at line 506 of file eda_angle.h.
References EDA_ORIENTATION(), and m_angle.
|
inline |
Subtract an EDA_ANGLE from this orientation, wrapping around the [0, 360) range.
Definition at line 501 of file eda_angle.h.
References EDA_ORIENTATION(), and m_angle.
|
inline |
The difference of two orientations is a signed rotation amount, not an orientation.
The sign of the result indicates the direction of the difference of the two orientations.
Definition at line 516 of file eda_angle.h.
References EDA_ORIENTATION(), and m_angle.
|
inline |
Definition at line 527 of file eda_angle.h.
References EDA_ORIENTATION(), m_angle, and SetAngle().
|
inline |
Assign a plain angle, normalising it.
Definition at line 482 of file eda_angle.h.
References EDA_ORIENTATION(), and SetAngle().
|
default |
References EDA_ORIENTATION().
|
inline |
Definition at line 535 of file eda_angle.h.
References ANGLE_0, and m_angle.
Referenced by BOOST_AUTO_TEST_CASE(), EDA_ORIENTATION(), operator+=(), operator-=(), and operator=().
|
private |
Definition at line 546 of file eda_angle.h.
Referenced by GetAngle(), operator+(), operator+=(), operator-(), operator-(), operator-(), operator-=(), and SetAngle().