FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::RectType< T > Class Template Reference

A Rectangle on screen. More...

#include <rect.h>

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

Public Member Functions

 RectType (T x=0, T y=0, T w=0, T h=0)
 Constructor. More...
 
template<typename U >
 RectType (const RectType< U > &r)
 Constructor. More...
 
right () const
 The X coordinate of the right edge. More...
 
bottom () const
 The Y coordinate of the bottom edge. More...
 
bool operator== (const RectType< T > &rect) const
 Equivalence operator. More...
 
bool contains (const PointType2D< T > &point) const
 Checks whether a rectangle contains a Point. More...
 
bool intersects (const RectType< T > &rect) const
 Check whether two rectangles share some area. More...
 
bool intersectInplace (const RectType< T > &rect)
 Calculate rectangle intersection in place. More...
 

Public Attributes

x
 The X Coordinate. More...
 
y
 The Y Coordinate. More...
 
w
 Width of the rectangle. More...
 
h
 Height of the rectangle. More...
 

Detailed Description

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

A Rectangle on screen.

This is a small helper class used for screen coordinate arithmetics. The same thoughts reasong using int32_t as value type as in Point apply.

See also
Point

Definition at line 80 of file rect.h.

Constructor & Destructor Documentation

template<typename T>
FIFE::RectType< T >::RectType ( x = 0,
y = 0,
w = 0,
h = 0 
)
inlineexplicit

Constructor.

Creates a new Rect with the values defaulting to 0.

Definition at line 99 of file rect.h.

template<typename T>
template<typename U >
FIFE::RectType< T >::RectType ( const RectType< U > &  r)
inlineexplicit

Constructor.

Creates a new Rect of type T from the given Rect of type U

Definition at line 107 of file rect.h.

Member Function Documentation

template<typename T >
T FIFE::RectType< T >::bottom ( ) const
inline

The Y coordinate of the bottom edge.

Definition at line 173 of file rect.h.

References FIFE::RectType< T >::h, and FIFE::RectType< T >::y.

