Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
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.
virtual ErrorCode leaf (EntityHandle node)
 Process a leaf node during tree traversal.

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

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.

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

Member Function Documentation

Process a leaf node during tree traversal.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 837 of file OrientedBoxTreeTool.cpp.

References MB_SUCCESS.

{
    boxes.insert( node );
    return MB_SUCCESS;
}
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.

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

{
    OrientedBox box;
    ErrorCode rval = tool->box( node, box );
    if( MB_SUCCESS != rval ) return rval;

    descend = box.intersect_ray( b, m, tol, len );
    return MB_SUCCESS;
}

Member Data Documentation

Definition at line 697 of file OrientedBoxTreeTool.cpp.

Definition at line 700 of file OrientedBoxTreeTool.cpp.

const double* moab::RayIntersector::len [private]

Definition at line 698 of file OrientedBoxTreeTool.cpp.

Definition at line 697 of file OrientedBoxTreeTool.cpp.

const double moab::RayIntersector::tol [private]

Definition at line 699 of file OrientedBoxTreeTool.cpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines