Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Ra::Core::Geometry::PolyLine Class Reference

#include <Core/Geometry/PolyLine.hpp>

+ Collaboration diagram for Ra::Core::Geometry::PolyLine:

Public Member Functions

 PolyLine (const Vector3Array &pt)
 Create a polyline from a given set of points.
 
const Vector3Array & getPoints () const
 Get the point vector.
 
void getSegment (uint segment, Vector3 &aOut, Vector3 &abOut) const
 Get the ith segment AB as starting point A and vector AB.
 
const Vector3Array & getSegmentVectors () const
 Get the segment vector ( Pi+1 - Pi)
 
Aabb aabb () const
 Get the aabb of the polyline.
 
Scalar length () const
 Get the total length of the line .
 
void setPoints (const Vector3Array &pt)
 Update the points of the polyline.
 
Scalar squaredDistance (const Vector3 &p) const
 Return the squared distance between the line and a given point p.
 
Scalar distance (const Vector3 &p) const
 Return the distance between the line and a given point p.
 
Scalar projectOnSegment (const Vector3 &p, uint segment) const
 
uint getNearestSegment (const Vector3 &p) const
 Returns the index of the nearest segment.
 
uint getSegmentIndex (Scalar t) const
 Returns the index of the segment to which t belons.
 
Scalar project (const Vector3 &p) const
 
Vector3 f (Scalar t) const
 

Protected Member Functions

void update ()
 Update the precomputed values after new points have been set.
 
Scalar getLineParameter (uint segment, Scalar tSegment) const
 

Detailed Description

A parametrized polyline, i.e. a continuous polygonal chain of segments. Points go from P0 to Pn. The ith segments joins Pi and Pi+1.

Definition at line 14 of file PolyLine.hpp.

Member Function Documentation

◆ f()

Vector3 Ra::Core::Geometry::PolyLine::f ( Scalar  t) const

Return a point on the line corresponding to parameter t in [0;1]. Values of t below 0 map to the first point, and values above 1 to the last.

Definition at line 91 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ getLineParameter()

Scalar Ra::Core::Geometry::PolyLine::getLineParameter ( uint  segment,
Scalar  tSegment 
) const
inlineprotected

Given a point on one of the segments identified by parameter tSegment in [0,1] and segment number, return the t in [0,1] corresponding to the same point in the whole line parametrization.

Definition at line 97 of file PolyLine.hpp.

+ Here is the call graph for this function:

◆ project()

Scalar Ra::Core::Geometry::PolyLine::project ( const Vector3 &  p) const

Returns the parameter t in [0,1] corresponding to the point on the line which is the closest point from p.

Definition at line 49 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ projectOnSegment()

Scalar Ra::Core::Geometry::PolyLine::projectOnSegment ( const Vector3 &  p,
uint  segment 
) const

Returns the parameter t in [0,1] corresponding to the point on the ith segment closest from point p.

Definition at line 43 of file PolyLine.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: