copyBuffer.cpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 #include <pcl/apps/point_cloud_editor/copyBuffer.h>
00041 #include <pcl/apps/point_cloud_editor/selection.h>
00042 #include <pcl/apps/point_cloud_editor/statistics.h>
00043 #include <pcl/apps/point_cloud_editor/common.h>
00044 
00045 CopyBuffer::CopyBuffer (const CopyBuffer& copy_buffer) :
00046   buffer_(copy_buffer.buffer_)
00047 {
00048 }
00049 
00050 CopyBuffer&
00051 CopyBuffer::operator= (const CopyBuffer& copy_buffer)
00052 {
00053   buffer_ = copy_buffer.buffer_;
00054   return (*this);
00055 }
00056 
00057 void
00058 CopyBuffer::set (ConstCloudPtr cloud_ptr, const Selection& selection)
00059 {
00060   clean();
00061   if (!cloud_ptr)
00062       return;
00063   Selection::const_iterator s_it;
00064   for(s_it = selection.begin(); s_it != selection.end(); ++s_it)
00065     buffer_.append( (*cloud_ptr)[*s_it] );
00066 }
00067 
00068 const Cloud&
00069 CopyBuffer::get () const
00070 {
00071   return (buffer_);
00072 }
00073 
00074 Cloud&
00075 CopyBuffer::get ()
00076 {
00077   return (buffer_);
00078 }
00079 
00080 void
00081 CopyBuffer::clean ()
00082 {
00083   buffer_.clear();
00084 }
00085 
00086 std::string
00087 CopyBuffer::getStat () const
00088 {
00089   if (buffer_.size() == 0)
00090     return ("");
00091   std::string title = "The number of points copied to the clipboard: ";
00092   std::string num_str;
00093   ::toString(buffer_.size(), num_str);
00094   return (title + num_str);
00095 }


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