Class for constructing and querying Hierarchical Oriented Bounding Box trees. More...
#include <OrientedBoxTreeTool.hpp>
Classes | |
class | IntRegCtxt |
Default/Base class to provide a context for registering intersections. More... | |
class | Op |
Implement this and pass instance to preorder_traverse. More... | |
struct | SetData |
struct | Settings |
Misc. knobs controlling tree subdivision. More... | |
class | TrvStats |
Traversal statistics structure. More... | |
Public Types | |
typedef std::pair< const double *, const double * > | IntersectSearchWindow |
This provides the search range for ray intersections, measured relative to the origin of the ray. More... | |
Public Member Functions | |
OrientedBoxTreeTool (Interface *i, const char *tag_name=0, bool destroy_created_trees=false) | |
~OrientedBoxTreeTool () | |
ErrorCode | build (const Range &entities, EntityHandle &set_handle_out, const Settings *settings=0) |
Build oriented bounding box tree. More... | |
ErrorCode | join_trees (const Range &tree_roots, EntityHandle &root_set_out, const Settings *settings=0) |
Build a tree of sets, where each set contains triangles. More... | |
ErrorCode | ray_intersect_triangles (std::vector< double > &distances_out, std::vector< EntityHandle > &facets_out, EntityHandle root_set, double tolerance, const double ray_point[3], const double unit_ray_dir[3], const double *ray_length=0, TrvStats *accum=0) |
Intersect a ray with the triangles contained within the tree. More... | |
ErrorCode | ray_intersect_boxes (Range &boxes_out, EntityHandle root_set, double tolerance, const double ray_point[3], const double unit_ray_dir[3], const double *ray_length=0, TrvStats *accum=0) |
Intersect ray with tree. More... | |
ErrorCode | ray_intersect_triangles (std::vector< double > &intersection_distances_out, std::vector< EntityHandle > &intersection_facets_out, const Range &leaf_boxes_containing_tris, double tolerance, const double ray_point[3], const double unit_ray_dir[3], const double *ray_length=0, unsigned int *raytri_test_count=0) |
Intersect ray with triangles contained in passed MBENTITYSETs. More... | |
ErrorCode | ray_intersect_sets (std::vector< double > &distances_out, std::vector< EntityHandle > &sets_out, std::vector< EntityHandle > &facets_out, EntityHandle root_set, double tolerance, const double ray_point[3], const double unit_ray_dir[3], IntersectSearchWindow &search_win, IntRegCtxt ®ister_intersection, TrvStats *accum=0) |
Intersect a ray with the triangles contained within the tree. More... | |
ErrorCode | ray_intersect_sets (std::vector< double > &distances_out, std::vector< EntityHandle > &sets_out, std::vector< EntityHandle > &facets_out, EntityHandle root_set, double tolerance, const double ray_point[3], const double unit_ray_dir[3], const double *ray_length=0, TrvStats *accum=0) |
ErrorCode | ray_intersect_sets (EntityHandle root_set, double tolerance, const double ray_point[3], const double unit_ray_dir[3], IntersectSearchWindow &search_win, IntRegCtxt ®ister_intersection, TrvStats *accum=0) |
ErrorCode | closest_to_location (const double *point, EntityHandle tree_root, double *point_out, EntityHandle &facet_out, EntityHandle *set_out=0, TrvStats *accum=0) |
Find closest surface, facet in surface, and location on facet. More... | |
ErrorCode | closest_to_location (const double *point, EntityHandle tree_root, double tolerance, std::vector< EntityHandle > &facets_out, std::vector< EntityHandle > *sets_out=0, TrvStats *accum=0) |
Find closest facet(s) to input position. More... | |
ErrorCode | sphere_intersect_triangles (const double *center, double radius, EntityHandle tree_root, std::vector< EntityHandle > &facets_out, std::vector< EntityHandle > *sets_out=0, TrvStats *accum=0) |
Find facets intersected by a sphere. More... | |
ErrorCode | get_close_tris (CartVect int_pt, double tol, const EntityHandle *rootSet, const EntityHandle *geomVol, const Tag *senseTag, std::vector< EntityHandle > &close_tris, std::vector< int > &close_senses) |
ErrorCode | box (EntityHandle node_set, double center[3], double axis1[3], double axis2[3], double axis3[3]) |
Get oriented box at node in tree. More... | |
ErrorCode | delete_tree (EntityHandle root_set) |
ErrorCode | remove_root (EntityHandle root_set) |
Remove obb tree root from the Oriented Box Tree Tool data structure. More... | |
void | print (EntityHandle tree_root_set, std::ostream &stream, bool list_contents=false, const char *id_tag_name=0) |
Print out tree. More... | |
ErrorCode | stats (EntityHandle tree_root_set, std::ostream &stream) |
Print tree statistics. More... | |
ErrorCode | stats (EntityHandle set, unsigned &entities_in_tree, double &root_volume, double &tot_node_volume, double &tot_to_root_volume, unsigned &tree_height, unsigned &node_count, unsigned &num_leaves) |
Get tree statistics. More... | |
ErrorCode | preorder_traverse (EntityHandle root_set, Op &operation, TrvStats *accum=0) |
Visitor pattern - do operation for each tree node. More... | |
Interface * | get_moab_instance () const |
ErrorCode | box (EntityHandle node_set, OrientedBox &box) |
Get oriented box at node in tree. More... | |
Private Member Functions | |
ErrorCode | build_tree (const Range &entities, EntityHandle &set, int depth, const Settings &settings) |
ErrorCode | build_sets (std::list< SetData > &sets, EntityHandle &node_set, int depth, const Settings &settings) |
ErrorCode | recursive_stats (OrientedBoxTreeTool *tool, Interface *instance, EntityHandle set, int depth, StatData &data, unsigned &count_out, CartVect &dimensions_out) |
Private Attributes | |
Interface * | instance |
Tag | tagHandle |
bool | cleanUpTrees |
std::vector< EntityHandle > | createdTrees |
Class for constructing and querying Hierarchical Oriented Bounding Box trees.
Definition at line 42 of file OrientedBoxTreeTool.hpp.
typedef std::pair< const double*, const double* > moab::OrientedBoxTreeTool::IntersectSearchWindow |
This provides the search range for ray intersections, measured relative to the origin of the ray.
first: nonnegative limit for search second: negative limit for search
These are const double* so that the window is always defined by pointing to other quantities, but it is not posible to change those quantities via the window.
Definition at line 55 of file OrientedBoxTreeTool.hpp.
moab::OrientedBoxTreeTool::OrientedBoxTreeTool | ( | Interface * | i, |
const char * | tag_name = 0 , |
||
bool | destroy_created_trees = false |
||
) |
Definition at line 49 of file OrientedBoxTreeTool.cpp.
References moab::DEFAULT_TAG_NAME, ErrorCode, instance, MB_SUCCESS, moab::OrientedBox::tag_handle(), and tagHandle.
moab::OrientedBoxTreeTool::~OrientedBoxTreeTool | ( | ) |
Definition at line 57 of file OrientedBoxTreeTool.cpp.
References cleanUpTrees, createdTrees, delete_tree(), ErrorCode, instance, MB_SUCCESS, moab::Interface::tag_get_by_ptr(), and tagHandle.
ErrorCode moab::OrientedBoxTreeTool::box | ( | EntityHandle | node_set, |
double | center[3], | ||
double | axis1[3], | ||
double | axis2[3], | ||
double | axis3[3] | ||
) |
Get oriented box at node in tree.
Get the oriented box for a node in an oriented bounding box tree.
Definition at line 91 of file OrientedBoxTreeTool.cpp.
References moab::OrientedBox::center, center(), ErrorCode, moab::CartVect::get(), and moab::OrientedBox::scaled_axis().
Referenced by closest_to_location(), moab::GeomTopoTool::get_obb(), moab::FBEngine::getEntBoundBox(), TriStats::leaf(), main(), moab::TreeNodePrinter::print_geometry(), recursive_stats(), sphere_intersect_triangles(), moab::split_box(), moab::split_sets(), TriStats::TriStats(), moab::RayIntersector::visit(), moab::RayIntersectSets::visit(), and TriCounter::visit().
ErrorCode moab::OrientedBoxTreeTool::box | ( | EntityHandle | node_set, |
OrientedBox & | box | ||
) |
Get oriented box at node in tree.
Get the oriented box for a node in an oriented bounding box tree.
NOTE: This function is provided for internal MOAB use only. The definition of OrientedBox is not available as a part of the MOAB API
Definition at line 86 of file OrientedBoxTreeTool.cpp.
References instance, moab::Interface::tag_get_data(), and tagHandle.
ErrorCode moab::OrientedBoxTreeTool::build | ( | const Range & | entities, |
EntityHandle & | set_handle_out, | ||
const Settings * | settings = 0 |
||
) |
Build oriented bounding box tree.
Build an oriented bounding box tree.
entities | A list of either vertices or 2-D elements (not both) for which to build a tree. |
set_handle_out | A handle for the entity set representing the root of the tree. |
Definition at line 115 of file OrientedBoxTreeTool.cpp.
References build_tree(), entities, MB_TYPE_OUT_OF_RANGE, and moab::OrientedBoxTreeTool::Settings::valid().
Referenced by moab::GeomTopoTool::construct_obb_tree(), and main().
|
private |
Definition at line 340 of file OrientedBoxTreeTool.cpp.
References moab::Interface::add_child_meshset(), child, moab::OrientedBox::compute_from_covariance_data(), moab::Interface::create_meshset(), delete_tree(), ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_entities_by_dimension(), instance, MB_SUCCESS, moab::OrientedBoxTreeTool::Settings::set_options, moab::split_sets(), moab::Interface::tag_set_data(), tagHandle, and moab::Interface::UNION.
Referenced by join_trees().
|
private |
Definition at line 204 of file OrientedBoxTreeTool.cpp.
References moab::Interface::add_child_meshset(), moab::Interface::add_entities(), moab::OrientedBoxTreeTool::Settings::best_split_ratio, child, moab::OrientedBox::compute_from_2d_cells(), moab::Interface::create_meshset(), createdTrees, delete_tree(), moab::Range::empty(), entities, ErrorCode, instance, moab::OrientedBoxTreeTool::Settings::max_depth, moab::OrientedBoxTreeTool::Settings::max_leaf_entities, MB_SUCCESS, moab::OrientedBoxTreeTool::Settings::set_options, moab::Range::size(), moab::split_box(), moab::Range::swap(), moab::Interface::tag_set_data(), tagHandle, and moab::OrientedBoxTreeTool::Settings::worst_split_ratio.
Referenced by build().
ErrorCode moab::OrientedBoxTreeTool::closest_to_location | ( | const double * | point, |
EntityHandle | tree_root, | ||
double * | point_out, | ||
EntityHandle & | facet_out, | ||
EntityHandle * | set_out = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Find closest surface, facet in surface, and location on facet.
Find the closest location in the tree to the specified location.
point | Location to search from |
point_out | Closest location on closest facet |
facet_out | Closest 2D element to input position |
set_out | Set containing closest facet. 0 if tree was not constructed using 'set_build' |
Definition at line 1118 of file OrientedBoxTreeTool.cpp.
References moab::Range::begin(), box(), children, moab::Range::clear(), moab::OrientedBox::closest_location_in_box(), moab::GeomUtil::closest_location_on_polygon(), moab::GeomUtil::closest_location_on_tri(), moab::Range::empty(), moab::Range::end(), moab::OrientedBoxTreeTool::TrvStats::end_traversal(), ErrorCode, moab::Range::front(), moab::CartVect::get(), moab::Interface::get_child_meshsets(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Interface::get_entities_by_type(), moab::OrientedBoxTreeTool::TrvStats::increment(), moab::OrientedBoxTreeTool::TrvStats::increment_leaf(), instance, MB_MULTIPLE_ENTITIES_FOUND, MB_SUCCESS, MBENTITYSET, and moab::Range::size().
Referenced by moab::GeomQueryTool::closest_to_location(), moab::GeomQueryTool::get_normal(), moab::FBEngine::getEntClosestPt(), moab::FBEngine::getEntNrmlXYZ(), moab::SmoothFace::project_to_facets_main(), and moab::GeomQueryTool::test_volume_boundary().
ErrorCode moab::OrientedBoxTreeTool::closest_to_location | ( | const double * | point, |
EntityHandle | tree_root, | ||
double | tolerance, | ||
std::vector< EntityHandle > & | facets_out, | ||
std::vector< EntityHandle > * | sets_out = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Find closest facet(s) to input position.
Find the closest location(s) in the tree to the specified location.
point | Location to search from |
facets_out | Closest 2D elements to input position are appended to this list |
sets_out | If non-null, sets owning facets are appended to this list. |
Definition at line 1258 of file OrientedBoxTreeTool.cpp.
References moab::Range::begin(), box(), children, moab::Range::clear(), moab::OrientedBox::closest_location_in_box(), moab::GeomUtil::closest_location_on_polygon(), moab::GeomUtil::closest_location_on_tri(), moab::Range::empty(), moab::Range::end(), moab::OrientedBoxTreeTool::TrvStats::end_traversal(), ErrorCode, moab::Interface::get_child_meshsets(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Interface::get_entities_by_type(), moab::OrientedBoxTreeTool::TrvStats::increment(), moab::OrientedBoxTreeTool::TrvStats::increment_leaf(), instance, MB_MULTIPLE_ENTITIES_FOUND, MB_SUCCESS, MBENTITYSET, moab::Range::size(), and moab::tolerance.
ErrorCode moab::OrientedBoxTreeTool::delete_tree | ( | EntityHandle | root_set | ) |
Definition at line 469 of file OrientedBoxTreeTool.cpp.
References children, createdTrees, moab::Interface::delete_entities(), ErrorCode, moab::Interface::get_child_meshsets(), instance, and MB_SUCCESS.
Referenced by build_sets(), build_tree(), and ~OrientedBoxTreeTool().
ErrorCode moab::OrientedBoxTreeTool::get_close_tris | ( | CartVect | int_pt, |
double | tol, | ||
const EntityHandle * | rootSet, | ||
const EntityHandle * | geomVol, | ||
const Tag * | senseTag, | ||
std::vector< EntityHandle > & | close_tris, | ||
std::vector< int > & | close_senses | ||
) |
Definition at line 845 of file OrientedBoxTreeTool.cpp.
References moab::CartVect::array(), ErrorCode, get_moab_instance(), MB_SUCCESS, sphere_intersect_triangles(), and moab::Interface::tag_get_data().
Referenced by moab::GQT_IntRegCtxt::register_intersection().
|
inline |
Definition at line 525 of file OrientedBoxTreeTool.hpp.
References instance.
Referenced by get_close_tris(), TriCounter::leaf(), TriStats::leaf(), moab::GQT_IntRegCtxt::register_intersection(), sphere_intersect_triangles(), and moab::GQT_IntRegCtxt::update_orient().
ErrorCode moab::OrientedBoxTreeTool::join_trees | ( | const Range & | tree_roots, |
EntityHandle & | root_set_out, | ||
const Settings * | settings = 0 |
||
) |
Build a tree of sets, where each set contains triangles.
Build a tree of sets. Each set must contain at least one triangle to define its geometry. Each passed set will become a leaf of the OBB tree. Settings controlling tree depth are ignored by this method. The tree will be as deep as it needs to be for each input set to be a leaf.
To build a tree representing the surfaces of a geometric volume, 1) Build an OBB tree for each surface using the 'build' method 2) Add each surface to the contents of the resulting OBB tree root set 3) Build a tree from all the surface OBB tree root sets using this method to get a combined tree for the volume.
Definition at line 123 of file OrientedBoxTreeTool.cpp.
References moab::Range::all_of_type(), moab::Range::begin(), moab::OrientedBoxTreeTool::SetData::box_data, build_sets(), moab::OrientedBox::covariance_data_from_tris(), createdTrees, moab::Range::empty(), moab::Range::end(), ErrorCode, moab::Interface::get_entities_by_dimension(), moab::OrientedBoxTreeTool::SetData::handle, instance, MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, MBENTITYSET, moab::Range::rbegin(), moab::Range::rend(), and moab::OrientedBoxTreeTool::Settings::valid().
Referenced by moab::GeomTopoTool::construct_obb_tree(), and moab::GeomTopoTool::construct_obb_trees().
ErrorCode moab::OrientedBoxTreeTool::preorder_traverse | ( | EntityHandle | root_set, |
Op & | operation, | ||
TrvStats * | accum = 0 |
||
) |
Visitor pattern - do operation for each tree node.
Do a preorder traversal of the tree, calling the method in the passed operation instance for each node in the tree. Parent node is visited before either child (pre-order traversal). If operator method passes back the 'descend' argument as false, traversal will not descend to the children of the current node.
Definition at line 498 of file OrientedBoxTreeTool.cpp.
References children, moab::Data::depth, moab::OrientedBoxTreeTool::TrvStats::end_traversal(), ErrorCode, moab::Interface::get_child_meshsets(), moab::OrientedBoxTreeTool::TrvStats::increment(), moab::OrientedBoxTreeTool::TrvStats::increment_leaf(), instance, moab::OrientedBoxTreeTool::Op::leaf(), MB_MULTIPLE_ENTITIES_FOUND, MB_SUCCESS, moab::Data::set, and moab::OrientedBoxTreeTool::Op::visit().
Referenced by obbstat_write(), obbvis_create(), print(), ray_intersect_boxes(), and ray_intersect_sets().
void moab::OrientedBoxTreeTool::print | ( | EntityHandle | tree_root_set, |
std::ostream & | stream, | ||
bool | list_contents = false , |
||
const char * | id_tag_name = 0 |
||
) |
Print out tree.
Print the tree to an output stream in a human-readable form.
tree_root_set | Entity set representing tree root. |
list_contents | If true, list entities in each tree node, If false, just list number of entities. |
id_tag_name | If specified, must be the name of an existing integer tag containing an ID for the entities. Not used if list_contents is false. |
Definition at line 1653 of file OrientedBoxTreeTool.cpp.
References ErrorCode, instance, MB_SUCCESS, and preorder_traverse().
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_boxes | ( | Range & | boxes_out, |
EntityHandle | root_set, | ||
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
const double * | ray_length = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Intersect ray with tree.
Return the tree nodes (as MBENTITYSET handles) for the leaf boxes of the tree intersected by a ray.
boxes_out | The boxes intersected by the ray. |
tolerance | The tolerance to use in intersection checks. |
ray_point | The base point of the ray. |
unit_ray_dir | The ray direction vector (must be unit length) |
ray_length | Optional ray length (intersect segment instead of ray.) |
Definition at line 815 of file OrientedBoxTreeTool.cpp.
References preorder_traverse(), and moab::tolerance.
Referenced by ray_intersect_triangles().
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_sets | ( | EntityHandle | root_set, |
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
IntersectSearchWindow & | search_win, | ||
IntRegCtxt & | register_intersection, | ||
TrvStats * | accum = 0 |
||
) |
Definition at line 1090 of file OrientedBoxTreeTool.cpp.
References preorder_traverse(), moab::OrientedBoxTreeTool::TrvStats::ray_tri_tests_count, and moab::tolerance.
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_sets | ( | std::vector< double > & | distances_out, |
std::vector< EntityHandle > & | sets_out, | ||
std::vector< EntityHandle > & | facets_out, | ||
EntityHandle | root_set, | ||
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
const double * | ray_length = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Definition at line 1059 of file OrientedBoxTreeTool.cpp.
References ErrorCode, moab::OrientedBoxTreeTool::IntRegCtxt::get_facets(), moab::OrientedBoxTreeTool::IntRegCtxt::get_intersections(), moab::OrientedBoxTreeTool::IntRegCtxt::get_sets(), MB_SUCCESS, preorder_traverse(), moab::OrientedBoxTreeTool::TrvStats::ray_tri_tests_count, and moab::tolerance.
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_sets | ( | std::vector< double > & | distances_out, |
std::vector< EntityHandle > & | sets_out, | ||
std::vector< EntityHandle > & | facets_out, | ||
EntityHandle | root_set, | ||
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
IntersectSearchWindow & | search_win, | ||
IntRegCtxt & | register_intersection, | ||
TrvStats * | accum = 0 |
||
) |
Intersect a ray with the triangles contained within the tree.
Intersect a ray with the triangles contained in the tree and return the distance at which the intersection occured.
distances_out | The output list of intersection points on the ray. |
sets_out | The contained set encountered during the tree traversal (see 'set_build'). For the most common use, this is the set corresponding to the geometric surface containing the intersected triangle. |
facets_out | Handles of intersected triangles corresponding to distances_out |
root_set | The MBENTITYSET representing the root of the tree. |
tolerance | The tolerance to use in intersection checks. |
ray_point | The base point of the ray. |
unit_ray_dir | The ray direction vector (must be unit length) |
search_win | An interval that defines the current window in which the an intersection is being sought: (nonnegative, negative) |
register_intersection | A context for assessing and registering intersections derived from IntRegCtxt |
accum | Optional class for tree traversal statistics. |
Definition at line 1036 of file OrientedBoxTreeTool.cpp.
References ErrorCode, moab::OrientedBoxTreeTool::IntRegCtxt::get_facets(), moab::OrientedBoxTreeTool::IntRegCtxt::get_intersections(), moab::OrientedBoxTreeTool::IntRegCtxt::get_sets(), preorder_traverse(), moab::OrientedBoxTreeTool::TrvStats::ray_tri_tests_count, and moab::tolerance.
Referenced by moab::GeomQueryTool::find_volume(), moab::FBEngine::getPntRayIntsct(), moab::GeomQueryTool::point_in_volume(), moab::GeomQueryTool::ray_fire(), and moab::FBEngine::split_surface_with_direction().
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_triangles | ( | std::vector< double > & | distances_out, |
std::vector< EntityHandle > & | facets_out, | ||
EntityHandle | root_set, | ||
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
const double * | ray_length = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Intersect a ray with the triangles contained within the tree.
Intersect a ray with the triangles contained in the tree and return the distance at which the intersection occured.
distances_out | The output list of intersection points on the ray. |
facets_out | Handles of intersected triangles corresponding to distances_out |
root_set | The MBENTITYSET representing the root of the tree. |
tolerance | The tolerance to use in intersection checks. |
ray_point | The base point of the ray. |
unit_ray_dir | The ray direction vector (must be unit length) |
ray_length | Optional ray length (intersect segment instead of ray.) |
Definition at line 796 of file OrientedBoxTreeTool.cpp.
References ErrorCode, MB_SUCCESS, ray_intersect_boxes(), moab::OrientedBoxTreeTool::TrvStats::ray_tri_tests_count, and moab::tolerance.
Referenced by main().
ErrorCode moab::OrientedBoxTreeTool::ray_intersect_triangles | ( | std::vector< double > & | intersection_distances_out, |
std::vector< EntityHandle > & | intersection_facets_out, | ||
const Range & | leaf_boxes_containing_tris, | ||
double | tolerance, | ||
const double | ray_point[3], | ||
const double | unit_ray_dir[3], | ||
const double * | ray_length = 0 , |
||
unsigned int * | raytri_test_count = 0 |
||
) |
Intersect ray with triangles contained in passed MBENTITYSETs.
raytri_test_count | If non-NULL, count of ray-triangle intersect tests will be added to the value at which this points. |
Definition at line 729 of file OrientedBoxTreeTool.cpp.
References moab::Range::begin(), moab::Range::clear(), moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_handle(), moab::Interface::get_entities_by_type(), instance, MB_SUCCESS, MBTRI, moab::GeomUtil::plucker_ray_tri_intersect(), and moab::TYPE_FROM_HANDLE().
|
private |
Definition at line 1813 of file OrientedBoxTreeTool.cpp.
References moab::StatData::Ratio::accum(), moab::StatData::Stat< T >::accum(), moab::OrientedBox::area(), moab::StatData::area, box(), children, moab::StatData::count, moab::OrientedBox::dimensions(), moab::StatData::entities, ErrorCode, moab::Interface::get_child_meshsets(), moab::Interface::get_number_entities_by_handle(), moab::OrientedBox::inner_radius(), moab::StatData::leaf_depth, moab::StatData::leaf_ent, MB_MULTIPLE_ENTITIES_FOUND, MB_SUCCESS, moab::measure(), moab::OrientedBox::outer_radius(), moab::StatData::radius, moab::StatData::vol, moab::OrientedBox::volume(), and moab::StatData::volume.
Referenced by stats().
ErrorCode moab::OrientedBoxTreeTool::remove_root | ( | EntityHandle | root_set | ) |
Remove obb tree root from the Oriented Box Tree Tool data structure.
Remove obb tree root from the Oriented Box Tree Tool data structure (createdTrees)
Definition at line 480 of file OrientedBoxTreeTool.cpp.
References createdTrees, MB_ENTITY_NOT_FOUND, and MB_SUCCESS.
Referenced by moab::GeomTopoTool::remove_root().
ErrorCode moab::OrientedBoxTreeTool::sphere_intersect_triangles | ( | const double * | center, |
double | radius, | ||
EntityHandle | tree_root, | ||
std::vector< EntityHandle > & | facets_out, | ||
std::vector< EntityHandle > * | sets_out = 0 , |
||
TrvStats * | accum = 0 |
||
) |
Find facets intersected by a sphere.
Find facets intersected by a spherical volume.
center | Sphere center |
radius | Sphere radius |
tree_root | Root of OBB tree |
facets_out | List of triangles intersecting sphere |
sets_out | If not null, sets owning facets are appended to this list in an order corresponding to the entries in facets_out. |
Definition at line 570 of file OrientedBoxTreeTool.cpp.
References moab::Range::begin(), box(), center(), children, moab::Range::clear(), moab::OrientedBox::closest_location_in_box(), moab::GeomUtil::closest_location_on_tri(), moab::Range::empty(), moab::Range::end(), moab::OrientedBoxTreeTool::TrvStats::end_traversal(), ErrorCode, moab::Range::front(), moab::Interface::get_child_meshsets(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_handle(), moab::Interface::get_entities_by_type(), get_moab_instance(), moab::OrientedBoxTreeTool::TrvStats::increment(), moab::OrientedBoxTreeTool::TrvStats::increment_leaf(), instance, moab::Range::lower_bound(), MB_SUCCESS, MBENTITYSET, MBTRI, and moab::TYPE_FROM_HANDLE().
Referenced by get_close_tris().
ErrorCode moab::OrientedBoxTreeTool::stats | ( | EntityHandle | set, |
unsigned & | entities_in_tree, | ||
double & | root_volume, | ||
double & | tot_node_volume, | ||
double & | tot_to_root_volume, | ||
unsigned & | tree_height, | ||
unsigned & | node_count, | ||
unsigned & | num_leaves | ||
) |
Get tree statistics.
Get summary stats. describing tree
set | Root of tree for which data is requested |
total_entities | Entities in tree |
root_volume | Total volume of root box |
tot_node_volume | Total volume in all nodes |
tot_to_root_volume | Ratio of total / root volume |
tree_height | Maximum height of tree, from root to leaf |
node_count | Number of nodes in tree |
num_leaves | Number of leaf nodes in tree |
Definition at line 1888 of file OrientedBoxTreeTool.cpp.
References moab::StatData::count, ErrorCode, instance, moab::StatData::leaf_depth, MB_SUCCESS, recursive_stats(), moab::StatData::Stat< T >::sum, and moab::StatData::vol.
ErrorCode moab::OrientedBoxTreeTool::stats | ( | EntityHandle | tree_root_set, |
std::ostream & | stream | ||
) |
Print tree statistics.
Print misc. stats. describing tree
Definition at line 1927 of file OrientedBoxTreeTool.cpp.
References moab::StatData::area, moab::StatData::count, moab::StatData::entities, ErrorCode, moab::StatData::Ratio::hist, instance, moab::StatData::leaf_depth, moab::StatData::leaf_ent, moab::StatData::Ratio::max, moab::StatData::Stat< T >::max, MB_SUCCESS, moab::StatData::Ratio::min, moab::StatData::Stat< T >::min, moab::StatData::radius, recursive_stats(), moab::StatData::Ratio::sqr, moab::StatData::Stat< T >::sqr, moab::std_dev(), moab::StatData::Ratio::sum, moab::StatData::Stat< T >::sum, moab::StatData::vol, moab::StatData::volume, WE, and WW.
Referenced by obbstat_write(), and moab::SmoothFace::SmoothFace().
|
private |
Definition at line 558 of file OrientedBoxTreeTool.hpp.
Referenced by ~OrientedBoxTreeTool().
|
private |
Definition at line 559 of file OrientedBoxTreeTool.hpp.
Referenced by build_tree(), delete_tree(), join_trees(), remove_root(), and ~OrientedBoxTreeTool().
|
private |
Definition at line 555 of file OrientedBoxTreeTool.hpp.
Referenced by box(), build_sets(), build_tree(), closest_to_location(), delete_tree(), get_moab_instance(), join_trees(), OrientedBoxTreeTool(), preorder_traverse(), print(), ray_intersect_triangles(), sphere_intersect_triangles(), moab::split_box(), stats(), and ~OrientedBoxTreeTool().
|
private |
Definition at line 556 of file OrientedBoxTreeTool.hpp.
Referenced by box(), build_sets(), build_tree(), OrientedBoxTreeTool(), and ~OrientedBoxTreeTool().