utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::graphic::Size< SizeComponentType > Class Template Reference

Template class representing a size (width, height). More...

#include <headers/utility/graphic/size.hpp>

Public Member Functions

 Size ()
 Default constructor (zero position, identity orientation).
 
 Size (SizeComponentType width, SizeComponentType height, SizeComponentType depth=SizeComponentType { 0 })
 Construct a size from width and height.
 
 Size (const Size &other)=default
 Copy constructor.
 
 Size (Size &&other) noexcept=default
 Move constructor.
 
Sizeoperator= (const Size &other)=default
 Copy assignment operator.
 
Sizeoperator= (Size &&other) noexcept=default
 Move assignment operator.
 
 ~Size (void)=default
 Default destructor for Size.
 
SizesetWidth (SizeComponentType width) noexcept
 Set the width component.
 
const SizeComponentType & getWidth (void) const noexcept
 Get the position component.
 
SizesetHeight (SizeComponentType height) noexcept
 Set the height component.
 
const SizeComponentType & getHeight (void) const noexcept
 Get the height component.
 
SizesetDepth (SizeComponentType depth) noexcept
 Set the depth component.
 
const SizeComponentType & getDepth (void) const noexcept
 Get the depth component.
 
bool operator== (const Size &other) const noexcept
 Equality comparison.
 
bool operator!= (const Size &other) const noexcept
 Inequality comparison.
 
bool operator< (const Size &other) const noexcept
 Less-than comparison for ordering.
 

Detailed Description

template<CanBeSizeComponent SizeComponentType>
class utility::graphic::Size< SizeComponentType >

Template class representing a size (width, height).

A size encodes both the spatial width and the height of an object in 2D space.

Template Parameters
SizeComponentTypeFloating-point or integral type for size components.

Definition at line 48 of file size.hpp.

Constructor & Destructor Documentation

◆ Size() [1/4]

template<CanBeSizeComponent SizeComponentType>
utility::graphic::Size< SizeComponentType >::Size ( )
inline

Default constructor (zero position, identity orientation).

Definition at line 59 of file size.hpp.

◆ Size() [2/4]

template<CanBeSizeComponent SizeComponentType>
utility::graphic::Size< SizeComponentType >::Size ( SizeComponentType  width,
SizeComponentType  height,
SizeComponentType  depth = SizeComponentType { 0 } 
)
inline

Construct a size from width and height.

Parameters
widthThe width component.
heightThe height component.
depthThe depth component (default is 0).

Definition at line 71 of file size.hpp.

◆ Size() [3/4]

template<CanBeSizeComponent SizeComponentType>
utility::graphic::Size< SizeComponentType >::Size ( const Size< SizeComponentType > &  other)
default

Copy constructor.

Parameters
otherThe Size object to copy from.

◆ Size() [4/4]

template<CanBeSizeComponent SizeComponentType>
utility::graphic::Size< SizeComponentType >::Size ( Size< SizeComponentType > &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe Size object to move from.

Member Function Documentation

◆ getDepth()

template<CanBeSizeComponent SizeComponentType>
const SizeComponentType & utility::graphic::Size< SizeComponentType >::getDepth ( void  ) const
inlinenoexcept

Get the depth component.

Returns
Const reference to the depth.

Definition at line 165 of file size.hpp.

◆ getHeight()

template<CanBeSizeComponent SizeComponentType>
const SizeComponentType & utility::graphic::Size< SizeComponentType >::getHeight ( void  ) const
inlinenoexcept

Get the height component.

Returns
Const reference to the height.

Definition at line 145 of file size.hpp.

◆ getWidth()

template<CanBeSizeComponent SizeComponentType>
const SizeComponentType & utility::graphic::Size< SizeComponentType >::getWidth ( void  ) const
inlinenoexcept

Get the position component.

Returns
Const reference to the position.

Definition at line 125 of file size.hpp.

◆ operator!=()

template<CanBeSizeComponent SizeComponentType>
bool utility::graphic::Size< SizeComponentType >::operator!= ( const Size< SizeComponentType > &  other) const
inlinenoexcept

Inequality comparison.

Parameters
otherSize to compare with.
Returns
True when either position or orientation differs.

Definition at line 186 of file size.hpp.

◆ operator<()

template<CanBeSizeComponent SizeComponentType>
bool utility::graphic::Size< SizeComponentType >::operator< ( const Size< SizeComponentType > &  other) const
inlinenoexcept

Less-than comparison for ordering.

Parameters
otherSize to compare with.
Returns
True when this size is less than the other size.

Definition at line 196 of file size.hpp.

◆ operator=() [1/2]

template<CanBeSizeComponent SizeComponentType>
Size & utility::graphic::Size< SizeComponentType >::operator= ( const Size< SizeComponentType > &  other)
default

Copy assignment operator.

Parameters
otherThe Size object to copy from.
Returns
A reference to this Size object.

◆ operator=() [2/2]

template<CanBeSizeComponent SizeComponentType>
Size & utility::graphic::Size< SizeComponentType >::operator= ( Size< SizeComponentType > &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe Size object to move from.
Returns
A reference to this Size object.

◆ operator==()

template<CanBeSizeComponent SizeComponentType>
bool utility::graphic::Size< SizeComponentType >::operator== ( const Size< SizeComponentType > &  other) const
inlinenoexcept

Equality comparison.

Parameters
otherSize to compare with.
Returns
True when position and orientation are equal.

Definition at line 175 of file size.hpp.

◆ setDepth()

template<CanBeSizeComponent SizeComponentType>
Size & utility::graphic::Size< SizeComponentType >::setDepth ( SizeComponentType  depth)
inlinenoexcept

Set the depth component.

Parameters
depthNew depth value.
Returns
Reference to this object for chaining.

Definition at line 155 of file size.hpp.

◆ setHeight()

template<CanBeSizeComponent SizeComponentType>
Size & utility::graphic::Size< SizeComponentType >::setHeight ( SizeComponentType  height)
inlinenoexcept

Set the height component.

Parameters
heightNew height value.
Returns
Reference to this object for chaining.

Definition at line 135 of file size.hpp.

◆ setWidth()

template<CanBeSizeComponent SizeComponentType>
Size & utility::graphic::Size< SizeComponentType >::setWidth ( SizeComponentType  width)
inlinenoexcept

Set the width component.

Parameters
widthNew width value.
Returns
Reference to this object for chaining.

Definition at line 115 of file size.hpp.


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