// ========================================================================== // $Id: obbox.h,v 1.1 2011/10/19 03:24:40 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: obbox.h,v $ // Revision 1.1 2011/10/19 03:24:40 jlang // Added code for lecture 7 // // // ========================================================================== #ifndef OBBOX_H #define OBBOX_H #include "bounds.h" #include "vector2d.h" #include "point2d.h" class OBBox : public Bounds { Vector2D d_major; Vector2D d_minor; Point2D d_center; double d_width; double d_height; public: OBBox( Point2D _center=Point2D(), Vector2D _direction=Vector2D(1,0), double _width=0.0, double _height=0.0); bool enclose( Point2D extrema[], int _size ); bool isInside( const Point2D& _pt ) const; void print() const; protected: double planeTestMajor( const Point2D& _pt ) const; double planeTestMinor( const Point2D& _pt ) const; }; #endif