Radium Engine  1.5.20
Loading...
Searching...
No Matches
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.

Constructor & Destructor Documentation

◆ PolyLine()

Ra::Core::Geometry::PolyLine::PolyLine ( const Vector3Array & pt)
explicit

Create a polyline from a given set of points.

Definition at line 21 of file PolyLine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ aabb()

Aabb Ra::Core::Geometry::PolyLine::aabb ( ) const
inline

Get the aabb of the polyline.

Definition at line 89 of file PolyLine.hpp.

+ Here is the call graph for this function:

◆ distance()

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

Return the distance between the line and a given point p.

Definition at line 39 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ 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:

◆ getNearestSegment()

uint Ra::Core::Geometry::PolyLine::getNearestSegment ( const Vector3 & p) const

Returns the index of the nearest segment.

Definition at line 109 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ getPoints()

const Vector3Array & Ra::Core::Geometry::PolyLine::getPoints ( ) const
inline

Get the point vector.

Definition at line 81 of file PolyLine.hpp.

◆ getSegment()

void Ra::Core::Geometry::PolyLine::getSegment ( uint segment,
Vector3 & aOut,
Vector3 & abOut ) const
inline

Get the ith segment AB as starting point A and vector AB.

Definition at line 104 of file PolyLine.hpp.

◆ getSegmentIndex()

uint Ra::Core::Geometry::PolyLine::getSegmentIndex ( Scalar t) const
inline

Returns the index of the segment to which t belons.

Definition at line 114 of file PolyLine.hpp.

+ Here is the call graph for this function:

◆ getSegmentVectors()

const Vector3Array & Ra::Core::Geometry::PolyLine::getSegmentVectors ( ) const
inline

Get the segment vector ( Pi+1 - Pi)

Definition at line 110 of file PolyLine.hpp.

◆ length()

Scalar Ra::Core::Geometry::PolyLine::length ( ) const
inline

Get the total length of the line .

Definition at line 85 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:

◆ setPoints()

void Ra::Core::Geometry::PolyLine::setPoints ( const Vector3Array & pt)

Update the points of the polyline.

Definition at line 25 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ squaredDistance()

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

Return the squared distance between the line and a given point p.

Definition at line 30 of file PolyLine.cpp.

+ Here is the call graph for this function:

◆ update()

void Ra::Core::Geometry::PolyLine::update ( )
protected

Update the precomputed values after new points have been set.

Definition at line 7 of file PolyLine.cpp.

+ Here is the call graph for this function:

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