class TileLoader :public IlvTileLoader { public: TileLoader(IlvDisplay*); virtual IlvMapsError load(IlvTile* tile); virtual void release(IlvTile* tile); virtual IlvBoolean isPersistent() const; private: IlvDisplay* _display; }; IlvMapsError TileLoader::load(IlvTile* tile) { IlvRect rbbox; tile->boundingBox(rbbox); IlvRectangle *rect = new IlvRectangle(_display, rbbox); tile->addObject(rect); IlString str; str += “(“; str += tile->getColumn(); str += “, “; str += tile->getRow(); str += “)”; IlvMapLabel* label = new IlvMapLabel(_display, IlvPoint(), IlvPoint(), IlvCenter, 10, str.getValue()); IlvRect lbbox; label->boundingBox(lbbox); IlvPos cx = rbbox.x() + rbbox.w() / 2; IlvPos cy = rbbox.y() + rbbox.h() / 2; label->move(cx - lbbox.w() / 2, cy - lbbox.h() / 2); tile->addObject(label); tile->loadComplete(); return IlvMaps::NoError(); } |
void TileLoader::release(IlvTile* tile) { tile->deleteAll(); } |