#include <GeomQueryTool.hpp>
Public Member Functions | |
void | reset () |
void | reset_to_last_intersection () |
void | rollback_last_intersection () |
ErrorCode | get_last_intersection (EntityHandle &last_facet_hit) const |
int | size () const |
bool | in_history (EntityHandle ent) const |
void | add_entity (EntityHandle ent) |
Private Attributes | |
std::vector< EntityHandle > | prev_facets |
Friends | |
class | GeomQueryTool |
Definition at line 61 of file GeomQueryTool.hpp.
void moab::GeomQueryTool::RayHistory::add_entity | ( | EntityHandle | ent | ) |
Add entity to the RayHistory
Definition at line 733 of file GeomQueryTool.cpp.
734 { 735 prev_facets.push_back( ent ); 736 }
ErrorCode moab::GeomQueryTool::RayHistory::get_last_intersection | ( | EntityHandle & | last_facet_hit | ) | const |
Get the last intersection in the RayHistory. This will return a null EntityHandle (0) if the history is empty.
Definition at line 715 of file GeomQueryTool.cpp.
716 {
717 if( prev_facets.size() > 0 )
718 {
719 last_facet_hit = prev_facets.back();
720 return MB_SUCCESS;
721 }
722 else
723 {
724 return MB_ENTITY_NOT_FOUND;
725 }
726 }
References MB_ENTITY_NOT_FOUND, and MB_SUCCESS.
bool moab::GeomQueryTool::RayHistory::in_history | ( | EntityHandle | ent | ) | const |
Definition at line 728 of file GeomQueryTool.cpp.
729 {
730 return std::find( prev_facets.begin(), prev_facets.end(), ent ) != prev_facets.end();
731 }
void moab::GeomQueryTool::RayHistory::reset | ( | ) |
Clear this entire history– logically equivalent to creating a new history, but probably more efficient.
Definition at line 695 of file GeomQueryTool.cpp.
696 { 697 prev_facets.clear(); 698 }
References prev_facets.
void moab::GeomQueryTool::RayHistory::reset_to_last_intersection | ( | ) |
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 700 of file GeomQueryTool.cpp.
701 {
702
703 if( prev_facets.size() > 1 )
704 {
705 prev_facets[0] = prev_facets.back();
706 prev_facets.resize( 1 );
707 }
708 }
void moab::GeomQueryTool::RayHistory::rollback_last_intersection | ( | ) |
Remove the most recent intersection. This allows a subsequent call along the same ray to return the same intersection.
Definition at line 710 of file GeomQueryTool.cpp.
711 {
712 if( prev_facets.size() ) prev_facets.pop_back();
713 }
|
inline |
Definition at line 93 of file GeomQueryTool.hpp.
94 {
95 return prev_facets.size();
96 }
References prev_facets.
|
friend |
Definition at line 111 of file GeomQueryTool.hpp.
|
private |
Definition at line 109 of file GeomQueryTool.hpp.
Referenced by moab::GeomQueryTool::get_normal(), moab::GeomQueryTool::point_in_volume(), moab::GeomQueryTool::ray_fire(), reset(), size(), and moab::GeomQueryTool::test_volume_boundary().