karto::Grid< T > Class Template Reference

#include <Karto.h>

List of all members.

Public Member Functions

void Clear ()
GridClone ()
BoundingBox2 GetBoundingBox () const
CoordinateConverterGetCoordinateConverter () const
T * GetDataPointer () const
T * GetDataPointer ()
T * GetDataPointer (const Vector2< kt_int32s > &rGrid) const
T * GetDataPointer (const Vector2< kt_int32s > &rGrid)
kt_int32s GetDataSize () const
kt_int32s GetHeight () const
kt_double GetResolution () const
const Size2< kt_int32sGetSize () const
GetValue (const Vector2< kt_int32s > &rGrid) const
kt_int32s GetWidth () const
kt_int32s GetWidthStep () const
virtual kt_int32s GridIndex (const Vector2< kt_int32s > &rGrid, kt_bool boundaryCheck=true) const
Vector2< kt_doubleGridToWorld (const Vector2< kt_int32s > &rGrid, kt_bool flipY=false) const
Vector2< kt_int32sIndexToGrid (kt_int32s index) const
kt_bool IsValidGridIndex (const Vector2< kt_int32s > &rGrid) const
virtual void Resize (kt_int32s width, kt_int32s height)
void TraceLine (kt_int32s x0, kt_int32s y0, kt_int32s x1, kt_int32s y1, Functor *f=NULL)
Vector2< kt_int32sWorldToGrid (const Vector2< kt_double > &rWorld, kt_bool flipY=false) const
virtual ~Grid ()

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 Attributes

kt_int32s m_Height
CoordinateConverterm_pCoordinateConverter
T * m_pData
kt_int32s m_Width
kt_int32s m_WidthStep

Detailed Description

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

Defines a grid class

Definition at line 4182 of file Karto.h.


Constructor & Destructor Documentation

template<typename T>
virtual karto::Grid< T >::~Grid (  )  [inline, virtual]

Destructor

Definition at line 4204 of file Karto.h.

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

Constructs grid of given size

Parameters:
width 
height 

Definition at line 4547 of file Karto.h.


Member Function Documentation

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

Clear out the grid data

Definition at line 4214 of file Karto.h.

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

Returns a clone of this grid

Returns:
grid clone

Definition at line 4223 of file Karto.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:
width 
height 
resolution 
Returns:
grid pointer

Definition at line 4192 of file Karto.h.

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

Gets the grids bounding box

Returns:
bounding box

Definition at line 4460 of file Karto.h.

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

Gets the coordinate converter for this grid

Returns:
coordinate converter

Definition at line 4442 of file Karto.h.

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

Gets const grid data pointer

Returns:
data pointer

Definition at line 4413 of file Karto.h.

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

Gets the grid data pointer

Returns:
data pointer

Definition at line 4404 of file Karto.h.

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

Gets pointer to data at given grid coordinate

Parameters:
rGrid grid coordinate
Returns:
grid point

Definition at line 4362 of file Karto.h.

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

Gets pointer to data at given grid coordinate

Parameters:
rGrid grid coordinate
Returns:
grid point

Definition at line 4351 of file Karto.h.

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

Gets the allocated grid size in bytes

Returns:
data size

Definition at line 4422 of file Karto.h.

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

Gets the height of the grid

Returns:
height of the grid

Definition at line 4381 of file Karto.h.

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

Gets the resolution

Returns:
resolution

Definition at line 4451 of file Karto.h.

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

Definition at line 4386 of file Karto.h.

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

Get value at given grid coordinate

Parameters:
rGrid grid coordinate
Returns:
value

Definition at line 4432 of file Karto.h.

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

Gets the width of the grid

Returns:
width of the grid

Definition at line 4372 of file Karto.h.

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

Gets the width step in bytes

Returns:
width step

Definition at line 4395 of file Karto.h.

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

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

Parameters:
rGrid 
boundaryCheck default value is true
Returns:
grid index

Reimplemented in karto::CorrelationGrid.

Definition at line 4289 of file Karto.h.

template<typename T>
Vector2<kt_double> karto::Grid< T >::GridToWorld ( const Vector2< kt_int32s > &  rGrid,
kt_bool  flipY = false 
) const [inline]

Converts the point from grid coordinates to world coordinates

Parameters:
rGrid world coordinate
Returns:
world coordinate

Definition at line 4341 of file Karto.h.

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

Gets the grid coordinate from an index

Parameters:
grid index
Returns:
grid coordinate

Definition at line 4316 of file Karto.h.

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

Checks whether the given coordinates are valid grid indices

Parameters:
x 
y 

Definition at line 4278 of file Karto.h.

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:
width 
height 

Reimplemented in karto::OccupancyGrid.

Definition at line 4238 of file Karto.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:
x0 
y0 
x1 
y1 
f 

Definition at line 4474 of file Karto.h.

template<typename T>
Vector2<kt_int32s> karto::Grid< T >::WorldToGrid ( const Vector2< kt_double > &  rWorld,
kt_bool  flipY = false 
) const [inline]

Converts the point from world coordinates to grid coordinates

Parameters:
rWorld world coordinate
Returns:
grid coordinate

Definition at line 4331 of file Karto.h.


Member Data Documentation

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

Definition at line 4556 of file Karto.h.

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

Definition at line 4560 of file Karto.h.

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

Definition at line 4558 of file Karto.h.

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

Definition at line 4555 of file Karto.h.

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

Definition at line 4557 of file Karto.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


karto
Author(s): SRI International (package maintained by Brian Gerkey)
autogenerated on Fri Jan 11 10:07:05 2013