本文整理汇总了C++中MeshPtr::addVertex方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::addVertex方法的具体用法?C++ MeshPtr::addVertex怎么用?C++ MeshPtr::addVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::addVertex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
pcl::ihs::Integration::addToMesh (const CloudModel::const_iterator& it_pt_0,
const CloudModel::const_iterator& it_pt_1,
const CloudModel::const_iterator& it_pt_2,
const CloudModel::const_iterator& it_pt_3,
const VertexIndexes::iterator& it_vi_0,
const VertexIndexes::iterator& it_vi_1,
const VertexIndexes::iterator& it_vi_2,
const VertexIndexes::iterator& it_vi_3,
const MeshPtr& mesh) const
{
// Treated bitwise
// 2 - 1
// | |
// 3 - 0
const unsigned char is_finite = static_cast <unsigned char> ((1 * pcl::isFinite (*it_pt_0)) | (2 * pcl::isFinite (*it_pt_1)) | (4 * pcl::isFinite (*it_pt_2)) | (8 * pcl::isFinite (*it_pt_3)));
switch (is_finite)
{
case 7: this->addToMesh (it_pt_0, it_pt_1, it_pt_2, it_vi_0, it_vi_1, it_vi_2, mesh); break; // 0-1-2
case 11: this->addToMesh (it_pt_0, it_pt_1, it_pt_3, it_vi_0, it_vi_1, it_vi_3, mesh); break; // 0-1-3
case 13: this->addToMesh (it_pt_0, it_pt_2, it_pt_3, it_vi_0, it_vi_2, it_vi_3, mesh); break; // 0-2-3
case 14: this->addToMesh (it_pt_1, it_pt_2, it_pt_3, it_vi_1, it_vi_2, it_vi_3, mesh); break; // 1-2-3
case 15: // 0-1-2-3
{
if (!distanceThreshold (*it_pt_0, *it_pt_1, *it_pt_2, *it_pt_3)) break;
if (!it_vi_0->isValid ()) *it_vi_0 = mesh->addVertex (*it_pt_0);
if (!it_vi_1->isValid ()) *it_vi_1 = mesh->addVertex (*it_pt_1);
if (!it_vi_2->isValid ()) *it_vi_2 = mesh->addVertex (*it_pt_2);
if (!it_vi_3->isValid ()) *it_vi_3 = mesh->addVertex (*it_pt_3);
mesh->addFace (*it_vi_0, *it_vi_1, *it_vi_2, *it_vi_3);
break;
}
}
}
示例2:
void
pcl::ihs::Integration::addToMesh (const CloudModel::const_iterator& it_pt_0,
const CloudModel::const_iterator& it_pt_1,
const CloudModel::const_iterator& it_pt_2,
const VertexIndexes::iterator& it_vi_0,
const VertexIndexes::iterator& it_vi_1,
const VertexIndexes::iterator& it_vi_2,
const MeshPtr& mesh) const
{
if (!distanceThreshold (*it_pt_0, *it_pt_1, *it_pt_2)) return;
if (!it_vi_0->isValid ()) *it_vi_0 = mesh->addVertex (*it_pt_0);
if (!it_vi_1->isValid ()) *it_vi_1 = mesh->addVertex (*it_pt_1);
if (!it_vi_2->isValid ()) *it_vi_2 = mesh->addVertex (*it_pt_2);
mesh->addFace (*it_vi_0, *it_vi_1, *it_vi_2);
}
示例3: switch
void
pcl::ihs::Integration::addToMesh (const PointIHS& pt_0,
const PointIHS& pt_1,
const PointIHS& pt_2,
const PointIHS& pt_3,
VertexIndex& vi_0,
VertexIndex& vi_1,
VertexIndex& vi_2,
VertexIndex& vi_3,
const MeshPtr& mesh) const
{
// Treated bitwise
// 2 - 1
// | |
// 3 - 0
const unsigned char is_finite = static_cast <unsigned char> (
(1 * !boost::math::isnan (pt_0.x)) |
(2 * !boost::math::isnan (pt_1.x)) |
(4 * !boost::math::isnan (pt_2.x)) |
(8 * !boost::math::isnan (pt_3.x)));
switch (is_finite)
{
case 7: this->addToMesh (pt_0, pt_1, pt_2, vi_0, vi_1, vi_2, mesh); break; // 0-1-2
case 11: this->addToMesh (pt_0, pt_1, pt_3, vi_0, vi_1, vi_3, mesh); break; // 0-1-3
case 13: this->addToMesh (pt_0, pt_2, pt_3, vi_0, vi_2, vi_3, mesh); break; // 0-2-3
case 14: this->addToMesh (pt_1, pt_2, pt_3, vi_1, vi_2, vi_3, mesh); break; // 1-2-3
case 15: // 0-1-2-3
{
if (!distanceThreshold (pt_0, pt_1, pt_2, pt_3)) break;
if (!vi_0.isValid ()) vi_0 = mesh->addVertex (pt_0);
if (!vi_1.isValid ()) vi_1 = mesh->addVertex (pt_1);
if (!vi_2.isValid ()) vi_2 = mesh->addVertex (pt_2);
if (!vi_3.isValid ()) vi_3 = mesh->addVertex (pt_3);
if (vi_0==vi_1 || vi_0==vi_2 || vi_0==vi_3 || vi_1==vi_2 || vi_1==vi_3 || vi_2==vi_3)
{
return;
}
mesh->addTrianglePair (vi_0, vi_1, vi_2, vi_3);
break;
}
}
}
示例4:
void
pcl::ihs::Integration::addToMesh (const PointIHS& pt_0,
const PointIHS& pt_1,
const PointIHS& pt_2,
VertexIndex& vi_0,
VertexIndex& vi_1,
VertexIndex& vi_2,
const MeshPtr& mesh) const
{
if (!distanceThreshold (pt_0, pt_1, pt_2)) return;
if (!vi_0.isValid ()) vi_0 = mesh->addVertex (pt_0);
if (!vi_1.isValid ()) vi_1 = mesh->addVertex (pt_1);
if (!vi_2.isValid ()) vi_2 = mesh->addVertex (pt_2);
if (vi_0==vi_1 || vi_0==vi_2 || vi_1==vi_2)
{
return;
}
mesh->addFace (vi_0, vi_1, vi_2);
}