se2ez
se2ez::Geometry Class Reference

#include <geometry.h>

Public Types

enum  Type {
  BOX = 0,
  CIRCLE = 1,
  CONVEX = 2,
  SIMPLE = 3
}
 Type of geometry. More...
 

Public Member Functions

Constructors
 Geometry (const GeometryPtr &g)
 Constructor. More...
 
 Geometry (Type type, const Eigen::VectorXd &dimensions, const Eigen::Isometry2d &offset, const Eigen::Vector4d &color={0., 0., 0., 1.})
 Constructor. More...
 
 Geometry (Type type, const Eigen::VectorXd &dimensions, const Eigen::Vector3d &offset, const Eigen::Vector4d &color={0., 0., 0., 1.})
 Constructor. More...
 
 Geometry (Type type, const tf::EigenVector< Eigen::Vector2d > &points, const Eigen::Isometry2d &offset, const Eigen::Vector4d &color={0., 0., 0., 1.})
 Constructor. More...
 
 Geometry (Type type, const tf::EigenVector< Eigen::Vector2d > &points, const Eigen::Vector3d &offset, const Eigen::Vector4d &color={0., 0., 0., 1.})
 Constructor. More...
 
 Geometry (const Geometry &)=delete
 
 Geometry (Geometry &&)=delete
 
Debug
std::string printGeometry () const
 Returns a string representation of the geometry. More...
 

Static Public Member Functions

static Type stringToType (const std::string &geometry)
 Try to convert a string into a geometry type. Not case-sensitive. More...
 
static const std::stringtypeToString (const Type &type)
 Converts a geometry type into its string representation. More...
 

Public Attributes

const Type type
 Type of geometry. More...
 
Eigen::VectorXd dimensions
 The geometry's dimensions. More...
 
tf::EigenVector< Eigen::Vector2d > points
 Point list for polygons. More...
 
Eigen::Isometry2d offset
 Offset of geometry from base frame. More...
 
bool isOffset
 Is this geometry offset? More...
 
Eigen::Vector4d color
 The color to display this geometry as. More...
 

Static Public Attributes

static const unsigned int TYPE_MAX = SIMPLE
 Maximum value a geometry type can have. More...
 
static const std::string TYPE_STRINGS [] = {"box", "circle", "convex", "simple"}
 String representation of geometry type. More...
 

Detailed Description

Definition at line 24 of file geometry.h.

Member Enumeration Documentation

◆ Type

Type of geometry.

Enumerator
BOX 

A rectangular prism.

CIRCLE 

A filled circle.

CONVEX 

A convex polygon.

SIMPLE 

A simple polygon (no holes).

Definition at line 31 of file geometry.h.

Constructor & Destructor Documentation

◆ Geometry() [1/7]

Geometry::Geometry ( const GeometryPtr g)

Constructor.

Parameters
[in]ggeometry to copy values from;

Definition at line 30 of file geometry.cpp.

◆ Geometry() [2/7]

Geometry::Geometry ( Type  type,
const Eigen::VectorXd &  dimensions,
const Eigen::Isometry2d &  offset,
const Eigen::Vector4d &  color = {0., 0., 0., 1.} 
)

Constructor.

Parameters
[in]typeType of the geometry(box or circle).
[in]dimensionsThe dimensions of this geometry.
[in]offsetThe offset of this geometry from its root frame.
[in]colorColor to display for this geometry.

Definition at line 35 of file geometry.cpp.

◆ Geometry() [3/7]

Geometry::Geometry ( Type  type,
const Eigen::VectorXd &  dimensions,
const Eigen::Vector3d &  offset,
const Eigen::Vector4d &  color = {0., 0., 0., 1.} 
)

Constructor.

Parameters
[in]typeType of the geometry (box or circle).
[in]dimensionsThe dimensions of this geometry.
[in]offsetThe offset of this geometry from its root frame.
[in]colorColor to display for this geometry.

Definition at line 57 of file geometry.cpp.

◆ Geometry() [4/7]

Geometry::Geometry ( Type  type,
const tf::EigenVector< Eigen::Vector2d > &  points,
const Eigen::Isometry2d &  offset,
const Eigen::Vector4d &  color = {0., 0., 0., 1.} 
)

Constructor.

Parameters
[in]typeType of the geometry (convex or polygon).
[in]pointsPoints of the polygon.
[in]offsetThe offset of this geometry from its root frame.
[in]colorColor to display for this geometry.

Definition at line 63 of file geometry.cpp.

◆ Geometry() [5/7]

Geometry::Geometry ( Type  type,
const tf::EigenVector< Eigen::Vector2d > &  points,
const Eigen::Vector3d &  offset,
const Eigen::Vector4d &  color = {0., 0., 0., 1.} 
)

Constructor.

Parameters
[in]typeType of the geometry (convex or polygon).
[in]pointsPoints of the polygon.
[in]offsetThe offset of this geometry from its root frame.
[in]colorColor to display for this geometry.

Definition at line 95 of file geometry.cpp.

◆ Geometry() [6/7]

se2ez::Geometry::Geometry ( const Geometry )
delete

◆ Geometry() [7/7]

se2ez::Geometry::Geometry ( Geometry &&  )
delete

Member Function Documentation

◆ printGeometry()

std::string Geometry::printGeometry ( ) const

Returns a string representation of the geometry.

Returns
A string of the geometry.

Definition at line 101 of file geometry.cpp.

◆ stringToType()

Geometry::Type Geometry::stringToType ( const std::string geometry)
static

Try to convert a string into a geometry type. Not case-sensitive.

Parameters
[in]geometryString of geometry type. See TYPE_STRINGS.
Returns
The type of geometry specified by the string, or an exception on failure.

Definition at line 13 of file geometry.cpp.

◆ typeToString()

const std::string & Geometry::typeToString ( const Type type)
static

Converts a geometry type into its string representation.

Parameters
[in]typeThe type to convert.
Returns
The geometry type as a string.

Definition at line 22 of file geometry.cpp.

Member Data Documentation

◆ color

Eigen::Vector4d se2ez::Geometry::color

The color to display this geometry as.

Definition at line 122 of file geometry.h.

◆ dimensions

Eigen::VectorXd se2ez::Geometry::dimensions

The geometry's dimensions.

Definition at line 118 of file geometry.h.

◆ isOffset

bool se2ez::Geometry::isOffset

Is this geometry offset?

Definition at line 121 of file geometry.h.

◆ offset

Eigen::Isometry2d se2ez::Geometry::offset

Offset of geometry from base frame.

Definition at line 120 of file geometry.h.

◆ points

tf::EigenVector<Eigen::Vector2d> se2ez::Geometry::points

Point list for polygons.

Definition at line 119 of file geometry.h.

◆ type

const Type se2ez::Geometry::type

Type of geometry.

Definition at line 117 of file geometry.h.

◆ TYPE_MAX

const unsigned int se2ez::Geometry::TYPE_MAX = SIMPLE
static

Maximum value a geometry type can have.

Definition at line 40 of file geometry.h.

◆ TYPE_STRINGS

const std::string Geometry::TYPE_STRINGS = {"box", "circle", "convex", "simple"}
static

String representation of geometry type.

Definition at line 43 of file geometry.h.


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