Point Cloud Library (PCL)  1.10.1-dev
Macros | Functions
pcl_macros.h File Reference
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <iostream>
#include <pcl/pcl_config.h>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/stringize.hpp>

Go to the source code of this file.

Detailed Description

Defines all the PCL and non-PCL macros used.

Definition in file pcl_macros.h.

Macros

#define _USE_MATH_DEFINES
 
#define OPENMP_LEGACY_CONST_DATA_SHARING_RULE   0
 
#define PCL_DEPRECATED_IMPL(message)
 
#define PCL_DEPRECATED_MODIFY_MSG(major, minor, msg)
 
#define PCL_DEPRECATED_MINOR(Minor, Msg)
 
#define PCL_DEPRECATED(Major, Minor, Message)
 macro for compatibility across compilers and help remove old deprecated items for the Major.Minor release More...
 
#define _MATH_DEFINES_DEFINED
 
#define M_E   2.71828182845904523536
 
#define M_LOG2E   1.44269504088896340736
 
#define M_LOG10E   0.434294481903251827651
 
#define M_LN2   0.693147180559945309417
 
#define M_LN10   2.30258509299404568402
 
#define M_PI   3.14159265358979323846
 
#define M_PI_2   1.57079632679489661923
 
#define M_PI_4   0.785398163397448309616
 
#define M_1_PI   0.318309886183790671538
 
#define M_2_PI   0.636619772367581343076
 
#define M_2_SQRTPI   1.12837916709551257390
 
#define M_SQRT2   1.41421356237309504880
 
#define M_SQRT1_2   0.707106781186547524401
 
#define DEG2RAD(x)   ((x)*0.017453293)
 
#define RAD2DEG(x)   ((x)*57.29578)
 
#define PCL_LINEAR_VERSION(major, minor, patch)   ((major)<<16|(minor)<<8|(patch))
 Macro that maps version information given by major.minor.patch to a linear integer value to enable easy comparison. More...
 
#define pcl_lrint(x)   (static_cast<long int>(pcl_round(x)))
 
#define pcl_lrintf(x)   (static_cast<long int>(pcl_round(x)))
 
#define pcl_sleep(x)   sleep(x)
 
#define PVAR(s)   #s << " = " << (s) << std::flush
 
#define PVARN(s)   #s << " = " << (s) << "\n"
 
#define PVARC(s)   #s << " = " << (s) << ", " << std::flush
 
#define PVARS(s)   #s << " = " << (s) << " " << std::flush
 
#define PVARA(s)   #s << " = " << RAD2DEG(s) << "deg" << std::flush
 
#define PVARAN(s)   #s << " = " << RAD2DEG(s) << "deg\n"
 
#define PVARAC(s)   #s << " = " << RAD2DEG(s) << "deg, " << std::flush
 
#define PVARAS(s)   #s << " = " << RAD2DEG(s) << "deg " << std::flush
 
#define FIXED(s)   std::fixed << s << std::resetiosflags(std::ios_base::fixed)
 
#define ERASE_STRUCT(var)   memset(&var, 0, sizeof(var))
 
#define ERASE_ARRAY(var, size)   memset(var, 0, size*sizeof(*var))
 
#define SET_ARRAY(var, value, size)   { for (decltype(size) i = 0; i < size; ++i) var[i]=value; }
 
#define PCL_EXTERN_C
 
#define PCL_EXPORTS
 
#define PCL_CDECL   __cdecl
 
#define PCL_STDCALL   __stdcall
 
#define PCLAPI(rettype)   PCL_EXTERN_C PCL_EXPORTS rettype PCL_CDECL
 
#define PCL_PRAGMA
 
#define PCL_PRAGMA_WARNING
 
#define __has_extension(x)   0
 
#define GLIBC_MALLOC_ALIGNED   0
 
#define FREEBSD_MALLOC_ALIGNED   0
 
#define PCL_FALLTHROUGH
 Macro to add a no-op or a fallthrough attribute based on compiler feature. More...
 
#define PCL_NODISCARD
 

Functions

template<typename T >
use std::isnan instead of pcl_isnan bool pcl_isnan (T &&x)
 
template<typename T >
use std::isfinite instead of pcl_isfinite bool pcl_isfinite (T &&x)
 
template<typename T >
use std::isinf instead of pcl_isinf bool pcl_isinf (T &&x)
 
__inline double pcl_round (double number)
 Win32 doesn't seem to have rounding functions. More...
 
__inline float pcl_round (float number)
 
void * aligned_malloc (std::size_t size)
 
void aligned_free (void *ptr)
 

Macro Definition Documentation

◆ __has_extension

#define __has_extension (   x)    0

Definition at line 314 of file pcl_macros.h.

◆ _MATH_DEFINES_DEFINED

#define _MATH_DEFINES_DEFINED

Definition at line 133 of file pcl_macros.h.

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 59 of file pcl_macros.h.

◆ DEG2RAD

#define DEG2RAD (   x)    ((x)*0.017453293)

Definition at line 176 of file pcl_macros.h.

◆ ERASE_ARRAY

#define ERASE_ARRAY (   var,
  size 
)    memset(var, 0, size*sizeof(*var))

Definition at line 257 of file pcl_macros.h.

Referenced by pcl::RangeImage::doZBuffer().

◆ ERASE_STRUCT

#define ERASE_STRUCT (   var)    memset(&var, 0, sizeof(var))

Definition at line 253 of file pcl_macros.h.

◆ FIXED

#define FIXED (   s)    std::fixed << s << std::resetiosflags(std::ios_base::fixed)

Definition at line 249 of file pcl_macros.h.

◆ FREEBSD_MALLOC_ALIGNED

#define FREEBSD_MALLOC_ALIGNED   0

Definition at line 334 of file pcl_macros.h.

◆ GLIBC_MALLOC_ALIGNED

#define GLIBC_MALLOC_ALIGNED   0

Definition at line 328 of file pcl_macros.h.

◆ M_1_PI

#define M_1_PI   0.318309886183790671538

Definition at line 143 of file pcl_macros.h.

◆ M_2_PI

#define M_2_PI   0.636619772367581343076

Definition at line 144 of file pcl_macros.h.

◆ M_2_SQRTPI

#define M_2_SQRTPI   1.12837916709551257390

Definition at line 145 of file pcl_macros.h.

◆ M_E

#define M_E   2.71828182845904523536

◆ M_LN10

#define M_LN10   2.30258509299404568402

Definition at line 139 of file pcl_macros.h.

◆ M_LN2

#define M_LN2   0.693147180559945309417

Definition at line 138 of file pcl_macros.h.

◆ M_LOG10E

#define M_LOG10E   0.434294481903251827651

Definition at line 137 of file pcl_macros.h.

◆ M_LOG2E

#define M_LOG2E   1.44269504088896340736

Definition at line 136 of file pcl_macros.h.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 140 of file pcl_macros.h.

