moab
moab::DagMC::RayHistory Class Reference

State object used in calls to ray_fire() More...

#include <DagMC.hpp>

List of all members.

Public Member Functions

void reset ()
void reset_to_last_intersection ()
void rollback_last_intersection ()
int size () const

Private Attributes

std::vector< EntityHandleprev_facets

Friends

class DagMC

Detailed Description

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.

Definition at line 109 of file DagMC.hpp.


Member Function Documentation

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]
Returns:
the number of surface crossings currently represented by this ray history

Definition at line 134 of file DagMC.hpp.

{ return prev_facets.size(); }

Friends And Related Function Documentation

friend class DagMC [friend]

Definition at line 139 of file DagMC.hpp.


Member Data Documentation

Definition at line 137 of file DagMC.hpp.


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