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

Simple width and height. More...

#include <geometry.h>

Public Types

using DimType = Dim
 Helper to reference the dimension type.
 

Public Member Functions

constexpr SizeType () noexcept=default
 
template<class Dim2 >
constexpr SizeType (const SizeType< Dim2 > &s)
 
constexpr SizeType (Dim width, Dim height) noexcept
 
constexpr void clear () noexcept
 Clear the size.
 
EGT_NODISCARD constexpr bool empty () const noexcept
 Returns true if the size has no width or height.
 
EGT_NODISCARD constexpr Dim height () const noexcept
 Get the height value.
 
constexpr void height (Dim height) noexcept
 Set the height value.
 
constexpr SizeTypeoperator*= (const SizeType &rhs) noexcept
 SizeType operator.
 
template<class T >
constexpr SizeTypeoperator*= (const T &rhs) noexcept
 SizeType operator.
 
constexpr SizeTypeoperator+= (const SizeType &rhs) noexcept
 SizeType operator.
 
template<class T >
constexpr SizeTypeoperator+= (const T &rhs) noexcept
 SizeType operator.
 
constexpr SizeTypeoperator-= (const SizeType &rhs) noexcept
 SizeType operator.
 
template<class T >
constexpr SizeTypeoperator-= (const T &rhs) noexcept
 SizeType operator.
 
constexpr SizeTypeoperator/= (const SizeType &rhs) noexcept
 SizeType operator.
 
template<class T >
constexpr SizeTypeoperator/= (const T &rhs) noexcept
 SizeType operator.
 
EGT_NODISCARD constexpr Dim width () const noexcept
 Get the width value.
 
constexpr void width (Dim width) noexcept
 Set the width value.
 

Protected Attributes

Dim m_height {0}
 Height.
 
Dim m_width {0}
 Width.
 

Detailed Description

template<class Dim, detail::Compatible DimCompat = detail::Compatible::normal>
class egt::v1::SizeType< Dim, DimCompat >

Simple width and height.

Typically Size, SizeF are used as aliases.

Member Typedef Documentation

◆ DimType

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
using DimType = Dim

Helper to reference the dimension type.

Constructor & Destructor Documentation

◆ SizeType() [1/3]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType ( )
constexprdefaultnoexcept

◆ SizeType() [2/3]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType ( Dim  width,
Dim  height 
)
inlineconstexprnoexcept
Parameters
widthWidth
heightHeight

◆ SizeType() [3/3]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
template<class Dim2 >
constexpr SizeType ( const SizeType< Dim2 > &  s)
inlineconstexpr

Member Function Documentation

◆ clear()

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr void clear ( )
inlineconstexprnoexcept

Clear the size.

This means to set the width and height to zero.

◆ empty()

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
EGT_NODISCARD constexpr bool empty ( ) const
inlineconstexprnoexcept

Returns true if the size has no width or height.

This is a special case, and is the default state of a SizeType. This can be used to determine if a size has not been set in many cases.

◆ height() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
EGT_NODISCARD constexpr Dim height ( ) const
inlineconstexprnoexcept

Get the height value.

◆ height() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr void height ( Dim  height)
inlineconstexprnoexcept

Set the height value.

◆ operator*=() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType & operator*= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator*=() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
template<class T >
constexpr SizeType & operator*= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator+=() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType & operator+= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator+=() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
template<class T >
constexpr SizeType & operator+= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator-=() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType & operator-= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator-=() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
template<class T >
constexpr SizeType & operator-= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator/=() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr SizeType & operator/= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator/=() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
template<class T >
constexpr SizeType & operator/= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ width() [1/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
EGT_NODISCARD constexpr Dim width ( ) const
inlineconstexprnoexcept

Get the width value.

◆ width() [2/2]

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
constexpr void width ( Dim  width)
inlineconstexprnoexcept

Set the width value.

Member Data Documentation

◆ m_height

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
Dim m_height {0}
protected

Height.

◆ m_width

template<class Dim , detail::Compatible DimCompat = detail::Compatible::normal>
Dim m_width {0}
protected

Width.