|
|
Donner
C++20 SVG rendering library
|
Represents the orientation of a marker. More...
#include "donner/svg/core/MarkerOrient.h"
Public Types | |
| enum class | Type : uint8_t { Angle , Auto , AutoStartReverse } |
| The type of the orientation. More... | |
| enum class | MarkerType : uint8_t { Default , Start } |
| For computeAngleRadians, to specify if this is the marker-start orientation. More... | |
Public Member Functions | |
| MarkerOrient ()=default | |
| Default constructor. | |
| ~MarkerOrient ()=default | |
| Destructor. | |
| MarkerOrient (const MarkerOrient &)=default | |
| Copy constructor. | |
| MarkerOrient (MarkerOrient &&)=default | |
| Move constructor. | |
| MarkerOrient & | operator= (const MarkerOrient &)=default |
| Copy assignment operator. | |
| MarkerOrient & | operator= (MarkerOrient &&)=default |
| Move assignment operator. | |
| Type | type () const |
| Returns the type of orientation. | |
| double | computeAngleRadians (const Vector2d &direction, MarkerType markerType=MarkerType::Default) const |
| Computes the angle in radians based on the direction vector and the type of orientation. | |
| bool | operator== (const MarkerOrient &other) const |
Static Public Member Functions | |
| static MarkerOrient | AngleRadians (double angleRadians) |
| Creates a new orientation with a user-provided angle in radians. | |
| static MarkerOrient | AngleDegrees (double angleDegrees) |
| Creates a new orientation with a user-provided angle in radians. | |
| static MarkerOrient | Auto () |
| Creates a new orientation that computes the angle from the direction vector. | |
| static MarkerOrient | AutoStartReverse () |
| Creates a new orientation that computes the angle from the direction vector, but reverses the direction for marker-start. | |
Represents the orientation of a marker.
|
strong |
For computeAngleRadians, to specify if this is the marker-start orientation.
| Enumerator | |
|---|---|
| Default | The default orientation. |
| Start | The marker-start orientation. |
|
strong |
The type of the orientation.
| Enumerator | |
|---|---|
| Angle | Contains a user-provided angle. |
| Auto | The angle is computed from the direction vector. |
| AutoStartReverse | Like Auto, but for marker-start the direction is reversed. |
|
inlinestatic |
Creates a new orientation with a user-provided angle in radians.
| angleDegrees | The angle in Degrees. |
|
inlinestatic |
Creates a new orientation with a user-provided angle in radians.
| angleRadians | The angle in radians. |
|
inlinestatic |
Creates a new orientation that computes the angle from the direction vector.
|
inlinestatic |
Creates a new orientation that computes the angle from the direction vector, but reverses the direction for marker-start.
|
inline |
Computes the angle in radians based on the direction vector and the type of orientation.
| direction | The direction vector. |
| markerType | Set to MarkerType::Start if this is the marker-start orientation. |