本文整理汇总了C++中Renderable::has_pointcloud方法的典型用法代码示例。如果您正苦于以下问题:C++ Renderable::has_pointcloud方法的具体用法?C++ Renderable::has_pointcloud怎么用?C++ Renderable::has_pointcloud使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderable
的用法示例。
在下文中一共展示了Renderable::has_pointcloud方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderImpl
bool PointCloudRenderer::renderImpl(SoSeparator *ivRoot, Renderable &renderable)
{
//Being here without a point cloud is a bug.
assert(renderable.has_pointcloud() || renderable.has_pointcloud2());
//Create the node subtree of the renderable if necessary.
if(!ivRoot->getNumChildren())
{
createNodes(ivRoot, renderable);
}
setScale(ivRoot, renderable);
//Get the nodes to insert the point data into.
SoMaterial * mat = static_cast<SoMaterial *>(ivRoot->getChild(3));
SoCoordinate3 * coord =
static_cast<SoCoordinate3 *>(ivRoot->getChild(2));
//Read the point data into Inventor structures.
std::vector<SbVec3f> points;
std::vector<SbColor> colors;
int point_size = fillPointList(renderable, points,colors);
//If points were parsed or the input meant to send no points,
//set the new point cloud points and colors.
if(points.size() || !point_size)
{
//Insert the inventor structures in to the
coord->point.setValues(0,points.size(), &points[0]);
mat->diffuseColor.setValues(0,colors.size(), &colors[0]);
}
return points.size() > 0;
}
示例2: renderMessage
void RenderableProtoDrawer::renderMessage(Renderable &renderable)
{
if(renderable.has_pointcloud())
{
PointCloudRenderer renderer;
QString ivRootName("PointCloudRoot");
renderer.render(renderable,ivRootName);
}
if(renderable.has_pointcloud2())
{
PointCloud2Renderer renderer;
QString ivRootName("PointCloudRoot2");
renderer.render(renderable,ivRootName);
}
if(renderable.has_frame())
{
FrameRenderer renderer;
QString emptyName = "";
renderer.render(renderable, emptyName);
}
}