outofcore_node_data.h
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) 2010-2012, Willow Garage, Inc.
00006  *
00007  *  All rights reserved.
00008  *
00009  *  Redistribution and use in source and binary forms, with or without
00010  *  modification, are permitted provided that the following conditions
00011  *  are met:
00012  *
00013  *   * Redistributions of source code must retain the above copyright
00014  *     notice, this list of conditions and the following disclaimer.
00015  *   * Redistributions in binary form must reproduce the above
00016  *     copyright notice, this list of conditions and the following
00017  *     disclaimer in the documentation and/or other materials provided
00018  *     with the distribution.
00019  *   * Neither the name of Willow Garage, Inc. nor the names of its
00020  *     contributors may be used to endorse or promote products derived
00021  *     from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00033  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00034  *  POSSIBILITY OF SUCH DAMAGE.
00035  *
00036  *  $Id: outofcore_node_data.h 6915 2012-08-22 10:54:21Z stfox88 $
00037  */
00038 
00039 #ifndef PCL_OUTOFCORE_OCTREE_NODE_METADATA_H_
00040 #define PCL_OUTOFCORE_OCTREE_NODE_METADATA_H_
00041 
00042 #include <pcl/pcl_macros.h>
00043 #include <pcl/outofcore/boost.h>
00044 #include <pcl/outofcore/cJSON.h>
00045 
00046 #include <pcl/common/eigen.h>
00047 
00048 #include <ostream>
00049 
00050 namespace pcl
00051 {
00052   namespace outofcore
00053   {
00083     class PCL_EXPORTS OutofcoreOctreeNodeMetadata
00084     {
00085 
00086       public:
00087         //public typedefs
00088         typedef boost::shared_ptr<OutofcoreOctreeNodeMetadata> Ptr;
00089         typedef boost::shared_ptr<const OutofcoreOctreeNodeMetadata> ConstPtr;
00090   
00092         OutofcoreOctreeNodeMetadata ();
00093         ~OutofcoreOctreeNodeMetadata ();
00094 
00096         OutofcoreOctreeNodeMetadata (const OutofcoreOctreeNodeMetadata& orig);
00097         
00099         const Eigen::Vector3d&
00100         getBoundingBoxMin () const;
00102         void 
00103         setBoundingBoxMin (const Eigen::Vector3d& min_bb);
00105         const Eigen::Vector3d&
00106         getBoundingBoxMax () const;
00108         void 
00109         setBoundingBoxMax (const Eigen::Vector3d& max_bb);
00110 
00112         void 
00113         getBoundingBox (Eigen::Vector3d &min_bb, Eigen::Vector3d &max_bb) const;
00115         void 
00116         setBoundingBox (const Eigen::Vector3d& min_bb, const Eigen::Vector3d& max_bb);
00117         
00119         const boost::filesystem::path&
00120         getDirectoryPathname () const;
00122         void 
00123         setDirectoryPathname (const boost::filesystem::path& directory_pathname);
00124 
00126         const boost::filesystem::path&
00127         getPCDFilename () const;
00129         void 
00130         setPCDFilename (const boost::filesystem::path& point_filename);
00131 
00133         int 
00134         getOutofcoreVersion () const;
00136         void 
00137         setOutofcoreVersion (const int version);
00138 
00140         const boost::filesystem::path&
00141         getMetadataFilename () const;
00143         void 
00144         setMetadataFilename (const boost::filesystem::path& path_to_metadata);
00145         
00147         const Eigen::Vector3d&
00148         getVoxelCenter () const;
00149         
00151         void 
00152         serializeMetadataToDisk ();
00153 
00155         int 
00156         loadMetadataFromDisk ();
00158         int 
00159         loadMetadataFromDisk (const boost::filesystem::path& path_to_metadata);
00160 
00161         friend
00162         std::ostream& operator<<(std::ostream& os, const OutofcoreOctreeNodeMetadata& metadata_arg);
00163         
00164       protected:
00166         Eigen::Vector3d min_bb_;
00168         Eigen::Vector3d max_bb_;
00170         boost::filesystem::path binary_point_filename_;
00172         Eigen::Vector3d midpoint_xyz_;
00174         boost::filesystem::path directory_;
00176         boost::filesystem::path metadata_filename_;
00178         int outofcore_version_;
00179 
00181         inline void 
00182         updateVoxelCenter ()
00183         {
00184           midpoint_xyz_ = (this->max_bb_ + this->min_bb_)/static_cast<double>(2.0);
00185         }
00186     };
00187   }//namespace outofcore
00188 }//namespace pcl
00189   
00190 #endif // PCL_OUTOFCORE_OCTREE_NODE_METADATA_H_


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:27:30