/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2012-, Open Perception, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the copyright holder(s) nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id: point_types.hpp 6415 2012-07-16 20:11:47Z rusu $ * */ #pragma once #include #ifdef _MSC_VER #include #endif namespace pcl { /** Tests if the 3D components of a point are all finite * param[in] pt point to be tested * return true if finite, false otherwise */ template inline bool isFinite (const PointT &pt) { return (std::isfinite (pt.x) && std::isfinite (pt.y) && std::isfinite (pt.z)); } #ifdef _MSC_VER template inline bool isFinite (const Eigen::internal::workaround_msvc_stl_support &pt) { return isFinite (static_cast (pt)); } #endif template<> inline bool isFinite(const pcl::Axis&) { return (true); } template<> inline bool isFinite(const pcl::BRISKSignature512&) { return (true); } template<> inline bool isFinite(const pcl::BorderDescription &) { return true; } template<> inline bool isFinite(const pcl::Boundary&) { return (true); } template<> inline bool isFinite(const pcl::CPPFSignature&) { return (true); } template<> inline bool isFinite(const pcl::ESFSignature640&) { return (true); } template<> inline bool isFinite(const pcl::FPFHSignature33&) { return (true); } template<> inline bool isFinite(const pcl::GASDSignature512&) { return (true); } template<> inline bool isFinite(const pcl::GASDSignature984&) { return (true); } template<> inline bool isFinite(const pcl::GASDSignature7992&) { return (true); } template<> inline bool isFinite(const pcl::GRSDSignature21&) { return (true); } template<> inline bool isFinite(const pcl::Intensity&) { return (true); } template<> inline bool isFinite(const pcl::IntensityGradient&) { return (true); } template<> inline bool isFinite(const pcl::Label&) { return (true); } template<> inline bool isFinite(const pcl::MomentInvariants&) { return (true); } template<> inline bool isFinite(const pcl::NormalBasedSignature12&) { return (true); } template<> inline bool isFinite(const pcl::PFHRGBSignature250&) { return (true); } template<> inline bool isFinite(const pcl::PFHSignature125&) { return (true); } template<> inline bool isFinite(const pcl::PPFRGBSignature&) { return (true); } template<> inline bool isFinite(const pcl::PPFSignature& pt) { return std::isfinite(pt.f1) && std::isfinite(pt.f2) && std::isfinite(pt.f3) && std::isfinite(pt.f4) && std::isfinite(pt.alpha_m); } template<> inline bool isFinite(const pcl::PrincipalCurvatures&) { return (true); } template<> inline bool isFinite(const pcl::PrincipalRadiiRSD&) { return (true); } template<> inline bool isFinite(const pcl::RGB&) { return (true); } template<> inline bool isFinite(const pcl::ReferenceFrame&) { return (true); } template<> inline bool isFinite(const pcl::SHOT1344&) { return (true); } template<> inline bool isFinite(const pcl::SHOT352&) { return (true); } template<> inline bool isFinite(const pcl::ShapeContext1980&) { return (true); } template<> inline bool isFinite(const pcl::UniqueShapeContext1960&) { return (true); } template<> inline bool isFinite(const pcl::VFHSignature308&) { return (true); } // specification for pcl::PointXY template <> inline bool isFinite (const pcl::PointXY &p) { return (std::isfinite (p.x) && std::isfinite (p.y)); } // specification for pcl::Normal template <> inline bool isFinite (const pcl::Normal &n) { return (std::isfinite (n.normal_x) && std::isfinite (n.normal_y) && std::isfinite (n.normal_z)); } // generic fallback cases template = true> constexpr inline bool isXYFinite (const PointT&) noexcept { return true; } template = true> constexpr inline bool isXYZFinite (const PointT&) noexcept { return true; } template = true> constexpr inline bool isNormalFinite (const PointT&) noexcept { return true; } // special cases for checks template = true> inline bool isXYFinite (const PointT& pt) noexcept { return std::isfinite(pt.x) && std::isfinite(pt.y); } template = true> inline bool isXYZFinite (const PointT& pt) noexcept { return std::isfinite(pt.x) && std::isfinite(pt.y) && std::isfinite(pt.z); } template = true> inline bool isNormalFinite (const PointT& pt) noexcept { return std::isfinite(pt.normal_x) && std::isfinite(pt.normal_y) && std::isfinite(pt.normal_z); } }