polyLine Class Reference

A series of straight line segments, which can also be interpreted as a series of control points for splines, etc. More...

Inheritance diagram for polyLine:
[legend]
Collaboration diagram for polyLine:
[legend]

Public Member Functions

 polyLine (const pointField &points, const bool notImplementedClosed=false)
 Construct from components. More...
 
 polyLine (const point &start, const pointField &intermediate, const point &end, const bool notImplementedClosed=false)
 Construct from begin, intermediate, end points. More...
 
const pointFieldpoints () const noexcept
 Return const-access to the control-points. More...
 
label nSegments () const noexcept
 The number of line segments. More...
 
point position (const scalar) const
 The point position corresponding to the curve parameter. More...
 
point position (const label segment, const scalar) const
 The point position corresponding to the local parameter. More...
 
scalar length () const noexcept
 The length of the curve. More...
 

Static Public Member Functions

static tmp< pointFieldconcat (const point &start, const pointField &intermediate, const point &end)
 Concatenate begin, intermediate and end points. More...
 

Protected Member Functions

void calcParam ()
 
label localParameter (scalar &lambda) const
 

Protected Attributes

pointField points_
 The control points or ends of each segments. More...
 
scalar lineLength_
 The real (total) line length. More...
 
scalarList param_
 The rational (0-1) cumulative parameter value for each point. More...
 

Detailed Description

A series of straight line segments, which can also be interpreted as a series of control points for splines, etc.

A future implementation could also handle a closed polyLine.

Source files

Definition at line 55 of file polyLine.H.

Constructor & Destructor Documentation

◆ polyLine() [1/2]

polyLine ( const pointField points,
const bool  notImplementedClosed = false 
)
explicit

Construct from components.

Parameters
pointsThe poly-line points

Definition at line 84 of file polyLine.C.

References polyLine::calcParam().

Here is the call graph for this function:

◆ polyLine() [2/2]

polyLine ( const point start,
const pointField intermediate,
const point end,
const bool  notImplementedClosed = false 
)

Construct from begin, intermediate, end points.

Parameters
startThe start point
intermediateThe intermediate points
endThe end point

Definition at line 95 of file polyLine.C.

Member Function Documentation

◆ calcParam()

void calcParam ( )
protected

Precalculate the rational cumulative parameter value and the line-length

Definition at line 57 of file polyLine.C.

References polyLine::lineLength_, Foam::mag(), polyLine::param_, polyLine::points_, and List< T >::resize().

Referenced by polyLine::polyLine().

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

◆ localParameter()

Foam::label localParameter ( scalar &  lambda) const
protected

Return the line segment and the local parameter [0..1] corresponding to the global lambda [0..1]

Definition at line 124 of file polyLine.C.

References lambda().

Referenced by BSpline::position().

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

◆ concat()

Foam::tmp< Foam::pointField > concat ( const point start,
const pointField intermediate,
const point end 
)
static

Concatenate begin, intermediate and end points.

Parameters
startThe start point
intermediateThe intermediate points
endThe end point

Definition at line 35 of file polyLine.C.

References Foam::New(), and p0.

Referenced by blockEdge::appendEndPoints().

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

◆ points()

const Foam::pointField & points ( ) const
noexcept

Return const-access to the control-points.

Definition at line 112 of file polyLine.C.

Referenced by BSpline::position().

Here is the caller graph for this function:

◆ nSegments()

Foam::label nSegments ( ) const
noexcept

The number of line segments.

Definition at line 118 of file polyLine.C.

◆ position() [1/2]

Foam::point position ( const scalar  mu) const

The point position corresponding to the curve parameter.

0 <= lambda <= 1

Definition at line 158 of file polyLine.C.

References lambda(), and Foam::constant::physicoChemical::mu.

Referenced by polyLineEdge::position().

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

◆ position() [2/2]

Foam::point position ( const label  segment,
const scalar  mu 
) const

The point position corresponding to the local parameter.

0 <= lambda <= 1 on the given segment

Definition at line 177 of file polyLine.C.

References Foam::constant::physicoChemical::mu, and p0.

◆ length()

Foam::scalar length ( ) const
noexcept

The length of the curve.

Definition at line 210 of file polyLine.C.

Member Data Documentation

◆ points_

pointField points_
protected

The control points or ends of each segments.

Definition at line 62 of file polyLine.H.

Referenced by polyLine::calcParam().

◆ lineLength_

scalar lineLength_
protected

The real (total) line length.

Definition at line 65 of file polyLine.H.

Referenced by polyLine::calcParam(), and polyLineEdge::length().

◆ param_

scalarList param_
protected

The rational (0-1) cumulative parameter value for each point.

Definition at line 68 of file polyLine.H.

Referenced by polyLine::calcParam().


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