本文整理汇总了C++中Facet::setIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ Facet::setIndex方法的具体用法?C++ Facet::setIndex怎么用?C++ Facet::setIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facet
的用法示例。
在下文中一共展示了Facet::setIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildTopology
char MembraneDeformer::buildTopology()
{
const unsigned nv = m_mesh->getNumVertices();
m_topology = new VertexAdjacency[nv];
for(unsigned i = 0; i < nv; i++) {
VertexAdjacency & v = m_topology[i];
v.setIndex(i);
v.m_v = &(m_mesh->getVertices()[i]);
}
const unsigned nf = m_mesh->getNumFaces();
unsigned a, b, c;
for(unsigned i = 0; i < nf; i++) {
a = m_mesh->getIndices()[i * 3];
b = m_mesh->getIndices()[i * 3 + 1];
c = m_mesh->getIndices()[i * 3 + 2];
Facet * f = new Facet(&m_topology[a], &m_topology[b], &m_topology[c]);
f->setIndex(i);
for(unsigned j = 0; j < 3; j++) {
Edge * e = f->edge(j);
m_topology[e->v0()->getIndex()].addEdge(e);
m_topology[e->v1()->getIndex()].addEdge(e);
}
}
for(unsigned i = 0; i < nv; i++) {
m_topology[i].findNeighbors();
m_topology[i].computeWeights();
m_topology[i].computeDifferentialCoordinate();
}
return 1;
}
示例2: buildTopology
char MeshLaplacian::buildTopology()
{
const unsigned nv = getNumVertices();
m_adjacency = new VertexAdjacency[nv];
for(unsigned i = 0; i < nv; i++) {
VertexAdjacency & v = m_adjacency[i];
v.setIndex(i);
v.m_v = &_vertices[i];
}
const unsigned nf = getNumFaces();
unsigned a, b, c;
for(unsigned i = 0; i < nf; i++) {
a = _indices[i * 3];
b = _indices[i * 3 + 1];
c = _indices[i * 3 + 2];
Facet * f = new Facet(&m_adjacency[a], &m_adjacency[b], &m_adjacency[c]);
f->setIndex(i);
for(unsigned j = 0; j < 3; j++) {
Edge * e = f->edge(j);
m_adjacency[e->v0()->getIndex()].addEdge(e);
m_adjacency[e->v1()->getIndex()].addEdge(e);
}
m_faces.push_back(f);
}
for(unsigned i = 0; i < nv; i++) {
m_adjacency[i].findNeighbors();
m_adjacency[i].computeWeights();
m_adjacency[i].computeDifferentialCoordinate();
//m_adjacency[i].verbose();
}
return 1;
}