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

Method paint

ASAP/WSITileGraphicsItem.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void WSITileGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
81 QWidget *widget){
82 float lod = option->levelOfDetailFromTransform(painter->worldTransform());
83 if (lod > _lowerLOD) {
84 if (_item) {
85 bool draw = false;
86 if (lod <= _upperLOD) {
87 draw = true;
88 }
89 else if (!_manager->isCovered(_itemLevel, _tileX, _tileY)) {
90 draw = true;
91 }
92 if (draw) {
93 QRectF pixmapArea = QRectF((option->exposedRect.left() + (_physicalSize / 2))*(_tileSize / _physicalSize), (option->exposedRect.top() + (_physicalSize / 2))*(_tileSize / _physicalSize), option->exposedRect.width()*(_tileSize / _physicalSize), option->exposedRect.height()*(_tileSize / _physicalSize));
94 painter->drawPixmap(option->exposedRect, *_item, pixmapArea);
95 if (_foregroundPixmap && _renderForeground && _foregroundOpacity > 0.0001) {
96 painter->setOpacity(_foregroundOpacity);
97 painter->drawPixmap(option->exposedRect, *_foregroundPixmap, pixmapArea);
98 }
99 }
100 }
101 }
102}
103
104void WSITileGraphicsItem::debugPrint() {
105 std::cout << "Position (x,y): (" << this->pos().x() << ", "<< this->pos().y() << ")" << std::endl;

Callers

nothing calls this directly

Calls 1

isCoveredMethod · 0.80

Tested by

no test coverage detected