Ponca  eb7239a9c07e156fb1edc6faac7fe89e2b256bda
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::Line< DataPoint, _NFilter, T > Class Template Reference

A parametrized line is defined by an origin point \(\mathbf{o}\) and a unit direction vector \(\overrightarrow{\mathbf{d}}\) such that the line corresponds to the set \(l(t)=\mathbf{o}+t\overrightarrow{\mathbf{d}}, t\in \mathbb{R}\). More...

#include <linePrimitive.h>

Inheritance diagram for Ponca::Line< DataPoint, _NFilter, T >:
Collaboration diagram for Ponca::Line< DataPoint, _NFilter, T >:

Public Types

using Scalar = typename DataPoint::Scalar
 Alias to scalar type.
using VectorType = typename Base::VectorType
 Alias to vector type.
using NeighborFilter = typename Base::NeighborFilter
 Alias to the filter applied on the neighbors.
using EigenBase = Eigen::ParametrizedLine<typename DataPoint::Scalar, DataPoint::Dim>
 Specialization of Eigen::ParametrizedLine inherited by Ponca::Line.

Public Member Functions

Line< DataPoint, _NFilter, T > & line ()
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
const Line< DataPoint, _NFilter, T > & line () const
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
Line< DataPoint, _NFilter, T > & implicitPrimitive ()
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
const Line< DataPoint, _NFilter, T > & implicitPrimitive () const
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
Line< DataPoint, _NFilter, T > & projectionOperator ()
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
const Line< DataPoint, _NFilter, T > & projectionOperator () const
 Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
void init ()
 Set the scalar field values to 0 and reset the distance() and origin() status.
bool isValid () const
 Tell if the line as been correctly set. Used to set CONFLICT_ERROR_FOUND during fitting.
bool operator== (const Line< DataPoint, NeighborFilter, T > &other) const
 Comparison operator.
bool operator!= (const Line< DataPoint, NeighborFilter, T > &other) const
 Comparison operator, convenience function.
void setLine (const VectorType &origin, const VectorType &direction)
 Init the line from a direction and a position.
void changeBasis (const VectorType &newbasis)
 Express the line relatively to a new basis.
Scalar potential () const
 Value of the scalar field at the evaluation point.
Scalar potential (const VectorType &_q) const
 Value of the scalar field at the location \( \mathbf{q} \), defined as the squared distance between \( \mathbf{q} \) and the line.
VectorType project (const VectorType &_q) const
 Project a point on the line.
VectorType primitiveGradient (const VectorType &_q) const
 Approximation of the scalar field gradient at \( \mathbf{q}\).
const VectorType & primitiveGradient () const
 Gradient of the scalar field at the line location.

Protected Types

using Base = T
 Base class of the procedure.

Protected Member Functions

Scalar potentialLocal (const VectorType &_lq) const
 Value of the scalar field at the evaluation point.
VectorType primitiveGradientLocal (const VectorType &_lq) const

Detailed Description

template<class DataPoint, class _NFilter, typename T>
requires ProvidesBasketUnitBase<T>
class Ponca::Line< DataPoint, _NFilter, T >

A parametrized line is defined by an origin point \(\mathbf{o}\) and a unit direction vector \(\overrightarrow{\mathbf{d}}\) such that the line corresponds to the set \(l(t)=\mathbf{o}+t\overrightarrow{\mathbf{d}}, t\in \mathbb{R}\).

This class inherits Eigen::ParametrizedLine.

This primitive requires the definition of n-d vectors (VectorType) in Concept::PointConcept.

This primitive respects:

ProvidesLines 

Definition at line 35 of file linePrimitive.h.

Member Typedef Documentation

◆ Base

template<class DataPoint, class _NFilter, typename T>
using Ponca::Line< DataPoint, _NFilter, T >::Base = T
protected

Base class of the procedure.

Definition at line 37 of file linePrimitive.h.

◆ EigenBase

template<class DataPoint, class _NFilter, typename T>
using Ponca::Line< DataPoint, _NFilter, T >::EigenBase = Eigen::ParametrizedLine<typename DataPoint::Scalar, DataPoint::Dim>

Specialization of Eigen::ParametrizedLine inherited by Ponca::Line.

Definition at line 41 of file linePrimitive.h.

◆ NeighborFilter

template<class DataPoint, class _NFilter, typename T>
using Ponca::Line< DataPoint, _NFilter, T >::NeighborFilter = typename Base::NeighborFilter

Alias to the filter applied on the neighbors.

Definition at line 37 of file linePrimitive.h.

◆ Scalar

template<class DataPoint, class _NFilter, typename T>
using Ponca::Line< DataPoint, _NFilter, T >::Scalar = typename DataPoint::Scalar

Alias to scalar type.

Definition at line 37 of file linePrimitive.h.

◆ VectorType

template<class DataPoint, class _NFilter, typename T>
using Ponca::Line< DataPoint, _NFilter, T >::VectorType = typename Base::VectorType

Alias to vector type.

Definition at line 37 of file linePrimitive.h.

Member Function Documentation

◆ changeBasis()

template<class DataPoint, class _NFilter, typename T>
void Ponca::Line< DataPoint, _NFilter, T >::changeBasis ( const VectorType & newbasis)
inline

Express the line relatively to a new basis.

Definition at line 92 of file linePrimitive.h.

◆ implicitPrimitive() [1/2]

template<class DataPoint, class _NFilter, typename T>
Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::implicitPrimitive ( )
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 45 of file linePrimitive.h.

◆ implicitPrimitive() [2/2]

template<class DataPoint, class _NFilter, typename T>
const Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::implicitPrimitive ( ) const
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 45 of file linePrimitive.h.

◆ init()

template<class DataPoint, class _NFilter, typename T>
void Ponca::Line< DataPoint, _NFilter, T >::init ( )
inline

Set the scalar field values to 0 and reset the distance() and origin() status.

Definition at line 51 of file linePrimitive.h.

◆ isValid()

template<class DataPoint, class _NFilter, typename T>
bool Ponca::Line< DataPoint, _NFilter, T >::isValid ( ) const
inlinenodiscard

Tell if the line as been correctly set. Used to set CONFLICT_ERROR_FOUND during fitting.

Returns
false when called straight after init. Should be true after fitting

Definition at line 61 of file linePrimitive.h.

◆ line() [1/2]

template<class DataPoint, class _NFilter, typename T>
Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::line ( )
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 44 of file linePrimitive.h.

◆ line() [2/2]

template<class DataPoint, class _NFilter, typename T>
const Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::line ( ) const
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 44 of file linePrimitive.h.

◆ operator!=()

template<class DataPoint, class _NFilter, typename T>
bool Ponca::Line< DataPoint, _NFilter, T >::operator!= ( const Line< DataPoint, NeighborFilter, T > & other) const
inline

Comparison operator, convenience function.

Definition at line 74 of file linePrimitive.h.

◆ operator==()

template<class DataPoint, class _NFilter, typename T>
bool Ponca::Line< DataPoint, _NFilter, T >::operator== ( const Line< DataPoint, NeighborFilter, T > & other) const
inline

Comparison operator.

Definition at line 68 of file linePrimitive.h.

◆ potential() [1/2]

template<class DataPoint, class _NFilter, typename T>
Scalar Ponca::Line< DataPoint, _NFilter, T >::potential ( ) const
inlinenodiscard

Value of the scalar field at the evaluation point.

See also
method #isSigned of the fit to check if the sign is reliable

Definition at line 102 of file linePrimitive.h.

◆ potential() [2/2]

template<class DataPoint, class _NFilter, typename T>
Scalar Ponca::Line< DataPoint, _NFilter, T >::potential ( const VectorType & _q) const
inlinenodiscard

Value of the scalar field at the location \( \mathbf{q} \), defined as the squared distance between \( \mathbf{q} \) and the line.

See also
method #isSigned of the fit to check if the sign is reliable

Definition at line 112 of file linePrimitive.h.

◆ potentialLocal()

template<class DataPoint, class _NFilter, typename T>
Scalar Ponca::Line< DataPoint, _NFilter, T >::potentialLocal ( const VectorType & _lq) const
inlinenodiscardprotected

Value of the scalar field at the evaluation point.

See also
method #isSigned of the fit to check if the sign is reliable

Definition at line 142 of file linePrimitive.h.

◆ primitiveGradient() [1/2]

template<class DataPoint, class _NFilter, typename T>
const VectorType & Ponca::Line< DataPoint, _NFilter, T >::primitiveGradient ( ) const
inlinenodiscard

Gradient of the scalar field at the line location.

As it is undefined, we set it to 0.

Definition at line 138 of file linePrimitive.h.

◆ primitiveGradient() [2/2]

template<class DataPoint, class _NFilter, typename T>
VectorType Ponca::Line< DataPoint, _NFilter, T >::primitiveGradient ( const VectorType & _q) const
inlinenodiscard

Approximation of the scalar field gradient at \( \mathbf{q}\).

Warning
The gradient norm is equal to the distance to the line

Definition at line 130 of file linePrimitive.h.

◆ primitiveGradientLocal()

template<class DataPoint, class _NFilter, typename T>
VectorType Ponca::Line< DataPoint, _NFilter, T >::primitiveGradientLocal ( const VectorType & _lq) const
inlinenodiscardprotected

Definition at line 148 of file linePrimitive.h.

◆ project()

template<class DataPoint, class _NFilter, typename T>
VectorType Ponca::Line< DataPoint, _NFilter, T >::project ( const VectorType & _q) const
inlinenodiscard

Project a point on the line.

Definition at line 121 of file linePrimitive.h.

◆ projectionOperator() [1/2]

template<class DataPoint, class _NFilter, typename T>
Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::projectionOperator ( )
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 46 of file linePrimitive.h.

◆ projectionOperator() [2/2]

template<class DataPoint, class _NFilter, typename T>
const Line< DataPoint, _NFilter, T > & Ponca::Line< DataPoint, _NFilter, T >::projectionOperator ( ) const
inline

Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.

Definition at line 46 of file linePrimitive.h.

◆ setLine()

template<class DataPoint, class _NFilter, typename T>
void Ponca::Line< DataPoint, _NFilter, T >::setLine ( const VectorType & origin,
const VectorType & direction )
inline

Init the line from a direction and a position.

Parameters
directionOrientation of the line, does not need to be normalized
originPosition of the line

Definition at line 83 of file linePrimitive.h.