Main MRPT website > C++ reference for MRPT 1.5.7
List of all members | Public Member Functions | Public Attributes

Detailed Description

3D segment, consisting of two points.

See also

Definition at line 655 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

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

Public Attributes

TPoint3D point1
 Origin point. More...
TPoint3D point2
 Destiny point. More...

Constructor & Destructor Documentation

mrpt::math::TSegment3D::TSegment3D ( const TPoint3D p1,
const TPoint3D p2 

Constructor from both points.

Definition at line 702 of file lightweight_geom_data.h.

mrpt::math::TSegment3D::TSegment3D ( )

Fast default constructor.

Initializes to garbage.

Definition at line 706 of file lightweight_geom_data.h.

mrpt::math::TSegment3D::TSegment3D ( const TSegment2D s)

Constructor from 2D object.

Sets the z to zero.

Definition at line 710 of file lightweight_geom_data.h.

References mrpt::poses::operator<().

Member Function Documentation

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

Check whether a point is inside the segment.

Definition at line 393 of file lightweight_geom_data.cpp.

References mrpt::math::distance(), and mrpt::math::geometryEpsilon.

Referenced by mrpt::math::intersect().

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

Distance to point.

Definition at line 318 of file lightweight_geom_data.cpp.

References mrpt::math::distance(), min, and mrpt::math::TLine3D.

double mrpt::math::TSegment3D::distance ( const TSegment3D segment) const

Distance to another segment.

Definition at line 321 of file lightweight_geom_data.cpp.

References mrpt::math::TPoint3D::getAsVector(), point1, and point2.

void mrpt::math::TSegment3D::generate2DObject ( TSegment2D s) const

Projection into 2D space, discarding the z.

Definition at line 688 of file lightweight_geom_data.h.

void mrpt::math::TSegment3D::getCenter ( TPoint3D p) const

Segment's central point.

Definition at line 694 of file lightweight_geom_data.h.

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

Referenced by mrpt::math::getSegmentBisector().

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

Segment length.

Definition at line 315 of file lightweight_geom_data.cpp.

References mrpt::math::distance().

bool mrpt::math::TSegment3D::operator< ( const TSegment3D s) const

Definition at line 398 of file lightweight_geom_data.cpp.

References point1, and point2.

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

Access to points using operator[0-1].

Definition at line 682 of file lightweight_geom_data.h.

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

Access to points using operator[0-1].

Definition at line 684 of file lightweight_geom_data.h.

Member Data Documentation

TPoint3D mrpt::math::TSegment3D::point1
TPoint3D mrpt::math::TSegment3D::point2

Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at miƩ may 16 12:40:16 CEST 2018