1 #ifndef PCL_OUTOFCORE_OUTOFCORE_CLOUD_H_
2 #define PCL_OUTOFCORE_OUTOFCORE_CLOUD_H_
7 #include <pcl/point_types.h>
10 #include <pcl/outofcore/outofcore.h>
11 #include <pcl/outofcore/outofcore_impl.h>
13 #include <pcl/outofcore/impl/lru_cache.hpp>
21 #include <vtkActorCollection.h>
22 #include <vtkAppendPolyData.h>
23 #include <vtkDataSetMapper.h>
28 #include <vtkPolyData.h>
31 #include <vtkSmartPointer.h>
47 typedef boost::shared_ptr<OctreeDisk> OctreeDiskPtr;
48 typedef Eigen::aligned_allocator<PointT> AlignedPointT;
52 typedef std::map<std::string, vtkSmartPointer<vtkActor> > CloudActorMap;
84 typedef std::priority_queue<PcdQueueItem>
PcdQueue;
97 this->
item = cloud_data;
104 return item->GetActualMemorySize();
122 OutofcoreCloud (std::string name, boost::filesystem::path& tree_root);
146 return cloud_actors_;
152 if (displayDepth < 0)
156 else if (displayDepth > octree_->getDepth ())
158 displayDepth = octree_->getDepth ();
161 if (display_depth_ != displayDepth)
163 display_depth_ = displayDepth;
172 return display_depth_;
178 return points_loaded_;
202 voxel_actor_->SetVisibility (display_voxels);
208 return voxel_actor_->GetVisibility ();
214 render_camera_ = render_camera;
220 return lod_pixel_threshold_;
226 if (lod_pixel_threshold <= 1000)
227 lod_pixel_threshold = 1000;
229 lod_pixel_threshold_ = lod_pixel_threshold;
237 if (lod_pixel_threshold_ >= 50000)
239 if (lod_pixel_threshold_ >= 10000)
241 else if (lod_pixel_threshold_ >= 1000)
244 lod_pixel_threshold_ += value;
245 std::cout <<
"Increasing lod pixel threshold: " << lod_pixel_threshold_ << endl;
252 if (lod_pixel_threshold_ > 50000)
254 else if (lod_pixel_threshold_ > 10000)
256 else if (lod_pixel_threshold_ > 1000)
259 lod_pixel_threshold_ -= value;
261 if (lod_pixel_threshold_ < 100)
262 lod_pixel_threshold_ = 100;
263 std::cout <<
"Decreasing lod pixel threshold: " << lod_pixel_threshold_ << endl;
267 render (vtkRenderer* renderer);
273 OctreeDiskPtr octree_;
275 uint64_t display_depth_;
276 uint64_t points_loaded_;
277 uint64_t data_loaded_;
279 Eigen::Vector3d bbox_min_, bbox_max_;
283 int lod_pixel_threshold_;
287 std::map<std::string, vtkSmartPointer<vtkActor> > cloud_actors_map_;
291 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
static CloudDataCache cloud_data_cache
void decreaseLodPixelThreshold()
Eigen::Vector3d getBoundingBoxMax()
Eigen::Vector3d getBoundingBoxMin()
static void pcdReaderThread()
vtkSmartPointer< vtkPolyData > item
OctreeDiskPtr getOctree()
vtkSmartPointer< vtkActor > getVoxelActor() const
static boost::condition pcd_queue_ready
PcdQueueItem(std::string pcd_file, float coverage)
virtual void render(vtkRenderer *renderer)
bool operator<(const PcdQueueItem &rhs) const
virtual size_t sizeOf() const
static boost::shared_ptr< boost::thread > pcd_reader_thread
void setRenderCamera(Camera *render_camera)
int getLodPixelThreshold()
void increaseLodPixelThreshold()
uint64_t getPointsLoaded()
void setDisplayVoxels(bool display_voxels)
A point structure representing Euclidean xyz coordinates.
static PcdQueue pcd_queue
static boost::mutex pcd_queue_mutex
std::priority_queue< PcdQueueItem > PcdQueue
OutofcoreCloud(std::string name, boost::filesystem::path &tree_root)
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.
void setLodPixelThreshold(int lod_pixel_threshold)
static boost::mutex cloud_data_cache_mutex
CloudDataCacheItem(std::string pcd_file, float coverage, vtkSmartPointer< vtkPolyData > cloud_data, size_t timestamp)
vtkSmartPointer< vtkActorCollection > getCloudActors() const
void setDisplayDepth(int displayDepth)
This code defines the octree used for point storage at Urban Robotics.
LRUCache< std::string, CloudDataCacheItem > CloudDataCache