8 #include <QtGui/QHBoxLayout>
9 #include <QtGui/QLayout>
10 #include <QtGui/QScrollBar>
11 #include <QtGui/QFrame>
12 #include <QtOpenGL/QGLFormat>
20 QVBoxLayout* pVBoxLayout =
new QVBoxLayout(
this);
21 this->setLayout(pVBoxLayout);
22 pVBoxLayout->setContentsMargins(0, 0, 0, 0);
23 QFrame* pHBox =
new QFrame(
this);
24 QHBoxLayout* pHBoxLayout =
new QHBoxLayout(pHBox);
25 pHBox->setLayout(pHBoxLayout);
26 pHBoxLayout->setContentsMargins(0, 0, 0, 0);
29 QGLFormat format(QGL::SampleBuffers);
30 format.setDoubleBuffer(
TRUE);
36 pVBoxLayout->addWidget(pHBox);
55 QFrame::resizeEvent(e);
75 double graphWidth = (maxX - minX) * zoom;
76 double graphHeight = (maxY - minY) * zoom;
77 double rectangleHeight = this->
mpLayoutPainter->contentsRect().height();
82 if (graphHeight < rectangleHeight)
92 int newMaximum = (int)(graphHeight - rectangleHeight);
96 if (oldValue != 0 && oldMaximum != 0)
98 newValue = (int)((
double) oldValue * (double) newMaximum / (
double) oldMaximum);
107 if (graphWidth < rectangleWidth)
117 int newMaximum = (int)(graphWidth - rectangleWidth);
121 if (oldValue != 0 && oldMaximum != 0)
123 newValue = (int)((
double) oldValue * (double) newMaximum / (
double) oldMaximum);
void singleCurveSelected(bool selected)
virtual ~CQGLLayoutViewer()
void slotDocumentChanged()
CQGLLayoutPainter * getPainter()
void update(const CCopasiDataModel *pDataModel, CLayout *pLayout, const CLRenderInformationBase *pRenderInfo, const QString &baseDir)
void setZoomFactor(double zoom)
CQGLLayoutViewer(QWidget *pParent=0, Qt::WindowFlags f=0)
void setCurrentPositionX(double x)
void setCurrentPositionY(double y)
void slotSingleCurveSelected(bool selected)
void setZoomFactor(double)
void change_style(const CLRenderInformationBase *pRenderInfo, bool defaultStyle=false)
double getZoomFactor() const
CQGLLayoutPainter * mpLayoutPainter
void slotVValueChanged(int value)
QScrollBar * mpVerticalScrollbar
void change_style(const CLRenderInformationBase *pRenderInfo, bool defaultStyle=false)
virtual void resizeEvent(QResizeEvent *e)
void slotHValueChanged(int value)
QScrollBar * mpHorizontalScrollbar