1.2
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...

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

Public Types

using DimType = Dim
 Helper to reference the dimension type. More...
 

Public Member Functions

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

Protected Attributes

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

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

using DimType = Dim

Helper to reference the dimension type.

Constructor & Destructor Documentation

◆ ArcType()

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]

constexpr EGT_NODISCARD float angle1 ( ) const
inlineconstexprnoexcept

Get the angle1.

◆ angle1() [2/2]

constexpr void angle1 ( float  angle)
inlineconstexprnoexcept

Set the angle1.

◆ angle2() [1/2]

constexpr EGT_NODISCARD float angle2 ( ) const
inlineconstexprnoexcept

Get the angle2.

◆ angle2() [2/2]

constexpr void angle2 ( float  angle)
inlineconstexprnoexcept

Set the angle2.

◆ center() [1/2]

constexpr EGT_NODISCARD PointType<Dim> center ( ) const
inlineconstexprnoexcept

Get the center point.

◆ center() [2/2]

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

Set the center point.

◆ empty()

EGT_NODISCARD EGT_API bool empty ( ) const
noexcept

Returns true if the arc has no radius.

◆ radius() [1/2]

constexpr EGT_NODISCARD Dim radius ( ) const
inlineconstexprnoexcept

Get the radius.

◆ radius() [2/2]

constexpr void radius ( Dim  radius)
inlineconstexprnoexcept

Set the radius.

Member Data Documentation

◆ m_angle1

float m_angle1 {}
protected

Angle of the arc in radians.

◆ m_angle2

float m_angle2 {}
protected

Angle of the arc in radians.

◆ m_center

PointType<Dim> m_center
protected

Center point of the arc.

◆ m_radius

Dim m_radius {0}
protected

Radius of the arc.