MRPT  1.9.9
mrpt::math::TSegment3D Struct Reference

Detailed Description

3D segment, consisting of two points.

See also
TSegment2D,TLine3D,TPlane,TPolygon3D,TPoint3D

Definition at line 21 of file TSegment3D.h.

#include <mrpt/math/TSegment3D.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 ()=default
 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

◆ TSegment3D() [1/3]

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

Constructor from both points.

Definition at line 90 of file TSegment3D.h.

◆ TSegment3D() [2/3]

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

Fast default constructor.

Initializes to garbage.

◆ TSegment3D() [3/3]

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

Constructor from 2D object.

Sets the z to zero.

Definition at line 100 of file TSegment3D.h.

Member Function Documentation

◆ contains()

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

Check whether a point is inside the segment.

Definition at line 709 of file TPoseOrPoint.cpp.

References mrpt::math::distance(), mrpt::math::getEpsilon(), point1, and point2.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distance() [1/2]

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

Distance to point.

Definition at line 623 of file TPoseOrPoint.cpp.

References mrpt::math::TLine3D::distance(), mrpt::math::distance(), point1, and point2.

Here is the call graph for this function:

◆ distance() [2/2]

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

Distance to another segment.

Definition at line 629 of file TPoseOrPoint.cpp.

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

Here is the call graph for this function:

◆ generate2DObject()

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

Projection into 2D space, discarding the z.

Definition at line 617 of file TPoseOrPoint.cpp.

◆ getCenter()

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

Segment's central point.

Definition at line 81 of file TSegment3D.h.

References point1, point2, mrpt::math::TPoint3D_data::x, mrpt::math::TPoint3D_data::y, and mrpt::math::TPoint3D_data::z.

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

Here is the caller graph for this function:

◆ length()

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

Segment length.

Definition at line 622 of file TPoseOrPoint.cpp.

References mrpt::math::distance(), point1, and point2.

Here is the call graph for this function:

◆ operator<()

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

Definition at line 716 of file TPoseOrPoint.cpp.

References point1, and point2.

◆ operator[]() [1/2]

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

Access to points using operator[0-1].

Definition at line 49 of file TSegment3D.h.

References point1, and point2.

◆ operator[]() [2/2]

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

Access to points using operator[0-1].

Definition at line 62 of file TSegment3D.h.

References point1, and point2.

Member Data Documentation

◆ point1

◆ point2




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: abb8b1a1e Fri Oct 18 14:19:12 2019 +0200 at vie oct 18 14:20:13 CEST 2019