本文整理汇总了C++中MyMesh::initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMesh::initialize方法的具体用法?C++ MyMesh::initialize怎么用?C++ MyMesh::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMesh
的用法示例。
在下文中一共展示了MyMesh::initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readTrimesh
void readTrimesh(MeshSegment*& meshSeg, const char* fileName)
{
std::vector<AML::double3> points;
std::vector<std::vector<unsigned> > faces;
TriMesh *triMesh = TriMesh::read(fileName);
int vNum = triMesh->vertices.size();
points.reserve(vNum);
for (int i = 0; i < vNum; i++)
{
points.push_back(AML::double3(triMesh->vertices[i][0], triMesh->vertices[i][1], triMesh->vertices[i][2]));
}
int fNum = triMesh->faces.size();
faces.reserve(fNum);
std::vector<unsigned> tf(3);
for (int i = 0; i < fNum; i++)
{
tf[0] = triMesh->faces[i][0]; tf[1] = triMesh->faces[i][1]; tf[2] = triMesh->faces[i][2];
faces.push_back(tf);
}
rescaleMesh(points);
for (int i = 0; i < vNum; i++)
{
for (int j = 0; j < 3; j++)
{
triMesh->vertices[i][j] = points[i][j];
}
}
triMesh->need_normals();
MyMesh* tmesh = new MyMesh;
tmesh->initialize(points, faces);
*(meshSeg->getMyMesh()) = tmesh;
computeCurvature(triMesh, meshSeg->getMyMesh());
}