本文整理汇总了C++中NodeContainer::at方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeContainer::at方法的具体用法?C++ NodeContainer::at怎么用?C++ NodeContainer::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeContainer
的用法示例。
在下文中一共展示了NodeContainer::at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildNonboundaryEdgeList
void EdgeContainer::buildNonboundaryEdgeList()
{
NodeContainer pContainer = m_triangleContainer.getPointContainer();
m_edgeToTriangleIndecesMap.clear();
m_edgeList.clear();
// Loop over all triangles and build a unique list of non-boundary edges.
for (unsigned indexOuter = 0; indexOuter < m_triangleContainer.size() ; ++ indexOuter)
{
const Triangle& tOuter = m_triangleContainer.at(indexOuter);
for (unsigned indexInner = indexOuter + 1; indexInner < m_triangleContainer.size() ; ++ indexInner)
{
if ( m_triangleContainer.hasCommonNode(indexInner, indexOuter) )
{
const Triangle& tInner = m_triangleContainer.at(indexInner);
// Find common nodes
std::vector<NodeContainer::SizeType> edgePointList;
for (unsigned ii = 0; ii < 3; ++ii)
{
for (unsigned jj = 0; jj < 3; ++jj)
{
if (tOuter.at(ii) == tInner.at(jj))
{
edgePointList.push_back(pContainer.find(tOuter.at(ii)));
}
}
}
assert(edgePointList.size() < 3); // Three matching nodes = coincident triangle
if (edgePointList.size() == 2)
{
// Found a common edge
Edge e;
std::sort(edgePointList.begin(), edgePointList.end());
e.set(pContainer.at(edgePointList.at(0)), pContainer.at(edgePointList.at(1)));
// Add items in sorted order (smallest to largest - basis function direction)
if (indexOuter < indexInner)
{
e.setSortedAssociatedTriangles({indexOuter, indexInner});
m_edgeToTriangleIndecesMap.push_back({indexOuter, indexInner});
}
else
{
e.setSortedAssociatedTriangles({indexInner, indexOuter});
m_edgeToTriangleIndecesMap.push_back({indexInner, indexOuter});
}
m_edgeList.push_back(e);
}
}
}
}
buildTriangleToEdgeMap();
}