#pragma once #include <point.h> #include "box_edges.h" struct Triangle; #define BOX_NB_POINTS 4 // left -> +x // up -> +y struct Box { Point topLeft; Point bottomRight; Point points [BOX_NB_POINTS]; BoxEdges edges; Box(Point topLeft, Point bottomRight); bool intersects(const Triangle &t) const; bool intersects(const Point &p) const; Box firstQuadrant() const; Box secondQuadrant() const; Box thirdQuadrant() const; Box fourthQuadrant() const; };