Referenced by pcl::FrustumCulling< PointT >::applyFilter(), pcl::RangeImage::atan2LookUp(), pcl::registration::FPCSInitialAlignment< PointSource, PointTarget, NormalT, Scalar >::bruteForceCorrespondences(), pcl::comparePoints2D(), pcl::BRISK2DEstimation< PointInT, PointOutT, KeypointT, IntensityT >::compute(), pcl::ESFEstimation< PointInT, PointOutT >::computeESF(), pcl::NormalBasedSignatureEstimation< PointT, PointNT, PointFeature >::computeFeature(), pcl::face_detection::PoseClassRegressionVarianceStatsEstimator< LabelDataType, NodeType, DataSet, ExampleIndex >::computeInformationGain(), pcl::MaximumLikelihoodSampleConsensus< PointT >::computeModel(), pcl::BOARDLocalReferenceFrameEstimation< PointInT, PointNT, PointOutT >::computePointLRF(), pcl::PFHRGBEstimation< PointInT, PointNT, PointOutT >::computePointPFHRGBSignature(), pcl::PFHEstimation< PointInT, PointNT, PointOutT >::computePointPFHSignature(), pcl::VFHEstimation< PointInT, PointNT, PointOutT >::computePointSPFHSignature(), pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::computePointSPFHSignature(), pcl::StatisticalMultiscaleInterestRegionExtraction< PointT >::computeRegionsOfInterest(), pcl::RIFTEstimation< PointInT, GradientT, PointOutT >::computeRIFT(), pcl::computeRSD(), pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::computeSiForPoint(), pcl::RangeImage::cosLookUp(), pcl::SampleConsensusModelNormalSphere< PointT, PointNT >::countWithinDistance(), pcl::SampleConsensusModelNormalPlane< PointT, PointNT >::countWithinDistance(), pcl::SampleConsensusModelCylinder< pcl::PointXYZRGB, PointNT >::countWithinDistance(), pcl::SampleConsensusModelCone< pcl::PointXYZRGB, PointNT >::countWithinDistance(), pcl::PackedHSIComparison< PointT >::evaluate(), pcl::BRISK2DEstimation< PointInT, PointOutT, KeypointT, IntensityT >::generateKernel(), pcl::RangeImage::getAcutenessValue(), pcl::getAngle3D(), pcl::BOARDLocalReferenceFrameEstimation< PointInT, PointNT, PointOutT >::getAngleBetweenUnitVectors(), pcl::RangeImageSpherical::getAnglesFromImagePoint(), pcl::RangeImage::getAnglesFromImagePoint(), pcl::SampleConsensusModelNormalSphere< PointT, PointNT >::getDistancesToModel(), pcl::SampleConsensusModelNormalPlane< PointT, PointNT >::getDistancesToModel(), pcl::SampleConsensusModelCylinder< pcl::PointXYZRGB, PointNT >::getDistancesToModel(), pcl::SampleConsensusModelCone< pcl::PointXYZRGB, PointNT >::getDistancesToModel(), pcl::MomentOfInertiaEstimation< PointT >::getEccentricity(), pcl::RangeImageSpherical::getImagePointFromAngles(), pcl::RangeImage::getImagePointFromAngles(), pcl::RangeImage::getImpactAngle(), pcl::RangeImage::getNormalBasedAcutenessValue(), pcl::ROPSEstimation< PointInT, PointOutT >::getTriangles(), pcl::QuantizedNormalLookUpTable::initializeLUT(), pcl::SACSegmentation< PointT >::initSACModel(), pcl::SACSegmentationFromNormals< PointT, PointNT >::initSACModel(), pcl::BoundaryEstimation< PointInT, PointNT, PointOutT >::isBoundaryPoint(), pcl::SampleConsensusModelParallelLine< PointT >::isModelValid(), pcl::SampleConsensusModelPerpendicularPlane< PointT >::isModelValid(), pcl::SampleConsensusModelCylinder< pcl::PointXYZRGB, PointNT >::isModelValid(), pcl::SampleConsensusModelCone< pcl::PointXYZRGB, PointNT >::isModelValid(), pcl::normAngle(), pcl::SampleConsensusModelNormalSphere< PointT, PointNT >::selectWithinDistance(), pcl::SampleConsensusModelNormalPlane< PointT, PointNT >::selectWithinDistance(), pcl::SampleConsensusModelCylinder< pcl::PointXYZRGB, PointNT >::selectWithinDistance(), pcl::SampleConsensusModelCone< pcl::PointXYZRGB, PointNT >::selectWithinDistance(), pcl::PPFRegistration< PointSource, PointTarget >::setInputTarget(), pcl::PolynomialCalculationsT< real >::solveCubicEquation(), pcl::registration::KFPCSInitialAlignment< PointSource, PointTarget, NormalT, Scalar >::validateTransformation(), and pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation().

◆ M_PI_2

#define M_PI_2   1.57079632679489661923

◆ M_PI_4

#define M_PI_4   0.785398163397448309616

Definition at line 142 of file pcl_macros.h.

◆ M_SQRT1_2

#define M_SQRT1_2   0.707106781186547524401

Definition at line 147 of file pcl_macros.h.

Referenced by pcl::approximatePolygon2D().

◆ M_SQRT2

#define M_SQRT2   1.41421356237309504880

Definition at line 146 of file pcl_macros.h.

◆ OPENMP_LEGACY_CONST_DATA_SHARING_RULE

#define OPENMP_LEGACY_CONST_DATA_SHARING_RULE   0

Definition at line 74 of file pcl_macros.h.

◆ PCL_CDECL

#define PCL_CDECL   __cdecl

Definition at line 283 of file pcl_macros.h.

◆ PCL_DEPRECATED

#define PCL_DEPRECATED (   Major,
  Minor,
  Message 
)
Value:
BOOST_PP_IF(BOOST_PP_EQUAL(PCL_MAJOR_VERSION, Major), \
PCL_DEPRECATED_MODIFY_MSG(Major, Minor, Message)), \
major_version_mismatch)
#define PCL_DEPRECATED_MINOR(Minor, Msg)
Definition: pcl_macros.h:106
#define PCL_DEPRECATED_MODIFY_MSG(major, minor, msg)
Definition: pcl_macros.h:102

macro for compatibility across compilers and help remove old deprecated items for the Major.Minor release

