MCPcopy Create free account
hub / github.com/MITK/MITK / PrepareTopLayout

Method PrepareTopLayout

Modules/Annotation/src/mitkLayoutAnnotationRenderer.cpp:182–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 }
181 }
182 void LayoutAnnotationRenderer::PrepareTopLayout(int *displaySize)
183 {
184 double posX, posY;
185 Point2D margin;
186 posX = 0;
187 posY = displaySize[1];
188 mitk::Annotation::Bounds bounds;
189 AnnotationRankedMap &AnnotationMap = m_AnnotationContainerMap[Top];
190 for (auto it = AnnotationMap.cbegin(); it != AnnotationMap.cend(); ++it)
191 {
192 Annotation *Annotation = it->second;
193 margin = GetMargin2D(Annotation);
194 bounds = Annotation->GetBoundsOnDisplay(this->GetCurrentBaseRenderer());
195
196 posX = displaySize[0] / 2 - bounds.Size[0] / 2;
197 posY -= bounds.Size[1] + margin[1];
198 bounds.Position[0] = posX;
199 bounds.Position[1] = posY;
200 Annotation->SetBoundsOnDisplay(this->GetCurrentBaseRenderer(), bounds);
201 }
202 }
203 void LayoutAnnotationRenderer::PrepareTopRightLayout(int *displaySize)
204 {
205 double posX, posY;

Callers

nothing calls this directly

Calls 3

GetBoundsOnDisplayMethod · 0.45
SetBoundsOnDisplayMethod · 0.45

Tested by

no test coverage detected