Intersection.h
Go to the documentation of this file.
1 #ifndef WIRECELLUTIL_INTERSECTION
2 #define WIRECELLUTIL_INTERSECTION
3 
4 #include "WireCellUtil/Point.h"
5 
6 namespace WireCell {
7 
8  /** Determine a 2D square is intersected by a 3D ray projected to
9  * its plane.
10  *
11  * \param axis0 is the axis number (0,1,2) to which the projected
12  * plane is perpendicular.
13  *
14  * \param bounds is a raw from opposite corners of the bounding box.
15  *
16  * \param point is a WireCell::Point from which a ray emanates.
17  *
18  * \param dir is a WireCell::Vector in the direction of the ray.
19  *
20  * \param hits is the returned intersection(s).
21  *
22  * \return a "hit mask" with 0 indicating the ray did not
23  * intersect, 1 or 2 meaning the first or second point in the ray
24  * is valid and 3 meaning both are.
25  */
26 
27  int hit_square(int axis0, const Ray& bounds,
28  const Point& point, const Vector& dir,
29  Ray& hits);
30 
31  /** Determine if a ray hits a rectangular box aligned with the
32  * Cartesian axes.
33  *
34  * See WireCelll::hit_square for definition of arguments and return value.
35  */
36  int box_intersection(const Ray& bounds, const Ray& ray, Ray& hits);
37 
38 }
39 
40 #endif
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
string dir
int hit_square(int axis0, const Ray &bounds, const Point &point, const Vector &dir, Ray &hits)
Definition: Intersection.cxx:8
BoundingBox bounds(int x, int y, int w, int h)
Definition: main.cpp:37
Definition: Main.h:22
std::vector< float > Vector
int box_intersection(const Ray &bounds, const Ray &ray, Ray &hits)