1.10
Public Types | Public Member Functions | Protected Attributes | List of all members
ArcType< Dim > Class Template Reference

An Arc consists of a radius and two angles. More...

#include <geometry.h>

Inheritance diagram for ArcType< Dim >:
Inheritance graph
[legend]

Public Types

using DimType = Dim
 Helper to reference the dimension type.
 

Public Member Functions

constexpr ArcType (const PointType< Dim > &center={}, Dim radius={}, float angle1=0.0f, float angle2=0.0f) noexcept
 Construct an Arc object.
 
EGT_NODISCARD constexpr float angle1 () const noexcept
 Get the angle1.
 
constexpr void angle1 (float angle) noexcept
 Set the angle1.
 
EGT_NODISCARD constexpr float angle2 () const noexcept
 Get the angle2.
 
constexpr void angle2 (float angle) noexcept
 Set the angle2.
 
EGT_NODISCARD constexpr PointType< Dim > center () const noexcept
 Get the center point.
 
constexpr void center (const PointType< Dim > &center) noexcept
 Set the center point.
 
EGT_NODISCARD EGT_API bool empty () const noexcept
 Returns true if the arc has no radius.
 
EGT_NODISCARD constexpr Dim radius () const noexcept
 Get the radius.
 
constexpr void radius (Dim radius) noexcept
 Set the radius.
 

Protected Attributes

float m_angle1 {}
 Angle of the arc in radians.
 
float m_angle2 {}
 Angle of the arc in radians.
 
PointType< Dim > m_center
 Center point of the arc.
 
Dim m_radius {0}
 Radius of the arc.
 

Detailed Description

template<class Dim>
class egt::v1::ArcType< Dim >

An Arc consists of a radius and two angles.

Typically Arc is used as an alias.

Member Typedef Documentation

◆ DimType

template<class Dim >
using DimType = Dim

Helper to reference the dimension type.

Constructor & Destructor Documentation

◆ ArcType()

template<class Dim >
constexpr ArcType ( const PointType< Dim > &  center = {},
Dim  radius = {},
float  angle1 = 0.0f,
float  angle2 = 0.0f 
)
inlineexplicitconstexprnoexcept

Construct an Arc object.

Parameters
centerCenter point of the arc.
radiusRadius of the arc.
angle1Angle 1 of the arc in radians.
angle2Angle 2 of the arc in radians.

Member Function Documentation

◆ angle1() [1/2]

template<class Dim >
EGT_NODISCARD constexpr float angle1 ( ) const
inlineconstexprnoexcept

Get the angle1.

◆ angle1() [2/2]

template<class Dim >
constexpr void angle1 ( float  angle)
inlineconstexprnoexcept

Set the angle1.

◆ angle2() [1/2]

template<class Dim >
EGT_NODISCARD constexpr float angle2 ( ) const
inlineconstexprnoexcept

Get the angle2.

◆ angle2() [2/2]

template<class Dim >
constexpr void angle2 ( float  angle)
inlineconstexprnoexcept

Set the angle2.

◆ center() [1/2]

template<class Dim >
EGT_NODISCARD constexpr PointType< Dim > center ( ) const
inlineconstexprnoexcept

Get the center point.

◆ center() [2/2]

template<class Dim >
constexpr void center ( const PointType< Dim > &  center)
inlineconstexprnoexcept

Set the center point.

◆ empty()

template<class Dim >
EGT_NODISCARD EGT_API bool empty ( ) const
noexcept

Returns true if the arc has no radius.

◆ radius() [1/2]

template<class Dim >
EGT_NODISCARD constexpr Dim radius ( ) const
inlineconstexprnoexcept

Get the radius.

◆ radius() [2/2]

template<class Dim >
constexpr void radius ( Dim  radius)
inlineconstexprnoexcept

Set the radius.

Member Data Documentation

◆ m_angle1

template<class Dim >
float m_angle1 {}
protected

Angle of the arc in radians.

◆ m_angle2

template<class Dim >
float m_angle2 {}
protected

Angle of the arc in radians.

◆ m_center

template<class Dim >
PointType<Dim> m_center
protected

Center point of the arc.

◆ m_radius

template<class Dim >
Dim m_radius {0}
protected

Radius of the arc.