Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
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 Vector2< kt_int32s > &rGrid)
T * GetDataPointer (const Vector2< kt_int32s > &rGrid) const
T * GetDataPointer ()
T * GetDataPointer () const
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 4363 of file Karto.h.


Constructor & Destructor Documentation

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

Destructor

Definition at line 4385 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 4734 of file Karto.h.


Member Function Documentation

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

Clear out the grid data

Definition at line 4395 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 4404 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 4373 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 4647 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 4629 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:
rGridgrid coordinate
Returns:
grid point

Definition at line 4534 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:
rGridgrid coordinate
Returns:
grid point

Definition at line 4545 of file Karto.h.

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

Gets the grid data pointer

Returns:
data pointer

Definition at line 4591 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 4600 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 4609 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 4564 of file Karto.h.

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

Gets the resolution

Returns:
resolution

Definition at line 4638 of file Karto.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 the grid

Definition at line 4573 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:
rGridgrid coordinate
Returns:
value

Definition at line 4619 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 4555 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 4582 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
boundaryCheckdefault value is true
Returns:
grid index

Reimplemented in karto::CorrelationGrid.

Definition at line 4469 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:
rGridworld coordinate
flipY
Returns:
world coordinate

Definition at line 4524 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:
index
Returns:
grid coordinate

Definition at line 4497 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:
rGrid

Definition at line 4458 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 4419 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 4661 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:
rWorldworld coordinate
flipY
Returns:
grid coordinate

Definition at line 4513 of file Karto.h.


Member Data Documentation

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

Definition at line 4743 of file Karto.h.

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

Definition at line 4748 of file Karto.h.

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

Definition at line 4745 of file Karto.h.

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

Definition at line 4742 of file Karto.h.

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

Definition at line 4744 of file Karto.h.


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


open_karto
Author(s):
autogenerated on Thu Jun 6 2019 21:02:57