MRPT logo

mrpt::opengl::CAngularObservationMesh Class Reference

A mesh built from a set of 2D laser scan observations. More...

#include <mrpt/opengl/CAngularObservationMesh.h>

Inheritance diagram for mrpt::opengl::CAngularObservationMesh:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

List of all members.

Classes

class  FTrace1D
 Internal functor class to trace a ray. More...
class  FTrace2D
 Internal functor class to trace a set of rays. More...
struct  TDoubleRange
 Range specification type, with several uses. More...

Public Member Functions

bool isWireframe () const
 Returns whether the object is configured as wireframe or solid.
void setWireframe (bool enabled=true)
 Sets the display mode for the object.
bool isTransparencyEnabled () const
 Returns whether the object may be transparent or not.
void enableTransparency (bool enabled=true)
 Enables or disables transparencies.
virtual void render () const
 Renderizes the object.
virtual bool traceRay (const mrpt::poses::CPose3D &o, double &dist) const
 Traces a ray to the object, returning the distance to a given pose through its X axis.
void setPitchBounds (const double initial, const double final)
 Sets the pitch bounds for this range.
void setPitchBounds (const std::vector< double > bounds)
 Sets the pitch bounds for this range.
void getPitchBounds (double &initial, double &final) const
 Gets the initial and final pitch bounds for this range.
void getPitchBounds (std::vector< double > &bounds) const
 Gets the pitch bounds for this range.
void getScanSet (std::vector< CObservation2DRangeScan > &scans) const
 Gets the scan set.
bool setScanSet (const std::vector< CObservation2DRangeScan > &scans)
 Sets the scan set.
void generateSetOfTriangles (CSetOfTrianglesPtr &res) const
 Gets the mesh as a set of triangles, for displaying them.
void generatePointCloud (CPointsMap *out_map) const
 Returns the scanned points as a 3D point cloud.
void getTracedRays (CSetOfLinesPtr &res) const
 Gets a set of lines containing the traced rays, for displaying them.
void getUntracedRays (CSetOfLinesPtr &res, double dist) const
 Gets a set of lines containing the untraced rays, up to a specified distance, for displaying them.
void generateSetOfTriangles (std::vector< TPolygon3D > &res) const
 Gets the mesh as a set of polygons, to work with them.

Static Public Member Functions

template<class T >
static void trace2DSetOfRays (const T &e, const CPose3D &initial, CAngularObservationMeshPtr &caom, const TDoubleRange &pitchs, const TDoubleRange &yaws)
 2D ray tracing (will generate a 3D mesh).
template<class T >
static void trace1DSetOfRays (const T &e, const CPose3D &initial, CObservation2DRangeScan &obs, const TDoubleRange &yaws)
 2D ray tracing (will generate a vectorial mesh inside a plane).

Protected Member Functions

void updateMesh () const
 Updates the mesh, if needed.
virtual ~CAngularObservationMesh ()
 Empty destructor.
void addTriangle (const TPoint3D &p1, const TPoint3D &p2, const TPoint3D &p3) const
 Internal method to add a triangle to the mutable mesh.
 CAngularObservationMesh ()
 Basic constructor.

Protected Attributes

std::vector
< CSetOfTriangles::TTriangle
triangles
 Actual set of triangles to be displayed.
bool mWireframe
 Whether the mesh will be displayed wireframe or solid.
bool meshUpToDate
 Mutable variable which controls if the object has suffered any change since last time the mesh was updated.
bool mEnableTransparency
 Whether the object may present transparencies or not.
mrpt::math::CMatrixTemplate
< TPoint3D
actualMesh
 Mutable object with the mesh's points.
mrpt::math::CMatrixB validityMatrix
 Scan validity matrix.
vector< double > pitchBounds
 Observation pitch range.
vector< CObservation2DRangeScanscanSet
 Actual scan set which is used to generate the mesh.


Detailed Description

A mesh built from a set of 2D laser scan observations.

Each element of this set is a single scan through the yaw, given a specific pitch. Each scan has a CPose3D identifying the origin of the scan, which ideally is the same for every one of them.

Definition at line 52 of file CAngularObservationMesh.h.


Constructor & Destructor Documentation

virtual mrpt::opengl::CAngularObservationMesh::~CAngularObservationMesh (  )  [inline, protected, virtual]

Empty destructor.

Definition at line 219 of file CAngularObservationMesh.h.

mrpt::opengl::CAngularObservationMesh::CAngularObservationMesh (  )  [inline, protected]

Basic constructor.

Definition at line 259 of file CAngularObservationMesh.h.


Member Function Documentation

void mrpt::opengl::CAngularObservationMesh::addTriangle ( const TPoint3D p1,
const TPoint3D p2,
const TPoint3D p3 
) const [protected]

Internal method to add a triangle to the mutable mesh.

void mrpt::opengl::CAngularObservationMesh::enableTransparency ( bool  enabled = true  )  [inline]

Enables or disables transparencies.

Definition at line 282 of file CAngularObservationMesh.h.

void mrpt::opengl::CAngularObservationMesh::generatePointCloud ( CPointsMap out_map  )  const

Returns the scanned points as a 3D point cloud.

The target pointmap must be passed as a pointer to allow the use of any derived class.

void mrpt::opengl::CAngularObservationMesh::generateSetOfTriangles ( std::vector< TPolygon3D > &  res  )  const

