本文整理汇总了C++中PointView::point方法的典型用法代码示例。如果您正苦于以下问题:C++ PointView::point方法的具体用法?C++ PointView::point怎么用?C++ PointView::point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointView
的用法示例。
在下文中一共展示了PointView::point方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filter
void ColorizationFilter::filter(PointView& view)
{
PointRef point = view.point(0);
for (PointId idx = 0; idx < view.size(); ++idx)
{
point.setPointId(idx);
processOne(point);
}
}
示例2: filter
void NormalFilter::filter(PointView& view)
{
KD3Index& kdi = view.build3dIndex();
for (PointId i = 0; i < view.size(); ++i)
{
// find the k-nearest neighbors
auto ids = kdi.neighbors(i, m_knn);
// compute covariance of the neighborhood
auto B = eigen::computeCovariance(view, ids);
// perform the eigen decomposition
Eigen::SelfAdjointEigenSolver<Eigen::Matrix3f> solver(B);
if (solver.info() != Eigen::Success)
throwError("Cannot perform eigen decomposition.");
auto eval = solver.eigenvalues();
Eigen::Vector3f normal = solver.eigenvectors().col(0);
if (m_viewpointArg->set())
{
PointRef p = view.point(i);
Eigen::Vector3f vp(
m_viewpoint.x - p.getFieldAs<double>(Dimension::Id::X),
m_viewpoint.y - p.getFieldAs<double>(Dimension::Id::Y),
m_viewpoint.z - p.getFieldAs<double>(Dimension::Id::Z));
if (vp.dot(normal) < 0)
normal *= -1.0;
}
else if (m_up)
{
if (normal[2] < 0)
normal *= -1.0;
}
view.setField(Dimension::Id::NormalX, i, normal[0]);
view.setField(Dimension::Id::NormalY, i, normal[1]);
view.setField(Dimension::Id::NormalZ, i, normal[2]);
double sum = eval[0] + eval[1] + eval[2];
view.setField(Dimension::Id::Curvature, i,
sum ? std::fabs(eval[0] / sum) : 0);
}
}