本文整理汇总了C++中TriMesh::fv_iter方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::fv_iter方法的具体用法?C++ TriMesh::fv_iter怎么用?C++ TriMesh::fv_iter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriMesh
的用法示例。
在下文中一共展示了TriMesh::fv_iter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFaceArea
void MeshDenoisingBase::getFaceArea(TriMesh &mesh, std::vector<double> &area)
{
area.resize(mesh.n_faces());
for(TriMesh::FaceIter f_it = mesh.faces_begin(); f_it != mesh.faces_end(); f_it++)
{
std::vector<TriMesh::Point> point;
point.resize(3); int index = 0;
for(TriMesh::FaceVertexIter fv_it = mesh.fv_iter(*f_it); fv_it.is_valid(); fv_it++)
{
point[index] = mesh.point(*fv_it);
index++;
}
TriMesh::Point edge1 = point[1] - point[0];
TriMesh::Point edge2 = point[1] - point[2];
double S = 0.5 * (edge1 % edge2).length();
area[(*f_it).idx()] = S;
}
}
示例2: computeNormals
bool computeNormals(TriMesh mesh)
{
OpenMesh::FPropHandleT<TriMesh::Point> trueNormals;
OpenMesh::FPropHandleT<TriMesh::Point> approxNormals;
mesh.add_property(trueNormals);
mesh.add_property(approxNormals);
TriMesh::FaceIter f_it, f_end(mesh.faces_end());
double valence;
TriMesh::FaceVertexIter fv_it;
for (f_it=mesh.faces_begin(); f_it!=f_end; ++f_it)
{
mesh.property(trueNormals,f_it).vectorize(0.0f);
valence = 0;
for (fv_it=mesh.fv_iter( f_it ); fv_it; ++fv_it)
{
mesh.property(approxNormals,fv_it) += mesh.point( fv_it );
++valence;
}
mesh.property(approxNormals,f_it) /= valence;
}
return true;
} // bool computeNormals(TriMesh mesh)