Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
pcl::PointRepresentation< T > Class Template Referenceabstract

PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensional vector. More...

#include <pcl/point_representation.h>

+ Inheritance diagram for pcl::PointRepresentation< T >:

Public Types

using Ptr = shared_ptr<PointRepresentation<PointT> >
 
using ConstPtr = shared_ptr<const PointRepresentation<PointT> >
 

Public Member Functions

virtual ~PointRepresentation ()=default
 Empty destructor.
 
virtual void copyToFloatArray (const PointT &p, float *out) const =0
 Copy point data from input point to a float array.
 
bool isTrivial () const
 Returns whether this point representation is trivial.
 
virtual bool isValid (const PointT &p) const
 Verify that the input point is valid.
 
template<typename OutputType >
void vectorize (const PointT &p, OutputType &out) const
 Convert input point into a vector representation, rescaling by alpha.
 
void setRescaleValues (const float *rescale_array)
 Set the rescale values to use when vectorizing points.
 
int getNumberOfDimensions () const
 Return the number of dimensions in the point's vector representation.
 

Protected Attributes

int nr_dimensions_ = 0
 The number of dimensions in this point's vector (i.e.
 
std::vector< float > alpha_
 A vector containing the rescale factor to apply to each dimension.
 
bool trivial_ = false
 Indicates whether this point representation is trivial.
 

Detailed Description

template<typename T>
class pcl::PointRepresentation< T >

PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensional vector.

Note
This is an abstract class. Subclasses must set nr_dimensions_ to the appropriate value in the constructor and provide an implementation of the pure virtual copyToFloatArray method.
Author
Michael Dixon

Definition at line 48 of file kdtree.h.

Member Typedef Documentation

◆ ConstPtr

template<typename T >
using pcl::PointRepresentation< T >::ConstPtr = shared_ptr<const PointRepresentation<PointT> >

Definition at line 79 of file point_representation.h.

◆ Ptr

template<typename T >
using pcl::PointRepresentation< T >::Ptr = shared_ptr<PointRepresentation<PointT> >

Definition at line 78 of file point_representation.h.

Constructor & Destructor Documentation

◆ ~PointRepresentation()

template<typename T >
virtual pcl::PointRepresentation< T >::~PointRepresentation ( )
virtualdefault

Empty destructor.

Member Function Documentation

◆ copyToFloatArray()

template<typename T >
virtual void pcl::PointRepresentation< T >::copyToFloatArray ( const PointT & p,
float * out ) const
pure virtual

Copy point data from input point to a float array.

This method must be overridden in all subclasses.

Parameters
[in]pThe input point
[out]outA pointer to a float array.

Referenced by pcl::PointRepresentation< T >::isValid(), and pcl::PointRepresentation< T >::vectorize().

◆ getNumberOfDimensions()

template<typename T >
int pcl::PointRepresentation< T >::getNumberOfDimensions ( ) const
inline

Return the number of dimensions in the point's vector representation.

Definition at line 172 of file point_representation.h.

References pcl::PointRepresentation< T >::nr_dimensions_.

◆ isTrivial()

template<typename T >
bool pcl::PointRepresentation< T >::isTrivial ( ) const
inline

Returns whether this point representation is trivial.

It is trivial if and only if the following conditions hold:

  • the relevant data consists only of float values
  • the vectorize operation directly copies the first nr_dimensions_ elements of PointT to the out array
  • sizeof(PointT) is a multiple of sizeof(float) In short, a trivial point representation converts the input point to a float array that is the same as if the point was reinterpret_casted to a float array of length nr_dimensions_ .

Definition at line 98 of file point_representation.h.

References pcl::PointRepresentation< T >::alpha_, and pcl::PointRepresentation< T >::trivial_.

◆ isValid()

template<typename T >
virtual bool pcl::PointRepresentation< T >::isValid ( const PointT & p) const
inlinevirtual

Verify that the input point is valid.

Parameters
pThe point to validate

Definition at line 104 of file point_representation.h.

References pcl::PointRepresentation< T >::copyToFloatArray(), pcl::PointRepresentation< T >::nr_dimensions_, and pcl::PointRepresentation< T >::trivial_.

◆ setRescaleValues()

template<typename T >
void pcl::PointRepresentation< T >::setRescaleValues ( const float * rescale_array)
inline

Set the rescale values to use when vectorizing points.

Parameters
[in]rescale_arrayThe array/vector of rescale values. Can be of any type that implements the [] operator.

Definition at line 165 of file point_representation.h.

References pcl::PointRepresentation< T >::alpha_, and pcl::PointRepresentation< T >::nr_dimensions_.

◆ vectorize()

template<typename T >
template<typename OutputType >
void pcl::PointRepresentation< T >::vectorize ( const PointT & p,
OutputType & out ) const
inline

Convert input point into a vector representation, rescaling by alpha.

Parameters
[in]pthe input point
[out]outThe output vector. Can be of any type that implements the [] operator.

Definition at line 144 of file point_representation.h.

References pcl::PointRepresentation< T >::alpha_, pcl::PointRepresentation< T >::copyToFloatArray(), and pcl::PointRepresentation< T >::nr_dimensions_.

Member Data Documentation

◆ alpha_

template<typename T >
std::vector<float> pcl::PointRepresentation< T >::alpha_
protected

A vector containing the rescale factor to apply to each dimension.

Definition at line 65 of file point_representation.h.

Referenced by pcl::PointRepresentation< T >::isTrivial(), pcl::PointRepresentation< T >::setRescaleValues(), and pcl::PointRepresentation< T >::vectorize().

◆ nr_dimensions_

template<typename T >
int pcl::PointRepresentation< T >::nr_dimensions_ = 0
protected

◆ trivial_

template<typename T >
bool pcl::PointRepresentation< T >::trivial_ = false
protected

Indicates whether this point representation is trivial.

It is trivial if and only if the following conditions hold:

  • the relevant data consists only of float values
  • the vectorize operation directly copies the first nr_dimensions_ elements of PointT to the out array
  • sizeof(PointT) is a multiple of sizeof(float) In short, a trivial point representation converts the input point to a float array that is the same as if the point was reinterpret_casted to a float array of length nr_dimensions_ . This value says that this representation can be trivial; it is only trivial if setRescaleValues() has not been set.

Definition at line 75 of file point_representation.h.

Referenced by pcl::PointRepresentation< T >::isTrivial(), and pcl::PointRepresentation< T >::isValid().


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