当前位置: 首页>>代码示例>>C++>>正文


C++ Renderable::has_pointcloud方法代码示例

本文整理汇总了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;
}
开发者ID:CURG,项目名称:graspit_bci,代码行数:30,代码来源:RenderableProtoDrawer.cpp

示例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);
    }
}
开发者ID:CURG,项目名称:graspit_bci,代码行数:21,代码来源:RenderableProtoDrawer.cpp


注:本文中的Renderable::has_pointcloud方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。