Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
bitpit::SkdNode Class Reference

The SkdPatchInfo class defines a node of the skd-tree. More...

Inheritance diagram for bitpit::SkdNode:
Inheritance graph
[legend]
Collaboration diagram for bitpit::SkdNode:
Collaboration graph
[legend]

Public Types

enum  ChildLocation { CHILD_LEFT = 0 , CHILD_RIGHT = 1 , CHILD_BEGIN = 0 , CHILD_END = 2 }
 

Public Member Functions

 SkdNode ()
 
 SkdNode (const SkdPatchInfo *patchInfo, std::size_t cellRangeBegin, std::size_t cellRangeEnd)
 
std::array< double, 3 > evalBoxWeightedMean () const
 
double evalBoxWeightedMean (int direction) const
 
double evalPointDistance (const std::array< double, 3 > &point, bool interiorCellsOnly) const
 
void findPointClosestCell (const std::array< double, 3 > &point, bool interiorCellsOnly, long *closestId, double *closestDistance) const
 
const SkdBoxgetBoundingBox () const
 
long getCell (std::size_t n) const
 
std::size_t getCellCount () const
 
std::vector< long > getCells () const
 
std::size_t getChildId (ChildLocation child) const
 
bool hasChild (ChildLocation child) const
 
bool isLeaf () const
 
void updatePointClosestCell (const std::array< double, 3 > &point, bool interiorCellsOnly, long *closestId, double *closestDistance) const
 
void updatePointClosestCells (const std::array< double, 3 > &point, bool interiorCellsOnly, std::vector< long > *closestIds, double *closestDistance) const
 
- Public Member Functions inherited from bitpit::SkdBox
 SkdBox ()
 
 SkdBox (const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax)
 
bool boxContainsPoint (const std::array< double, 3 > &point, double offset) const
 
bool boxIntersectsSphere (const std::array< double, 3 > &center, double radius) const
 
double evalPointMaxDistance (const std::array< double, 3 > &point) const
 
double evalPointMaxDistance (const std::array< double, 3 > &point, double emptyDistance) const
 
double evalPointMaxSquareDistance (const std::array< double, 3 > &point) const
 
double evalPointMaxSquareDistance (const std::array< double, 3 > &point, double emptySquareDistance) const
 
double evalPointMinDistance (const std::array< double, 3 > &point) const
 
double evalPointMinDistance (const std::array< double, 3 > &point, double emptyDistance) const
 
double evalPointMinSquareDistance (const std::array< double, 3 > &point) const
 
double evalPointMinSquareDistance (const std::array< double, 3 > &point, double emptySquareDistance) const
 
const std::array< double, 3 > & getBoxMax () const
 
const std::array< double, 3 > & getBoxMin () const
 
bool isEmpty () const
 

Static Public Attributes

BITPIT_PUBLIC_API static constexpr const int MAX_CHILDREN = 2
 
static BITPIT_PUBLIC_API const std::size_t NULL_ID = std::numeric_limits<std::size_t>::max()
 

Friends

class PatchSkdTree
 

Additional Inherited Members

- Protected Attributes inherited from bitpit::SkdBox
std::array< double, 3 > m_boxMax
 
std::array< double, 3 > m_boxMin
 

Detailed Description

The SkdPatchInfo class defines a node of the skd-tree.

Definition at line 96 of file patch_skd_tree.hpp.

Member Enumeration Documentation

◆ ChildLocation

enum bitpit::SkdNode::ChildLocation

Definition at line 105 of file patch_skd_tree.hpp.

Constructor & Destructor Documentation

◆ SkdNode() [1/2]

bitpit::SkdNode::SkdNode ( )

Default constructor.

Definition at line 442 of file patch_skd_tree.cpp.

◆ SkdNode() [2/2]

bitpit::SkdNode::SkdNode ( const SkdPatchInfo * patchInfo,
std::size_t cellRangeBegin,
std::size_t cellRangeEnd )

Constructor

Parameters
patchInfoare the patch information
cellRangeBeginis the index of the first cell enclosed in the bounding box associated to the node
cellRangeEndis the index of the past-the-end cell enclosed in the bounding box associated to the node

Definition at line 458 of file patch_skd_tree.cpp.

Member Function Documentation

◆ evalBoxWeightedMean() [1/2]

std::array< double, 3 > bitpit::SkdNode::evalBoxWeightedMean ( ) const

Evaluates the weighted centroid of the bounding box associated to the node.

Returns
The the weighted centroid of the bounding box associated to the node.

Definition at line 573 of file patch_skd_tree.cpp.

◆ evalBoxWeightedMean() [2/2]

double bitpit::SkdNode::evalBoxWeightedMean ( int direction) const

Evaluates the weighted centroid along the specified direction of the bounding box associated with the node.

Parameters
directionis the direction along which the centroid is requested
Returns
The the weighted centroid of the bounding box associated to the node.

Definition at line 595 of file patch_skd_tree.cpp.

◆ evalPointDistance()

double bitpit::SkdNode::evalPointDistance ( const std::array< double, 3 > & point,
bool interiorCellsOnly ) const

Computes the distance between the specified point and the closest cell contained in the bounding box associated to the node.

Parameters
pointis the point
interiorCellsOnlyif set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled
Returns
The distance between the specified point and the closest cell contained in the bounding box associated to the node.

Definition at line 659 of file patch_skd_tree.cpp.

◆ findPointClosestCell()

void bitpit::SkdNode::findPointClosestCell ( const std::array< double, 3 > & point,
bool interiorCellsOnly,
long * id,
double * closestDistance ) const

Given the specified point find the closest cell contained in the bounding box associated to the node and evaluates the distance between that cell and the given point.

Parameters
pointis the point
interiorCellsOnlyif set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled
[out]idon output it will contain the id of the closest cell
[out]closestDistanceon output it will contain the distance between the point and the closest cell

Definition at line 682 of file patch_skd_tree.cpp.

◆ getBoundingBox()

const SkdBox & bitpit::SkdNode::getBoundingBox ( ) const

Get the bounding box associated to the node.

Definition at line 561 of file patch_skd_tree.cpp.

◆ getCell()

long bitpit::SkdNode::getCell ( std::size_t n) const

Get the n-th cell enclosed in the bounding box associated to the node.

Parameters
nis the index of the requested cell
Returns
The n-th cell enclosed in the bounding box associated to the node.

Definition at line 523 of file patch_skd_tree.cpp.

◆ getCellCount()

std::size_t bitpit::SkdNode::getCellCount ( ) const

Count the cells enclosed in the bounding box associated to the node.

Returns
The number of cells enclosed in the bounding box associated to the node.

Definition at line 512 of file patch_skd_tree.cpp.

◆ getCells()

std::vector< long > bitpit::SkdNode::getCells ( ) const

Get the list of cells enclosed in the bounding box associated to the node.

Returns
The list of cells enclosed in the bounding box associated to the node.

Definition at line 540 of file patch_skd_tree.cpp.

◆ getChildId()

std::size_t bitpit::SkdNode::getChildId ( ChildLocation child) const

Get the id of the specified child.

Parameters
childis the child that has to reteived
Returns
The id of the specified child.

Definition at line 643 of file patch_skd_tree.cpp.

◆ hasChild()

bool bitpit::SkdNode::hasChild ( ChildLocation child) const

Checks if a node has the specified child.

Parameters
childis the child that has to be checked
Returns
Returns true if the specified child exists, false otherwise.

Definition at line 632 of file patch_skd_tree.cpp.

◆ isLeaf()

bool bitpit::SkdNode::isLeaf ( ) const

Checks if a node is a leaf.

Returns
Returns true is the node is a leaf, false otherwise.

Definition at line 614 of file patch_skd_tree.cpp.

◆ updatePointClosestCell()

void bitpit::SkdNode::updatePointClosestCell ( const std::array< double, 3 > & point,
bool interiorCellsOnly,
long * closestId,
double * closestDistance ) const

Given the specified point find if, among the cells contained in the bounding box associated to the node, there is a cell closer to the one received in input.

If two cells have the same distance, the closest cell will be chosen using the normal of the cells: the cell more "aligned" with the line that connect the specified point and its projection onto the cell will be chosen.

Parameters
pointis the point
interiorCellsOnlyif set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled
[in,out]closestIdis the id of the current closest cell, on output it will be updated if a closer cell is found
[in,out]closestDistanceis the distance of the current closest cell, on output it will be updated if a closer cell is found

Definition at line 709 of file patch_skd_tree.cpp.

◆ updatePointClosestCells()

void bitpit::SkdNode::updatePointClosestCells ( const std::array< double, 3 > & point,
bool interiorCellsOnly,
std::vector< long > * closestIds,
double * closestDistance ) const

Given the specified point find if, among the cells contained in the bounding box associated to the node, there are cells closer to the one received in input.

In output all the cells at minimal distance from the given point are provided.

Parameters
pointis the point
interiorCellsOnlyif set to true, only interior cells will be considered, it will be possible to consider non-interior cells only if the tree has been instantiated with non-interior cells support enabled
[in,out]closestIdsare the indices of the closest cells, on output it will be updated if the specified cell is closer than the current closest cells or it is at the same distance.
[in,out]closestDistanceis the distance of the current closest cells, on output it will be updated if closer cells are found

Definition at line 802 of file patch_skd_tree.cpp.

Friends And Related Symbol Documentation

◆ PatchSkdTree

friend class PatchSkdTree
friend

Definition at line 98 of file patch_skd_tree.hpp.

Member Data Documentation

◆ MAX_CHILDREN

BITPIT_PUBLIC_API static constexpr const int bitpit::SkdNode::MAX_CHILDREN = 2
staticconstexpr

Definition at line 103 of file patch_skd_tree.hpp.

◆ NULL_ID

const std::size_t bitpit::SkdNode::NULL_ID = std::numeric_limits<std::size_t>::max()
static

Null node id

Definition at line 101 of file patch_skd_tree.hpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---