Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::Line< DataPoint, _WFunctor, 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, _WFunctor, T >:
+ Collaboration diagram for Ponca::Line< DataPoint, _WFunctor, T >:

Public Types

using Scalar = typename DataPoint::Scalar
 Alias to scalar type.
 
using VectorType = typename Base::VectorType
 Alias to vector type.
 
using WFunctor = typename Base::WFunctor
 Alias to weight function.
 
using EigenBase = Eigen::ParametrizedLine< typename DataPoint::Scalar, DataPoint::Dim >
 Specialization of Eigen::ParametrizedLine inherited by Ponca::Line.
 

Public Member Functions

Line< DataPoint, _WFunctor, T > & line ()
 Explicit conversion to Line , to access methods potentially hidden by heritage.
 
const Line< DataPoint, _WFunctor, T > & line () const
 Explicit conversion to Line , to access methods potentially hidden by heritage.
 
void init (const VectorType &_basisCenter=VectorType::Zero())
 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, WFunctor, T > &other) const
 Comparison operator.
 
bool operator!= (const Line< DataPoint, WFunctor, T > &other) const
 Comparison operator, convenience function.
 
void setLine (const VectorType &origin, const VectorType &direction)
 Init the line from a direction and a position.
 
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.
 

Protected Types

enum  { check = Base::PROVIDES_PRIMITIVE_BASE , PROVIDES_LINE }
 
using Base = T
 Base class of the procedure.
 

Detailed Description

template<class DataPoint, class _WFunctor, typename T>
class Ponca::Line< DataPoint, _WFunctor, 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-dimensionnal vectors (VectorType) in Concept::PointConcept.

This primitive provides:

PROVIDES_LINE 

Definition at line 34 of file linePrimitive.h.

Member Typedef Documentation

◆ Base

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

Base class of the procedure.

Definition at line 37 of file linePrimitive.h.

◆ EigenBase

template<class DataPoint , class _WFunctor , typename T >
using Ponca::Line< DataPoint, _WFunctor, 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.

◆ Scalar

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

Alias to scalar type.

Definition at line 37 of file linePrimitive.h.

◆ VectorType

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

Alias to vector type.

Definition at line 37 of file linePrimitive.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , typename T >
using Ponca::Line< DataPoint, _WFunctor, T >::WFunctor = typename Base::WFunctor

Alias to weight function.

Definition at line 37 of file linePrimitive.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _WFunctor , typename T >
anonymous enum
protected
Enumerator
check 

Requires PrimitiveBase.

PROVIDES_LINE 

Provides Line.

Definition at line 45 of file linePrimitive.h.

Member Function Documentation

◆ init()

template<class DataPoint , class _WFunctor , typename T >
void Ponca::Line< DataPoint, _WFunctor, T >::init ( const VectorType _basisCenter = VectorType::Zero())
inline

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

Definition at line 57 of file linePrimitive.h.

◆ isValid()

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

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 67 of file linePrimitive.h.

◆ line() [1/2]

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

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

Definition at line 52 of file linePrimitive.h.

◆ line() [2/2]

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

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

Definition at line 52 of file linePrimitive.h.

◆ operator!=()

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

Comparison operator, convenience function.

Definition at line 78 of file linePrimitive.h.

◆ operator==()

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

Comparison operator.

Definition at line 73 of file linePrimitive.h.

◆ potential() [1/2]

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

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 95 of file linePrimitive.h.

◆ potential() [2/2]

template<class DataPoint , class _WFunctor , typename T >
Scalar Ponca::Line< DataPoint, _WFunctor, T >::potential ( const VectorType _q) const
inline

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 105 of file linePrimitive.h.

◆ project()

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::Line< DataPoint, _WFunctor, T >::project ( const VectorType _q) const
inline

Project a point on the line.

Definition at line 112 of file linePrimitive.h.

◆ setLine()

template<class DataPoint , class _WFunctor , typename T >
void Ponca::Line< DataPoint, _WFunctor, 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 86 of file linePrimitive.h.