1 #ifndef PCL_OUTOFCORE_OUTOFCORE_CLOUD_H_
2 #define PCL_OUTOFCORE_OUTOFCORE_CLOUD_H_
9 #include <pcl/point_types.h>
12 #include <pcl/outofcore/outofcore.h>
13 #include <pcl/outofcore/outofcore_impl.h>
15 #include <pcl/outofcore/impl/lru_cache.hpp>
23 #include <vtkActorCollection.h>
24 #include <vtkAppendPolyData.h>
25 #include <vtkDataSetMapper.h>
30 #include <vtkPolyData.h>
33 #include <vtkSmartPointer.h>
49 typedef boost::shared_ptr<OctreeDisk> OctreeDiskPtr;
50 typedef Eigen::aligned_allocator<PointT> AlignedPointT;
54 typedef std::map<std::string, vtkSmartPointer<vtkActor> > CloudActorMap;
86 typedef std::priority_queue<PcdQueueItem>
PcdQueue;
99 this->
item = cloud_data;
106 return item->GetActualMemorySize();
124 OutofcoreCloud (std::string name, boost::filesystem::path& tree_root);
148 return cloud_actors_;
154 if (displayDepth < 0)
158 else if (displayDepth > octree_->getDepth ())
160 displayDepth = octree_->getDepth ();
163 if (display_depth_ != displayDepth)
165 display_depth_ = displayDepth;
174 return display_depth_;
180 return points_loaded_;
204 voxel_actor_->SetVisibility (display_voxels);
210 return voxel_actor_->GetVisibility ();
216 render_camera_ = render_camera;
222 return lod_pixel_threshold_;
228 if (lod_pixel_threshold <= 1000)
229 lod_pixel_threshold = 1000;
231 lod_pixel_threshold_ = lod_pixel_threshold;
239 if (lod_pixel_threshold_ >= 50000)
241 if (lod_pixel_threshold_ >= 10000)
243 else if (lod_pixel_threshold_ >= 1000)
246 lod_pixel_threshold_ += value;
247 std::cout <<
"Increasing lod pixel threshold: " << lod_pixel_threshold_ << endl;
254 if (lod_pixel_threshold_ > 50000)
256 else if (lod_pixel_threshold_ > 10000)
258 else if (lod_pixel_threshold_ > 1000)
261 lod_pixel_threshold_ -= value;
263 if (lod_pixel_threshold_ < 100)
264 lod_pixel_threshold_ = 100;
265 std::cout <<
"Decreasing lod pixel threshold: " << lod_pixel_threshold_ << endl;
269 render (vtkRenderer* renderer);
275 OctreeDiskPtr octree_;
277 uint64_t display_depth_;
278 uint64_t points_loaded_;
279 uint64_t data_loaded_;
281 Eigen::Vector3d bbox_min_, bbox_max_;
285 int lod_pixel_threshold_;
289 std::map<std::string, vtkSmartPointer<vtkActor> > cloud_actors_map_;
293 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
vtkSmartPointer< vtkActor > getVoxelActor() const
This code defines the octree used for point storage at Urban Robotics.
bool operator<(const PcdQueueItem &rhs) const
OctreeDiskPtr getOctree()
static boost::condition pcd_queue_ready
OutofcoreCloud(std::string name, boost::filesystem::path &tree_root)
void setDisplayDepth(int displayDepth)
virtual void render(vtkRenderer *renderer)
OutofcoreOctreeBaseNode Class internally representing nodes of an outofcore octree, with accessors to its data via the octree_disk_container class or octree_ram_container class, whichever it is templated against.
static CloudDataCache cloud_data_cache
static PcdQueue pcd_queue
void setRenderCamera(Camera *render_camera)
Eigen::Vector3d getBoundingBoxMin()
CloudDataCacheItem(std::string pcd_file, float coverage, vtkSmartPointer< vtkPolyData > cloud_data, size_t timestamp)
LRUCache< std::string, CloudDataCacheItem > CloudDataCache
Eigen::Vector3d getBoundingBoxMax()
void decreaseLodPixelThreshold()
static boost::mutex pcd_queue_mutex
vtkSmartPointer< vtkPolyData > item
static boost::mutex cloud_data_cache_mutex
std::priority_queue< PcdQueueItem > PcdQueue
void increaseLodPixelThreshold()
int getLodPixelThreshold()
void setLodPixelThreshold(int lod_pixel_threshold)
static void pcdReaderThread()
static boost::shared_ptr< boost::thread > pcd_reader_thread
void setDisplayVoxels(bool display_voxels)
A point structure representing Euclidean xyz coordinates.
vtkSmartPointer< vtkActorCollection > getCloudActors() const
virtual size_t sizeOf() const
PcdQueueItem(std::string pcd_file, float coverage)
uint64_t getPointsLoaded()