Gets the mesh as a set of polygons, to work with them.

See also:
generateSetOfTriangles(mrpt::opengl::CSetOfTriangles &)

void mrpt::opengl::CAngularObservationMesh::generateSetOfTriangles ( CSetOfTrianglesPtr &  res  )  const

Gets the mesh as a set of triangles, for displaying them.

See also:
generateSetOfTriangles(std::vector<TPolygon3D> &),mrpt::opengl::CSetOfTriangles,mrpt::opengl::CSetOfTriangles::TTriangle

void mrpt::opengl::CAngularObservationMesh::getPitchBounds ( std::vector< double > &  bounds  )  const

Gets the pitch bounds for this range.

void mrpt::opengl::CAngularObservationMesh::getPitchBounds ( double &  initial,
double &  final 
) const

Gets the initial and final pitch bounds for this range.

void mrpt::opengl::CAngularObservationMesh::getScanSet ( std::vector< CObservation2DRangeScan > &  scans  )  const

Gets the scan set.

void mrpt::opengl::CAngularObservationMesh::getTracedRays ( CSetOfLinesPtr &  res  )  const

Gets a set of lines containing the traced rays, for displaying them.

See also:
getUntracedRays,mrpt::opengl::CSetOfLines

void mrpt::opengl::CAngularObservationMesh::getUntracedRays ( CSetOfLinesPtr &  res,
double  dist 
) const

Gets a set of lines containing the untraced rays, up to a specified distance, for displaying them.

See also:
getTracedRays,mrpt::opengl::CSetOfLines

bool mrpt::opengl::CAngularObservationMesh::isTransparencyEnabled (  )  const [inline]

Returns whether the object may be transparent or not.

Definition at line 276 of file CAngularObservationMesh.h.

bool mrpt::opengl::CAngularObservationMesh::isWireframe (  )  const [inline]

Returns whether the object is configured as wireframe or solid.

Definition at line 264 of file CAngularObservationMesh.h.

virtual void mrpt::opengl::CAngularObservationMesh::render (  )  const [virtual]

Renderizes the object.

See also:
mrpt::opengl::CRenderizable

Implements mrpt::opengl::CRenderizable.

void mrpt::opengl::CAngularObservationMesh::setPitchBounds ( const std::vector< double >  bounds  ) 

Sets the pitch bounds for this range.

void mrpt::opengl::CAngularObservationMesh::setPitchBounds ( const double  initial,
const double  final 
)

Sets the pitch bounds for this range.

bool mrpt::opengl::CAngularObservationMesh::setScanSet ( const std::vector< CObservation2DRangeScan > &  scans  ) 

Sets the scan set.

void mrpt::opengl::CAngularObservationMesh::setWireframe ( bool  enabled = true  )  [inline]

Sets the display mode for the object.

True=wireframe, False=solid.

Definition at line 270 of file CAngularObservationMesh.h.

template<class T >
static void mrpt::opengl::CAngularObservationMesh::trace1DSetOfRays ( const T &  e,
const CPose3D initial,
CObservation2DRangeScan obs,
const TDoubleRange yaws 
) [inline, static]

template<class T >
static void mrpt::opengl::CAngularObservationMesh::trace2DSetOfRays ( const T &  e,
const CPose3D initial,
CAngularObservationMeshPtr &  caom,
const TDoubleRange pitchs,
const TDoubleRange yaws 
) [inline, static]

2D ray tracing (will generate a 3D mesh).

Given an object and two ranges, realizes a scan from the initial pose and stores it in a CAngularObservationMesh object. The objective may be a COpenGLScene, a CRenderizable or any children of its.

See also:
mrpt::opengl::CRenderizable,mrpt::opengl::COpenGLScene.

Definition at line 407 of file CAngularObservationMesh.h.

References mrpt::opengl::CAngularObservationMesh::TDoubleRange::values().

virtual bool mrpt::opengl::CAngularObservationMesh::traceRay ( const mrpt::poses::CPose3D o,
double &  dist 
) const [virtual]

Traces a ray to the object, returning the distance to a given pose through its X axis.

See also:
mrpt::opengl::CRenderizable,trace2DSetOfRays,trace1DSetOfRays

Reimplemented from mrpt::opengl::CRenderizable.

void mrpt::opengl::CAngularObservationMesh::updateMesh (  )  const [protected]

Updates the mesh, if needed.

It's a const method, but modifies mutable content.


Member Data Documentation

Mutable object with the mesh's points.

Definition at line 243 of file CAngularObservationMesh.h.

Whether the object may present transparencies or not.

Definition at line 239 of file CAngularObservationMesh.h.

Mutable variable which controls if the object has suffered any change since last time the mesh was updated.

Definition at line 235 of file CAngularObservationMesh.h.

Whether the mesh will be displayed wireframe or solid.

Definition at line 231 of file CAngularObservationMesh.h.

Observation pitch range.

When containing exactly two elements, they represent the bounds.

Definition at line 251 of file CAngularObservationMesh.h.

Actual scan set which is used to generate the mesh.

Definition at line 255 of file CAngularObservationMesh.h.

Actual set of triangles to be displayed.

Definition at line 223 of file CAngularObservationMesh.h.

Scan validity matrix.

Definition at line 247 of file CAngularObservationMesh.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:10:56 EDT 2009