Referenced by FIFE::RectType< int32_t >::RectType(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::FloatingTextRenderer::render(), FIFE::GLImage::renderZ(), and FIFE::LayerCache::update().

+ Here is the caller graph for this function:

template<typename T>
bool FIFE::RectType< T >::contains ( const PointType2D< T > &  point) const
inline

Checks whether a rectangle contains a Point.

Parameters
pointThe point that is checked.
Returns
True if the point lies inside the rectangle or on one of its borders.

Definition at line 184 of file rect.h.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::PointType2D< T >::x, FIFE::RectType< T >::x, FIFE::PointType2D< T >::y, and FIFE::RectType< T >::y.

Referenced by FIFE::InstanceTree::findInstances(), FIFE::Camera::getMatchingInstances(), and FIFE::RectType< int32_t >::RectType().

+ Here is the caller graph for this function:

template<typename T>
bool FIFE::RectType< T >::intersectInplace ( const RectType< T > &  rect)
inline

Calculate rectangle intersection in place.

Parameters
rectThe other rectangle that is checked.
Returns
True, if and only if both rectangles have some covered area in common. This includes edges that cover each other.

Definition at line 192 of file rect.h.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

Referenced by FIFE::RectType< int32_t >::RectType().

+ Here is the caller graph for this function:

template<typename T>
bool FIFE::RectType< T >::intersects ( const RectType< T > &  rect) const
inline
template<typename T>
bool FIFE::RectType< T >::operator== ( const RectType< T > &  rect) const
inline

Equivalence operator.

Parameters
rectThe rectangle to which this is compared.
Returns
True only if both rectangle values are all equal.

Definition at line 178 of file rect.h.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

Referenced by FIFE::RectType< int32_t >::RectType().

+ Here is the caller graph for this function:

template<typename T >
T FIFE::RectType< T >::right ( ) const
inline

The X coordinate of the right edge.

Definition at line 168 of file rect.h.

References FIFE::RectType< T >::w, and FIFE::RectType< T >::x.

Referenced by FIFE::RectType< int32_t >::RectType(), FIFE::SDLImage::render(), FIFE::GLImage::render(), FIFE::FloatingTextRenderer::render(), FIFE::GLImage::renderZ(), and FIFE::LayerCache::update().

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T>
T FIFE::RectType< T >::h

Height of the rectangle.

Definition at line 93 of file rect.h.

Referenced by FIFE::RenderBackendOpenGL::addImageToArray(), FIFE::RenderBackendOpenGL::addImageToArrayZ(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CellCache::addInteractOnRuntime(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::RectType< T >::bottom(), FIFE::CellCache::calculateCurrentSize(), FIFE::CellCache::CellCache(), FIFE::RectType< T >::contains(), FIFE::Image::copySubimage(), FIFE::CellRenderer::createFowMap(), FIFE::GuiFont::drawMultiLineString(), FIFE::GuiFont::drawString(), FIFE::QuadNode< DataType, MinimumSize >::find_container(), FIFE::QuadTree< InstanceList, MIN_TREE_SIZE >::find_container(), FIFE::GLImage::generateGLSharedTexture(), FIFE::CellCache::getCellsInRect(), FIFE::Image::getHeight(), FIFE::Layer::getInstancesIn(), FIFE::Camera::getLayerViewPort(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::AtlasLoader::loadAtlas(), FIFE::RectType< T >::operator==(), FIFE::EventManager::processMouseEvent(), FIFE::CellCache::removeInteractOnRuntime(), FIFE::SDLImage::render(), FIFE::GridRenderer::render(), FIFE::FloatingTextRenderer::render(), FIFE::CoordinateRenderer::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::InstanceRenderer::renderAlreadySorted(), FIFE::Camera::renderOverlay(), FIFE::Camera::renderStaticLayer(), FIFE::InstanceRenderer::renderUnsorted(), FIFE::CellCache::reset(), FIFE::CellCache::resize(), FIFE::MapSaver::save(), FIFE::RenderBackendSDL::setClipArea(), FIFE::RenderBackendOpenGL::setClipArea(), FIFE::LayerCache::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::LayerCache::updatePosition(), and FIFE::LayerCache::updateScreenCoordinate().

template<typename T>
T FIFE::RectType< T >::w

Width of the rectangle.

Definition at line 90 of file rect.h.

Referenced by FIFE::RenderBackendOpenGL::addImageToArray(), FIFE::RenderBackendOpenGL::addImageToArrayZ(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CellCache::addInteractOnRuntime(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::CellCache::calculateCurrentSize(), FIFE::CellCache::CellCache(), FIFE::RectType< T >::contains(), FIFE::Image::copySubimage(), FIFE::CellRenderer::createFowMap(), FIFE::GuiFont::drawMultiLineString(), FIFE::GuiFont::drawString(), FIFE::QuadNode< DataType, MinimumSize >::find_container(), FIFE::QuadTree< InstanceList, MIN_TREE_SIZE >::find_container(), FIFE::GLImage::generateGLSharedTexture(), FIFE::CellCache::getCellsInRect(), FIFE::Layer::getInstancesIn(), FIFE::Camera::getLayerViewPort(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::Image::getWidth(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::AtlasLoader::loadAtlas(), FIFE::RectType< T >::operator==(), FIFE::EventManager::processMouseEvent(), FIFE::CellCache::removeInteractOnRuntime(), FIFE::SDLImage::render(), FIFE::GridRenderer::render(), FIFE::FloatingTextRenderer::render(), FIFE::CoordinateRenderer::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::InstanceRenderer::renderAlreadySorted(), FIFE::Camera::renderOverlay(), FIFE::Camera::renderStaticLayer(), FIFE::InstanceRenderer::renderUnsorted(), FIFE::CellCache::reset(), FIFE::CellCache::resize(), FIFE::RectType< T >::right(), FIFE::MapSaver::save(), FIFE::RenderBackendSDL::setClipArea(), FIFE::RenderBackendOpenGL::setClipArea(), FIFE::LayerCache::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::LayerCache::updatePosition(), and FIFE::LayerCache::updateScreenCoordinate().

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

The X Coordinate.

Definition at line 84 of file rect.h.

Referenced by FIFE::CellCache::addCell(), FIFE::RenderBackendOpenGL::addImageToArray(), FIFE::RenderBackendOpenGL::addImageToArrayZ(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CellCache::addInteractOnRuntime(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::CellCache::calculateCurrentSize(), FIFE::CellCache::CellCache(), FIFE::RectType< T >::contains(), FIFE::CellCache::convertCoordToInt(), FIFE::CellCache::convertIntToCoord(), FIFE::Image::copySubimage(), FIFE::CellCache::createCell(), FIFE::CellCache::createCells(), FIFE::SdlGuiGraphics::drawImage(), FIFE::GuiFont::drawMultiLineString(), FIFE::GuiFont::drawString(), FIFE::QuadNode< DataType, MinimumSize >::find_container(), FIFE::QuadTree< InstanceList, MIN_TREE_SIZE >::find_container(), FIFE::GLImage::generateGLSharedTexture(), FIFE::CellCache::getCell(), FIFE::CellCache::getCellsInRect(), FIFE::Layer::getInstancesIn(), FIFE::Camera::getLayerViewPort(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::Image::getPixelRGBA(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::CellCache::isInCellCache(), FIFE::AtlasLoader::loadAtlas(), FIFE::RectType< T >::operator==(), FIFE::EventManager::processMouseEvent(), FIFE::CellCache::removeInteractOnRuntime(), FIFE::SDLImage::render(), FIFE::GridRenderer::render(), FIFE::GLImage::render(), FIFE::FloatingTextRenderer::render(), FIFE::CoordinateRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::LightRendererImageInfo::render(), FIFE::CellRenderer::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::InstanceRenderer::renderAlreadySorted(), FIFE::Camera::renderOverlay(), FIFE::InstanceRenderer::renderUnsorted(), FIFE::GLImage::renderZ(), FIFE::CellCache::reset(), FIFE::CellCache::resize(), FIFE::RectType< T >::right(), FIFE::MapSaver::save(), FIFE::RenderBackendSDL::setClipArea(), FIFE::RenderBackendOpenGL::setClipArea(), FIFE::LayerCache::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::LayerCache::updatePosition(), and FIFE::LayerCache::updateScreenCoordinate().

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

The Y Coordinate.

Definition at line 87 of file rect.h.

Referenced by FIFE::CellCache::addCell(), FIFE::RenderBackendOpenGL::addImageToArray(), FIFE::RenderBackendOpenGL::addImageToArrayZ(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CellCache::addInteractOnRuntime(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::RectType< T >::bottom(), FIFE::CellCache::calculateCurrentSize(), FIFE::CellCache::CellCache(), FIFE::RectType< T >::contains(), FIFE::CellCache::convertCoordToInt(), FIFE::CellCache::convertIntToCoord(), FIFE::Image::copySubimage(), FIFE::CellCache::createCell(), FIFE::CellCache::createCells(), FIFE::SdlGuiGraphics::drawImage(), FIFE::GuiFont::drawMultiLineString(), FIFE::GuiFont::drawString(), FIFE::QuadNode< DataType, MinimumSize >::find_container(), FIFE::QuadTree< InstanceList, MIN_TREE_SIZE >::find_container(), FIFE::GLImage::generateGLSharedTexture(), FIFE::CellCache::getCell(), FIFE::CellCache::getCellsInRect(), FIFE::Layer::getInstancesIn(), FIFE::Camera::getLayerViewPort(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::Image::getPixelRGBA(), FIFE::RectType< T >::intersectInplace(), FIFE::RectType< T >::intersects(), FIFE::CellCache::isInCellCache(), FIFE::AtlasLoader::loadAtlas(), FIFE::RectType< T >::operator==(), FIFE::EventManager::processMouseEvent(), FIFE::CellCache::removeInteractOnRuntime(), FIFE::SDLImage::render(), FIFE::GridRenderer::render(), FIFE::GLImage::render(), FIFE::FloatingTextRenderer::render(), FIFE::CoordinateRenderer::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::InstanceRenderer::renderAlreadySorted(), FIFE::Camera::renderOverlay(), FIFE::InstanceRenderer::renderUnsorted(), FIFE::GLImage::renderZ(), FIFE::CellCache::reset(), FIFE::CellCache::resize(), FIFE::MapSaver::save(), FIFE::RenderBackendSDL::setClipArea(), FIFE::RenderBackendOpenGL::setClipArea(), FIFE::LayerCache::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::LayerCache::updatePosition(), and FIFE::LayerCache::updateScreenCoordinate().


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