Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::RayIntersector Class Reference
+ Inheritance diagram for moab::RayIntersector:
+ Collaboration diagram for moab::RayIntersector:

Public Member Functions

 RayIntersector (OrientedBoxTreeTool *tool_ptr, const double *ray_point, const double *unit_ray_dir, const double *ray_length, double tolerance, Range &leaf_boxes)
 
virtual ErrorCode visit (EntityHandle node, int depth, bool &descend)
 Visit a node in the tree during a traversal. More...
 
virtual ErrorCode leaf (EntityHandle node)
 Process a leaf node during tree traversal. More...
 
- Public Member Functions inherited from moab::OrientedBoxTreeTool::Op
virtual ~Op ()
 

Private Attributes

OrientedBoxTreeTooltool
 
const CartVect b
 
const CartVect m
 
const double * len
 
const double tol
 
Rangeboxes
 

Detailed Description

Definition at line 693 of file OrientedBoxTreeTool.cpp.

Constructor & Destructor Documentation

◆ RayIntersector()

moab::RayIntersector::RayIntersector ( OrientedBoxTreeTool tool_ptr,
const double *  ray_point,
const double *  unit_ray_dir,
const double *  ray_length,
double  tolerance,
Range leaf_boxes 
)
inline

Definition at line 703 of file OrientedBoxTreeTool.cpp.

709  : tool( tool_ptr ), b( ray_point ), m( unit_ray_dir ), len( ray_length ), tol( tolerance ), boxes( leaf_boxes )
710  {
711  }

Member Function Documentation

◆ leaf()

ErrorCode moab::RayIntersector::leaf ( EntityHandle  node)
virtual

Process a leaf node during tree traversal.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 837 of file OrientedBoxTreeTool.cpp.

838 {
839  boxes.insert( node );
840  return MB_SUCCESS;
841 }

References MB_SUCCESS.

◆ visit()

ErrorCode moab::RayIntersector::visit ( EntityHandle  node,
int  depth,
bool &  descend 
)
virtual

Visit a node in the tree during a traversal.

This method is called for each node in the tree visited during a pre-order traversal.

Parameters
nodeThe EntityHandle for the entity set for the tree node.
depthThe current depth in the tree.
descendOutput: if false, traversal will skip children of the current node, or if the current node is a leaf, the 'leaf' method will not be called.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 827 of file OrientedBoxTreeTool.cpp.

828 {
829  OrientedBox box;
830  ErrorCode rval = tool->box( node, box );
831  if( MB_SUCCESS != rval ) return rval;
832 
833  descend = box.intersect_ray( b, m, tol, len );
834  return MB_SUCCESS;
835 }

References moab::OrientedBoxTreeTool::box(), ErrorCode, and MB_SUCCESS.

Member Data Documentation

◆ b

const CartVect moab::RayIntersector::b
private

Definition at line 697 of file OrientedBoxTreeTool.cpp.

◆ boxes

Range& moab::RayIntersector::boxes
private

Definition at line 700 of file OrientedBoxTreeTool.cpp.

◆ len

const double* moab::RayIntersector::len
private

Definition at line 698 of file OrientedBoxTreeTool.cpp.

◆ m

const CartVect moab::RayIntersector::m
private

Definition at line 697 of file OrientedBoxTreeTool.cpp.

◆ tol

const double moab::RayIntersector::tol
private

Definition at line 699 of file OrientedBoxTreeTool.cpp.

◆ tool

OrientedBoxTreeTool* moab::RayIntersector::tool
private

Definition at line 696 of file OrientedBoxTreeTool.cpp.


The documentation for this class was generated from the following file: