本文整理汇总了C++中scene::Ptr::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::add方法的具体用法?C++ Ptr::add怎么用?C++ Ptr::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene::Ptr
的用法示例。
在下文中一共展示了Ptr::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cloud
// Read in a 3D model
void
loadPolygonMeshModel (char* polygon_file)
{
pcl::PolygonMesh mesh;
pcl::io::loadPolygonFile (polygon_file, mesh);
pcl::PolygonMesh::Ptr cloud (new pcl::PolygonMesh (mesh));
TriangleMeshModel::Ptr model = TriangleMeshModel::Ptr (new TriangleMeshModel (cloud));
scene_->add (model);
std::cout << "Just read " << polygon_file << std::endl;
std::cout << mesh.polygons.size () << " polygons and "
<< mesh.cloud.data.size () << " triangles\n";
}
示例2: load_model
void load_model(const std::vector<std::string> & files)
{
for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file)
{
std::cout << "Load model: " << *file << std::endl;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
if (pcl::io::loadPCDFile<pcl::PointXYZRGB> (*file, *cloud) == -1) //* load the file
{
PCL_ERROR ("Couldn't read file %s \n", file->c_str()) ;
exit (-1);
}
PointCloudModel::Ptr model = PointCloudModel::Ptr(new PointCloudModel(GL_POLYGON, cloud));
scene_->add(model);
}
}
示例3: load_PolygonMesh_model
// Read in a 3D model
void load_PolygonMesh_model (char* polygon_file)
{
pcl::PolygonMesh mesh; // (new pcl::PolygonMesh);
//pcl::io::loadPolygonFile("/home/mfallon/data/models/dalet/Darlek_modified_works.obj",mesh);
pcl::io::loadPolygonFile (polygon_file, mesh);
pcl::PolygonMesh::Ptr cloud (new pcl::PolygonMesh (mesh));
// Not sure if PolygonMesh assumes triangles if to
// TODO: Ask a developer
PolygonMeshModel::Ptr model = PolygonMeshModel::Ptr (new PolygonMeshModel (GL_POLYGON, cloud));
scene_->add (model);
std::cout << "Just read " << polygon_file << std::endl;
std::cout << mesh.polygons.size () << " polygons and "
<< mesh.cloud.data.size () << " triangles\n";
}
示例4: exit
// Read in a 3D model
void
load_PolygonMesh_model (std::string polygon_file)
{
pcl::PolygonMesh mesh; // (new pcl::PolygonMesh);
//pcl::io::loadPolygonFile("/home/mfallon/data/models/dalet/Darlek_modified_works.obj",mesh);
if (!pcl::io::loadPolygonFile (polygon_file, mesh)){
std::cout << "No ply file found, exiting" << std::endl;
exit(-1);
}
pcl::PolygonMesh::Ptr cloud (new pcl::PolygonMesh (mesh));
TriangleMeshModel::Ptr model = TriangleMeshModel::Ptr (new TriangleMeshModel (cloud));
scene_->add (model);
std::cout << "Just read " << polygon_file << std::endl;
std::cout << mesh.polygons.size () << " polygons and "
<< mesh.cloud.data.size () << " triangles\n";
}