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

#include <Grid.h>

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

Static Public Member Functions

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

Protected Member Functions

void Clear ()
 
GridClone ()
 
BoundingBox2 GetBoundingBox () const
 
CoordinateConverterGetCoordinateConverter () const
 
T * GetDataPointer (const Vector2i &rGrid)
 
T * GetDataPointer (const Vector2i &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 Vector2i &rGrid) const
 
kt_int32s GetWidth () const
 
kt_int32s GetWidthStep () const
 
 Grid (kt_int32s width, kt_int32s height)
 
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
 
- Protected Member Functions inherited from karto::Object
const IdentifierGetIdentifier () const
 
AbstractParameterGetParameter (const String &rParameterName) const
 
template<typename T >
Parameter< T > * GetParameter (const String &rParameterName) const
 
ParameterList GetParameters ()
 
ParameterSetGetParameterSet ()
 
template<typename T >
void SetParameters (const karto::String &rParameterName, const T &rValue)
 
- Protected Member Functions inherited from karto::Referenced
kt_int32s GetReferenceCount ()
 
kt_int32s Reference () const
 
kt_int32s Unreference () const
 
kt_int32s UnreferenceNoDelete () const
 

Private Member Functions

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

Private Attributes

kt_int32s m_Height
 
CoordinateConverterm_pCoordinateConverter
 
T * m_pData
 
kt_int32s m_Width
 
kt_int32s m_WidthStep
 

Additional Inherited Members

- Public Member Functions inherited from karto::Object
 Object ()
 
 Object (const Identifier &rIdentifier)
 
- Public Member Functions inherited from karto::Referenced
 Referenced ()
 

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 
)
inlineprotected

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 ( )
inlineprotected

public: /** Clears out the grid data

Definition at line 93 of file Grid.h.

template<typename T>
Grid* karto::Grid< T >::Clone ( )
inlineprotected

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 
)
inlinestatic

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
inlineprotected

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
inlineprotected

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)
inlineprotected

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
inlineprotected

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 ( )
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotectedvirtual

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
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 
)
inlineprotectedvirtual

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,
rValue 
) const
inlineprotected

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 
)
inlineprotected

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
inlineprotected

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 Tue Nov 7 2017 06:02:36