| 62 | } |
| 63 | |
| 64 | CesiumGeometry::Rectangle QuadtreeTilingScheme::tileToRectangle( |
| 65 | const CesiumGeometry::QuadtreeTileID& tileID) const noexcept { |
| 66 | const uint32_t xTiles = this->getNumberOfXTilesAtLevel(tileID.level); |
| 67 | const uint32_t yTiles = this->getNumberOfYTilesAtLevel(tileID.level); |
| 68 | |
| 69 | const double xTileWidth = this->_rectangle.computeWidth() / xTiles; |
| 70 | const double left = this->_rectangle.minimumX + tileID.x * xTileWidth; |
| 71 | const double right = this->_rectangle.minimumX + (tileID.x + 1) * xTileWidth; |
| 72 | |
| 73 | const double yTileHeight = this->_rectangle.computeHeight() / yTiles; |
| 74 | const double bottom = this->_rectangle.minimumY + tileID.y * yTileHeight; |
| 75 | const double top = this->_rectangle.minimumY + (tileID.y + 1) * yTileHeight; |
| 76 | |
| 77 | return Rectangle(left, bottom, right, top); |
| 78 | } |
| 79 | |
| 80 | } // namespace CesiumGeometry |