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

Simple width and height. More...

Public Types

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

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. More...
 
constexpr EGT_NODISCARD bool empty () const noexcept
 Returns true if the size has no width or height. More...
 
constexpr EGT_NODISCARD Dim height () const noexcept
 Get the height value. More...
 
constexpr void height (Dim height) noexcept
 Set the height value. More...
 
constexpr SizeTypeoperator*= (const SizeType &rhs) noexcept
 SizeType operator. More...
 
template<class T >
constexpr SizeTypeoperator*= (const T &rhs) noexcept
 SizeType operator. More...
 
constexpr SizeTypeoperator+= (const SizeType &rhs) noexcept
 SizeType operator. More...
 
template<class T >
constexpr SizeTypeoperator+= (const T &rhs) noexcept
 SizeType operator. More...
 
constexpr SizeTypeoperator-= (const SizeType &rhs) noexcept
 SizeType operator. More...
 
template<class T >
constexpr SizeTypeoperator-= (const T &rhs) noexcept
 SizeType operator. More...
 
constexpr SizeTypeoperator/= (const SizeType &rhs) noexcept
 SizeType operator. More...
 
template<class T >
constexpr SizeTypeoperator/= (const T &rhs) noexcept
 SizeType operator. More...
 
constexpr EGT_NODISCARD Dim width () const noexcept
 Get the width value. More...
 
constexpr void width (Dim width) noexcept
 Set the width value. More...
 

Protected Attributes

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

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

using DimType = Dim

Helper to reference the dimension type.

Constructor & Destructor Documentation

◆ SizeType() [1/3]

constexpr SizeType ( )
constexprdefaultnoexcept

◆ SizeType() [2/3]

constexpr SizeType ( Dim  width,
Dim  height 
)
inlineconstexprnoexcept
Parameters
widthWidth
heightHeight

◆ SizeType() [3/3]

constexpr SizeType ( const SizeType< Dim2 > &  s)
inlineconstexpr

Member Function Documentation

◆ clear()

constexpr void clear ( )
inlineconstexprnoexcept

Clear the size.

This means to set the width and height to zero.

◆ empty()

constexpr EGT_NODISCARD 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]

constexpr EGT_NODISCARD Dim height ( ) const
inlineconstexprnoexcept

Get the height value.

◆ height() [2/2]

constexpr void height ( Dim  height)
inlineconstexprnoexcept

Set the height value.

◆ operator*=() [1/2]

constexpr SizeType& operator*= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator*=() [2/2]

constexpr SizeType& operator*= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator+=() [1/2]

constexpr SizeType& operator+= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator+=() [2/2]

constexpr SizeType& operator+= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator-=() [1/2]

constexpr SizeType& operator-= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator-=() [2/2]

constexpr SizeType& operator-= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator/=() [1/2]

constexpr SizeType& operator/= ( const SizeType< Dim, DimCompat > &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ operator/=() [2/2]

constexpr SizeType& operator/= ( const T &  rhs)
inlineconstexprnoexcept

SizeType operator.

◆ width() [1/2]

constexpr EGT_NODISCARD Dim width ( ) const
inlineconstexprnoexcept

Get the width value.

◆ width() [2/2]

constexpr void width ( Dim  width)
inlineconstexprnoexcept

Set the width value.

Member Data Documentation

◆ m_height

Dim m_height {0}
protected

Height.

◆ m_width

Dim m_width {0}
protected

Width.