Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::MarkerOrient Struct Reference

Represents the orientation of a marker. More...

#include "donner/svg/core/MarkerOrient.h"

Public Types

enum class  Type {
  Angle ,
  Auto ,
  AutoStartReverse
}
 The type of the orientation. More...
 

Public Member Functions

 MarkerOrient ()=default
 Default constructor.
 
 ~MarkerOrient ()=default
 Destructor.
 
 MarkerOrient (const MarkerOrient &)=default
 Copy constructor.
 
 MarkerOrient (MarkerOrient &&)=default
 Move constructor.
 
MarkerOrientoperator= (const MarkerOrient &)=default
 Copy assignment operator.
 
MarkerOrientoperator= (MarkerOrient &&)=default
 Move assignment operator.
 
Type type () const
 Returns the type of orientation.
 
double computeAngleRadians (const Vector2d &direction, bool isMarkerStart) 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 Angle (double angleRadians)
 Creates a new orientation with a user-provided angle.
 
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.
 

Detailed Description

Represents the orientation of a marker.

Member Enumeration Documentation

◆ Type

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.

Member Function Documentation

◆ Angle()

static MarkerOrient donner::svg::MarkerOrient::Angle ( double angleRadians)
inlinestatic

Creates a new orientation with a user-provided angle.

Parameters
angleRadiansThe angle in radians.
Returns
The new orientation.

◆ Auto()

static MarkerOrient donner::svg::MarkerOrient::Auto ( )
inlinestatic

Creates a new orientation that computes the angle from the direction vector.

Returns
The new orientation.

◆ AutoStartReverse()

static MarkerOrient donner::svg::MarkerOrient::AutoStartReverse ( )
inlinestatic

Creates a new orientation that computes the angle from the direction vector, but reverses the direction for marker-start.

Returns
The new orientation.

◆ computeAngleRadians()

double donner::svg::MarkerOrient::computeAngleRadians ( const Vector2d & direction,
bool isMarkerStart ) const
inline

Computes the angle in radians based on the direction vector and the type of orientation.

Parameters
directionThe direction vector.
isMarkerStartTrue if this is the marker-start orientation.
Returns
The angle in radians.

The documentation for this struct was generated from the following file: