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

#include <Karto.h>

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
 
 Grid ()
 
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 Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

kt_int32s m_Height
 
CoordinateConverterm_pCoordinateConverter
 
T * m_pData
 
kt_int32s m_Width
 
kt_int32s m_WidthStep
 

Friends

class boost::serialization::access
 

Detailed Description

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

Defines a grid class

Definition at line 4640 of file Karto.h.

Constructor & Destructor Documentation

◆ Grid() [1/2]

template<typename T>
karto::Grid< T >::Grid ( )
inline

Creates a grid of given size and resolution

Parameters
width
height
resolution
Returns
grid pointer

Definition at line 4650 of file Karto.h.

◆ ~Grid()

template<typename T>
virtual karto::Grid< T >::~Grid ( )
inlinevirtual

Destructor

Definition at line 4665 of file Karto.h.

◆ Grid() [2/2]

template<typename T>
karto::Grid< T >::Grid ( kt_int32s  width,
kt_int32s  height 
)
inlineprotected

Constructs grid of given size

Parameters
width
height

Definition at line 5020 of file Karto.h.

Member Function Documentation

◆ Clear()

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

Clear out the grid data

Definition at line 4681 of file Karto.h.

◆ Clone()

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

Returns a clone of this grid

Returns
grid clone

Definition at line 4690 of file Karto.h.

◆ CreateGrid()

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

Definition at line 4653 of file Karto.h.

◆ GetBoundingBox()

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

Gets the grids bounding box

Returns
bounding box

Definition at line 4933 of file Karto.h.

◆ GetCoordinateConverter()

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

Gets the coordinate converter for this grid

Returns
coordinate converter

Definition at line 4915 of file Karto.h.

◆ GetDataPointer() [1/4]

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 4820 of file Karto.h.

◆ GetDataPointer() [2/4]

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 4831 of file Karto.h.

◆ GetDataPointer() [3/4]

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

Gets the grid data pointer

Returns
data pointer

Definition at line 4877 of file Karto.h.

◆ GetDataPointer() [4/4]

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

Gets const grid data pointer

Returns
data pointer

Definition at line 4886 of file Karto.h.

◆ GetDataSize()

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

Gets the allocated grid size in bytes

Returns
data size

Definition at line 4895 of file Karto.h.

◆ GetHeight()

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 4850 of file Karto.h.

◆ GetResolution()

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

Gets the resolution

Returns
resolution

Definition at line 4924 of file Karto.h.

◆ GetSize()

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 4859 of file Karto.h.

◆ GetValue()

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 4905 of file Karto.h.

◆ GetWidth()

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 4841 of file Karto.h.

◆ GetWidthStep()

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

Gets the width step in bytes

Returns
width step

Definition at line 4868 of file Karto.h.

◆ GridIndex()

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

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 4755 of file Karto.h.

◆ GridToWorld()

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 4810 of file Karto.h.

◆ IndexToGrid()

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 4783 of file Karto.h.

◆ IsValidGridIndex()

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 4744 of file Karto.h.

◆ Resize()

template<typename T>
virtual void karto::Grid< T >::Resize ( kt_int32s  width,
kt_int32s  height 
)
inlinevirtual

Resizes the grid (deletes all old data)

Parameters
width
height

Reimplemented in karto::OccupancyGrid.

Definition at line 4705 of file Karto.h.

◆ serialize()

template<typename T>
template<class Archive >
void karto::Grid< T >::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Definition at line 5037 of file Karto.h.

◆ TraceLine()

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 4947 of file Karto.h.

◆ WorldToGrid()

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 4799 of file Karto.h.

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename T>
friend class boost::serialization::access
friend

Definition at line 5035 of file Karto.h.

Member Data Documentation

◆ m_Height

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

Definition at line 5029 of file Karto.h.

◆ m_pCoordinateConverter

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

Definition at line 5034 of file Karto.h.

◆ m_pData

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

Definition at line 5031 of file Karto.h.

◆ m_Width

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

Definition at line 5028 of file Karto.h.

◆ m_WidthStep

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

Definition at line 5030 of file Karto.h.


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


slam_toolbox
Author(s): Steve Macenski
autogenerated on Mon Feb 28 2022 23:46:49