#include "QuadTree.h" #include "global.h" #include void QuadTree::readImage() { int x, y; int S; // the size of the bitmap image scanf( "%d", &S ); ASSERT( S >= 0 ); bool ** I = new bool*[ S ]; // the bitmap image for ( x = 0; x < S; ++x ) { I[x] = new bool[ S ]; } char * string = new char[ S + 1 ]; for ( y = 0; y < S; ++y ) { scanf( "%s", string ); int length = strlen( string ); for ( x = 0; x < S && x < length; ++x ) I[x][y] = string[x] == '1'; } // Now store the bitmap image internally // by converting it to a quadtree. // ... fill in this part // Clean up. delete [] string; for ( x = 0; x < S; ++x ) { delete [] I[x]; } delete [] I; } QuadTree QuadTree::computeIntersection( const QuadTree& /*q1*/, const QuadTree& /*q2*/ ) { // The implementation of this method is optional. // If you don't want to implement it, leave it as is. // If you do want to implement, be sure to uncomment the // parameter names above. // (They're commented for now to avoid compiler warnings.) // Return an empty quadtree. QuadTree Q; return Q; }