Compute the area of intersection of two polygons. The polygons are given as a vector of vertices of struct
point.
typedef long long polygon::PolygonIntersection::hp [protected] |
polygon::PolygonIntersection::PolygonIntersection | ( | void | ) | [inline] |
virtual polygon::PolygonIntersection::~PolygonIntersection | ( | ) | [inline, virtual] |
float polygon::PolygonIntersection::inter | ( | std::vector< point > & | a, | |
std::vector< point > & | b | |||
) | [inline] |
return the area of intersection between two plygons defined by the verices in a[] and b[].
Referenced by Extractor::extract_aperture_w_rebin(), and Projector::find_res_elems_ell_aperture().
return the area of intersection between two plygons defined by the verices in a[] and b[].
References area(), B_, cross(), fit(), inness(), polygon::PolygonIntersection::box::max, polygon::PolygonIntersection::box::min, ovl(), range(), polygon::point::x, and polygon::point::y.
std::vector< point > polygon::PolygonIntersection::get_ellipse | ( | const float | x, | |
const float | y, | |||
const float | a, | |||
const float | b, | |||
const float | pa, | |||
const int | n | |||
) | const |
return a vector<point>
with n vertices on an ellipse of semi-axes a and b and position angle pa centered at x, y.
Referenced by Projector::find_res_elems_ell_aperture().
std::vector< point > polygon::PolygonIntersection::get_rect | ( | const float | x, | |
const float | y, | |||
const float | xw, | |||
const float | yw | |||
) | const |
return a vector<point>
with 4 vertices on a rectangle which is xw pixel wide and yw pixel high x, y.
References v.
void polygon::PolygonIntersection::bd | ( | float * | X, | |
float | y | |||
) | [inline, protected] |
Referenced by range().
void polygon::PolygonIntersection::bu | ( | float * | X, | |
float | y | |||
) | [inline, protected] |
Referenced by range().
void polygon::PolygonIntersection::range | ( | point * | x, | |
int | c | |||
) | [protected] |
References B_, bd(), bu(), polygon::PolygonIntersection::box::max, polygon::PolygonIntersection::box::min, polygon::point::x, and polygon::point::y.
Referenced by inter().
void polygon::PolygonIntersection::fit | ( | point * | x, | |
int | cx, | |||
vertex * | ix, | |||
int | fudge, | |||
float | sclx, | |||
float | scly, | |||
float | mid | |||
) | [protected] |
References B_, c, polygon::PolygonIntersection::vertex::in, polygon::PolygonIntersection::vertex::ip, polygon::PolygonIntersection::box::min, polygon::PolygonIntersection::vertex::rx, polygon::PolygonIntersection::vertex::ry, polygon::point::x, polygon::PolygonIntersection::ipoint::x, polygon::point::y, and polygon::PolygonIntersection::ipoint::y.
Referenced by inter().
hp polygon::PolygonIntersection::area | ( | const ipoint & | a, | |
const ipoint & | p, | |||
const ipoint & | q | |||
) | [inline, protected] |
void polygon::PolygonIntersection::cntrib | ( | const ipoint & | f, | |
const ipoint & | t, | |||
short | w, | |||
hp * | s | |||
) | [inline, protected] |
References polygon::PolygonIntersection::rng::mn, and polygon::PolygonIntersection::rng::mx.
Referenced by inter().
box polygon::PolygonIntersection::B_ [protected] |