ScummVM API documentation
Common::PointBase< T, ConcretePoint > Struct Template Reference

#include <rect.h>

Public Member Functions

constexpr PointBase (T x1, T y1)
 
bool operator== (const ConcretePoint &p) const
 
bool operator!= (const ConcretePoint &p) const
 
ConcretePoint operator+ (const ConcretePoint &delta) const
 
ConcretePoint operator- (const ConcretePoint &delta) const
 
ConcretePoint operator/ (int divisor) const
 
ConcretePoint operator* (int multiplier) const
 
ConcretePoint operator/ (double divisor) const
 
ConcretePoint operator* (double multiplier) const
 
void operator+= (const ConcretePoint &delta)
 
void operator-= (const ConcretePoint &delta)
 
uint sqrDist (const ConcretePoint &p) const
 
String toString () const
 

Public Attributes

x
 
y
 

Detailed Description

template<typename T, typename ConcretePoint>
struct Common::PointBase< T, ConcretePoint >

Simple class for handling both 2D position and size.

Constructor & Destructor Documentation

◆ PointBase()

template<typename T, typename ConcretePoint>
constexpr Common::PointBase< T, ConcretePoint >::PointBase ( x1,
y1 
)
inline

Create a point with position defined by x1 and y1.

Member Function Documentation

◆ operator==()

template<typename T, typename ConcretePoint>
bool Common::PointBase< T, ConcretePoint >::operator== ( const ConcretePoint &  p) const
inline

Determine whether the position of two points is the same.

◆ operator!=()

template<typename T, typename ConcretePoint>
bool Common::PointBase< T, ConcretePoint >::operator!= ( const ConcretePoint &  p) const
inline

Determine whether the position of two points is not the same.

◆ operator+()

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator+ ( const ConcretePoint &  delta) const
inline

Create a point by adding the delta value to a point.

◆ operator-()

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator- ( const ConcretePoint &  delta) const
inline

Create a point by subtracting the delta value from a point.

◆ operator/() [1/2]

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator/ ( int  divisor) const
inline

Create a point by dividing a point by the (int) divisor value.

◆ operator*() [1/2]

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator* ( int  multiplier) const
inline

Create a point by multiplying a point by the (int) multiplier value.

◆ operator/() [2/2]

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator/ ( double  divisor) const
inline

Create a point by dividing a point by the (double) divisor value.

◆ operator*() [2/2]

template<typename T, typename ConcretePoint>
ConcretePoint Common::PointBase< T, ConcretePoint >::operator* ( double  multiplier) const
inline

Create a point by multiplying a point by the (double) multiplier value.

◆ operator+=()

template<typename T, typename ConcretePoint>
void Common::PointBase< T, ConcretePoint >::operator+= ( const ConcretePoint &  delta)
inline

Change a point's position by adding delta to its x and y coordinates.

◆ operator-=()

template<typename T, typename ConcretePoint>
void Common::PointBase< T, ConcretePoint >::operator-= ( const ConcretePoint &  delta)
inline

Change a point's position by subtracting delta from its x and y arguments.

◆ sqrDist()

template<typename T, typename ConcretePoint>
uint Common::PointBase< T, ConcretePoint >::sqrDist ( const ConcretePoint &  p) const
inline

Return the square of the distance between this point and the point p.

Parameters
pThe other point.
Returns
The distance between this and p.

◆ toString()

template<typename T, typename ConcretePoint>
String Common::PointBase< T, ConcretePoint >::toString ( ) const
inline

Return string representation of the point.

Member Data Documentation

◆ x

template<typename T, typename ConcretePoint>
T Common::PointBase< T, ConcretePoint >::x

The horizontal position of the point.

◆ y

template<typename T, typename ConcretePoint>
T Common::PointBase< T, ConcretePoint >::y

The vertical position of the point.


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