#include <openvdb/tree/InternalNode.h>
Public Types | |
using | ChildNodeType |
using | LeafNodeType |
using | ValueType |
using | BuildType |
using | UnionType |
using | NodeMaskType |
using | ChildOnIter |
using | ChildOnCIter |
using | ChildOffIter |
using | ChildOffCIter |
using | ChildAllIter |
using | ChildAllCIter |
using | ValueOnIter |
using | ValueOnCIter |
using | ValueOffIter |
using | ValueOffCIter |
using | ValueAllIter |
using | ValueAllCIter |
Public Member Functions | |
TopologyCopy1 (const OtherInternalNode *source, InternalNode *target, const ValueType &background) | |
void | operator() (const tbb::blocked_range< Index > &r) const |
NodeT * | probeNode (const Coord &xyz) |
NodeT * | probeNodeAndCache (const Coord &xyz, AccessorT &acc) |
const NodeT * | probeConstNode (const Coord &xyz) const |
const NodeT * | probeConstNodeAndCache (const Coord &xyz, AccessorT &acc) const |
ChildT::LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) |
const ChildT::LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) const |
const ChildT::LeafNodeType * | probeConstLeafAndCache (const Coord &xyz, AccessorT &acc) const |
ChildT::LeafNodeType * | touchLeafAndCache (const Coord &xyz, AccessorT &acc) |
const ChildT::ValueType & | getValueAndCache (const Coord &xyz, AccessorT &acc) const |
void | topologyUnion (const InternalNode< OtherChildT, Log2Dim > &other, const bool preserveTiles) |
void | topologyIntersection (const InternalNode< OtherChildT, Log2Dim > &other, const ValueType &background) |
void | topologyDifference (const InternalNode< OtherChildT, Log2Dim > &other, const ValueType &background) |
InternalNode () | |
Default constructor. | |
InternalNode (const ValueType &offValue) | |
Constructor of an InternalNode with dense inactive tiles of the specified value. | |
InternalNode (const Coord &origin, const ValueType &fillValue, bool active=false) | |
Constructs an InternalNode with dense tiles. | |
InternalNode (PartialCreate, const Coord &, const ValueType &fillValue, bool active=false) | |
InternalNode (const InternalNode &) | |
Deep copy constructor. | |
InternalNode (const InternalNode< OtherChildNodeType, Log2Dim > &other) | |
Value conversion copy constructor. | |
InternalNode (const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background, TopologyCopy) | |
Topology copy constructor. | |
InternalNode (const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &offValue, const ValueType &onValue, TopologyCopy) | |
Topology copy constructor. | |
~InternalNode () | |
ChildOnCIter | cbeginChildOn () const |
ChildOffCIter | cbeginChildOff () const |
ChildAllCIter | cbeginChildAll () const |
ChildOnCIter | beginChildOn () const |
ChildOnIter | beginChildOn () |
ChildOffCIter | beginChildOff () const |
ChildOffIter | beginChildOff () |
ChildAllCIter | beginChildAll () const |
ChildAllIter | beginChildAll () |
ValueOnCIter | cbeginValueOn () const |
ValueOffCIter | cbeginValueOff () const |
ValueAllCIter | cbeginValueAll () const |
ValueOnCIter | beginValueOn () const |
ValueOnIter | beginValueOn () |
ValueOffCIter | beginValueOff () const |
ValueOffIter | beginValueOff () |
ValueAllCIter | beginValueAll () const |
ValueAllIter | beginValueAll () |
Coord | offsetToGlobalCoord (Index n) const |
Return the global coordinates for a linear table offset. | |
const Coord & | origin () const |
Return the grid index coordinates of this node's local origin. | |
void | setOrigin (const Coord &origin) |
Set the grid index coordinates of this node's local origin. | |
Index32 | transientData () const |
Return the transient data value. | |
void | setTransientData (Index32 transientData) |
Set the transient data value. | |
Index64 | leafCount () const |
Index64 | nonLeafCount () const |
void | nodeCount (std::vector< Index64 > &vec) const |
void | nodeCount (std::vector< Index32 > &vec) const |
Index32 | childCount () const |
Index64 | onVoxelCount () const |
Index64 | offVoxelCount () const |
Index64 | onLeafVoxelCount () const |
Index64 | offLeafVoxelCount () const |
Index64 | onTileCount () const |
Index64 | memUsage () const |
Return the total amount of memory in bytes occupied by this node and its children. | |
void | evalActiveBoundingBox (CoordBBox &bbox, bool visitVoxels=true) const |
Expand the specified bounding box so that it includes the active tiles of this internal node as well as all the active values in its child nodes. If visitVoxels is false LeafNodes will be approximated as dense, i.e. with all voxels active. Else the individual active voxels are visited to produce a tight bbox. | |
CoordBBox | getNodeBoundingBox () const |
Return the bounding box of this node, i.e., the full index space spanned by the node regardless of its content. | |
bool | isEmpty () const |
bool | isConstant (ValueType &firstValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const |
bool | isConstant (ValueType &minValue, ValueType &maxValue, bool &state, const ValueType &tolerance=zeroVal< ValueType >()) const |
bool | isInactive () const |
Return true if this node has no children and only contains inactive values. | |
bool | isValueOn (const Coord &xyz) const |
Return true if the voxel at the given coordinates is active. | |
bool | isValueOn (Index offset) const |
Return true if the voxel at the given offset is active. | |
bool | isValueOff (const Coord &xyz) const |
Return true if the voxel at the given coordinates is inactive. | |
bool | isValueOff (Index offset) const |
Return true if the voxel at the given offset is inactive. | |
bool | hasActiveTiles () const |
Return true if this node or any of its child nodes have any active tiles. | |
const ValueType & | getValue (const Coord &xyz) const |
bool | probeValue (const Coord &xyz, ValueType &value) const |
Index | getValueLevel (const Coord &xyz) const |
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides. | |
const ValueType & | getFirstValue () const |
If the first entry in this node's table is a tile, return the tile's value. Otherwise, return the result of calling getFirstValue() on the child. | |
const ValueType & | getLastValue () const |
If the last entry in this node's table is a tile, return the tile's value. Otherwise, return the result of calling getLastValue() on the child. | |
void | setActiveState (const Coord &xyz, bool on) |
Set the active state of the voxel at the given coordinates but don't change its value. | |
void | setValueOnly (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates but don't change its active state. | |
void | setValueOn (const Coord &xyz) |
Mark the voxel at the given coordinates as active but don't change its value. | |
void | setValueOn (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates and mark the voxel as active. | |
void | setValueOff (const Coord &xyz) |
Mark the voxel at the given coordinates as inactive but don't change its value. | |
void | setValueOff (const Coord &xyz, const ValueType &value) |
Set the value of the voxel at the given coordinates and mark the voxel as inactive. | |
void | modifyValue (const Coord &xyz, const ModifyOp &op) |
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active. | |
void | modifyValueAndActiveState (const Coord &xyz, const ModifyOp &op) |
Apply a functor to the voxel at the given coordinates. | |
const ValueType & | getValueAndCache (const Coord &xyz, AccessorT &) const |
const ChildT::ValueType & | getValueAndCache (const Coord &xyz, AccessorT &acc) const |
bool | isValueOnAndCache (const Coord &xyz, AccessorT &) const |
void | setValueAndCache (const Coord &xyz, const ValueType &value, AccessorT &) |
void | setValueOnlyAndCache (const Coord &xyz, const ValueType &value, AccessorT &) |
void | modifyValueAndCache (const Coord &xyz, const ModifyOp &op, AccessorT &) |
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel. | |
void | modifyValueAndActiveStateAndCache (const Coord &xyz, const ModifyOp &op, AccessorT &) |
void | setValueOffAndCache (const Coord &xyz, const ValueType &value, AccessorT &) |
void | setActiveStateAndCache (const Coord &xyz, bool on, AccessorT &) |
bool | probeValueAndCache (const Coord &xyz, ValueType &value, AccessorT &) const |
Index | getValueLevelAndCache (const Coord &xyz, AccessorT &) const |
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides. | |
void | setValuesOn () |
Mark all values (both tiles and voxels) as active. | |
void | writeTopology (std::ostream &, bool toHalf=false) const |
void | readTopology (std::istream &, bool fromHalf=false) |
void | writeBuffers (std::ostream &, bool toHalf=false) const |
void | readBuffers (std::istream &, bool fromHalf=false) |
void | readBuffers (std::istream &, const CoordBBox &, bool fromHalf=false) |
const ValueType & | getValueUnsafe (Index offset) const |
Return the tile value at offset. | |
bool | getValueUnsafe (Index offset, ValueType &value) const |
Return the tile value and active state at offset. | |
ChildNodeType * | getChildUnsafe (Index offset) |
Return the child node at offset. | |
const ChildNodeType * | getChildUnsafe (Index offset) const |
Return the child node at offset. | |
const ChildNodeType * | getConstChildUnsafe (Index offset) const |
Return the child node at offset. | |
void | setActiveStateUnsafe (Index offset, bool on) |
Set the tile active state at offset but don't change its value. | |
void | setValueOnlyUnsafe (Index offset, const ValueType &value) |
Set the tile value at offset but don't change its value. | |
void | setValueOnUnsafe (Index offset) |
Mark the tile active at offset but don't change its value. | |
void | setValueOnUnsafe (Index offset, const ValueType &value) |
Set the tile value at offset and mark the voxel as active. | |
void | setValueOffUnsafe (Index offset) |
Mark the tile inactive at offset but don't change its value. | |
void | setValueOffUnsafe (Index offset, const ValueType &value) |
Set the tile value at offset and mark the voxel as inactive. | |
void | setChildUnsafe (Index offset, ChildNodeType *child) |
Replace a tile at offset with the given child node. | |
void | resetChildUnsafe (Index offset, ChildNodeType *child) |
Replace a child node at offset with the given child node. | |
ChildNodeType * | stealChildUnsafe (Index offset, const ValueType &value, bool active) |
Replace a child node at offset with the given value and active state. | |
void | deleteChildUnsafe (Index offset, const ValueType &value, bool active) |
Delete a child node at offset and replace with the given value and active state. | |
void | negate () |
Change the sign of all the values represented in this node and its child nodes. | |
void | fill (const CoordBBox &bbox, const ValueType &value, bool active=true) |
Set all voxels within a given axis-aligned box to a constant value. | |
void | denseFill (const CoordBBox &bbox, const ValueType &value, bool active=true) |
Set all voxels within a given axis-aligned box to a constant value and ensure that those voxels are all represented at the leaf level. | |
void | voxelizeActiveTiles (bool threaded=true) |
Densify active tiles, i.e., replace them with leaf-level active voxels. | |
void | copyToDense (const CoordBBox &bbox, DenseT &dense) const |
Copy into a dense grid the values of the voxels that lie within a given bounding box. | |
void | merge (InternalNode &other, const ValueType &background, const ValueType &otherBackground) |
Efficiently merge another tree into this tree using one of several schemes. | |
void | merge (const ValueType &tileValue, bool tileActive) |
Merge, using one of several schemes, this node (and its descendants) with a tile of the same dimensions and the given value and active state. | |
void | topologyUnion (const InternalNode< OtherChildNodeType, Log2Dim > &other, const bool preserveTiles=false) |
Union this branch's set of active values with the other branch's active values. The value type of the other branch can be different. | |
void | topologyUnion (const InternalNode< OtherChildT, Log2Dim > &other, const bool preserveTiles) |
void | topologyIntersection (const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background) |
Intersects this tree's set of active values with the active values of the other tree, whose ValueType may be different. | |
void | topologyIntersection (const InternalNode< OtherChildT, Log2Dim > &other, const ValueType &background) |
void | topologyDifference (const InternalNode< OtherChildNodeType, Log2Dim > &other, const ValueType &background) |
Difference this node's set of active values with the active values of the other node, whose ValueType may be different. So a resulting voxel will be active only if the original voxel is active in this node and inactive in the other node. | |
void | topologyDifference (const InternalNode< OtherChildT, Log2Dim > &other, const ValueType &background) |
void | combine (InternalNode &other, CombineOp &) |
void | combine (const ValueType &value, bool valueIsActive, CombineOp &) |
void | combine2 (const InternalNode &other0, const OtherNodeType &other1, CombineOp &) |
void | combine2 (const ValueType &value, const OtherNodeType &other, bool valIsActive, CombineOp &) |
void | combine2 (const InternalNode &other, const OtherValueType &, bool valIsActive, CombineOp &) |
void | clip (const CoordBBox &, const ValueType &background) |
Set all voxels that lie outside the given axis-aligned box to the background. | |
void | prune (const ValueType &tolerance=zeroVal< ValueType >()) |
Reduce the memory footprint of this tree by replacing with tiles any nodes whose values are all the same (optionally to within a tolerance) and have the same active state. | |
void | addLeaf (LeafNodeType *leaf) |
Add the specified leaf to this node, possibly creating a child branch in the process. If the leaf node already exists, replace it. | |
void | addLeafAndCache (LeafNodeType *leaf, AccessorT &) |
Same as addLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the coordinate. | |
NodeT * | stealNode (const Coord &xyz, const ValueType &value, bool state) |
Return a pointer to the node of type NodeT that contains voxel (x, y, z) and replace it with a tile of the specified value and state. If no such node exists, leave the tree unchanged and return nullptr . | |
bool | addChild (ChildNodeType *child) |
Add the given child node at this level deducing the offset from it's origin. If a child node with this offset already exists, delete the old node and add the new node in its place (i.e. ownership of the new child node is transferred to this InternalNode) | |
void | addTile (Index level, const Coord &xyz, const ValueType &value, bool state) |
Add a tile at the specified tree level that contains voxel (x, y, z), possibly creating a parent branch or deleting a child branch in the process. | |
void | addTile (Index offset, const ValueType &value, bool state) |
Delete any existing child branch at the specified offset and add a tile. | |
void | addTileAndCache (Index level, const Coord &xyz, const ValueType &, bool state, AccessorT &) |
Same as addTile() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z). | |
NodeType * | probeNode (const Coord &xyz) |
Return a pointer to the node that contains voxel (x, y, z). If no such node exists, return nullptr. | |
const NodeType * | probeNode (const Coord &xyz) const |
NodeT * | probeNode (const Coord &xyz) |
const NodeType * | probeConstNode (const Coord &xyz) const |
const NodeT * | probeConstNode (const Coord &xyz) const |
ChildNodeType * | probeChild (const Coord &xyz) |
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists, return nullptr. | |
const ChildNodeType * | probeChild (const Coord &xyz) const |
ChildNodeType * | probeChild (const Coord &xyz, ValueType &value, bool &active) |
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists, return nullptr. | |
const ChildNodeType * | probeChild (const Coord &xyz, ValueType &value, bool &active) const |
const ChildNodeType * | probeConstChild (const Coord &xyz) const |
const ChildNodeType * | probeConstChild (const Coord &xyz, ValueType &value, bool &active) const |
ChildNodeType * | probeChildUnsafe (Index offset) |
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr. | |
const ChildNodeType * | probeChildUnsafe (Index offset) const |
ChildNodeType * | probeChildUnsafe (Index offset, ValueType &value, bool &active) |
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr. | |
const ChildNodeType * | probeChildUnsafe (Index offset, ValueType &value, bool &active) const |
const ChildNodeType * | probeConstChildUnsafe (Index offset) const |
const ChildNodeType * | probeConstChildUnsafe (Index offset, ValueType &value, bool &active) const |
NodeType * | probeNodeAndCache (const Coord &xyz, AccessorT &) |
Same as probeNode() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z). | |
NodeT * | probeNodeAndCache (const Coord &xyz, AccessorT &acc) |
const NodeType * | probeConstNodeAndCache (const Coord &xyz, AccessorT &) const |
const NodeT * | probeConstNodeAndCache (const Coord &xyz, AccessorT &acc) const |
LeafNodeType * | probeLeaf (const Coord &xyz) |
Return a pointer to the leaf node that contains voxel (x, y, z). If no such node exists, return nullptr . | |
const LeafNodeType * | probeLeaf (const Coord &xyz) const |
const LeafNodeType * | probeConstLeaf (const Coord &xyz) const |
LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) |
Same as probeLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z). | |
const LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) const |
ChildT::LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) |
const ChildT::LeafNodeType * | probeLeafAndCache (const Coord &xyz, AccessorT &acc) const |
const LeafNodeType * | probeConstLeafAndCache (const Coord &xyz, AccessorT &acc) const |
const ChildT::LeafNodeType * | probeConstLeafAndCache (const Coord &xyz, AccessorT &acc) const |
LeafNodeType * | touchLeaf (const Coord &xyz) |
Return the leaf node that contains voxel (x, y, z). If no such node exists, create one, but preserve the values and active states of all voxels. | |
LeafNodeType * | touchLeafAndCache (const Coord &xyz, AccessorT &) |
Same as touchLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the coordinate. | |
ChildT::LeafNodeType * | touchLeafAndCache (const Coord &xyz, AccessorT &acc) |
void | getNodes (ArrayT &array) |
Adds all nodes of a certain type to a container with the following API: | |
void | getNodes (ArrayT &array) const |
void | stealNodes (ArrayT &array, const ValueType &value, bool state) |
Steals all nodes of a certain type from the tree and adds them to a container with the following API: | |
void | resetBackground (const ValueType &oldBackground, const ValueType &newBackground) |
Change inactive tiles or voxels with value oldBackground to newBackground or -oldBackground to -newBackground. Active values are unchanged. | |
bool | hasSameTopology (const InternalNode< OtherChildNodeType, OtherLog2Dim > *other) const |
Return true if the given tree branch has the same node and active value topology as this tree branch (but possibly a different ValueType ). | |
bool | isValueMaskOn (Index n) const |
bool | isValueMaskOn () const |
bool | isValueMaskOff (Index n) const |
bool | isValueMaskOff () const |
bool | isChildMaskOn (Index n) const |
bool | isChildMaskOff (Index n) const |
bool | isChildMaskOff () const |
const NodeMaskType & | getValueMask () const |
const NodeMaskType & | getChildMask () const |
NodeMaskType | getValueOffMask () const |
const UnionType * | getTable () const |
Static Public Member Functions | |
static Index | dim () |
static Index | getLevel () |
static void | getNodeLog2Dims (std::vector< Index > &dims) |
Populated an std::vector with the dimension of all the nodes in the branch starting with this node. | |
static Index | getChildDim () |
static Index | coordToOffset (const Coord &xyz) |
Return the linear table offset of the given global or local coordinates. | |
static void | offsetToLocalCoord (Index n, Coord &xyz) |
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0, 0, 0). | |
Public Attributes | |
const OtherInternalNode * | s |
InternalNode * | t |
const ValueType & | b |
Static Public Attributes | |
static const Index | LOG2DIM |
static const Index | TOTAL |
static const Index | DIM |
static const Index | NUM_VALUES |
static const Index | LEVEL |
static const Index64 | NUM_VOXELS |
Protected Types | |
using | MaskOnIterator |
using | MaskOffIterator |
using | MaskDenseIterator |
Protected Member Functions | |
void | setValueMask (Index n, bool on) |
void | makeChildNodeEmpty (Index n, const ValueType &value) |
void | setChildNode (Index i, ChildNodeType *child) |
void | resetChildNode (Index i, ChildNodeType *child) |
ChildNodeType * | unsetChildNode (Index i, const ValueType &value) |
ChildNodeType * | getChildNode (Index n) |
Returns a pointer to the child node at the linear offset n. | |
const ChildNodeType * | getChildNode (Index n) const |
Returns a pointer to the child node at the linear offset n. | |
Protected Attributes | |
UnionType | mNodes [NUM_VALUES] |
NodeMaskType | mChildMask |
NodeMaskType | mValueMask |
Coord | mOrigin |
Global grid index coordinates (x,y,z) of the local origin of this node. | |
Index32 | mTransientData |
Transient data (not serialized) | |
Friends | |
class | IteratorBase< MaskOnIterator, InternalNode > |
class | IteratorBase< MaskOffIterator, InternalNode > |
class | IteratorBase< MaskDenseIterator, InternalNode > |
class | InternalNode |
During topology-only construction, access is needed to protected/private members of other template instances. | |
using BuildType |
using ChildAllCIter |
using ChildAllIter |
using ChildNodeType |
using ChildOffCIter |
using ChildOffIter |
using ChildOnCIter |
using ChildOnIter |
using LeafNodeType |
|
protected |
|
protected |
|
protected |
using NodeMaskType |
using UnionType |
using ValueAllCIter |
using ValueAllIter |
using ValueOffCIter |
using ValueOffIter |
using ValueOnCIter |
using ValueOnIter |
using ValueType |
|
inline |
|
inline |
|
inline |
Add the given child node at this level deducing the offset from it's origin. If a child node with this offset already exists, delete the old node and add the new node in its place (i.e. ownership of the new child node is transferred to this InternalNode)
true
if inserting the child has been successful, otherwise the caller retains ownership of the node and is responsible for deleting it.
|
inline |
Add the specified leaf to this node, possibly creating a child branch in the process. If the leaf node already exists, replace it.
|
inline |
Same as addLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the coordinate.
Add a tile at the specified tree level that contains voxel (x, y, z), possibly creating a parent branch or deleting a child branch in the process.
Delete any existing child branch at the specified offset and add a tile.
|
inline |
Same as addTile() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set all voxels that lie outside the given axis-aligned box to the background.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the linear table offset of the given global or local coordinates.
|
inline |
Copy into a dense grid the values of the voxels that lie within a given bounding box.
bbox | inclusive bounding box of the voxels to be copied into the dense grid |
dense | dense grid with a stride in z of one (see tools::Dense in tools/Dense.h for the required API) |
Delete a child node at offset and replace with the given value and active state.
Set all voxels within a given axis-aligned box to a constant value and ensure that those voxels are all represented at the leaf level.
bbox | inclusive coordinates of opposite corners of an axis-aligned box. |
value | the value to which to set voxels within the box. |
active | if true, mark voxels within the box as active, otherwise mark them as inactive. |
|
inlinestatic |
The number of voxels in one coordinate direction covered by this node
|
inline |
Expand the specified bounding box so that it includes the active tiles of this internal node as well as all the active values in its child nodes. If visitVoxels is false LeafNodes will be approximated as dense, i.e. with all voxels active. Else the individual active voxels are visited to produce a tight bbox.
Set all voxels within a given axis-aligned box to a constant value.
bbox | inclusive coordinates of opposite corners of an axis-aligned box |
value | the value to which to set voxels within the box |
active | if true, mark voxels within the box as active, otherwise mark them as inactive |
|
inlinestatic |
The number of voxels in one coordinate direction covered by a child node of this node.
|
inline |
|
inlineprotected |
Returns a pointer to the child node at the linear offset n.
|
inlineprotected |
Returns a pointer to the child node at the linear offset n.
|
inline |
Return the child node at offset.
|
inline |
Return the child node at offset.
|
inline |
Return the child node at offset.
|
inline |
If the first entry in this node's table is a tile, return the tile's value. Otherwise, return the result of calling getFirstValue() on the child.
|
inline |
If the last entry in this node's table is a tile, return the tile's value. Otherwise, return the result of calling getLastValue() on the child.
|
inlinestatic |
Level 0 is by definition the level of the leaf nodes
|
inline |
Return the bounding box of this node, i.e., the full index space spanned by the node regardless of its content.
|
static |
Populated an std::vector with the dimension of all the nodes in the branch starting with this node.
|
inline |
Adds all nodes of a certain type to a container with the following API:
An example of a wrapper around a c-style array is:
An example that constructs a list of pointer to all leaf nodes is:
|
inline |
|
inline |
|
inline |
Return the value of the voxel at the given coordinates and, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
|
inline |
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides.
Return the level of the tree (0 = leaf) at which the value at the given coordinates resides.
If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
|
inline |
|
inline |
Return the tile value at offset.
Return the tile value and active state at offset.
|
inline |
Return true
if this node or any of its child nodes have any active tiles.
|
inline |
Return true
if the given tree branch has the same node and active value topology as this tree branch (but possibly a different ValueType
).
|
inline |
Default constructor.
|
inline |
Constructs an InternalNode with dense tiles.
origin | The location in index space of the fist tile value |
fillValue | Value assigned to all the tiles |
active | State assigned to all the tiles |
|
inline |
Deep copy constructor.
|
inlineexplicit |
Value conversion copy constructor.
|
inline |
Topology copy constructor.
|
inline |
Topology copy constructor.
|
inlineexplicit |
Constructor of an InternalNode with dense inactive tiles of the specified value.
offValue | Background value used for inactive values |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true
if all of this node's table entries have the same active state and the same constant value to within the given tolerance, and return that value in firstValue and the active state in state.
false
if this node contains any child nodes.
|
inline |
Return true
if all of this node's tables entries have the same active state and the range of its values satisfy (maxValue - minValue) <= tolerance.
minValue | Is updated with the minimum of all values IF method returns true . Else the value is undefined! |
maxValue | Is updated with the maximum of all values IF method returns true . Else the value is undefined! |
state | Is updated with the state of all values IF method returns true . Else the value is undefined! |
tolerance | The tolerance used to determine if values are approximately constant. |
false
if this node contains any child nodes.
|
inline |
|
inline |
Return true
if this node has no children and only contains inactive values.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true
if the voxel at the given coordinates is inactive.
|
inline |
Return true
if the voxel at the given offset is inactive.
|
inline |
Return true
if the voxel at the given coordinates is active.
|
inline |
Return true
if the voxel at the given offset is active.
|
inline |
Return true
if the voxel at the given coordinates is active and, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
|
inline |
Return the total amount of memory in bytes occupied by this node and its children.
|
inline |
Merge, using one of several schemes, this node (and its descendants) with a tile of the same dimensions and the given value and active state.
|
inline |
Efficiently merge another tree into this tree using one of several schemes.
|
inline |
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active.
|
inline |
Apply a functor to the voxel at the given coordinates.
|
inline |
Apply a functor to the voxel at the given coordinates. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
Apply a functor to the value of the voxel at the given coordinates and mark the voxel as active. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
Change the sign of all the values represented in this node and its child nodes.
|
inline |
|
inline |
|
inline |
|
inline |
Return the global coordinates for a linear table offset.
Return the local coordinates for a linear table offset, where offset 0 has coordinates (0, 0, 0).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the grid index coordinates of this node's local origin.
|
inline |
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists, return nullptr.
|
inline |
Return a pointer to the child node that contains voxel (x, y, z). If no such node exists, return nullptr.
|
inline |
|
inline |
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr.
|
inline |
Return a pointer to the child node for a specific offset. If no such node exists, return nullptr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const LeafNodeType * probeConstLeafAndCache | ( | const Coord & | xyz, |
AccessorT & | acc ) const |
|
inline |
|
inline |
const NodeType * probeConstNode | ( | const Coord & | xyz | ) | const |
|
inline |
|
inline |
const NodeType * probeConstNodeAndCache | ( | const Coord & | xyz, |
AccessorT & | ) const |
|
inline |
|
inline |
|
inline |
Return a pointer to the leaf node that contains voxel (x, y, z). If no such node exists, return nullptr
.
const LeafNodeType * probeLeaf | ( | const Coord & | xyz | ) | const |
LeafNodeType * probeLeafAndCache | ( | const Coord & | xyz, |
AccessorT & | acc ) |
Same as probeLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z).
|
inline |
|
inline |
const LeafNodeType * probeLeafAndCache | ( | const Coord & | xyz, |
AccessorT & | acc ) const |
|
inline |
|
inline |
NodeType * probeNode | ( | const Coord & | xyz | ) |
Return a pointer to the node that contains voxel (x, y, z). If no such node exists, return nullptr.
|
inline |
|
inline |
|
inline |
NodeType * probeNodeAndCache | ( | const Coord & | xyz, |
AccessorT & | ) |
Same as probeNode() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing (x, y, z).
|
inline |
|
inline |
Return, in value, the value of the voxel at the given coordinates and, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
true
if the voxel at the given coordinates is active Reduce the memory footprint of this tree by replacing with tiles any nodes whose values are all the same (optionally to within a tolerance) and have the same active state.
|
inline |
|
inline |
|
inline |
Change inactive tiles or voxels with value oldBackground to newBackground or -oldBackground to -newBackground. Active values are unchanged.
|
inlineprotected |
|
inline |
Replace a child node at offset with the given child node.
|
inline |
Set the active state of the voxel at the given coordinates but don't change its value.
|
inline |
Set the active state of the voxel at the given coordinates without changing its value. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
Set the tile active state at offset but don't change its value.
|
inlineprotected |
|
inline |
Replace a tile at offset with the given child node.
|
inline |
Set the grid index coordinates of this node's local origin.
|
inline |
Set the transient data value.
Change the value of the voxel at the given coordinates and mark it as active. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inlineprotected |
Use a mask accessor to ensure consistency between the child and value masks; i.e., the value mask should always be off wherever the child mask is on.
|
inline |
Mark the voxel at the given coordinates as inactive but don't change its value.
Set the value of the voxel at the given coordinates and mark the voxel as inactive.
Change the value of the voxel at the given coordinates and mark it as inactive. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
|
inline |
Mark the tile inactive at offset but don't change its value.
Set the tile value at offset and mark the voxel as inactive.
|
inline |
Mark the voxel at the given coordinates as active but don't change its value.
Set the value of the voxel at the given coordinates and mark the voxel as active.
Set the value of the voxel at the given coordinates but don't change its active state.
Set the value of the voxel at the given coordinate but preserves its active state. If necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the voxel.
Set the tile value at offset but don't change its value.
|
inline |
Mark the tile active at offset but don't change its value.
Set the tile value at offset and mark the voxel as active.
|
inline |
Mark all values (both tiles and voxels) as active.
Replace a child node at offset with the given value and active state.
Return a pointer to the node of type NodeT
that contains voxel (x, y, z) and replace it with a tile of the specified value and state. If no such node exists, leave the tree unchanged and return nullptr
.
|
inline |
Steals all nodes of a certain type from the tree and adds them to a container with the following API:
An example of a wrapper around a c-style array is:
An example that constructs a list of pointer to all leaf nodes is:
void topologyDifference | ( | const InternalNode< OtherChildNodeType, Log2Dim > & | other, |
const ValueType & | background ) |
Difference this node's set of active values with the active values of the other node, whose ValueType
may be different. So a resulting voxel will be active only if the original voxel is active in this node and inactive in the other node.
The last dummy argument is required to match the signature for InternalNode::topologyDifference.
|
inline |
|
inline |
void topologyIntersection | ( | const InternalNode< OtherChildNodeType, Log2Dim > & | other, |
const ValueType & | background ) |
Intersects this tree's set of active values with the active values of the other tree, whose ValueType
may be different.
The resulting state of a value is active only if the corresponding value was already active AND if it is active in the other tree. Also, a resulting value maps to a voxel if the corresponding value already mapped to an active voxel in either of the two grids and it maps to an active tile or voxel in the other grid.
|
inline |
|
inline |
void topologyUnion | ( | const InternalNode< OtherChildNodeType, Log2Dim > & | other, |
const bool | preserveTiles = false ) |
Union this branch's set of active values with the other branch's active values. The value type of the other branch can be different.
The resulting state of a value is active if the corresponding value was already active OR if it is active in the other tree. Also, a resulting value maps to a voxel if the corresponding value already mapped to a voxel OR if it is a voxel in the other tree. Thus, a resulting value can only map to a tile if the corresponding value already mapped to a tile AND if it is a tile value in other tree.
Specifically, active tiles and voxels in this branch are not changed, and tiles or voxels that were inactive in this branch but active in the other branch are marked as active in this branch but left with their original values.
|
inline |
|
inline |
|
inline |
Return the leaf node that contains voxel (x, y, z). If no such node exists, create one, but preserve the values and active states of all voxels.
Use this method to preallocate a static tree topology over which to safely perform multithreaded processing.
LeafNodeType * touchLeafAndCache | ( | const Coord & | xyz, |
AccessorT & | ) |
Same as touchLeaf() except, if necessary, update the accessor with pointers to the nodes along the path from the root node to the node containing the coordinate.
|
inline |
|
inline |
|
inline |
Return the transient data value.
|
inline |
Densify active tiles, i.e., replace them with leaf-level active voxels.
threaded | if true, this operation is multi-threaded (over the internal nodes). |
|
inline |
|
inline |
|
friend |
During topology-only construction, access is needed to protected/private members of other template instances.
|
friend |
|
friend |
|
friend |
Allow iterators to call mask accessor methods (setValueMask(), setChildMask(), etc.).
const ValueType& b |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
Global grid index coordinates (x,y,z) of the local origin of this node.
|
protected |
Transient data (not serialized)
|
protected |
|
static |
|
static |
const OtherInternalNode* s |
InternalNode* t |
|
static |