Ejemplo n.º 1
0
// Helper function to calculate tight fitting bounding boxes.
Foam::treeBoundBoxList Foam::octreeDataTriSurface::calcBb
(
    const triSurface& surf
)
{
    treeBoundBoxList allBb(surf.size(), treeBoundBox::invertedBox);

    const labelListList& pointFcs = surf.pointFaces();
    const pointField& localPts = surf.localPoints();

    forAll(pointFcs, pointI)
    {
        const labelList& myFaces = pointFcs[pointI];
        const point& vertCoord = localPts[pointI];

        forAll(myFaces, myFaceI)
        {
            // Update bb
            label faceI = myFaces[myFaceI];

            treeBoundBox& bb = allBb[faceI];

            bb.min() = min(bb.min(), vertCoord);
            bb.max() = max(bb.max(), vertCoord);
        }
    }
Ejemplo n.º 2
0
//- Sets point neighbours of face to val
static void markPointNbrs
(
    const triSurface& surf,
    const label faceI,
    const bool val,
    boolList& okToCollapse
)
{
    const triSurface::FaceType& f = surf.localFaces()[faceI];

    forAll(f, fp)
    {
        const labelList& pFaces = surf.pointFaces()[f[fp]];

        forAll(pFaces, i)
        {
            okToCollapse[pFaces[i]] = false;
        }
    }
}