message: ENH: add unit tests for the QueryAccessor
diff: @@ -1062,6 +1062,71 @@ void check_single_box3d( )
  //------------------------------------------------------------------------------
  // UNIT TESTS
  //------------------------------------------------------------------------------
  +TEST( spin_bvh, query_point_accessor )
  +{
  + constexpr double VAL = 42.0;
  + constexpr IndexType ID = 0;
  +
  + double x[] = { VAL };
  + double y[] = { VAL+1.5 };
  + double z[] = { VAL+2.5 };
  +
  + namespace bvh = axom::spin::internal::linear_bvh;
  + using QueryAccessor2D = bvh::QueryAccessor< 2, double >;
  + using QueryAccessor3D = bvh::QueryAccessor< 3, double >;
  + using Point2D = bvh::Vec< double, 2 >;
  + using Point3D = bvh::Vec< double, 3 >;
  +
  + Point2D test_point2d;
  + QueryAccessor2D::getPoint( test_point2d, ID, x, y, nullptr );
  + EXPECT_DOUBLE_EQ( test_point2d[0], x[ ID ] );
  + EXPECT_DOUBLE_EQ( test_point2d[1], y[ ID ] );
  +
  + Point3D test_point3d;
  + QueryAccessor3D::getPoint( test_point3d, 0, x, y, z );
  + EXPECT_DOUBLE_EQ( test_point3d[0], x[ ID ] );
  + EXPECT_DOUBLE_EQ( test_point3d[1], y[ ID ] );
  + EXPECT_DOUBLE_EQ( test_point3d[2], z[ ID ] );
  +}
  +
  +//------------------------------------------------------------------------------
  +TEST( spin_bvh, query_ray_accessor )
  +{
  + constexpr double VAL = 42.0;
  + constexpr IndexType ID = 0;
  +
  + double x[] = { VAL };
  + double y[] = { VAL+1.5 };
  + double z[] = { VAL+2.5 };
  +
  + double nx[] = { VAL };
  + double ny[] = { VAL+1.5 };
  + double nz[] = { VAL+2.5 };
  +
  + namespace bvh = axom::spin::internal::linear_bvh;
  + using QueryAccessor2D = bvh::QueryAccessor< 2, double >;
  + using QueryAccessor3D = bvh::QueryAccessor< 3, double >;
  + using Ray2D = bvh::Vec< double, 4 >;
  + using Ray3D = bvh::Vec< double, 6 >;
  +
  + Ray2D ray2d;
  + QueryAccessor2D::getRay( ray2d, ID, x, nx, y, ny, nullptr, nullptr );
  + EXPECT_DOUBLE_EQ( ray2d[0], x[ ID ] );
  + EXPECT_DOUBLE_EQ( ray2d[1], y[ ID ] );
  +
  + EXPECT_DOUBLE_EQ( ray2d[2], nx[ ID ] );
  + EXPECT_DOUBLE_EQ( ray2d[3], ny[ ID ] );
  +
  + Ray3D ray3d;
  + QueryAccessor3D::getRay( ray3d, ID, x, nx, y, ny, z, nz );
  + EXPECT_DOUBLE_EQ( ray3d[0], x[ ID ] );
  + EXPECT_DOUBLE_EQ( ray3d[1], y[ ID ] );
  + EXPECT_DOUBLE_EQ( ray3d[2], z[ ID ] );
  +
  + EXPECT_DOUBLE_EQ( ray3d[3], nx[ ID ] );
  + EXPECT_DOUBLE_EQ( ray3d[4], ny[ ID ] );
  + EXPECT_DOUBLE_EQ( ray3d[5], nz[ ID ] );
  +}
  //------------------------------------------------------------------------------
  TEST( spin_bvh, traversal_predicates_rayIntersectsLeftBin )
  