Gorgon Game Engine
basic_PointProperty< C_, T_, Getter_, Setter_ > Class Template Reference

Property support for point class. More...

Inheritance diagram for basic_PointProperty< C_, T_, Getter_, Setter_ >:
[legend]

Public Member Functions

 basic_PointProperty (basic_PointProperty &&)=default
 
 basic_PointProperty (C_ &object)
 
 basic_PointProperty (C_ *object)
 
Float Angle () const
 Calculates the angle of the line formed from the origin to this point. More...
 
Float Angle (const T_ &origin) const
 Calculates the angle of the line formed from the given point to this point. More...
 
bool Compare (const T_ &point) const
 Compares two points. More...
 
T_ CrossProduct (const T_ &value) const
 Calculates cross product of two points. More...
 
Float Distance () const
 Calculates Euclidean distance from this point to origin. More...
 
Float Distance (const T_ &target) const
 Calculates Euclidean distance from this point to the given target. More...
 
T_ DotProduct (const T_ &value) const
 Calculates dot product of two points. More...
 
Float EuclideanSquare () const
 Calculates EuclideanSquare distance from this point to the given target. More...
 
Float EuclideanSquare (const T_ &target) const
 Calculates EuclideanSquare distance from this point to the given target. More...
 
T_::BaseType GetX () const
 Returns X component. More...
 
T_::BaseType GetY () const
 Returns Y component. More...
 
Float ManhattanDistance () const
 Calculates Manhattan distance from this point to origin. More...
 
Float ManhattanDistance (const T_ &target) const
 Calculates Manhattan distance from this point to the given target. More...
 
void Move (const T_ &x, const T_ &y)
 Moves this point to the given coordinates. More...
 
T_ Normalize () const
 Normalizes the point as a unit vector. More...
 
 operator const T_ () const
 
 operator T_ ()
 
bool operator!= (const T_ &point) const
 Compares two points. More...
 
T_ operator* (const T_ &value) const
 Multiplies two points. This is essentially a dot product. More...
 
template<class O_ >
T_ operator* (O_ value) const
 Multiply this point with a scalar value. More...
 
template<class O_ >
basic_PointPropertyoperator*= (O_ value)
 Scales this point. More...
 
T_ operator+ (const T_ &point) const
 Adds another point to this one and returns the result. More...
 
basic_PointPropertyoperator+= (const T_ &point)
 Adds another point from this point. More...
 
T_ operator- () const
 Negates this point. More...
 
T_ operator- (const T_ &point) const
 
basic_PointPropertyoperator-= (const T_ &point)
 Subtracts another point from this point. More...
 
template<class O_ >
T_ operator/ (O_ value) const
 Divides this point to a scalar value. More...
 
template<class O_ >
basic_PointPropertyoperator/= (O_ value)
 Scales this point. More...
 
basic_PointPropertyoperator= (basic_PointProperty &&)=default
 
basic_PointPropertyoperator= (const T_ &value)
 
bool operator== (const T_ &point) const
 Compares two points. More...
 
T_ Perpendicular () const
 Calculates perpendicular vector to this point. More...
 
void SetX (const typename T_::BaseType &value)
 Sets X component. More...
 
void SetY (const typename T_::BaseType &value)
 Sets Y component. More...
 
Float Slope () const
 Calculates the slope of the line formed from the origin to this point. More...
 
Float Slope (const T_ &point) const
 Calculates the slope of the line formed from the given point to this point. More...
 

Public Attributes

NumericProperty< basic_PointProperty, typename T_::BaseType, &basic_PointProperty::GetX, &basic_PointProperty::SetXX
 
NumericProperty< basic_PointProperty, typename T_::BaseType, &basic_PointProperty::GetY, &basic_PointProperty::SetYY
 

Detailed Description

template<class C_, class T_, T_(C_::*)() const Getter_, void(C_::*)(const T_ &) Setter_>
class Gorgon::Geometry::basic_PointProperty< C_, T_, Getter_, Setter_ >

Property support for point class.

Constructor & Destructor Documentation

◆ basic_PointProperty() [1/3]

basic_PointProperty ( C_ *  object)

◆ basic_PointProperty() [2/3]

basic_PointProperty ( C_ &  object)

◆ basic_PointProperty() [3/3]

basic_PointProperty ( basic_PointProperty< C_, T_, Getter_, Setter_ > &&  )
default

Member Function Documentation

◆ Angle() [1/2]

Float Angle ( ) const

Calculates the angle of the line formed from the origin to this point.

Returns
angle in radians

◆ Angle() [2/2]

Float Angle ( const T_ &  origin) const

Calculates the angle of the line formed from the given point to this point.

Parameters
originis the starting point of the line
Returns
angle in radians

◆ Compare()

bool Compare ( const T_ &  point) const

Compares two points.

◆ CrossProduct()

T_ CrossProduct ( const T_ &  value) const

Calculates cross product of two points.

◆ Distance() [1/2]

Float Distance ( ) const

Calculates Euclidean distance from this point to origin.

◆ Distance() [2/2]

Float Distance ( const T_ &  target) const

Calculates Euclidean distance from this point to the given target.

◆ DotProduct()

T_ DotProduct ( const T_ &  value) const

Calculates dot product of two points.

◆ EuclideanSquare() [1/2]

Float EuclideanSquare ( ) const

Calculates EuclideanSquare distance from this point to the given target.

◆ EuclideanSquare() [2/2]

Float EuclideanSquare ( const T_ &  target) const

Calculates EuclideanSquare distance from this point to the given target.

◆ GetX()

T_::BaseType GetX ( ) const

Returns X component.

◆ GetY()

T_::BaseType GetY ( ) const

Returns Y component.

◆ ManhattanDistance() [1/2]

Float ManhattanDistance ( ) const

Calculates Manhattan distance from this point to origin.

◆ ManhattanDistance() [2/2]

Float ManhattanDistance ( const T_ &  target) const

Calculates Manhattan distance from this point to the given target.

◆ Move()

void Move ( const T_ &  x,
const T_ &  y 
)

Moves this point to the given coordinates.

◆ Normalize()

T_ Normalize ( ) const

Normalizes the point as a unit vector.

◆ operator const T_()

operator const T_ ( ) const

◆ operator T_()

operator T_ ( )

◆ operator!=()

bool operator!= ( const T_ &  point) const

Compares two points.

◆ operator*() [1/2]

T_ operator* ( const T_ &  value) const

Multiplies two points. This is essentially a dot product.

◆ operator*() [2/2]

T_ operator* ( O_  value) const

Multiply this point with a scalar value.

This is effectively scales the point

◆ operator*=()

basic_PointProperty& operator*= ( O_  value)

Scales this point.

◆ operator+()

T_ operator+ ( const T_ &  point) const

Adds another point to this one and returns the result.

◆ operator+=()

basic_PointProperty& operator+= ( const T_ &  point)

Adds another point from this point.

Result is assigned to this point

◆ operator-() [1/2]

T_ operator- ( ) const

Negates this point.

◆ operator-() [2/2]

T_ operator- ( const T_ &  point) const

◆ operator-=()

basic_PointProperty& operator-= ( const T_ &  point)

Subtracts another point from this point.

Result is assigned to this point

◆ operator/()

T_ operator/ ( O_  value) const

Divides this point to a scalar value.

This is effectively scales the point

◆ operator/=()

basic_PointProperty& operator/= ( O_  value)

Scales this point.

◆ operator=() [1/2]

basic_PointProperty& operator= ( basic_PointProperty< C_, T_, Getter_, Setter_ > &&  )
default

◆ operator=() [2/2]

basic_PointProperty& operator= ( const T_ &  value)

◆ operator==()

bool operator== ( const T_ &  point) const

Compares two points.

◆ Perpendicular()

T_ Perpendicular ( ) const

Calculates perpendicular vector to this point.

◆ SetX()

void SetX ( const typename T_::BaseType &  value)

Sets X component.

◆ SetY()

void SetY ( const typename T_::BaseType &  value)

Sets Y component.

◆ Slope() [1/2]

Float Slope ( ) const

Calculates the slope of the line formed from the origin to this point.

◆ Slope() [2/2]

Float Slope ( const T_ &  point) const

Calculates the slope of the line formed from the given point to this point.

Parameters
pointis the starting point of the line

Member Data Documentation

◆ X

◆ Y


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