21 static const std::string s =
"STANDARD_2D_TOPLEFT";
26 static const std::string s =
"STANDARD_2D_TOP";
31 static const std::string s =
"STANDARD_2D_TOPRIGHT";
36 static const std::string s =
"STANDARD_2D_BOTTOMLEFT";
41 static const std::string s =
"STANDARD_2D_BOTTOM";
46 static const std::string s =
"STANDARD_2D_BOTTOMRIGHT";
65 if (identifier.compare(0, 11,
"STANDARD_2D") != 0)
67 if (identifier.compare(STANDARD_2D_TOPLEFT()) == 0)
69 else if (identifier.compare(STANDARD_2D_TOP()) == 0)
71 else if (identifier.compare(STANDARD_2D_TOPRIGHT()) == 0)
73 else if (identifier.compare(STANDARD_2D_BOTTOMLEFT()) == 0)
74 alignment = BottomLeft;
75 else if (identifier.compare(STANDARD_2D_BOTTOM()) == 0)
77 else if (identifier.compare(STANDARD_2D_BOTTOMRIGHT()) == 0)
78 alignment = BottomRight;
83 layouter->m_Alignment = alignment;
84 layouter->m_Identifier = identifier;
85 layouter->SetBaseRenderer(renderer);
94 std::string identifier;
98 identifier = STANDARD_2D_TOPLEFT();
101 identifier = STANDARD_2D_TOP();
104 identifier = STANDARD_2D_TOPRIGHT();
107 identifier = STANDARD_2D_BOTTOMLEFT();
110 identifier = STANDARD_2D_BOTTOM();
113 identifier = STANDARD_2D_BOTTOMRIGHT();
120 layouter->m_Alignment = alignment;
121 layouter->m_Identifier = identifier;
122 layouter->SetBaseRenderer(renderer);
128 std::list<mitk::Overlay *> managedOverlays = GetManagedOverlays();
129 std::list<mitk::Overlay *>::iterator it;
132 int *size = GetBaseRenderer()->GetVtkRenderer()->GetSize();
139 posY = size[1] - m_Margin;
140 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
144 posY -= bounds.
Size[1];
155 posY = size[1] - m_Margin;
156 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
160 posX = size[0] / 2 - bounds.
Size[0] / 2;
161 posY -= bounds.
Size[1];
170 posY = size[1] - m_Margin;
171 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
175 posX = size[0] - (bounds.
Size[0] + m_Margin);
176 posY -= bounds.
Size[1];
186 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
193 posY += bounds.
Size[1];
200 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
204 posX = size[0] / 2 - bounds.
Size[0] / 2;
208 posY += bounds.
Size[1];
215 for (it = managedOverlays.begin(); it != managedOverlays.end(); it++)
219 posX = size[0] - (bounds.
Size[0] + m_Margin);
223 posY += bounds.
Size[1];
void PrepareLayout() override
Sets the positions of each managed overlay according to the layouter role.
virtual void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &)
Sets position and size of the overlay on the display.
itk::SmartPointer< Self > Pointer
virtual Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const
Returns position and size of the overlay on the display.
itk::Point< double, 2 > Size
Organizes the rendering process.
static std::string STANDARD_2D_TOPLEFT()
Overlay2DLayouter()
explicit constructor which disallows implicit conversions
static std::string STANDARD_2D_BOTTOM()
itk::Point< double, 2 > Position
virtual ~Overlay2DLayouter()
virtual destructor in order to derive from this class
static std::string STANDARD_2D_TOP()
static std::string STANDARD_2D_BOTTOMLEFT()
static std::string STANDARD_2D_BOTTOMRIGHT()
Base class for all overlays.
static Overlay2DLayouter::Pointer CreateLayouter(Alignment alignment, BaseRenderer *renderer)
Factory method for the different kinds of Layouters.
static std::string STANDARD_2D_TOPRIGHT()
Container for position and size on the display.