//============================================================================== VoxelGridShape::VoxelGridShape(fcl_shared_ptr<octomap::OcTree> octree) : Shape() { if (!octree) { dtwarn << "[VoxelGridShape] Attempting to assign null octree. Creating an " << "empty octree with resolution 0.01 instead.\n"; setOctree(fcl_make_shared<octomap::OcTree>(0.01)); return; } setOctree(std::move(octree)); }
void OctreeShape::loadOctree(const std::string& filePath) { auto rootNode = std::make_shared<NodeType>(); rootNode->load(filePath); SURGSIM_ASSERT(isValid(rootNode)) << "Loading failed " << filePath << " contains an invalid octree."; setOctree(rootNode); }
void ccOctreeSpinBox::setCloud(ccGenericPointCloud* cloud) { if (!cloud) return; if (cloud->getOctree()) { setOctree(cloud->getOctree()); } else { ccBBox box = cloud->getOwnBB(false); CCLib::CCMiscTools::MakeMinAndMaxCubical(box.minCorner(),box.maxCorner()); m_octreeBoxWidth = box.getMaxBoxDim(); onValueChange(value()); } }
//============================================================================== VoxelGridShape::VoxelGridShape(double resolution) : Shape() { setOctree(fcl_make_shared<octomap::OcTree>(resolution)); }