Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
karto::Grid< T > Class Template Reference

#include <Grid.h>

Inheritance diagram for karto::Grid< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void Clear ()
GridClone ()
BoundingBox2 GetBoundingBox () const
CoordinateConverterGetCoordinateConverter () const
TGetDataPointer (const Vector2i &rGrid)
TGetDataPointer (const Vector2i &rGrid) const
TGetDataPointer ()
TGetDataPointer () const
kt_int32s GetDataSize () const
kt_int32s GetHeight () const
kt_double GetResolution () const
const Size2< kt_int32sGetSize () const
T GetValue (const Vector2i &rGrid) const
kt_int32s GetWidth () const
kt_int32s GetWidthStep () const
virtual kt_int32s GridIndex (const Vector2i &rGrid, kt_bool boundaryCheck=true) const
Vector2d GridToWorld (const Vector2i &rGrid, kt_bool flipY=false) const
Vector2i IndexToGrid (kt_int32s index) const
kt_bool IsValidGridIndex (const Vector2i &rGrid) const
virtual void Resize (kt_int32s width, kt_int32s height)
void SetValue (const Vector2i &rGrid, T rValue) const
void TraceLine (kt_int32s x0, kt_int32s y0, kt_int32s x1, kt_int32s y1, Functor *f=NULL)
Vector2i WorldToGrid (const Vector2d &rWorld, kt_bool flipY=false) const

Static Public Member Functions

static GridCreateGrid (kt_int32s width, kt_int32s height, kt_double resolution)

Protected Member Functions

 Grid (kt_int32s width, kt_int32s height)

Private Member Functions

 Grid (const Grid &)
 KARTO_RTTI ()
const Gridoperator= (const Grid &)

Private Attributes

kt_int32s m_Height
CoordinateConverterm_pCoordinateConverter
Tm_pData
kt_int32s m_Width
kt_int32s m_WidthStep

Detailed Description

template<typename T>
class karto::Grid< T >

Defines a grid

Definition at line 56 of file Grid.h.


Constructor & Destructor Documentation

template<typename T>
karto::Grid< T >::Grid ( kt_int32s  width,
kt_int32s  height 
) [inline, protected]

Constructs grid of given size

Parameters:
widthwidth
heightheight

Definition at line 444 of file Grid.h.

template<typename T>
karto::Grid< T >::Grid ( const Grid< T > &  ) [private]

Member Function Documentation

template<typename T>
void karto::Grid< T >::Clear ( ) [inline]

Clears out the grid data

Definition at line 93 of file Grid.h.

template<typename T>
Grid* karto::Grid< T >::Clone ( ) [inline]

Returns a clone of this grid

Returns:
grid clone

Definition at line 102 of file Grid.h.

template<typename T>
static Grid* karto::Grid< T >::CreateGrid ( kt_int32s  width,
kt_int32s  height,
kt_double  resolution 
) [inline, static]

Creates a grid of given size and resolution

Parameters:
widthwidth
heightheight
resolutionresolution
Returns:
grid pointer

Definition at line 68 of file Grid.h.

template<typename T>
BoundingBox2 karto::Grid< T >::GetBoundingBox ( ) const [inline]

Gets this grid's bounding box

Returns:
bounding box

Definition at line 357 of file Grid.h.

template<typename T>
CoordinateConverter* karto::Grid< T >::GetCoordinateConverter ( ) const [inline]

Gets the coordinate converter for this grid

Returns:
coordinate converter for this grid

Definition at line 339 of file Grid.h.

template<typename T>
T* karto::Grid< T >::GetDataPointer ( const Vector2i rGrid) [inline]

Gets pointer to data at given grid coordinate

Parameters:
rGridgrid coordinate
Returns:
pointer to data at given grid coordinate

Definition at line 233 of file Grid.h.

template<typename T>
T* karto::Grid< T >::GetDataPointer ( const Vector2i rGrid) const [inline]

Gets pointer to data at given grid coordinate (const version)

Parameters:
rGridgrid coordinate
Returns:
pointer to data at given grid coordinate

Definition at line 244 of file Grid.h.

template<typename T>
T* karto::Grid< T >::GetDataPointer ( ) [inline]

Gets the grid data pointer

Returns:
data pointer

Definition at line 290 of file Grid.h.

template<typename T>
T* karto::Grid< T >::GetDataPointer ( ) const [inline]

Gets the grid data pointer (const version)

Returns:
data pointer

Definition at line 299 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::GetDataSize ( ) const [inline]

Gets the allocated grid size in bytes

Returns:
allocated grid size in bytes

Definition at line 308 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::GetHeight ( ) const [inline]

Gets the height of this grid

Returns:
height of this grid

Definition at line 263 of file Grid.h.

template<typename T>
kt_double karto::Grid< T >::GetResolution ( ) const [inline]