compiler errors of unneeded_deprecation and major_version_mismatch are hints to the developer that those items can be safely removed. Warning message with PCL_DEPRECATED(1, 99, "Not needed anymore") till PCL 1.98: "Slated for removal in PCL 1.99: Not needed anymore"

Definition at line 120 of file pcl_macros.h.

Referenced by pcl::concatenate(), pcl::MaskMap::getData(), pcl::getFieldIndex(), pcl::EuclideanClusterComparator< PointT, PointNT, PointLT >::getInputNormals(), pcl::PointCloud< pcl::RGB >::makeShared(), pcl::NdCopyPointEigenFunctor< PointInT >::operator()(), pcl_isfinite(), pcl_isnan(), pcl::PointWithViewpoint::PointWithViewpoint(), pcl::EuclideanClusterComparator< PointT, PointNT, PointLT >::setAngularThreshold(), and pcl::EuclideanClusterComparator< PointT, PointNT, PointLT >::setInputNormals().

◆ PCL_DEPRECATED_IMPL

#define PCL_DEPRECATED_IMPL (   message)

Definition at line 99 of file pcl_macros.h.

◆ PCL_DEPRECATED_MINOR

#define PCL_DEPRECATED_MINOR (   Minor,
  Msg 
)
Value:
BOOST_PP_IF(BOOST_PP_LESS(PCL_MINOR_VERSION, Minor), \
unneeded_deprecation)
#define PCL_DEPRECATED_IMPL(message)
Definition: pcl_macros.h:99

Definition at line 106 of file pcl_macros.h.

◆ PCL_DEPRECATED_MODIFY_MSG

#define PCL_DEPRECATED_MODIFY_MSG (   major,
  minor,
  msg 
)
Value:
msg " (It will be removed in PCL " \
BOOST_PP_STRINGIZE(major.minor) ")"

Definition at line 102 of file pcl_macros.h.

◆ PCL_EXPORTS

#define PCL_EXPORTS

Definition at line 276 of file pcl_macros.h.

Referenced by pcl::Boundary::Boundary(), pcl::BRISKSignature512::BRISKSignature512(), pcl::concatenate(), pcl::Correspondence::Correspondence(), pcl::CPPFSignature::CPPFSignature(), pcl::PFHSignature125::descriptorSize(), pcl::PFHRGBSignature250::descriptorSize(), pcl::ShapeContext1980::descriptorSize(), pcl::UniqueShapeContext1960::descriptorSize(), pcl::SHOT352::descriptorSize(), pcl::FPFHSignature33::descriptorSize(), pcl::VFHSignature308::descriptorSize(), pcl::GRSDSignature21::descriptorSize(), pcl::ESFSignature640::descriptorSize(), pcl::GASDSignature512::descriptorSize(), pcl::GASDSignature984::descriptorSize(), pcl::GASDSignature7992::descriptorSize(), pcl::GFPFHSignature16::descriptorSize(), pcl::cuda::detail::dist2(), pcl::RangeImage::getAngularResolutionY(), pcl::getFieldSize(), pcl::_ReferenceFrame::getMatrix3fMap(), pcl::RangeImagePlanar::getNew(), pcl::RangeImage::getNew(), pcl::isSamePointType(), pcl::io::loadOBJFile(), pcl::RangeImagePlanar::makeShared(), pcl::RangeImage::makeShared(), pcl::MomentInvariants::MomentInvariants(), pcl::Narf36::Narf36(), pcl::NdCopyPointEigenFunctor< PointInT >::operator()(), pcl::console::parse(), pcl::planeWithPlaneIntersection(), POINT_CLOUD_REGISTER_POINT_STRUCT(), pcl::PointUV::PointUV(), pcl::PointXY::PointXY(), pcl::PointXYZHSV::PointXYZHSV(), pcl::PointXYZL::PointXYZL(), pcl::PointXYZRGB::PointXYZRGB(), pcl::PPFRGBSignature::PPFRGBSignature(), pcl::PPFSignature::PPFSignature(), pcl::PrincipalCurvatures::PrincipalCurvatures(), pcl::PrincipalRadiiRSD::PrincipalRadiiRSD(), pcl::ReferenceFrame::ReferenceFrame(), pcl::io::savePLYFile(), pcl::segmentation::grabcut::GaussianFitter::setEpsilon(), pcl::RangeImage::setImageOffsets(), and pcl::threePlanesIntersection().

◆ PCL_EXTERN_C

#define PCL_EXTERN_C

Definition at line 268 of file pcl_macros.h.

