23 #include <QHBoxLayout>
24 #include <QVBoxLayout>
29 : QObject(), m_RenderWindow(rw), m_PropertyList(pl)
72 #if !defined(_WIN32) || defined(_WIN64)
92 QPalette p = QPalette();
93 p.setColor(QPalette::Window, Qt::transparent);
103 layout->setDirection(QBoxLayout::TopToBottom);
104 layout->setAlignment(Qt::AlignLeft);
112 layout->setDirection(QBoxLayout::TopToBottom);
113 layout->setAlignment(Qt::AlignCenter);
114 layout->setAlignment(Qt::AlignLeft);
122 layout->setDirection(QBoxLayout::TopToBottom);
123 layout->setAlignment(Qt::AlignRight);
131 layout->setDirection(QBoxLayout::LeftToRight);
132 layout->setAlignment(Qt::AlignLeft);
133 layout->setSpacing(3);
140 layout->setDirection(QBoxLayout::RightToLeft);
141 layout->setAlignment(Qt::AlignRight);
142 layout->setSpacing(3);
149 layout->setDirection(QBoxLayout::BottomToTop);
150 layout->setAlignment(Qt::AlignLeft);
157 layout->setDirection(QBoxLayout::BottomToTop);
158 layout->setAlignment(Qt::AlignCenter);
165 layout->setDirection(QBoxLayout::BottomToTop);
166 layout->setAlignment(Qt::AlignRight);
191 switch (displayPosition)
205 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
208 widget->move(pos.x() - widget->size().width() / 2, pos.y());
216 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
219 widget->move(pos.x() - widget->size().width(), pos.y());
227 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
230 widget->move(pos.x(), pos.y() - widget->size().height() / 2);
238 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
241 widget->move(pos.x() - widget->size().width(), pos.y() - widget->size().height() / 2);
249 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
252 widget->move(pos.x(), pos.y() - widget->size().height());
260 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
263 widget->move(pos.x() - widget->size().width() / 2, pos.y() - widget->size().height());
271 widget->setFixedWidth(
std::max(widget->width(), size.width() * 2));
274 widget->move(pos.x() - widget->size().width(), pos.y() - widget->size().height());
283 OverlayPositionMap::iterator overlayIter;
288 (overlayIter->second)->show();
292 (overlayIter->second)->hide();
296 OverlayVector::iterator allOverlaysIter;
301 (*allOverlaysIter)->GetWidget()->show();
305 (*allOverlaysIter)->GetWidget()->hide();
359 overlay->deleteLater();
392 overlay->deleteLater();
411 OverlayVector::iterator overlayIter;
419 if ((*overlayIter)->GetPosition() != pos)
427 unsigned int layer = (*overlayIter)->GetLayer();
429 if (!layout->isEmpty())
445 layout->insertWidget(stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignLeft);
454 layout->insertWidget(stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignCenter);
466 layout->insertWidget(stackLayer, (*overlayIter)->GetWidget(), 0, Qt::AlignRight);
491 width =
std::max(width, overlaySize.width());
492 height =
std::max(height, overlaySize.height());
496 QSize result(width, height);
void UpdateOverlayData(QmitkOverlay *overlay)
void InitializeOverlayLayout()
setting up the widgets that will hold all overlays
OverlayVector m_AllOverlays
all QmitkOverlays that are currently added
void RestackOverlays(QmitkOverlay::DisplayPosition pos)
PropertyList::Pointer GetPropertyList() const
void AdjustAllOverlayPosition()
adjusts the position of all overlays to the position of the RenderWindow
virtual ~QmitkOverlayController()
Abstract base class for all overlay-objects in MITK.
virtual void AlignOverlays()
re-aligning the overlays - not implemented yet
void AdjustOverlayPosition(QmitkOverlay::DisplayPosition displayPosition)
virtual DisplayPosition GetPosition()
getter for the display-position
Key-value list holding instances of BaseProperty.
DisplayPosition
enumeration of all possible display positions
virtual void GenerateData(mitk::PropertyList::Pointer)
abstract method to internally setup the overlay
virtual QWidget * GetWidget()
returns the internally handled QWidget
mitk::PropertyList::Pointer m_PropertyList
PropertyList for RenderWindow-specific properties.
void AddOverlay(QmitkOverlay *)
adds an instance of QmitkOverlay to the RenderWindow
virtual mitk::RenderingManager * GetRenderingManager() const
Setter for the RenderingManager that handles this instance of BaseRenderer.
void InitializeWidget(QmitkOverlay::DisplayPosition pos)
initializes one QWidget - internally used by InitializeOverlayLayout()
QmitkOverlayController(QmitkRenderWindow *rw, mitk::PropertyList *pl=NULL)
constructor with mandatory QmitkRenderWindow and optional mitk::PropertyList
virtual QSize GetNeededSize()=0
MITK implementation of the QVTKWidget.
virtual mitk::VtkPropRenderer * GetRenderer()
void SetOverlayVisibility(bool visible)
setting the visibility of all overlays
QSize GetMinimumSizeForWidget(QmitkOverlay::DisplayPosition displayPosition)
OverlayPositionMap m_PositionedOverlays
all possible positions and the QWidgets representing the corresponding QmitkOverlays ...
void RemoveOverlay(QmitkOverlay *)
QmitkRenderWindow * m_RenderWindow
RenderWindow that all Overlays will be added to.