Gets the resolution

Returns:
resolution

Definition at line 348 of file Grid.h.

template<typename T>
const Size2<kt_int32s> karto::Grid< T >::GetSize ( ) const [inline]

Get the size as a Size2<kt_int32s>

Returns:
size of this grid

Definition at line 272 of file Grid.h.

template<typename T>
T karto::Grid< T >::GetValue ( const Vector2i rGrid) const [inline]

Gets value at given grid coordinate

Parameters:
rGridgrid coordinate
Returns:
value at given grid coordinate

Definition at line 318 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::GetWidth ( ) const [inline]

Gets the width of this grid

Returns:
width of this grid

Definition at line 254 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::GetWidthStep ( ) const [inline]

Get actual allocated grid width. Note: The width of the grid is 8-byte aligned.

Returns:
width step

Definition at line 281 of file Grid.h.

template<typename T>
virtual kt_int32s karto::Grid< T >::GridIndex ( const Vector2i rGrid,
kt_bool  boundaryCheck = true 
) const [inline, virtual]

Gets the index into the data pointer of the given grid coordinate

Parameters:
rGridgrid index
boundaryCheckwhether to check if the grid index is in the grid boundaries
Exceptions:
Exceptionif boundaryCheck is true and the grid index falls outside the grid boundaries
Returns:
index into the grid data pointer of the given grid coordinate

Reimplemented in karto::CorrelationGrid.

Definition at line 169 of file Grid.h.

template<typename T>
Vector2d karto::Grid< T >::GridToWorld ( const Vector2i rGrid,
kt_bool  flipY = false 
) const [inline]

Converts the given grid coordinate to world coordinates

Parameters:
rGridgrid coordinate
flipYwhether to flip the y-coordinate (useful for drawing applications with inverted y-coordinates)
Returns:
equivalent world coordinate of given grid coordinate

Definition at line 223 of file Grid.h.

template<typename T>
Vector2i karto::Grid< T >::IndexToGrid ( kt_int32s  index) const [inline]

Gets the grid coordinate from an index

Parameters:
indexindex
Returns:
grid coordinate from index

Definition at line 196 of file Grid.h.

template<typename T>
kt_bool karto::Grid< T >::IsValidGridIndex ( const Vector2i rGrid) const [inline]

Checks whether the given coordinate is a valid grid index

Parameters:
rGridgrid index
Returns:
whether the given coordinate is a valid grid index

Definition at line 157 of file Grid.h.

template<typename T>
karto::Grid< T >::KARTO_RTTI ( ) [private]

Reimplemented from karto::Object.

Reimplemented in karto::OccupancyGrid.

template<typename T>
const Grid& karto::Grid< T >::operator= ( const Grid< T > &  ) [private]
template<typename T>
virtual void karto::Grid< T >::Resize ( kt_int32s  width,
kt_int32s  height 
) [inline, virtual]

Resizes the grid (deletes all old data)

Parameters:
widthnew width
heightnew height

Reimplemented in karto::OccupancyGrid.

Definition at line 117 of file Grid.h.

template<typename T>
void karto::Grid< T >::SetValue ( const Vector2i rGrid,
T  rValue 
) const [inline]

Sets value at given grid coordinate

Parameters:
rGridgrid coordinate
rValuenew value

Definition at line 329 of file Grid.h.

template<typename T>
void karto::Grid< T >::TraceLine ( kt_int32s  x0,
kt_int32s  y0,
kt_int32s  x1,
kt_int32s  y1,
Functor f = NULL 
) [inline]

Increments all the grid cells from (x0, y0) to (x1, y1); if applicable, apply f to each cell traced

Parameters:
x0x0
y0y0
x1x1
y1y1
ffunctor

Definition at line 371 of file Grid.h.

template<typename T>
Vector2i karto::Grid< T >::WorldToGrid ( const Vector2d rWorld,
kt_bool  flipY = false 
) const [inline]

Converts the given world coordinate to grid coordinates

Parameters:
rWorldworld coordinate
flipYwhether to flip the y-coordinate (useful for drawing applications with inverted y-coordinates)
Returns:
equivalent grid coordinate of given world coordinate

Definition at line 212 of file Grid.h.


Member Data Documentation

template<typename T>
kt_int32s karto::Grid< T >::m_Height [private]

Definition at line 461 of file Grid.h.

template<typename T>
CoordinateConverter* karto::Grid< T >::m_pCoordinateConverter [private]

Definition at line 465 of file Grid.h.

template<typename T>
T* karto::Grid< T >::m_pData [private]

Definition at line 463 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::m_Width [private]

Definition at line 460 of file Grid.h.

template<typename T>
kt_int32s karto::Grid< T >::m_WidthStep [private]

Definition at line 462 of file Grid.h.


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


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Sun Apr 2 2017 03:53:09