MRPT logo

mrpt::math::TSegment3D Struct Reference

3D segment, consisting of two points. More...

#include <mrpt/math/lightweight_geom_data.h>

List of all members.

Public Member Functions

double length () const
 Segment length.
double distance (const TPoint3D &point) const
 Distance to point.
bool contains (const TPoint3D &point) const
 Check whether a point is inside the segment.
TPoint3Doperator[] (size_t i)
 Unsafe point access using [] operator, intended for loops.
const TPoint3Doperator[] (size_t i) const
 Unsafe point access using [] operator, intended for loops.
void generate2DObject (TSegment2D &s) const
 Projection into 2D space, discarding the z.
void getCenter (TPoint3D &p) const
 Segment's central point.
 TSegment3D (const TPoint3D &p1, const TPoint3D &p2)
 Constructor from both points.
 TSegment3D ()
 Fast default constructor.
 TSegment3D (const TSegment2D &s)
 Constructor from 2D object.

Public Attributes

TPoint3D point1
 Origin point.
TPoint3D point2
 Destiny point.


Detailed Description

3D segment, consisting of two points.

See also:
TSegment2D,TLine3D,TPlane,TPolygon3D,TPoint3D

Definition at line 541 of file lightweight_geom_data.h.


Constructor & Destructor Documentation

mrpt::math::TSegment3D::TSegment3D ( const TPoint3D p1,
const TPoint3D p2 
) [inline]

Constructor from both points.

Definition at line 592 of file lightweight_geom_data.h.

mrpt::math::TSegment3D::TSegment3D (  )  [inline]

Fast default constructor.

Initializes to garbage.

Definition at line 596 of file lightweight_geom_data.h.

mrpt::math::TSegment3D::TSegment3D ( const TSegment2D s  )  [inline]

Constructor from 2D object.

Sets the z to zero.

Definition at line 600 of file lightweight_geom_data.h.


Member Function Documentation

bool mrpt::math::TSegment3D::contains ( const TPoint3D point  )  const

Check whether a point is inside the segment.

double mrpt::math::TSegment3D::distance ( const TPoint3D point  )  const

Distance to point.

void mrpt::math::TSegment3D::generate2DObject ( TSegment2D s  )  const [inline]

Projection into 2D space, discarding the z.

Definition at line 578 of file lightweight_geom_data.h.

void mrpt::math::TSegment3D::getCenter ( TPoint3D p  )  const [inline]

Segment's central point.

Definition at line 584 of file lightweight_geom_data.h.

References mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

double mrpt::math::TSegment3D::length (  )  const

Segment length.

const TPoint3D& mrpt::math::TSegment3D::operator[] ( size_t  i  )  const [inline]

Unsafe point access using [] operator, intended for loops.

Definition at line 572 of file lightweight_geom_data.h.

TPoint3D& mrpt::math::TSegment3D::operator[] ( size_t  i  )  [inline]

Unsafe point access using [] operator, intended for loops.

Definition at line 566 of file lightweight_geom_data.h.


Member Data Documentation




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