Пример #1
0
//==============================================================================
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));
}
Пример #2
0
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);
}
Пример #3
0
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());
	}
}
Пример #4
0
//==============================================================================
VoxelGridShape::VoxelGridShape(double resolution) : Shape()
{
  setOctree(fcl_make_shared<octomap::OcTree>(resolution));
}