COPASI API  4.16.103
CQGLViewport.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 #include <QtGui/QFrame>
12 
13 class CQGLNetworkPainter;
14 class QScrollBar;
15 class CLayout;
16 class QResizeEvent;
17 
18 /**
19  * This class is supposed to act as a sort of scrollview for a
20  * CQGLNetworkPainter.
21  */
22 class CQGLViewport : public QFrame
23 {
24  Q_OBJECT
25 
26 protected:
27  QScrollBar* mpVerticalScrollbar;
28  QScrollBar* mpHorizontalScrollbar;
30 
31 public:
32  /**
33  * Constructor.
34  */
35  CQGLViewport(QWidget* pParent = 0, Qt::WFlags f = 0);
36 
37  /**
38  * Destructor.
39  */
40  virtual ~CQGLViewport();
41 
42  const CQGLNetworkPainter* getPainter() const;
43 
45 
46  /**
47  * Pass the layout on to the network painters createGraph and set the
48  * scrollbar ranges.
49  */
50  void createGraph(CLayout *lP);
51 
52  /**
53  * Sets the zoom factor on the network painter and updates the
54  *scrollbars.
55  */
56  void setZoomFactor(double zoom);
57 
58  void resetView();
59 
60  /**
61  * Make the diagram fit the screen.
62  * Returns the new zoom factor.
63  */
64  double fitToScreen();
65 
66  /**
67  * Returns whether the layout window is in circle (animation mode) or not.
68  * This method only calls the corresponding method in the contained network
69  * painter.
70  */
71  bool isCircleMode() const;
72 
73 protected:
74  virtual void resizeEvent(QResizeEvent* e);
75 
76  void updateScrollbars();
77 
78 protected slots:
79  void slotVValueChanged(int value);
80  void slotHValueChanged(int value);
81 
82 public slots:
83  void updateWidget();
84 };
void updateWidget()
double fitToScreen()
QScrollBar * mpVerticalScrollbar
Definition: CQGLViewport.h:27
void setZoomFactor(double zoom)
const CQGLNetworkPainter * getPainter() const
virtual void resizeEvent(QResizeEvent *e)
CQGLViewport(QWidget *pParent=0, Qt::WFlags f=0)
void updateScrollbars()
void createGraph(CLayout *lP)
virtual ~CQGLViewport()
CQGLNetworkPainter * mpNetworkPainter
Definition: CQGLViewport.h:29
void slotVValueChanged(int value)
bool isCircleMode() const
QScrollBar * mpHorizontalScrollbar
Definition: CQGLViewport.h:28
void slotHValueChanged(int value)