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

Detailed Description

3D segment, consisting of two points.

See also
TSegment2D,TLine3D,TPlane,TPolygon3D,TPoint3D

Definition at line 628 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

double length () const
 Segment length.
 
double distance (const TPoint3D &point) const
 Distance to point.
 
double distance (const TSegment3D &segment) const
 Distance to another segment.
 
bool contains (const TPoint3D &point) const
 Check whether a point is inside the segment.
 
TPoint3Doperator[] (size_t i)
 Access to points using operator[0-1].
 
const TPoint3Doperator[] (size_t i) const
 Access to points using operator[0-1].
 
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.
 
bool operator< (const TSegment3D &s) const
 

Public Attributes

TPoint3D point1
 Origin point.
 
TPoint3D point2
 Destiny point.
 

Constructor & Destructor Documentation

◆ TSegment3D() [1/3]

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

Constructor from both points.

Definition at line 675 of file lightweight_geom_data.h.

◆ TSegment3D() [2/3]

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

Fast default constructor.

Initializes to garbage.

Definition at line 679 of file lightweight_geom_data.h.

◆ TSegment3D() [3/3]

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

Constructor from 2D object.

Sets the z to zero.

Definition at line 683 of file lightweight_geom_data.h.

Member Function Documentation

◆ contains()

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

Check whether a point is inside the segment.

◆ distance() [1/2]

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

Distance to point.

◆ distance() [2/2]

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

Distance to another segment.

◆ generate2DObject()

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

Projection into 2D space, discarding the z.

Definition at line 661 of file lightweight_geom_data.h.

◆ getCenter()

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

Segment's central point.

Definition at line 667 of file lightweight_geom_data.h.

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

◆ length()

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

Segment length.

◆ operator<()

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

◆ operator[]() [1/2]

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

Access to points using operator[0-1].

Definition at line 655 of file lightweight_geom_data.h.

◆ operator[]() [2/2]

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

Access to points using operator[0-1].

Definition at line 657 of file lightweight_geom_data.h.

Member Data Documentation

◆ point1

TPoint3D mrpt::math::TSegment3D::point1

◆ point2

TPoint3D mrpt::math::TSegment3D::point2



Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 14:10:35 UTC 2023