当前位置: 首页>>代码示例>>C++>>正文


C++ Facet::setIndex方法代码示例

本文整理汇总了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;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:35,代码来源:MembraneDeformer.cpp

示例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;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:37,代码来源:MeshLaplacian.cpp


注:本文中的Facet::setIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。