Loading...
Searching...
No Matches
polyLine Class Reference

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

#include <polyLine.H>

Inheritance diagram for polyLine:
Collaboration diagram for polyLine:

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

void calcParam ()
 Precalculate the rational cumulative parameter value and the line-length.
label localParameter (scalar &lambda) const
 Return the line segment and the local parameter [0..1] corresponding to the global lambda [0..1].

Protected Attributes

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

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 51 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 77 of file polyLine.C.

References calcParam(), lineLength_, p, param_, and points_.

Referenced by BSpline::BSpline(), BSplineEdge::BSplineEdge(), BSplineEdge::BSplineEdge(), CatmullRomSpline::CatmullRomSpline(), polyLine(), polyLineEdge::polyLineEdge(), polyLineEdge::polyLineEdge(), splineEdge::splineEdge(), and splineEdge::splineEdge().

Here is the call graph for this function:
Here is the caller 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 87 of file polyLine.C.

References calcParam(), concat(), lineLength_, param_, points_, and polyLine().

Here is the call graph for this function:

Member Function Documentation

◆ calcParam()

void calcParam ( )
protected

Precalculate the rational cumulative parameter value and the line-length.

Definition at line 50 of file polyLine.C.

References lineLength_, Foam::mag(), param_, and points_.

Referenced by polyLine(), and 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 117 of file polyLine.C.

References lambda(), nSegments(), and param_.

Referenced by BSpline::position(), CatmullRomSpline::position(), and 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 27 of file polyLine.C.

References UList< T >::first(), tmp< T >::New(), p0, and UList< T >::size().

Referenced by blockEdge::appendEndPoints(), BSplineEdge::BSplineEdge(), BSplineEdge::BSplineEdge(), polyLine(), splineEdge::splineEdge(), and splineEdge::splineEdge().

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

◆ points()

◆ nSegments()

Foam::label nSegments ( ) const
noexcept

The number of line segments.

Definition at line 111 of file polyLine.C.

References Foam::noexcept, and points_.

Referenced by CatmullRomSpline::length(), localParameter(), BSpline::position(), CatmullRomSpline::position(), and position().

Here is the caller graph for this function:

◆ position() [1/2]

Foam::point position ( const scalar mu) const

The point position corresponding to the curve parameter.

0 <= lambda <= 1

Definition at line 151 of file polyLine.C.

References lambda(), localParameter(), mu, points_, and position().

Referenced by polyLineEdge::position(), and 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 169 of file polyLine.C.

References mu, nSegments(), p0, and points_.

Here is the call graph for this function:

◆ length()

Foam::scalar length ( ) const
noexcept

The length of the curve.

Definition at line 203 of file polyLine.C.

References lineLength_, and Foam::noexcept.

Member Data Documentation

◆ points_

pointField points_
protected

The control points or ends of each segments.

Definition at line 60 of file polyLine.H.

Referenced by calcParam(), nSegments(), points(), polyLine(), polyLine(), position(), and position().

◆ lineLength_

scalar lineLength_
protected

The real (total) line length.

Definition at line 65 of file polyLine.H.

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

◆ param_

scalarList param_
protected

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

Definition at line 70 of file polyLine.H.

Referenced by calcParam(), localParameter(), polyLine(), and polyLine().


The documentation for this class was generated from the following files:
  • src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.H
  • src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.C