AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/quest/InOutOctree.hpp>
Public Member Functions | |
InOutOctree (const GeometricBoundingBox &bb, SurfaceMesh *&meshPtr) | |
Construct an InOutOctree to handle containment queries on a surface mesh. More... | |
void | generateIndex () |
Generate the spatial index over the surface mesh. More... | |
bool | within (const SpacePt &pt) const |
The point containment query. More... | |
void | setVertexWeldThreshold (double thresh) |
Sets the threshold for welding vertices during octree construction. More... | |
const GeometricBoundingBox & | boundingBox () const |
Returns a reference to the octree's bounding box (i.e. the bounding box of the root block) More... | |
GeometricBoundingBox | blockBoundingBox (const BlockIndex &block) const |
Return the spatial bounding box of a grid cell at the given level or resolution. More... | |
GeometricBoundingBox | blockBoundingBox (const GridPt &gridPt, int level) const |
Return the spatial bounding box of a grid cell at the given level or resolution. More... | |
const SpaceVector & | spacingAtLevel (int level) const |
BlockIndex | findLeafBlock (const SpacePt &pt, int startingLevel=-1) const |
Finds the index of the leaf block covering the query point pt. More... | |
GridPt | findGridCellAtLevel (const SpacePt &pt, int lev) const |
Utility function to find the quantized grid cell at level lev for query point pt. More... | |
int | maxLeafLevel () const |
The max level for leaf blocks of the octree. More... | |
int | maxInternalLevel () const |
The max level for internal blocks of the octree. More... | |
OctreeLevelType & | getOctreeLevel (int lev) |
Accessor for a reference to the octree level instance at level lev. More... | |
const OctreeLevelType & | getOctreeLevel (int lev) const |
Const accessor for a reference to the octree level instance at level lev. More... | |
bool | isLevelValid (int lev) const |
Predicate to determine if level lev is in the range. More... | |
bool | isLeaf (const GridPt &pt, int lev) const |
Determine whether the octree contains a leaf block associated with grid point pt at level lev. More... | |
bool | isLeaf (const BlockIndex &block) const |
Determine whether the octree contains a leaf block associated with this BlockIndex. More... | |
bool | isInternal (const GridPt &pt, int lev) const |
Determine whether the octree contains an internal block associated with grid point pt at level lev. More... | |
bool | isInternal (const BlockIndex &block) const |
Determine whether the octree contains an internal block associated with this BlockIndex. More... | |
bool | hasBlock (const GridPt &pt, int lev) const |
Determine whether the octree contains a block (internal or leaf) associated with grid point pt at level lev. More... | |
bool | hasBlock (const BlockIndex &block) const |
Determine whether the octree contains a block (internal or leaf) associated with this BlockIndex. More... | |
bool | inBounds (const GridPt &pt, int lev) const |
Determine whether the octree block associated with grid point pt and level lev is a possible block in this octree. More... | |
bool | inBounds (const BlockIndex &block) const |
Determine whether the octree block associated with BlockIndex is a possible block in this octree. More... | |
void | refineLeaf (const BlockIndex &leafBlock) |
Refines the given leaf block in the octree. More... | |
InOutBlockData & | operator[] (const BlockIndex &block) |
Accessor to the data associated with block. More... | |
const InOutBlockData & | operator[] (const BlockIndex &block) const |
Const accessor to the data associated with block. More... | |
BlockIndex | coveringLeafBlock (const BlockIndex &blk, bool checkInBounds=true) const |
Finds the finest octree leaf covering BlockIndex blk. More... | |
BlockIndex | parent (const GridPt &pt, int level) const |
Finds the grid index and level of the current octree block's parent. More... | |
BlockIndex | parent (const BlockIndex &block) const |
Finds the BlockIndex of the given block's parent. More... | |
BlockIndex | child (const GridPt &pt, int level, int childIndex) const |
Finds the BlockIndex of the given block's child. More... | |
BlockIndex | child (const BlockIndex &block, int childIndex) const |
Finds the BlockIndex of the given block's child. More... | |
Static Public Member Functions | |
static CoordType | maxCoordAtLevel (int level) |
Utility function to find the number of (possible) grid cells at a given level or resolution. More... | |
static BlockIndex | root () |
Static Public Attributes | |
static const int | MAX_VERTS_PER_BLOCK = 1 |
Protected Member Functions | |
TreeBlockStatus | blockStatus (const GridPt &pt, int lev) const |
Helper function to determine the status of a BlockIndex within an octree instance. More... | |
TreeBlockStatus | blockStatus (const BlockIndex &blk) const |
Helper function to determine the status of a BlockIndex within an octree instance. More... | |
Protected Attributes | |
MeshWrapper< DIM > | m_meshWrapper |
VertexBlockMap | m_vertexToBlockMap |
GrayLeafsLevelMap | m_grayLeafsMap |
GrayLeafVertexRelationLevelMap | m_grayLeafToVertexRelationLevelMap |
GrayLeafElementRelationLevelMap | m_grayLeafToElementRelationLevelMap |
GenerationState | m_generationState |
IndexRegistry | m_indexRegistry |
double | m_vertexWeldThresholdSquared |
double | m_boundingBoxScaleFactor {DEFAULT_BOUNDING_BOX_SCALE_FACTOR} |
Bounding box scaling factor for dealing with grazing triangles. More... | |
SpaceVectorLevelMap | m_deltaLevelMap |
SpaceVectorLevelMap | m_invDeltaLevelMap |
GeometricBoundingBox | m_boundingBox |
OctreeLevels | m_levels |
LeafIndicesLevelMap | m_leavesLevelMap |
using axom::quest::InOutOctree< DIM >::OctreeBaseType = spin::OctreeBase<DIM, InOutBlockData> |
using axom::quest::InOutOctree< DIM >::SpatialOctreeType = spin::SpatialOctree<DIM, InOutBlockData> |
using axom::quest::InOutOctree< DIM >::GeometricBoundingBox = typename SpatialOctreeType::GeometricBoundingBox |
using axom::quest::InOutOctree< DIM >::SpacePt = typename SpatialOctreeType::SpacePt |
using axom::quest::InOutOctree< DIM >::SpaceVector = typename SpatialOctreeType::SpaceVector |
using axom::quest::InOutOctree< DIM >::BlockIndex = typename SpatialOctreeType::BlockIndex |
using axom::quest::InOutOctree< DIM >::GridPt = typename OctreeBaseType::GridPt |
using axom::quest::InOutOctree< DIM >::SpaceRay = primal::Ray<double, DIM> |
using axom::quest::InOutOctree< DIM >::SurfaceMesh = typename MeshWrapper<DIM>::SurfaceMesh |
using axom::quest::InOutOctree< DIM >::VertexIndex = axom::IndexType |
using axom::quest::InOutOctree< DIM >::CellIndex = axom::IndexType |
using axom::quest::InOutOctree< DIM >::IndexRegistry = slam::FieldRegistry<slam::Set<VertexIndex>, VertexIndex> |
using axom::quest::InOutOctree< DIM >::SpaceCell = typename MeshWrapper<DIM>::SpaceCell |
using axom::quest::InOutOctree< DIM >::MeshVertexSet = typename MeshWrapper<DIM>::MeshVertexSet |
using axom::quest::InOutOctree< DIM >::MeshElementSet = typename MeshWrapper<DIM>::MeshElementSet |
using axom::quest::InOutOctree< DIM >::CellVertIndices = typename MeshWrapper<DIM>::CellVertIndices |
using axom::quest::InOutOctree< DIM >::VertexIndexMap = typename MeshWrapper<DIM>::VertexIndexMap |
using axom::quest::InOutOctree< DIM >::VertexBlockMap = slam::Map<slam::Set<>, BlockIndex> |
using axom::quest::InOutOctree< DIM >::STLIndirection = slam::policies::STLVectorIndirection<VertexIndex, VertexIndex> |
using axom::quest::InOutOctree< DIM >::GrayLeafSet = slam::PositionSet<> |
using axom::quest::InOutOctree< DIM >::BVStride = slam::policies::CompileTimeStride<VertexIndex, MAX_VERTS_PER_BLOCK> |
using axom::quest::InOutOctree< DIM >::ConstantCardinality = slam::policies::ConstantCardinality<VertexIndex, BVStride> |
using axom::quest::InOutOctree< DIM >::GrayLeafVertexRelation = slam::StaticRelation<VertexIndex, VertexIndex, ConstantCardinality, STLIndirection, GrayLeafSet, MeshVertexSet> |
using axom::quest::InOutOctree< DIM >::VariableCardinality = slam::policies::VariableCardinality<VertexIndex, STLIndirection> |
using axom::quest::InOutOctree< DIM >::GrayLeafElementRelation = slam::StaticRelation<VertexIndex, VertexIndex, VariableCardinality, STLIndirection, GrayLeafSet, MeshElementSet> |
using axom::quest::InOutOctree< DIM >::CellIndexSet = typename GrayLeafElementRelation::RelationSubset |
using axom::quest::InOutOctree< DIM >::GrayLeafsLevelMap = slam::Map<slam::Set<>, GrayLeafSet> |
using axom::quest::InOutOctree< DIM >::GrayLeafVertexRelationLevelMap = slam::Map<slam::Set<>, GrayLeafVertexRelation> |
using axom::quest::InOutOctree< DIM >::GrayLeafElementRelationLevelMap = slam::Map<slam::Set<>, GrayLeafElementRelation> |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inline |
Construct an InOutOctree to handle containment queries on a surface mesh.
[in] | bb | The spatial extent covered by the octree |
void axom::quest::InOutOctree< DIM >::generateIndex | ( | ) |
Generate the spatial index over the surface mesh.
References axom::primal::Ray< T, NDIMS >::at(), AXOM_UNUSED_VAR, axom::slam::StaticRelation< PosType, ElemType, RelationCardinalityPolicy, RelationIndicesIndirectionPolicy, TheFromSet, TheToSet >::bindIndices(), axom::primal::Polygon< T, NDIMS >::centroid(), axom::primal::clip(), axom::copy(), DEBUG_BLOCK_1, DEBUG_BLOCK_2, DEBUG_VERT_IDX, axom::primal::Ray< T, NDIMS >::direction(), axom::primal::intersect(), axom::primal::Polygon< T, NDIMS >::numVertices(), QUEST_OCTREE_DEBUG_LOG_IF, SLIC_ASSERT, SLIC_ASSERT_MSG, SLIC_DEBUG, SLIC_INFO, and axom::primal::squared_distance().
bool axom::quest::InOutOctree< DIM >::within | ( | const SpacePt & | pt | ) | const |
The point containment query.
pt | The point at which we are checking for containment |
References AXOM_DEBUG_PARAM, AXOM_UNUSED_VAR, DEBUG_BLOCK_1, DEBUG_BLOCK_2, DEBUG_TRI_IDX, DEBUG_VERT_IDX, SLIC_ASSERT_MSG, SLIC_DEBUG, and SLIC_INFO.
|
inline |
Sets the threshold for welding vertices during octree construction.
[in] | thresh | The cutoff distance at which we consider two vertices to be identical during the octree construction |
References AXOM_DEBUG_PARAM, DISABLE_COPY_AND_ASSIGNMENT, DISABLE_MOVE_AND_ASSIGNMENT, SLIC_ASSERT, and SLIC_WARNING_IF.
|
inlineinherited |
Returns a reference to the octree's bounding box (i.e. the bounding box of the root block)
References axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox.
|
inlineinherited |
Return the spatial bounding box of a grid cell at the given level or resolution.
References axom::spin::SpatialOctree< DIM, BlockDataType >::blockBoundingBox().
|
inlineinherited |
Return the spatial bounding box of a grid cell at the given level or resolution.
References axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, and axom::spin::SpatialOctree< DIM, BlockDataType >::m_deltaLevelMap.
|
inlineinherited |
Returns the width of an octree block at level of resolution level
level | The level of resolution that we are checking |
References axom::spin::SpatialOctree< DIM, BlockDataType >::m_deltaLevelMap.
|
inlineinherited |
Finds the index of the leaf block covering the query point pt.
[in] | pt | The query point in space |
[in] | startingLevel | (Optional) starting level for the query |
References axom::spin::BlockNotInTree, axom::spin::OctreeBase< DIM, BlockDataType >::blockStatus(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::spin::SpatialOctree< DIM, BlockDataType >::findGridCellAtLevel(), axom::spin::InternalBlock, axom::spin::LeafBlock, axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, axom::spin::OctreeBase< DIM, BlockDataType >::maxLeafLevel(), and SLIC_ASSERT_MSG.
|
inlineinherited |
Utility function to find the quantized grid cell at level lev for query point pt.
[in] | pt | The point at which we are querying. |
[in] | lev | The level or resolution. |
References axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, axom::spin::SpatialOctree< DIM, BlockDataType >::m_invDeltaLevelMap, axom::spin::OctreeBase< DIM, BlockDataType >::maxCoordAtLevel(), and axom::utilities::min().
|
inlineinherited |
The max level for leaf blocks of the octree.
|
inlineinherited |
The max level for internal blocks of the octree.
|
inlinestaticinherited |
Utility function to find the number of (possible) grid cells at a given level or resolution.
[in] | level | The level or resolution. |
|
inlinestaticinherited |
Auxiliary function to return the root of the octree
|
inlineinherited |
Finds the grid index and level of the current octree block's parent.
[in] | pt | The grid index of the block whose parent we want to find. |
[in] | level | The level of the block whose parent we want to find. |
|
inlineinherited |
Finds the BlockIndex of the given block's parent.
[in] | block | The block whose parent we want to find |
|
inlineinherited |
Finds the BlockIndex of the given block's child.
[in] | pt | The grid index of the block whose child we want to find. |
[in] | level | The level of the block whose child we want to find. |
[in] | childIndex | The index of the child to find |
|
inlineinherited |
Finds the BlockIndex of the given block's child.
[in] | block | The block whose child we want to find |
[in] | childIndex | The index of the child to find |
|
inlineinherited |
Accessor for a reference to the octree level instance at level lev.
|
inlineinherited |
Const accessor for a reference to the octree level instance at level lev.
|
inlineinherited |
Predicate to determine if level lev is in the range.
|
inlineinherited |
Determine whether the octree contains a leaf block associated with grid point pt at level lev.
[in] | pt | The grid point to check |
[in] | lev | The level of the grid point |
|
inlineinherited |
Determine whether the octree contains a leaf block associated with this BlockIndex.
[in] | block | The BlockIndex of the tree to check |
References axom::spin::BlockData::isLeaf().
|
inlineinherited |
Determine whether the octree contains an internal block associated with grid point pt at level lev.
[in] | pt | The grid point to check |
[in] | lev | The level of the grid point |
|
inlineinherited |
Determine whether the octree contains an internal block associated with this BlockIndex.
[in] | block | The BlockIndex of the tree to check |
|
inlineinherited |
Determine whether the octree contains a block (internal or leaf) associated with grid point pt at level lev.
[in] | pt | The grid point to check |
[in] | lev | The level of the grid point |
References SLIC_ASSERT.
|
inlineinherited |
Determine whether the octree contains a block (internal or leaf) associated with this BlockIndex.
[in] | block | The BlockIndex of the tree to check |
|
inlineinherited |
Determine whether the octree block associated with grid point pt and level lev is a possible block in this octree.
|
inlineinherited |
Determine whether the octree block associated with BlockIndex is a possible block in this octree.
|
inlineinherited |
Refines the given leaf block in the octree.
Marks leafBlock as internal (non-leaf) and adds its children to the tree
References axom::spin::OctreeLevel< DIM, BlockDataType >::addAllChildren(), axom::spin::BlockData::isLeaf(), and SLIC_ASSERT.
|
inlineinherited |
Accessor to the data associated with block.
block | A block (internal or leaf) in the tree |
References SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineinherited |
Const accessor to the data associated with block.
block | A block (internal or leaf) in the tree |
References SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineinherited |
Finds the finest octree leaf covering BlockIndex blk.
blk | A BlockIndex, not necessarily in the octree |
checkInBounds | A flag to determine if we should check that the block lies within the octree bounds (default=true) |
References axom::spin::BlockNotInTree, axom::spin::InternalBlock, axom::spin::BlockData::isLeaf(), axom::spin::LeafBlock, SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineprotectedinherited |
Helper function to determine the status of a BlockIndex within an octree instance.
pt | The grid point of the block index that we are testing |
lev | The level of the block index that we are testing |
References axom::spin::BlockNotInTree, and SLIC_ASSERT.
|
inlineprotectedinherited |
Helper function to determine the status of a BlockIndex within an octree instance.
blk | The block index we are testing |
References DISABLE_COPY_AND_ASSIGNMENT, and DISABLE_MOVE_AND_ASSIGNMENT.
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Bounding box scaling factor for dealing with grazing triangles.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |