ENH: support construction of pointIndexHit from pointHit

STYLE: combine templated/non-templated headers (reduced clutter)

STYLE: use hitPoint(const point&) combined setter

- same as setHit() + setPoint(const point&)

ENH: expose and use labelOctBits::pack method for addressing
This commit is contained in:
Mark Olesen
2022-10-13 11:23:35 +02:00
parent 454f7960b0
commit 9433898941
29 changed files with 689 additions and 760 deletions

View File

@ -365,7 +365,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::calcVolumeType
}
// Store octant type
nodeTypes_.set((nodeI<<3)+octant, subType);
nodeTypes_.set(labelBits::pack(nodeI, octant), subType);
// Combine sub node types into type for treeNode. Result is 'mixed' if
// types differ among subnodes.
@ -393,7 +393,11 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
direction octant = nod.bb_.subOctant(sample);
volumeType octantType = volumeType::type(nodeTypes_.get((nodeI<<3)+octant));
volumeType octantType =
volumeType::type
(
nodeTypes_.get(labelBits::pack(nodeI, octant))
);
if (octantType == volumeType::INSIDE)
{
@ -1418,9 +1422,8 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode
{
// Hit so pt is nearer than nearestPoint.
// Update hit info
hitInfo.setHit();
hitInfo.hitPoint(pt);
hitInfo.setIndex(shapeI);
hitInfo.setPoint(pt);
return;
}
}
@ -1456,9 +1459,8 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode
// Hit so pt is nearer than nearestPoint.
nearestPoint = pt;
// Update hit info
hitInfo.setHit();
hitInfo.hitPoint(pt);
hitInfo.setIndex(shapeI);
hitInfo.setPoint(pt);
}
}