MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / loadTilesForFieldOfView

Method loadTilesForFieldOfView

ASAP/TileManager.cpp:82–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void TileManager::loadTilesForFieldOfView(const QRectF& FOV, const unsigned int level) {
83 if (level > _lastRenderLevel) {
84 return;
85 }
86 if (_ioThread) {
87 QPoint topLeftTile = this->pixelCoordinatesToTileCoordinates(FOV.topLeft(), level);
88 QPoint bottomRightTile = this->pixelCoordinatesToTileCoordinates(FOV.bottomRight(), level);
89 QRect FOVTile = QRect(topLeftTile, bottomRightTile);
90 QPoint nrTiles = getLevelTiles(level);
91 float levelDownsample = _levelDownsamples[level];
92 if (FOVTile != _lastFOV || level != _lastLevel) {
93 _lastLevel = level;
94 _lastFOV = FOVTile;
95 for (int x = topLeftTile.x(); x <= bottomRightTile.x(); ++x) {
96 if (x >= 0 && x <= nrTiles.x()) {
97 for (int y = topLeftTile.y(); y <= bottomRightTile.y(); ++y) {
98 if (y >= 0 && y <= nrTiles.y()) {
99 if (providesCoverage(level, x, y) < 1) {
100 setCoverage(level, x, y, 1);
101 _ioThread->addJob(_tileSize, x, y, level);
102 }
103 }
104 }
105 }
106 }
107 }
108 }
109}
110
111void TileManager::updateTileForegounds() {
112 _ioThread->clearJobs();

Callers 2

loadAllTilesForLevelMethod · 0.95
onFieldOfViewChangedMethod · 0.80

Calls 2

addJobMethod · 0.80

Tested by

no test coverage detected