Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
karto::CoordinateConverter Class Reference

#include <Karto.h>

Public Member Functions

 CoordinateConverter ()
 
BoundingBox2 GetBoundingBox () const
 
const Vector2< kt_double > & GetOffset () const
 
kt_double GetResolution () const
 
kt_double GetScale () const
 
const Size2< kt_int32s > & GetSize () const
 
Vector2< kt_doubleGridToWorld (const Vector2< kt_int32s > &rGrid, kt_bool flipY=false) const
 
void SetOffset (const Vector2< kt_double > &rOffset)
 
void SetResolution (kt_double resolution)
 
void SetScale (kt_double scale)
 
void SetSize (const Size2< kt_int32s > &rSize)
 
kt_double Transform (kt_double value)
 
Vector2< kt_int32sWorldToGrid (const Vector2< kt_double > &rWorld, kt_bool flipY=false) const
 

Private Member Functions

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

Private Attributes

Vector2< kt_doublem_Offset
 
kt_double m_Scale
 
Size2< kt_int32sm_Size
 

Friends

class boost::serialization::access
 

Detailed Description

The CoordinateConverter class is used to convert coordinates between world and grid coordinates In world coordinates 1.0 = 1 meter where 1 in grid coordinates = 1 pixel! Default scale for coordinate converter is 20 that converters to 1 pixel = 0.05 meter

Definition at line 4458 of file Karto.h.

Constructor & Destructor Documentation

◆ CoordinateConverter()

karto::CoordinateConverter::CoordinateConverter ( )
inline

Default constructor

Definition at line 4464 of file Karto.h.

Member Function Documentation

◆ GetBoundingBox()

BoundingBox2 karto::CoordinateConverter::GetBoundingBox ( ) const
inline

Gets the bounding box

Returns
bounding box

Definition at line 4602 of file Karto.h.

◆ GetOffset()

const Vector2<kt_double>& karto::CoordinateConverter::GetOffset ( ) const
inline

Gets the offset

Returns
offset

Definition at line 4548 of file Karto.h.

◆ GetResolution()

kt_double karto::CoordinateConverter::GetResolution ( ) const
inline

Gets the resolution

Returns
resolution

Definition at line 4584 of file Karto.h.

◆ GetScale()

kt_double karto::CoordinateConverter::GetScale ( ) const
inline

Gets the scale

Returns
scale

Definition at line 4530 of file Karto.h.

◆ GetSize()

const Size2<kt_int32s>& karto::CoordinateConverter::GetSize ( ) const
inline

Gets the size

Returns
size

Definition at line 4575 of file Karto.h.

◆ GridToWorld()

Vector2<kt_double> karto::CoordinateConverter::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 4509 of file Karto.h.

◆ serialize()

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

Definition at line 4623 of file Karto.h.

◆ SetOffset()

void karto::CoordinateConverter::SetOffset ( const Vector2< kt_double > &  rOffset)
inline

Sets the offset

Parameters
rOffset

Definition at line 4557 of file Karto.h.

◆ SetResolution()

void karto::CoordinateConverter::SetResolution ( kt_double  resolution)
inline

Sets the resolution

Parameters
resolution

Definition at line 4593 of file Karto.h.

◆ SetScale()

void karto::CoordinateConverter::SetScale ( kt_double  scale)
inline

Sets the scale

Parameters
scale

Definition at line 4539 of file Karto.h.

◆ SetSize()

void karto::CoordinateConverter::SetSize ( const Size2< kt_int32s > &  rSize)
inline

Sets the size

Parameters
rSize

Definition at line 4566 of file Karto.h.

◆ Transform()

kt_double karto::CoordinateConverter::Transform ( kt_double  value)
inline

Scales the value

Parameters
value
Returns
scaled value

Definition at line 4475 of file Karto.h.

◆ WorldToGrid()

Vector2<kt_int32s> karto::CoordinateConverter::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 4486 of file Karto.h.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 4621 of file Karto.h.

Member Data Documentation

◆ m_Offset

Vector2<kt_double> karto::CoordinateConverter::m_Offset
private

Definition at line 4620 of file Karto.h.

◆ m_Scale

kt_double karto::CoordinateConverter::m_Scale
private

Definition at line 4618 of file Karto.h.

◆ m_Size

Size2<kt_int32s> karto::CoordinateConverter::m_Size
private

Definition at line 4617 of file Karto.h.


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


slam_toolbox
Author(s): Steve Macenski
autogenerated on Sat Oct 3 2020 03:51:02