VR-Exchange 2.5 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
progressiveLineGraph.h
Go to the documentation of this file.
1 /******************************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #ifndef progressiveLineGraph_H_
7 #define progressiveLineGraph_H_
8 
9 #include <QtCore/QObject>
10 #include <QtGui/QWidget>
11 #include <QtGui/QImage>
12 #include <QtGui/QPixmap>
13 #include <QtCore/QPair>
14 #include <QtCore/QMap>
15 #include <QtGui/QPen>
16 #include <portalApp/dllExport.h>
17 
18 #include <list>
19 #include <utility>
20 
21 
22 
23 class QPainter;
24 
25 
31 {
32  Q_OBJECT
33 
34 public:
35 
37  DtProgressiveLineGraph(int rangeMin, int rangeMax,bool autoScale,
38  QWidget* parent);
39 
41  virtual ~DtProgressiveLineGraph();
42 
44  void addSet(int set,QPen pen, int initial, bool valueCentered = false);
45 
47  void insertValue(int set,double percent,int value);
48 
50  virtual void resetAllValues(int value);
51 
53  virtual void resetValues(int set,int value);
54 
56  virtual void clearValues(int set);
57 
59  virtual void clearAllValues();
60 
63  virtual void offsetPercentages(double percentOffset);
64 
67  virtual void offsetPercentages(int set, double percentOffset);
68 
71  virtual void setRange(int min,int max);
72 
74  virtual int rangeMinimum() const;
75  virtual int rangeMaximum() const;
76 
79  virtual bool autoScale() const;
80 
83  virtual void setAutoScale(bool value);
84 
86  virtual void setNegativeReflection(bool positive);
87 
89  virtual void useBackgroundGradient(bool useIt);
90 
92  virtual bool usesBackgroundGradient() const;
93 
96  virtual void drawAsVerticalLines(bool useVerticalLines);
97 
100  virtual bool usesVerticalLines() const;
101 
103  void forceUpdate(bool widgetUpdate);
104 
105 protected:
106 
107  typedef std::list<std::pair<double,int> > PercentValueMap;
108 
109  struct Set
110  {
112  QPen myPen;
114  int myMax;
115  int myMin;
116  };
117 
118  typedef std::map<int,DtProgressiveLineGraph::Set*> SetMap;
119 
121  virtual void resizeEvent( QResizeEvent* e);
122 
124  virtual void paintEvent( QPaintEvent* );
125 
127  virtual void draw(QPainter& painter,const QRect& rect);
128 
130  virtual void paintBackground(QPainter& painter);
131 
133  virtual int getSeparation() const;
134 
136  virtual void paintLines(QPainter&,Set& set);
137 
139  virtual int desiredRange() const;
140 
142  void paintVerticalLines( PercentValueMap &set, QRectF svp,
143  int rangeHeight, QPainter &painter, QPen pen, bool centered);
144 
146  void paintConnectedLines( PercentValueMap &set, QRectF svp,
147  int rangeHeight, QPainter &painter, QPen pen );
148 
150  int desiredMinimum() const;
151 
154 
158  bool myActive;
159 
161  QPixmap myGradBack;
162  QPixmap* myLineBuffer;
163  QPolygon* myPointCache;
164 
170 };
171 
172 
173 #endif

Document ID: Generated on Wed Dec 21 15:05:11 EST 2016 from SVN revision 171891
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)