Commit e4bbd82a authored by Jan Möbius's avatar Jan Möbius
Browse files

Dennis: Don-t-draw-active-examiner-frame-in-single-view-mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4754 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 76be6405
...@@ -110,9 +110,12 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -110,9 +110,12 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Construct GL context & widget // Construct GL context & widget
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
glWidget_ = new QGLWidget(format); glWidget_ = new QGLWidget(format);
glView_ = new QtGLGraphicsView(stackedWidget_); glView_ = new QtGLGraphicsView(stackedWidget_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_); glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_);
// is stereo possible ? // is stereo possible ?
if (format.stereo()) if (format.stereo())
...@@ -123,8 +126,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -123,8 +126,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glView_->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); glView_->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
glView_->setScene(glScene_); glView_->setScene(glScene_);
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
centerWidget_ = new QGraphicsWidget; centerWidget_ = new QGraphicsWidget;
glScene_->addItem(centerWidget_); glScene_->addItem(centerWidget_);
centerWidget_->setGeometry (glScene_->sceneRect ()); centerWidget_->setGeometry (glScene_->sceneRect ());
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh> #include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include "QtGLGraphicsScene.hh" #include "QtGLGraphicsScene.hh"
#include "QtMultiViewLayout.hh"
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh> #include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
#include <QApplication> #include <QApplication>
#include <QPainter> #include <QPainter>
...@@ -53,9 +54,11 @@ ...@@ -53,9 +54,11 @@
//== IMPLEMENTATION =========================================================== //== IMPLEMENTATION ===========================================================
QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views) : QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views,
QtMultiViewLayout *_layout) :
QGraphicsScene (), QGraphicsScene (),
views_(_views) views_(_views),
layout_(_layout)
{ {
} }
...@@ -84,28 +87,28 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect) ...@@ -84,28 +87,28 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
views_->at(i)->paintGL(); views_->at(i)->paintGL();
} }
int i = PluginFunctions::activeExaminer(); if (layout_->mode() != QtMultiViewLayout::SingleView)
{
QPen pen(Qt::red); glViewer *v = views_->at(PluginFunctions::activeExaminer());
pen.setWidth (2);
_painter->setPen(pen); QPen pen(Qt::red);
_painter->drawLine(views_->at(i)->scenePos().x(), pen.setWidth (2);
views_->at(i)->scenePos().y(), _painter->setPen(pen);
views_->at(i)->scenePos().x(), _painter->drawLine(v->scenePos().x(), v->scenePos().y(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1); v->scenePos().x(),
_painter->drawLine(views_->at(i)->scenePos().x() + views_->at(i)->size().width(), v->scenePos().y() + v->size().height() - 1);
views_->at(i)->scenePos().y(), _painter->drawLine(v->scenePos().x() + v->size().width(), v->scenePos().y(),
views_->at(i)->scenePos().x() + views_->at(i)->size().width(), v->scenePos().x() + v->size().width(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1); v->scenePos().y() + v->size().height() - 1);
_painter->drawLine(views_->at(i)->scenePos().x(), _painter->drawLine(v->scenePos().x(), v->scenePos().y() - 1,
views_->at(i)->scenePos().y() - 1, v->scenePos().x() + v->size().width(),
views_->at(i)->scenePos().x() + views_->at(i)->size().width(), v->scenePos().y() - 1);
views_->at(i)->scenePos().y() - 1); _painter->drawLine(v->scenePos().x(),
_painter->drawLine(views_->at(i)->scenePos().x(), v->scenePos().y() + v->size().height() - 1,
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1, v->scenePos().x() + v->size().width(),
views_->at(i)->scenePos().x() + views_->at(i)->size().width(), v->scenePos().y() + v->size().height() - 1);
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1); }
} }
glViewer* QtGLGraphicsScene::findView (const QPointF &_p, bool _setActive) glViewer* QtGLGraphicsScene::findView (const QPointF &_p, bool _setActive)
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
//== FORWARDDECLARATIONS ====================================================== //== FORWARDDECLARATIONS ======================================================
class glViewer; class glViewer;
class QtMultiViewLayout;
//== NAMESPACES =============================================================== //== NAMESPACES ===============================================================
...@@ -68,7 +69,7 @@ class DLLEXPORT QtGLGraphicsScene : public QGraphicsScene ...@@ -68,7 +69,7 @@ class DLLEXPORT QtGLGraphicsScene : public QGraphicsScene
Q_OBJECT Q_OBJECT
public: public:
QtGLGraphicsScene(std::vector< glViewer *> *_views); QtGLGraphicsScene(std::vector< glViewer *> *_views, QtMultiViewLayout *_layout);
protected: protected:
...@@ -85,6 +86,7 @@ private: ...@@ -85,6 +86,7 @@ private:
glViewer* findView (const QPointF &_p, bool _setActive = false); glViewer* findView (const QPointF &_p, bool _setActive = false);
std::vector< glViewer *> *views_; std::vector< glViewer *> *views_;
QtMultiViewLayout *layout_;
}; };
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment