FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::PointType2D< T > Class Template Reference

A 2D Point. More...

#include <point.h>

+ Inheritance diagram for FIFE::PointType2D< T >:
+ Collaboration diagram for FIFE::PointType2D< T >:

Public Member Functions

 PointType2D (T _x=0, T _y=0)
 Constructor. More...
 
 PointType2D (const PointType2D< T > &rhs)
 Copy Constructor. More...
 
PointType2D< T > operator+ (const PointType2D< T > &p) const
 Vector addition. More...
 
PointType2D< T > operator- (const PointType2D< T > &p) const
 Vector substraction. More...
 
PointType2D< T > & operator+= (const PointType2D< T > &p)
 Vector inplace addition. More...
 
PointType2D< T > & operator-= (const PointType2D< T > &p)
 Vector inplace substraction. More...
 
PointType2D< T > operator* (const T &i) const
 Scalar multiplication with an integer value. More...
 
PointType2D< T > operator/ (const T &i) const
 Scalar division with an integer value. More...
 
bool operator== (const PointType2D< T > &p) const
 Equality comparision. More...
 
bool operator!= (const PointType2D< T > &p) const
 Equality comparision. More...
 
length () const
 Return length. More...
 
void normalize ()
 Normalizes the point. More...
 
void rotate (T angle)
 Rotates the point around the origin. More...
 
void rotate (const PointType2D< T > &origin, T angle)
 Rotates the point around an origin. More...
 
void set (T _x, T _y)
 Sets the x and y coordinate of the 2D point. More...
 
T & operator[] (int32_t ind)
 

Public Attributes

union {
   T   val [2]
 
   struct {
      T   x
 
      T   y
 
   } 
 
}; 
 

Detailed Description

template<typename T>
class FIFE::PointType2D< T >

A 2D Point.

This is a small helper class to aid in 2d vector arithmetics.

See also
Rect

Definition at line 48 of file point.h.

Constructor & Destructor Documentation

◆ PointType2D() [1/2]

template<typename T>
FIFE::PointType2D< T >::PointType2D ( _x = 0,
_y = 0 
)
inlineexplicit

Constructor.

Creates a with 0 as default values.

Definition at line 61 of file point.h.

◆ PointType2D() [2/2]

template<typename T>
FIFE::PointType2D< T >::PointType2D ( const PointType2D< T > &  rhs)
inline

Copy Constructor.

Definition at line 66 of file point.h.

Member Function Documentation

◆ length()

template<typename T>
T FIFE::PointType2D< T >::length ( ) const
inline

Return length.

Definition at line 123 of file point.h.

Referenced by FIFE::PointType2D< int32_t >::normalize(), and FIFE::PointType3D< double >::normalize().

+ Here is the caller graph for this function:

◆ normalize()

template<typename T>
void FIFE::PointType2D< T >::normalize ( )
inline

Normalizes the point.

Definition at line 131 of file point.h.

◆ operator!=()

template<typename T>
bool FIFE::PointType2D< T >::operator!= ( const PointType2D< T > &  p) const
inline

Equality comparision.

Definition at line 117 of file point.h.

◆ operator*()

template<typename T>
PointType2D<T> FIFE::PointType2D< T >::operator* ( const T &  i) const
inline

Scalar multiplication with an integer value.

Definition at line 99 of file point.h.

◆ operator+()

template<typename T>
PointType2D<T> FIFE::PointType2D< T >::operator+ ( const PointType2D< T > &  p) const
inline

Vector addition.

Definition at line 71 of file point.h.

◆ operator+=()

template<typename T>
PointType2D<T>& FIFE::PointType2D< T >::operator+= ( const PointType2D< T > &  p)
inline

Vector inplace addition.

Definition at line 83 of file point.h.

◆ operator-()

template<typename T>
PointType2D<T> FIFE::PointType2D< T >::operator- ( const PointType2D< T > &  p) const
inline

Vector substraction.

Definition at line 77 of file point.h.

◆ operator-=()

template<typename T>
PointType2D<T>& FIFE::PointType2D< T >::operator-= ( const PointType2D< T > &  p)
inline

Vector inplace substraction.

Definition at line 91 of file point.h.

◆ operator/()

template<typename T>
PointType2D<T> FIFE::PointType2D< T >::operator/ ( const T &  i) const
inline

Scalar division with an integer value.

Definition at line 105 of file point.h.

◆ operator==()

template<typename T>
bool FIFE::PointType2D< T >::operator== ( const PointType2D< T > &  p) const
inline

Equality comparision.

Definition at line 111 of file point.h.

◆ operator[]()

template<typename T>
T& FIFE::PointType2D< T >::operator[] ( int32_t  ind)
inline

Definition at line 182 of file point.h.

◆ rotate() [1/2]

template<typename T>
void FIFE::PointType2D< T >::rotate ( angle)
inline

Rotates the point around the origin.

Definition at line 147 of file point.h.

◆ rotate() [2/2]

template<typename T>
void FIFE::PointType2D< T >::rotate ( const PointType2D< T > &  origin,
angle 
)
inline

Rotates the point around an origin.

Definition at line 162 of file point.h.

◆ set()

template<typename T>
void FIFE::PointType2D< T >::set ( _x,
_y 
)
inline

Sets the x and y coordinate of the 2D point.

Definition at line 177 of file point.h.

Referenced by FIFE::LibRocketRenderInterface::RenderGeometry().

+ Here is the caller graph for this function:

Member Data Documentation

◆ @5

union { ... }

◆ val

template<typename T>
T FIFE::PointType2D< T >::val[2]

◆ x

template<typename T>
T FIFE::PointType2D< T >::x

Definition at line 53 of file point.h.

Referenced by FIFE::RenderBackend::addControlPoints(), FIFE::RectType< int32_t >::contains(), FIFE::doublePt2intPt(), FIFE::RenderBackendOpenGL::drawBezier(), FIFE::RenderBackendSDL::drawCircle(), FIFE::RenderBackendOpenGL::drawCircle(), FIFE::RenderBackendSDL::drawCircleSegment(), FIFE::RenderBackendOpenGL::drawCircleSegment(), FIFE::RenderBackendSDL::drawFillCircle(), FIFE::RenderBackendOpenGL::drawFillCircle(), FIFE::RenderBackendSDL::drawFillCircleSegment(), FIFE::RenderBackendOpenGL::drawFillCircleSegment(), FIFE::RenderBackendOpenGL::drawLightPrimitive(), FIFE::OpenGLGuiGraphics::drawLine(), FIFE::RenderBackendSDL::drawLine(), FIFE::RenderBackendOpenGL::drawLine(), FIFE::RenderBackendSDL::drawQuad(), FIFE::RenderBackendOpenGL::drawQuad(), FIFE::RenderBackendSDL::drawRectangle(), FIFE::RenderBackendOpenGL::drawRectangle(), FIFE::RenderBackendSDL::drawThickLine(), FIFE::RenderBackendOpenGL::drawThickLine(), FIFE::RenderBackendSDL::drawTriangle(), FIFE::RenderBackendOpenGL::drawTriangle(), FIFE::RenderBackendSDL::drawVertex(), FIFE::RenderBackendOpenGL::drawVertex(), FIFE::RenderBackendSDL::fillRectangle(), FIFE::RenderBackendOpenGL::fillRectangle(), FIFE::RendererNode::getCalculatedPoint(), FIFE::Camera::getCellImageDimensions(), FIFE::intPt2doublePt(), FIFE::PointType2D< int32_t >::length(), FIFE::PointType3D< double >::length(), FIFE::PointType2D< int32_t >::normalize(), FIFE::PointType3D< double >::normalize(), FIFE::PointType2D< int32_t >::operator!=(), FIFE::PointType3D< double >::operator!=(), FIFE::PointType2D< int32_t >::operator*(), FIFE::PointType3D< double >::operator*(), FIFE::PointType2D< int32_t >::operator+(), FIFE::PointType3D< double >::operator+(), FIFE::PointType2D< int32_t >::operator+=(), FIFE::PointType3D< double >::operator+=(), FIFE::PointType2D< int32_t >::operator-(), FIFE::PointType3D< double >::operator-(), FIFE::PointType2D< int32_t >::operator-=(), FIFE::PointType3D< double >::operator-=(), FIFE::PointType2D< int32_t >::operator/(), FIFE::PointType3D< double >::operator/(), FIFE::PointType2D< int32_t >::operator==(), FIFE::PointType3D< double >::operator==(), FIFE::GridRenderer::render(), FIFE::OffRendererPointInfo::render(), FIFE::GenericRendererPointInfo::render(), FIFE::CellSelectionRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::CellRenderer::render(), FIFE::LightRendererImageInfo::render(), FIFE::LightRendererAnimationInfo::render(), FIFE::OffRendererImageInfo::render(), FIFE::GenericRendererImageInfo::render(), FIFE::OffRendererAnimationInfo::render(), FIFE::GenericRendererAnimationInfo::render(), FIFE::LightRendererResizeInfo::render(), FIFE::OffRendererTextInfo::render(), FIFE::GenericRendererTextInfo::render(), FIFE::OffRendererResizeInfo::render(), FIFE::GenericRendererResizeInfo::render(), FIFE::RenderBackendOpenGL::renderGuiGeometry(), FIFE::Camera::renderOverlay(), FIFE::ImageFontBase::renderString(), FIFE::PointType2D< int32_t >::rotate(), FIFE::MapSaver::save(), FIFE::PointType2D< int32_t >::set(), FIFE::PointType3D< double >::set(), and FIFE::Camera::updateReferenceScale().

◆ y

template<typename T>
T FIFE::PointType2D< T >::y

Definition at line 53 of file point.h.

Referenced by FIFE::RenderBackend::addControlPoints(), FIFE::RectType< int32_t >::contains(), FIFE::doublePt2intPt(), FIFE::RenderBackendOpenGL::drawBezier(), FIFE::RenderBackendSDL::drawCircle(), FIFE::RenderBackendOpenGL::drawCircle(), FIFE::RenderBackendSDL::drawCircleSegment(), FIFE::RenderBackendOpenGL::drawCircleSegment(), FIFE::RenderBackendSDL::drawFillCircle(), FIFE::RenderBackendOpenGL::drawFillCircle(), FIFE::RenderBackendSDL::drawFillCircleSegment(), FIFE::RenderBackendOpenGL::drawFillCircleSegment(), FIFE::RenderBackendOpenGL::drawLightPrimitive(), FIFE::OpenGLGuiGraphics::drawLine(), FIFE::RenderBackendSDL::drawLine(), FIFE::RenderBackendOpenGL::drawLine(), FIFE::RenderBackendSDL::drawQuad(), FIFE::RenderBackendOpenGL::drawQuad(), FIFE::RenderBackendSDL::drawRectangle(), FIFE::RenderBackendOpenGL::drawRectangle(), FIFE::RenderBackendSDL::drawThickLine(), FIFE::RenderBackendOpenGL::drawThickLine(), FIFE::RenderBackendSDL::drawTriangle(), FIFE::RenderBackendOpenGL::drawTriangle(), FIFE::RenderBackendSDL::drawVertex(), FIFE::RenderBackendOpenGL::drawVertex(), FIFE::RenderBackendSDL::fillRectangle(), FIFE::RenderBackendOpenGL::fillRectangle(), FIFE::RendererNode::getCalculatedPoint(), FIFE::Camera::getCellImageDimensions(), FIFE::intPt2doublePt(), FIFE::PointType2D< int32_t >::length(), FIFE::PointType3D< double >::length(), FIFE::PointType2D< int32_t >::normalize(), FIFE::PointType3D< double >::normalize(), FIFE::PointType2D< int32_t >::operator!=(), FIFE::PointType3D< double >::operator!=(), FIFE::PointType2D< int32_t >::operator*(), FIFE::PointType3D< double >::operator*(), FIFE::PointType2D< int32_t >::operator+(), FIFE::PointType3D< double >::operator+(), FIFE::PointType2D< int32_t >::operator+=(), FIFE::PointType3D< double >::operator+=(), FIFE::PointType2D< int32_t >::operator-(), FIFE::PointType3D< double >::operator-(), FIFE::PointType2D< int32_t >::operator-=(), FIFE::PointType3D< double >::operator-=(), FIFE::PointType2D< int32_t >::operator/(), FIFE::PointType3D< double >::operator/(), FIFE::PointType2D< int32_t >::operator==(), FIFE::PointType3D< double >::operator==(), FIFE::GridRenderer::render(), FIFE::OffRendererPointInfo::render(), FIFE::GenericRendererPointInfo::render(), FIFE::CellSelectionRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::CellRenderer::render(), FIFE::LightRendererImageInfo::render(), FIFE::LightRendererAnimationInfo::render(), FIFE::OffRendererImageInfo::render(), FIFE::GenericRendererImageInfo::render(), FIFE::OffRendererAnimationInfo::render(), FIFE::GenericRendererAnimationInfo::render(), FIFE::LightRendererResizeInfo::render(), FIFE::OffRendererTextInfo::render(), FIFE::GenericRendererTextInfo::render(), FIFE::OffRendererResizeInfo::render(), FIFE::GenericRendererResizeInfo::render(), FIFE::RenderBackendOpenGL::renderGuiGeometry(), FIFE::Camera::renderOverlay(), FIFE::ImageFontBase::renderString(), FIFE::PointType2D< int32_t >::rotate(), FIFE::MapSaver::save(), FIFE::PointType2D< int32_t >::set(), FIFE::PointType3D< double >::set(), and FIFE::Camera::updateReferenceScale().


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