MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "moab/OrientedBox.hpp"
#include "moab/CartVect.hpp"
#include "moab/Core.hpp"
#include "moab/Range.hpp"
#include <cassert>
#include <iostream>
Go to the source code of this file.
Macros | |
#define | ASSERT_VECTOR_ELEMENT(A, B) assert_vector_element( ( A ), ( B ), #A, #B, __LINE__ ) |
#define | ASSERT_VECTORS_EQUAL(A, B) assert_vectors_equal( ( A ), ( B ), #A, #B, __LINE__ ) |
#define | ASSERT_DOUBLES_EQUAL(A, B) assert_doubles_equal( ( A ), ( B ), #A, #B, __LINE__ ) |
#define | ASSERT(B) assert_bool( ( B ), #B, __LINE__ ) |
Functions | |
static void | test_basic () |
static void | test_contained () |
static void | test_ray_intersect () |
static void | test_closest_point () |
static void | test_build_from_tri () |
static void | test_build_from_pts () |
static void | test_save () |
static void | assert_vector_element (const CartVect &a, const Matrix3 &b, const char *sa, const char *sb, int lineno) |
static void | assert_vectors_equal (const CartVect &a, const CartVect &b, const char *sa, const char *sb, int lineno) |
static void | assert_doubles_equal (double a, double b, const char *sa, const char *sb, int lineno) |
static void | assert_bool (bool b, const char *sb, int lineno) |
int | main () |
const Matrix3 | origaxes (5 *unitaxes.col(0), 10 *unitaxes.col(1), 0.1 *unitaxes.col(2), true) |
static CartVect | scaled_corner (const OrientedBox &box, int corner, double factor) |
static CartVect | scaled_face (const OrientedBox &box, int face, double factor) |
static void | axis_dims (const Matrix3 &axis, CartVect &dims) |
Variables | |
const double | TOL = 1e-6 |
int | error_count = 0 |
const CartVect | origin (0.0, 0.0, 0.0) |
const Matrix3 | unitaxes (0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5) |
const OrientedBox | unitbox (unitaxes, origin) |
const CartVect | unitcenter (10, 20, 30) |
const OrientedBox | offsetbox (unitaxes, unitcenter) |
const OrientedBox | oblongbox (origaxes, origin) |
const CartVect | rotax0 = CartVect( 1.0, 1.0, 0.0 ) |
const CartVect | rotax1 = CartVect( 1.0, -1.0, 1.0 ) |
const CartVect | rotax2 = CartVect( 1.0, 1.0, 0.0 ) * CartVect( 1.0, -1.0, 1.0 ) |
const CartVect | rotax [3] = { rotax0, rotax1, rotax2 } |
const OrientedBox | rotbox_cv (rotax, origin) |
const Matrix3 | rotaxes (rotax0, rotax1, rotax2, false) |
const OrientedBox | rotbox (rotaxes, origin) |
#define ASSERT | ( | B | ) | assert_bool( ( B ), #B, __LINE__ ) |
Definition at line 25 of file oriented_box_test.cpp.
#define ASSERT_DOUBLES_EQUAL | ( | A, | |
B | |||
) | assert_doubles_equal( ( A ), ( B ), #A, #B, __LINE__ ) |
Definition at line 24 of file oriented_box_test.cpp.
#define ASSERT_VECTOR_ELEMENT | ( | A, | |
B | |||
) | assert_vector_element( ( A ), ( B ), #A, #B, __LINE__ ) |
Definition at line 22 of file oriented_box_test.cpp.
#define ASSERT_VECTORS_EQUAL | ( | A, | |
B | |||
) | assert_vectors_equal( ( A ), ( B ), #A, #B, __LINE__ ) |
Definition at line 23 of file oriented_box_test.cpp.
|
static |
|
static |
|
static |
Definition at line 1632 of file oriented_box_test.cpp.
References error_count, and TOL.
|
static |
Definition at line 1655 of file oriented_box_test.cpp.
References error_count, and TOL.
Definition at line 93 of file oriented_box_test.cpp.
References moab::Matrix3::col(), moab::CartVect::length(), and swap().
Referenced by test_basic().
int main | ( | ) |
Definition at line 32 of file oriented_box_test.cpp.
References error_count, test_basic(), test_build_from_pts(), test_build_from_tri(), test_closest_point(), test_contained(), test_ray_intersect(), and test_save().
const Matrix3 origaxes | ( | 5 *unitaxes. | col0, |
10 *unitaxes. | col1, | ||
0.1 *unitaxes. | col2, | ||
true | |||
) |
Referenced by test_basic().
|
static |
Definition at line 76 of file oriented_box_test.cpp.
References box().
Referenced by test_closest_point(), test_contained(), and test_ray_intersect().
|
static |
Definition at line 85 of file oriented_box_test.cpp.
References box().
Referenced by test_closest_point(), test_contained(), and test_ray_intersect().
|
static |
Definition at line 103 of file oriented_box_test.cpp.
References ASSERT_DOUBLES_EQUAL, ASSERT_VECTOR_ELEMENT, ASSERT_VECTORS_EQUAL, axis_dims(), moab::OrientedBox::center, moab::OrientedBox::dimensions(), moab::OrientedBox::inner_radius(), moab::CartVect::length(), oblongbox, offsetbox, origaxes(), origin, moab::OrientedBox::outer_radius(), rotax0, rotax1, rotax2, rotaxes, rotbox, rotbox_cv, moab::OrientedBox::scaled_axis(), unitaxes, unitbox, unitcenter, and moab::OrientedBox::volume().
Referenced by main().
|
static |
Definition at line 1559 of file oriented_box_test.cpp.
References ASSERT, box(), center(), moab::OrientedBox::compute_from_vertices(), moab::Interface::create_vertex(), ErrorCode, gMB, moab::Range::insert(), MB_SUCCESS, and vertex_coords().
Referenced by main().
|
static |
Definition at line 1483 of file oriented_box_test.cpp.
References ASSERT, ASSERT_DOUBLES_EQUAL, box(), moab::Matrix3::col(), moab::OrientedBox::compute_from_2d_cells(), ErrorCode, moab::Range::insert(), MB_SUCCESS, MBTRI, and TOL.
Referenced by main().
|
static |
Definition at line 409 of file oriented_box_test.cpp.
References ASSERT_VECTORS_EQUAL, moab::OrientedBox::center, moab::OrientedBox::closest_location_in_box(), oblongbox, offsetbox, rotbox, scaled_corner(), scaled_face(), and unitbox.
Referenced by main().
|
static |
Definition at line 160 of file oriented_box_test.cpp.
References ASSERT, moab::OrientedBox::center, moab::OrientedBox::contained(), oblongbox, offsetbox, rotbox, scaled_corner(), scaled_face(), TOL, and unitbox.
Referenced by main().
|
static |
Definition at line 779 of file oriented_box_test.cpp.
References ASSERT, moab::OrientedBox::center, moab::OrientedBox::intersect_ray(), moab::CartVect::normalize(), oblongbox, offsetbox, rotbox, moab::OrientedBox::scaled_axis(), scaled_corner(), scaled_face(), TOL, and unitbox.
Referenced by main().
|
static |
Definition at line 1612 of file oriented_box_test.cpp.
References ASSERT, box(), ErrorCode, MB_SUCCESS, size, and moab::OrientedBox::tag_handle().
Referenced by main().
int error_count = 0 |
Definition at line 11 of file oriented_box_test.cpp.
Referenced by assert_bool(), assert_doubles_equal(), assert_vector_element(), assert_vectors_equal(), and main().
const OrientedBox oblongbox(origaxes, origin) | ( | origaxes | , |
origin | |||
) |
Referenced by test_basic(), test_closest_point(), test_contained(), and test_ray_intersect().
const OrientedBox offsetbox(unitaxes, unitcenter) | ( | unitaxes | , |
unitcenter | |||
) |
Referenced by test_basic(), test_closest_point(), test_contained(), and test_ray_intersect().
const CartVect origin(0.0, 0.0, 0.0) | ( | 0. | 0, |
0. | 0, | ||
0. | 0 | ||
) |
Referenced by dagmc_origin_face_rayfire(), dagmc_outside_face_rayfire(), dagmc_outside_face_rayfire_history(), dagmc_outside_face_rayfire_history_fail(), dagmc_outside_face_rayfire_orient_entrance(), dagmc_outside_face_rayfire_orient_exit(), dagmc_point_in_vol_1(), dagmc_point_in_vol_2(), dagmc_point_in_vol_3(), dagmc_point_in_vol_4(), dagmc_point_in_vol_5(), dagmc_point_in_vol_6(), dagmc_point_in_vol_dir(), dagmc_point_on_corner_1(), dagmc_point_on_corner_2(), dagmc_point_on_corner_3(), dagmc_point_on_corner_4(), dagmc_point_on_corner_5(), dagmc_point_on_corner_6(), dagmc_point_on_corner_7(), dagmc_point_on_corner_8(), do_ray_fire_test(), gqt_origin_face_rayfire(), gqt_outside_face_rayfire(), gqt_outside_face_rayfire_history(), gqt_outside_face_rayfire_history_fail(), gqt_outside_face_rayfire_orient_entrance(), gqt_outside_face_rayfire_orient_exit(), gqt_point_in_box_1(), gqt_point_in_box_2(), gqt_point_in_box_3(), gqt_point_in_box_4(), gqt_point_in_box_5(), gqt_point_in_vol_1(), gqt_point_in_vol_2(), gqt_point_in_vol_3(), gqt_point_in_vol_4(), gqt_point_in_vol_5(), gqt_point_in_vol_6(), gqt_point_in_vol_dir(), gqt_point_on_corner_1(), gqt_point_on_corner_2(), gqt_point_on_corner_3(), gqt_point_on_corner_4(), gqt_point_on_corner_5(), gqt_point_on_corner_6(), gqt_point_on_corner_7(), gqt_point_on_corner_8(), moab::GeomUtil::plucker_ray_tri_intersect(), moab::ReadMCNP5::read_mesh_planes(), test_basic(), test_ray_fire(), and moab::ReadVtk::vtk_read_structured_points().
Definition at line 64 of file oriented_box_test.cpp.
Definition at line 61 of file oriented_box_test.cpp.
Referenced by test_basic().
Definition at line 62 of file oriented_box_test.cpp.
Referenced by test_basic().
Definition at line 63 of file oriented_box_test.cpp.
Referenced by test_basic().
Referenced by test_basic().
const OrientedBox rotbox(rotaxes, origin) | ( | rotaxes | , |
origin | |||
) |
Referenced by test_basic(), test_closest_point(), test_contained(), and test_ray_intersect().
const OrientedBox rotbox_cv(rotax, origin) | ( | rotax | , |
origin | |||
) |
Referenced by test_basic().
const double TOL = 1e-6 |
Definition at line 10 of file oriented_box_test.cpp.
Referenced by assert_doubles_equal(), assert_vector_element(), assert_vectors_equal(), test_build_from_tri(), test_contained(), and test_ray_intersect().
const Matrix3 unitaxes(0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5) | ( | 0. | 5, |
0. | 0, | ||
0. | 0, | ||
0. | 0, | ||
0. | 5, | ||
0. | 0, | ||
0. | 0, | ||
0. | 0, | ||
0. | 5 | ||
) |
Referenced by test_basic().
const OrientedBox unitbox(unitaxes, origin) | ( | unitaxes | , |
origin | |||
) |
Referenced by test_basic(), test_closest_point(), test_contained(), and test_ray_intersect().
const CartVect unitcenter(10, 20, 30) | ( | 10 | , |
20 | , | ||
30 | |||
) |
Referenced by test_basic().