MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "moab/Core.hpp"
#include "TestUtil.hpp"
#include "moab/BSPTree.hpp"
#include "moab/CartVect.hpp"
#include "moab/BSPTreePoly.hpp"
#include "moab/Range.hpp"
#include <algorithm>
Go to the source code of this file.
Macros | |
#define | CHECK_RAY_XSECTS(PT, DIR, T_IN, T_OUT) |
Functions | |
void | test_set_plane () |
void | test_iterator () |
void | test_box_iterator () |
void | test_tree_create () |
void | test_box_tree_create () |
void | test_leaf_containing_point_bounded_tree () |
void | test_leaf_containing_point_unbounded_tree () |
void | test_merge_leaf () |
void | test_box_iter_neighbors () |
void | test_leaf_sibling () |
void | test_leaf_volume (bool box) |
void | test_leaf_volume_box () |
void | test_leaf_volume_gen () |
void | test_leaf_splits_intersects () |
void | test_leaf_intersects_ray_common (bool box) |
void | test_box_leaf_intersects_ray () |
void | test_gen_leaf_intersects_ray () |
void | test_leaf_polyhedron () |
int | main () |
void | check_equal (const BSPTree::Plane &p1, const BSPTree::Plane &p2, const char *exp1, const char *exp2, int line, const char *file) |
bool | compare_hexes (const double expected[8][3], const double actual[8][3], double epsilon) |
static void | aabox_corners (const double min[3], const double max[3], double corners[8][3]) |
static void | aabox_corners (double min_x, double min_y, double min_z, double max_x, double max_y, double max_z, double corners[8][3]) |
static std::vector< int > | neighbors (const BSPTreeBoxIter &iter, const EntityHandle leaves[8], BSPTreeBoxIter::SideBits side, double epsilon) |
static void | box (const double pts[], int num_pts, double minpt[3], double maxpt[3]) |
static EntityHandle | build_tree (const double points[], int num_points, BSPTree &tool) |
#define CHECK_RAY_XSECTS | ( | PT, | |
DIR, | |||
T_IN, | |||
T_OUT | |||
) |
Definition at line 1515 of file bsp_tree_test.cpp.
|
static |
Definition at line 222 of file bsp_tree_test.cpp.
Referenced by aabox_corners(), test_box_iterator(), test_box_tree_create(), test_leaf_containing_point_bounded_tree(), and test_merge_leaf().
|
static |
|
static |
Definition at line 1668 of file bsp_tree_test.cpp.
Referenced by access_adjacencies(), moab::ScdInterface::add_box(), moab::ScdInterface::assign_global_ids(), moab::common_tree::box_contains_point(), moab::BVHTree::bruteforce_find(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::bucket_index(), moab::BVHTree::Bucket::bucket_index(), build_tree(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::build_tree(), moab::AdaptiveKDTree::build_tree(), moab::BVHTree::build_tree(), moab::AxisBox::calculate(), moab::common_tree::compute_box_center(), moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::compute_split(), moab::common_tree::construct_element_map(), moab::BVHTree::construct_element_vec(), DeformMeshRemap::deform_master(), moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::determine_split(), moab::AdaptiveKDTree::distance_search(), moab::BVHTree::distance_search(), do_closest_point_test(), do_ray_fire_test(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::establish_buckets(), moab::BVHTree::establish_buckets(), moab::BVHTree::get_bounding_box(), moab::Tree::get_bounding_box(), moab::AdaptiveKDTree::get_info(), moab::AdaptiveKDTree::get_last_iterator(), moab::ScdInterface::get_shared_vertices(), moab::AdaptiveKDTree::get_tree_iterator(), moab::ParallelMergeMesh::GetGlobalBox(), moab::Coupler::initialize_tree(), moab::Element::Map::inside_box(), LeafHexer::leaf(), TriStats::leaf(), moab::BVHTree::local_build_tree(), moab::Coupler::locate_points(), main(), moab::operator<<(), moab::common_tree::operator<<(), moab::BoundBox::operator==(), moab::AdaptiveKDTree::point_search(), moab::BVHTree::point_search(), moab::AdaptiveKDTree::print(), moab::TreeNodePrinter::print_geometry(), moab::AdaptiveKDTree::ray_intersect_triangles(), moab::ScdInterface::remove_box(), scaled_corner(), scaled_face(), moab::BVHTree::set_interval(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::set_interval(), moab::Skinner::skin_box(), moab::ScdInterface::tag_shared_vertices(), test_bound_box(), test_build_from_pts(), test_build_from_tri(), test_leaf_intersects_ray_common(), test_leaf_volume(), moab::Coupler::test_local_box(), test_locator(), test_save(), TriStats::TriStats(), moab::BoundBox::update(), TreeValidator::visit(), CubitWriter::visit(), and TriCounter::visit().
|
static |
Definition at line 1683 of file bsp_tree_test.cpp.
References moab::Interface::add_entities(), moab::CartVect::array(), moab::Range::begin(), box(), CHECK, CHECK_ERR, moab::BSPTree::create_tree(), moab::Interface::create_vertex(), moab::Range::end(), ErrorCode, moab::Interface::get_coords(), moab::Interface::get_entities_by_handle(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), leaf, moab::BSPTree::leaf_containing_point(), length_squared(), MB_ENTITY_NOT_FOUND, MB_SUCCESS, moab::BSPTree::moab(), moab::CartVect::normalize(), moab::BSPTree::split_leaf(), and moab::BSPTreeIter::step().
Referenced by test_leaf_polyhedron().
void check_equal | ( | const BSPTree::Plane & | p1, |
const BSPTree::Plane & | p2, | ||
const char * | exp1, | ||
const char * | exp2, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 67 of file bsp_tree_test.cpp.
References moab::BSPTree::Plane::coeff, FLAG_ERROR, and moab::BSPTree::Plane::norm.
Referenced by check_equal_eigvect().
bool compare_hexes | ( | const double | expected[8][3], |
const double | actual[8][3], | ||
double | epsilon | ||
) |
Definition at line 181 of file bsp_tree_test.cpp.
Referenced by test_box_iterator(), test_box_tree_create(), test_leaf_containing_point_bounded_tree(), and test_merge_leaf().
int main | ( | ) |
Definition at line 42 of file bsp_tree_test.cpp.
References RUN_TEST, test_box_iter_neighbors(), test_box_iterator(), test_box_leaf_intersects_ray(), test_box_tree_create(), test_gen_leaf_intersects_ray(), test_iterator(), test_leaf_containing_point_bounded_tree(), test_leaf_containing_point_unbounded_tree(), test_leaf_polyhedron(), test_leaf_sibling(), test_leaf_splits_intersects(), test_leaf_volume_box(), test_leaf_volume_gen(), test_merge_leaf(), test_set_plane(), and test_tree_create().
|
static |
Definition at line 972 of file bsp_tree_test.cpp.
References CHECK_ERR, ErrorCode, and moab::BSPTreeBoxIter::get_neighbors().
Referenced by MetisPartitioner::assemble_graph(), ZoltanPartitioner::assemble_graph(), MetisPartitioner::assemble_taggedsets_graph(), moab::Intx2Mesh::DetermineOrderedNeighbors(), get_part_boundary_verts(), get_part_neighbors(), iMeshP_getNumPartNborsArr(), moab::Intx2Mesh::intersect_meshes(), ZoltanPartitioner::partition_owned_cells(), test_box_iter_neighbors(), test_entity_copy_parts(), and test_get_neighbors().
void test_box_iter_neighbors | ( | ) |
Definition at line 987 of file bsp_tree_test.cpp.
References moab::BSPTreeBoxIter::B0154, moab::BSPTreeBoxIter::B1265, moab::BSPTreeBoxIter::B2376, moab::BSPTreeBoxIter::B3047, moab::BSPTreeBoxIter::B3210, moab::BSPTreeBoxIter::B4567, CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), neighbors(), moab::BSPTree::split_leaf(), and moab::BSPTreeBoxIter::step().
Referenced by main().
void test_box_iterator | ( | ) |
Definition at line 243 of file bsp_tree_test.cpp.
References aabox_corners(), moab::BSPTreeIter::back(), moab::BSPTreeBoxIter::back(), CHECK, CHECK_EQUAL, CHECK_ERR, compare_hexes(), moab::BSPTree::create_tree(), moab::BSPTreeIter::depth(), ErrorCode, moab::BSPTreeBoxIter::get_box_corners(), moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_end_iterator(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), MB_ENTITY_NOT_FOUND, moab::BSPTree::Plane::norm, moab::BSPTree::split_leaf(), moab::BSPTreeIter::step(), moab::BSPTreeBoxIter::step(), and moab::BSPTreeIter::tool().
Referenced by main().
void test_box_leaf_intersects_ray | ( | ) |
Definition at line 32 of file bsp_tree_test.cpp.
References test_leaf_intersects_ray_common().
Referenced by main().
void test_box_tree_create | ( | ) |
Definition at line 435 of file bsp_tree_test.cpp.
References aabox_corners(), CHECK, CHECK_EQUAL, CHECK_ERR, compare_hexes(), moab::BSPTree::create_tree(), moab::BSPTreeIter::depth(), ErrorCode, moab::BSPTreeBoxIter::get_box_corners(), moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), MB_ENTITY_NOT_FOUND, moab::BSPTree::split_leaf(), moab::BSPTreeBoxIter::step(), and moab::BSPTreeIter::tool().
Referenced by main().
void test_gen_leaf_intersects_ray | ( | ) |
Definition at line 36 of file bsp_tree_test.cpp.
References test_leaf_intersects_ray_common().
Referenced by main().
void test_iterator | ( | ) |
Definition at line 96 of file bsp_tree_test.cpp.
References moab::BSPTreeIter::back(), CHECK, CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), moab::BSPTreeIter::depth(), ErrorCode, moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_end_iterator(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), MB_ENTITY_NOT_FOUND, moab::BSPTree::Plane::norm, moab::BSPTree::split_leaf(), moab::BSPTreeIter::step(), and moab::BSPTreeIter::tool().
Referenced by main().
void test_leaf_containing_point_bounded_tree | ( | ) |
Definition at line 706 of file bsp_tree_test.cpp.
References aabox_corners(), CHECK, CHECK_EQUAL, CHECK_ERR, compare_hexes(), moab::BSPTree::create_tree(), ErrorCode, moab::BSPTreeBoxIter::get_box_corners(), moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), moab::BSPTree::leaf_containing_point(), MB_ENTITY_NOT_FOUND, moab::BSPTree::split_leaf(), and moab::BSPTreeIter::step().
Referenced by main().
void test_leaf_containing_point_unbounded_tree | ( | ) |
Definition at line 822 of file bsp_tree_test.cpp.
References CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), moab::BSPTree::leaf_containing_point(), moab::BSPTree::split_leaf(), and moab::BSPTreeIter::step().
Referenced by main().
void test_leaf_intersects_ray_common | ( | bool | box | ) |
Start with only root box for initial testing
Now split twice and test the bottom right corne
Definition at line 1523 of file bsp_tree_test.cpp.
References box(), CHECK, CHECK_ERR, CHECK_RAY_XSECTS, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::intersect_ray(), moab::BSPTree::split_leaf(), moab::BSPTreeIter::step(), moab::BSPTree::X, and moab::BSPTree::Y.
Referenced by test_box_leaf_intersects_ray(), and test_gen_leaf_intersects_ray().
void test_leaf_polyhedron | ( | ) |
Definition at line 1824 of file bsp_tree_test.cpp.
References build_tree(), moab::BSPTreeIter::calculate_polyhedron(), CHECK, CHECK_ERR, ErrorCode, moab::Interface::get_coords(), moab::Interface::get_entities_by_handle(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), moab::BSPTreePoly::is_point_contained(), moab::BSPTreePoly::is_valid(), MB_SUCCESS, moab::BSPTree::moab(), moab::BSPTreeIter::step(), and moab::BSPTreePoly::volume().
Referenced by main().
void test_leaf_sibling | ( | ) |
Definition at line 1306 of file bsp_tree_test.cpp.
References CHECK, CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), moab::BSPTreeIter::is_sibling(), moab::BSPTreeIter::sibling_is_forward(), moab::BSPTree::split_leaf(), and moab::BSPTreeIter::step().
Referenced by main().
void test_leaf_splits_intersects | ( | ) |
Definition at line 1441 of file bsp_tree_test.cpp.
References CHECK, CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTree::Plane::flip(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeBoxIter::intersects(), moab::BSPTreeBoxIter::MISS, moab::BSPTreeBoxIter::NONHEX, moab::BSPTree::Plane::set(), moab::BSPTreeBoxIter::SPLIT, and moab::BSPTreeBoxIter::splits().
Referenced by main().
void test_leaf_volume | ( | bool | box | ) |
Definition at line 1389 of file bsp_tree_test.cpp.
References box(), CHECK_ERR, CHECK_REAL_EQUAL, moab::BSPTree::create_tree(), ErrorCode, moab::BSPTree::get_tree_iterator(), moab::BSPTree::split_leaf(), moab::BSPTreeIter::step(), and moab::BSPTreeIter::volume().
Referenced by test_leaf_volume_box(), and test_leaf_volume_gen().
void test_leaf_volume_box | ( | ) |
Definition at line 22 of file bsp_tree_test.cpp.
References test_leaf_volume().
Referenced by main().
void test_leaf_volume_gen | ( | ) |
Definition at line 26 of file bsp_tree_test.cpp.
References test_leaf_volume().
Referenced by main().
void test_merge_leaf | ( | ) |
Definition at line 905 of file bsp_tree_test.cpp.
References aabox_corners(), CHECK, CHECK_EQUAL, CHECK_ERR, compare_hexes(), moab::BSPTree::create_tree(), moab::BSPTreeIter::depth(), ErrorCode, moab::BSPTreeBoxIter::get_box_corners(), moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), MB_ENTITY_NOT_FOUND, moab::BSPTree::merge_leaf(), moab::BSPTree::split_leaf(), and moab::BSPTreeBoxIter::step().
Referenced by main().
void test_set_plane | ( | ) |
Definition at line 86 of file bsp_tree_test.cpp.
References CHECK_REAL_EQUAL, moab::BSPTree::Plane::distance(), and moab::BSPTree::Plane::set().
Referenced by main().
void test_tree_create | ( | ) |
Definition at line 357 of file bsp_tree_test.cpp.
References CHECK_EQUAL, CHECK_ERR, moab::BSPTree::create_tree(), moab::BSPTreeIter::depth(), ErrorCode, moab::BSPTreeIter::get_parent_split_plane(), moab::BSPTree::get_tree_iterator(), moab::BSPTreeIter::handle(), MB_ENTITY_NOT_FOUND, moab::BSPTree::split_leaf(), moab::BSPTreeIter::step(), and moab::BSPTreeIter::tool().
Referenced by main().