moab
|
State object used in calls to ray_fire() More...
#include <DagMC.hpp>
Public Member Functions | |
void | reset () |
void | reset_to_last_intersection () |
void | rollback_last_intersection () |
int | size () const |
Private Attributes | |
std::vector< EntityHandle > | prev_facets |
Friends | |
class | DagMC |
State object used in calls to ray_fire()
Storage for the "history" of a ray. This represents the surface facets that the ray is known to have crossed, which cannot be crossed again as long as the ray does not change direction. It is intended to be used with a series of consecutive calls to ray_fire(), in which a ray passes over potentially many surfaces.
void moab::DagMC::RayHistory::reset | ( | ) |
Clear this entire history-- logically equivalent to creating a new history, but probably more efficient.
Definition at line 517 of file DagMC.cpp.
{ prev_facets.clear(); }
Clear the history up to the most recent intersection. This should be called when a ray changes direction at the site of a surface crossing, a situation that most commonly occurs at a reflecting boundary.
Definition at line 521 of file DagMC.cpp.
{ if( prev_facets.size() > 1 ){ prev_facets[0] = prev_facets.back(); prev_facets.resize( 1 ); } }
Remove the most recent intersection. This allows a subsequent call along the same ray to return the same intersection.
Definition at line 530 of file DagMC.cpp.
{ if( prev_facets.size() ) prev_facets.pop_back(); }
int moab::DagMC::RayHistory::size | ( | ) | const [inline] |
Definition at line 134 of file DagMC.hpp.
{ return prev_facets.size(); }
std::vector<EntityHandle> moab::DagMC::RayHistory::prev_facets [private] |