// ========================================================================== // $Id: aa_box.cpp,v 1.3 2017/09/13 16:09:27 jlang Exp $ // CSI2372 example Code for lecture 4 // ========================================================================== // (C)opyright: // // Jochen Lang // EECS, University of Ottawa // 800 King Edward Ave. // Ottawa, On., K1N 6N5 // Canada. // http://www.eecs.uottawa.ca // // Creator: jlang (Jochen Lang) // Email: jlang@eecs.uottawa.ca // ========================================================================== // $Log: aa_box.cpp,v $ // Revision 1.3 2017/09/13 16:09:27 jlang // Wrapped point array in std::array. Removed use of pointers. // // Revision 1.2 2014/09/16 22:06:25 jlang // Added some brace initialization. // // Revision 1.1 2011/09/27 17:22:21 jlang // Added bounding shape example // // // ========================================================================== #include #include "aa_box.h" AABox::AABox( Point2D _lowerLeft, Point2D _upperRight ) { d_lowerLeft = _lowerLeft; d_upperRight = _upperRight; } bool AABox::enclose( std::array extrema ) { Point2D lowerLeft(1e99,1e99); Point2D upperRight(-1e99,-1e99); for (int i=0; i