common_types.hpp
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  * Point Cloud Library (PCL) - www.pointclouds.org
00005  * Copyright (c) 2009-2012, Willow Garage, Inc.
00006  * Copyright (c) 2012-, Open Perception, Inc.
00007  *
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  *
00014  *  * Redistributions of source code must retain the above copyright
00015  *    notice, this list of conditions and the following disclaimer.
00016  *  * Redistributions in binary form must reproduce the above
00017  *    copyright notice, this list of conditions and the following
00018  *    disclaimer in the documentation and/or other materials provided
00019  *    with the distribution.
00020  *  * Neither the name of the copyright holder(s) nor the names of its
00021  *    contributors may be used to endorse or promote products derived
00022  *    from this software without specific prior written permission.
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00026  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00027  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00028  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00029  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00030  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00031  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00033  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00034  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035  * POSSIBILITY OF SUCH DAMAGE.
00036  *
00037  * $Id$
00038  *
00039  */
00040 
00041 #ifndef PCL_APPS_IN_HAND_SCANNER_IMPL_COMMON_TYPES_HPP
00042 #define PCL_APPS_IN_HAND_SCANNER_IMPL_COMMON_TYPES_HPP
00043 
00044 #include <limits>
00045 
00046 namespace pcl
00047 {
00048   namespace ihs
00049   {
00050     struct EIGEN_ALIGN16 _PointIHS
00051     {
00052       PCL_ADD_POINT4D
00053       PCL_ADD_NORMAL4D
00054       PCL_ADD_RGB
00055       float        weight;
00056       unsigned int age;
00057       uint32_t     directions;
00058 
00059       EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00060     };
00061 
00062     struct PointIHS : public pcl::ihs::_PointIHS
00063     {
00064       // NOTE: I rely on NaN in the default constructor!
00065       inline PointIHS ()
00066       {
00067         this->x = this->y = this->z = std::numeric_limits<float>::quiet_NaN ();
00068         this->data[3] = 1.f;
00069 
00070         this->normal_x = this->normal_y = this->normal_z = std::numeric_limits<float>::quiet_NaN ();
00071         this->data_n[3] = 0.f;
00072 
00073         this->b = this->g = this->r = 0; this->a = 255;
00074 
00075         this->weight     = 0.f;
00076         this->age        = 0;
00077         this->directions = 0;
00078       }
00079 
00080       inline PointIHS (const PointIHS& other)
00081       {
00082         this->x       = other.x;
00083         this->y       = other.y;
00084         this->z       = other.z;
00085         this->data[3] = other.data[3];
00086 
00087         this->normal_x  = other.normal_x;
00088         this->normal_y  = other.normal_y;
00089         this->normal_z  = other.normal_z;
00090         this->data_n[3] = other.data_n[3];
00091 
00092         this->rgba = other.rgba;
00093 
00094         this->weight     = other.weight;
00095         this->age        = other.age;
00096         this->directions = other.directions;
00097       }
00098 
00099       inline PointIHS (const pcl::PointXYZRGBNormal& other, const float weight)
00100       {
00101         this->x       = other.x;
00102         this->y       = other.y;
00103         this->z       = other.z;
00104         this->data[3] = other.data[3];
00105 
00106         this->normal_x  = other.normal_x;
00107         this->normal_y  = other.normal_y;
00108         this->normal_z  = other.normal_z;
00109         this->data_n[3] = other.data_n[3];
00110 
00111         this->rgba = other.rgba;
00112 
00113         this->weight     = weight;
00114         this->age        = 0;
00115         this->directions = 0;
00116       }
00117 
00118    // inline       Eigen::Vector3i getRGBVector3i ()       {return (Eigen::Vector3i (r, g, b));}
00119       inline const Eigen::Vector3i getRGBVector3i () const {return (Eigen::Vector3i (r, g, b));}
00120    // inline       Eigen::Vector4i getRGBVector4i ()       {return (Eigen::Vector4i (r, g, b, a));}
00121       inline const Eigen::Vector4i getRGBVector4i () const {return (Eigen::Vector4i (r, g, b, a));}
00122     };
00123 
00124   } // End namespace ihs
00125 } // End namespace pcl
00126 
00127 #endif // PCL_APPS_IN_HAND_SCANNER_IMPL_COMMON_TYPES_HPP


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:22:49