olp-cpp-sdk  1.22.0
Public Types | Public Member Functions | List of all members
olp::math::Size2< T > Class Template Reference

Represents the 2D size. More...

#include <Size.h>

Public Types

using Value = T
 An alias for the value type.
 

Public Member Functions

 Size2 ()
 Creates an uninitialized Size2 instance.
 
template<typename U >
 Size2 (const Size2< U > &size)
 Creates a Size2 instance from another type. More...
 
template<typename U >
 Size2 (const Vector2< U > &vector)
 Creates a Size2 instance from a vector. More...
 
 Size2 (Value width, Value height)
 Creates a Size2 instance from the value width and height. More...
 
template<typename U >
 operator Vector2< U > () const
 Converts a type to a vector. More...
 
bool empty () const
 Checks whether the size is empty. More...
 
Value Width () const
 Gets the width of the Size2 object. More...
 
Value Height () const
 Gets the height of the Size2 object. More...
 

Detailed Description

template<typename T>
class olp::math::Size2< T >

Represents the 2D size.

Constructor & Destructor Documentation

◆ Size2() [1/3]

template<typename T >
template<typename U >
olp::math::Size2< T >::Size2 ( const Size2< U > &  size)

Creates a Size2 instance from another type.

Parameters
sizeThe size of the other type to create from.

◆ Size2() [2/3]

template<typename T >
template<typename U >
olp::math::Size2< T >::Size2 ( const Vector2< U > &  vector)
explicit

Creates a Size2 instance from a vector.

Parameters
[in]vectorThe vector to create from.

◆ Size2() [3/3]

template<typename T >
olp::math::Size2< T >::Size2 ( Value  width,
Value  height 
)

Creates a Size2 instance from the value width and height.

Parameters
[in]widthThe value width to create from.
[in]heightThe value height to create from.

Member Function Documentation

◆ empty()

template<typename T >
bool olp::math::Size2< T >::empty

Checks whether the size is empty.

Returns
True if any of the size components is zero; false otherwise.

◆ Height()

template<typename T >
auto olp::math::Size2< T >::Height

Gets the height of the Size2 object.

Returns
The height of the Size2 object.

◆ operator Vector2< U >()

template<typename T >
template<typename U >
olp::math::Size2< T >::operator Vector2< U >
explicit

Converts a type to a vector.

Returns
The vector.

◆ Width()

template<typename T >
auto olp::math::Size2< T >::Width

Gets the width of the Size2 object.

Returns
The width of the Size2 object.

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