本文整理汇总了C++中triSurface::edgeFaces方法的典型用法代码示例。如果您正苦于以下问题:C++ triSurface::edgeFaces方法的具体用法?C++ triSurface::edgeFaces怎么用?C++ triSurface::edgeFaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类triSurface
的用法示例。
在下文中一共展示了triSurface::edgeFaces方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Foam::vector Foam::surfaceLocation::normal(const triSurface& s) const
{
const vectorField& n = s.faceNormals();
if (elementType_ == triPointRef::NONE)
{
return n[index()];
}
else if (elementType_ == triPointRef::EDGE)
{
const labelList& eFaces = s.edgeFaces()[index()];
if (eFaces.size() == 1)
{
return n[eFaces[0]];
}
else
{
vector edgeNormal(vector::zero);
forAll(eFaces, i)
{
edgeNormal += n[eFaces[i]];
}
return edgeNormal/(mag(edgeNormal) + VSMALL);
}
}
else
{
return s.pointNormals()[index()];
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:foam-extend-foam-extend-3.2,代码行数:30,代码来源:surfaceLocation.C
示例2: bb
void Foam::edgeIntersections::checkEdges(const triSurface& surf)
{
const pointField& localPoints = surf.localPoints();
const edgeList& edges = surf.edges();
const labelListList& edgeFaces = surf.edgeFaces();
treeBoundBox bb(localPoints);
scalar minSize = SMALL * bb.minDim();
forAll(edges, edgeI)
{
const edge& e = edges[edgeI];
scalar eMag = e.mag(localPoints);
if (eMag < minSize)
{
WarningIn
(
"Foam::edgeIntersections::checkEdges(const triSurface& surf)"
) << "Edge " << edgeI << " vertices " << e
<< " coords:" << localPoints[e[0]] << ' '
<< localPoints[e[1]] << " is very small compared to bounding"
<< " box dimensions " << bb << endl
<< "This might lead to problems in intersection"
<< endl;
}
if (edgeFaces[edgeI].size() == 1)
{
WarningIn
(
"Foam::edgeIntersections::checkEdges(const triSurface& surf)"
) << "Edge " << edgeI << " vertices " << e
<< " coords:" << localPoints[e[0]] << ' '
<< localPoints[e[1]] << " has only one face connected to it:"
<< edgeFaces[edgeI] << endl
<< "This might lead to problems in intersection"
<< endl;
}
}
}
示例3: changedFaces
Foam::labelList Foam::orientedSurface::edgeToFace
(
const triSurface& s,
const labelList& changedEdges,
labelList& flip
)
{
labelList changedFaces(2*changedEdges.size());
label changedI = 0;
// 1.6.x merge: using local faces. Reconsider
// Rewrite uses cached local faces for efficiency
// HJ, 24/Aug/2010
const List<labelledTri> lf = s.localFaces();
forAll(changedEdges, i)
{
label edgeI = changedEdges[i];
const labelList& eFaces = s.edgeFaces()[edgeI];
if (eFaces.size() < 2)
{
// Do nothing, faces was already visited.
}
else if (eFaces.size() == 2)
{
label face0 = eFaces[0];
label face1 = eFaces[1];
const labelledTri& f0 = lf[face0];
const labelledTri& f1 = lf[face1];
// Old. HJ, 24/Aug/2010
// const labelledTri& f0 = s[face0];
// const labelledTri& f1 = s[face1];
if (flip[face0] == UNVISITED)
{
if (flip[face1] == UNVISITED)
{
FatalErrorIn("orientedSurface::edgeToFace") << "Problem"
<< abort(FatalError);
}
else
{
// Face1 has a flip state, face0 hasn't
if (consistentEdge(s.edges()[edgeI], f0, f1))
{
// Take over flip status
flip[face0] = (flip[face1] == FLIP ? FLIP : NOFLIP);
}
else
{
// Invert
flip[face0] = (flip[face1] == FLIP ? NOFLIP : FLIP);
}
changedFaces[changedI++] = face0;
}
}
else
{
if (flip[face1] == UNVISITED)
{
// Face0 has a flip state, face1 hasn't
if (consistentEdge(s.edges()[edgeI], f0, f1))
{
flip[face1] = (flip[face0] == FLIP ? FLIP : NOFLIP);
}
else
{
flip[face1] = (flip[face0] == FLIP ? NOFLIP : FLIP);
}
changedFaces[changedI++] = face1;
}
}
}
else
{
// Multiply connected. Do what?
}
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:foam-extend-foam-extend-3.2,代码行数:82,代码来源:orientedSurface.C