◆ PCL_LINEAR_VERSION

#define PCL_LINEAR_VERSION (   major,
  minor,
  patch 
)    ((major)<<16|(minor)<<8|(patch))

Macro that maps version information given by major.minor.patch to a linear integer value to enable easy comparison.

Definition at line 185 of file pcl_macros.h.

◆ pcl_lrint

#define pcl_lrint (   x)    (static_cast<long int>(pcl_round(x)))

◆ pcl_lrintf

#define pcl_lrintf (   x)    (static_cast<long int>(pcl_round(x)))

◆ PCL_NODISCARD

#define PCL_NODISCARD

Definition at line 410 of file pcl_macros.h.

◆ PCL_PRAGMA

#define PCL_PRAGMA

Definition at line 300 of file pcl_macros.h.

◆ PCL_PRAGMA_WARNING

#define PCL_PRAGMA_WARNING

Definition at line 309 of file pcl_macros.h.

◆ pcl_sleep

#define pcl_sleep (   x)    sleep(x)

Definition at line 213 of file pcl_macros.h.

◆ PCL_STDCALL

#define PCL_STDCALL   __stdcall

Definition at line 284 of file pcl_macros.h.

◆ PCLAPI

#define PCLAPI (   rettype)    PCL_EXTERN_C PCL_EXPORTS rettype PCL_CDECL

Definition at line 291 of file pcl_macros.h.

◆ PVAR

#define PVAR (   s)    #s << " = " << (s) << std::flush

Definition at line 217 of file pcl_macros.h.

◆ PVARA

#define PVARA (   s)    #s << " = " << RAD2DEG(s) << "deg" << std::flush

Definition at line 233 of file pcl_macros.h.

◆ PVARAC

#define PVARAC (   s)    #s << " = " << RAD2DEG(s) << "deg, " << std::flush

Definition at line 241 of file pcl_macros.h.

◆ PVARAN

#define PVARAN (   s)    #s << " = " << RAD2DEG(s) << "deg\n"

Definition at line 237 of file pcl_macros.h.

◆ PVARAS

#define PVARAS (   s)    #s << " = " << RAD2DEG(s) << "deg " << std::flush

Definition at line 245 of file pcl_macros.h.

◆ PVARC

#define PVARC (   s)    #s << " = " << (s) << ", " << std::flush

Definition at line 225 of file pcl_macros.h.

Referenced by pcl::operator<<().

◆ PVARN

#define PVARN (   s)    #s << " = " << (s) << "\n"

Definition at line 221 of file pcl_macros.h.

Referenced by pcl::operator<<().

◆ PVARS

#define PVARS (   s)    #s << " = " << (s) << " " << std::flush

Definition at line 229 of file pcl_macros.h.

◆ RAD2DEG

#define RAD2DEG (   x)    ((x)*57.29578)

Definition at line 180 of file pcl_macros.h.

Referenced by pcl::operator<<().

◆ SET_ARRAY

#define SET_ARRAY (   var,
  value,
  size 
)    { for (decltype(size) i = 0; i < size; ++i) var[i]=value; }

Definition at line 261 of file pcl_macros.h.

Function Documentation

◆ aligned_free()

void aligned_free ( void *  ptr)
inline

Definition at line 373 of file pcl_macros.h.

Referenced by pcl::EnergyMaps::releaseAll(), and pcl::LinearizedMaps::releaseAll().

◆ aligned_malloc()

void* aligned_malloc ( std::size_t  size)
inline

Definition at line 351 of file pcl_macros.h.

Referenced by pcl::EnergyMaps::initialize(), and pcl::LinearizedMaps::initialize().

◆ pcl_isfinite()

template<typename T >
use std::isfinite instead of pcl_isfinite bool pcl_isfinite ( T &&  x)

Definition at line 168 of file pcl_macros.h.

References PCL_DEPRECATED.

◆ pcl_isinf()

template<typename T >
use std::isinf instead of pcl_isinf bool pcl_isinf ( T &&  x)

Definition at line 172 of file pcl_macros.h.

◆ pcl_isnan()

template<typename T >
use std::isnan instead of pcl_isnan bool pcl_isnan ( T &&  x)

Definition at line 164 of file pcl_macros.h.

References PCL_DEPRECATED.

◆ pcl_round() [1/2]

__inline double pcl_round ( double  number)

◆ pcl_round() [2/2]

__inline float pcl_round ( float  number)

Definition at line 197 of file pcl_macros.h.