10 #ifndef progressiveLineGraph_H_
11 #define progressiveLineGraph_H_
23 class QLinearGradient;
30 class DtLgrVerticalRangeSlider;
39 Q_PROPERTY(QColor UpdateColor READ updateColor WRITE setUpdateColor)
40 Q_PROPERTY(QColor InteraColor READ interaColor WRITE setInteraColor)
41 Q_PROPERTY(QColor CheckpColor READ checkpColor WRITE setCheckpColor)
42 Q_PROPERTY(QColor GridTextColor READ gridTextColor WRITE setGridTextColor)
43 Q_PROPERTY(QColor HoverColor READ hoverColor WRITE setHoverColor)
59 int verticalMargin() const;
62 void setMargins(
int horizontalMargin,
int verticalMargin);
65 void addSet(
int set,QPen pen,
int initial,
bool valueCentered = false);
68 QColor updateColor()
const {
return myUpdateColor; }
69 void setUpdateColor(
const QColor& color);
71 void setInteraColor(
const QColor& color);
73 void setCheckpColor(
const QColor& color);
75 void setGridTextColor(
const QColor& color);
80 void setHoverColor(
const QColor& color);
83 void insertValue(
int set,
double percent,
int value);
86 virtual void resetAllValues(
int value);
89 virtual void resetValues(
int set,
int value);
92 virtual void clearValues(
int set);
95 virtual void clearAllValues();
99 virtual void offsetPercentages(
double percentOffset);
103 virtual void offsetPercentages(
int set,
double percentOffset);
107 virtual void setRange(
int min,
int max);
110 virtual int rangeMinimum()
const;
111 virtual int rangeMaximum()
const;
115 virtual bool autoScale()
const;
119 virtual void setAutoScale(
bool value);
122 virtual void setNegativeReflection(
bool positive);
125 virtual void useBackgroundGradient(
bool useIt);
128 virtual bool usesBackgroundGradient()
const;
131 virtual void useAlphaBlending(
bool useIt);
134 virtual bool usesAlphaBlending()
const;
137 void useBasicGui(
bool basic);
141 virtual void drawAsVerticalLines(
bool useVerticalLines);
145 virtual bool usesVerticalLines()
const;
148 virtual void setOffsets(
float left,
float right);
151 void forceUpdate(
bool widgetUpdate);
154 bool updateNeeded()
const;
162 virtual void enableZoom();
164 virtual void disableZoom();
167 virtual void initializeZoomSlider();
170 virtual void syncZoomSlider();
173 virtual void setZoomed(
bool zoom);
176 virtual bool isZoomed();
178 virtual bool isMoveValid(
int slideAmount);
181 void wheelMoved(
int);
185 void intervalSelected(
double startSec,
double stopSec);
188 void moveUp(
int steps);
190 void moveDown(
int steps);
192 void scrollBarMoved(
int action);
197 typedef std::map<int,Set*>
SetMap;
200 virtual double firstTime()
const;
203 virtual double lastTime()
const;
206 virtual double currentTime()
const;
209 virtual void resizeEvent( QResizeEvent* e);
212 virtual void paintEvent( QPaintEvent* );
215 virtual void draw(QPainter& painter,
const QRect& rect);
218 virtual void paintBackground(QPainter& painter);
221 virtual int getSeparation()
const;
224 virtual void paintLines(QPainter&,Set& set);
227 virtual int desiredRange()
const;
231 int rangeHeight, QPainter &painter, QPen pen,
bool centered);
235 int rangeHeight, QPainter &painter, QPen pen );
238 int desiredMinimum()
const;
241 virtual void wheelEvent(QWheelEvent *event);
244 virtual void mousePressEvent(QMouseEvent* event);
247 virtual void mouseMoveEvent(QMouseEvent* event);
250 virtual void leaveEvent(
QEvent* event);
253 void drawHoverLine(QPainter& painter);
256 virtual void validateAndSetZoomedGraphRanges(
int zoomedMax,
int zoomedMin);
259 virtual void slideZoomedRangeDown(
int slideAmount);
260 virtual void slideZoomedRangeUp(
int slideAmount);
263 virtual void setScrollBarRange();
266 virtual void calibrateScrollBarPosition(
int jumpsToMax);
286 void setSetColor(
int set,
const QColor& color);
std::set< std::pair< double, int > > PercentValueMap
Definition: progressiveLineGraph.h:156
int myInitialMinimumRange
Definition: progressiveLineGraph.h:268
int myVerticalMargin
Definition: progressiveLineGraph.h:278
int myInitialZoomedMinRange
Definition: progressiveLineGraph.h:275
int mySliderPosition
Definition: progressiveLineGraph.h:276
std::map< int, Set * > SetMap
Definition: progressiveLineGraph.h:196
bool myActive
Definition: progressiveLineGraph.h:281
QColor gridTextColor() const
Definition: progressiveLineGraph.h:74
DtLgrGuiModel * myModel
Definition: progressiveLineGraph.h:308
bool myZoomEnabled
Definition: progressiveLineGraph.h:306
int myHoverX
Pixel x of the current hover position, or -1 when not hovering.
Definition: progressiveLineGraph.h:312
QColor myInteraColor
Definition: progressiveLineGraph.h:289
QColor myUpdateColor
Definition: progressiveLineGraph.h:288
The logger GUI's model.
Definition: lgrGuiModel.h:56
QColor myHoverColor
Definition: progressiveLineGraph.h:292
bool myUseVerticalLines
Definition: progressiveLineGraph.h:298
QColor hoverColor() const
Color of the hover time-indicator line, styleable via qproperty-HoverColor in the app's qss theme fil...
Definition: progressiveLineGraph.h:79
DtLgrVerticalRangeSlider * myRangeWidget
Definition: progressiveLineGraph.h:304
QPixmap * myLineBuffer
Definition: progressiveLineGraph.h:301
bool myUseGradient
Definition: progressiveLineGraph.h:294
bool myUseAlphaBlending
Definition: progressiveLineGraph.h:295
int myMaximumRange
Definition: progressiveLineGraph.h:272
QColor myCheckpColor
Definition: progressiveLineGraph.h:290
QColor interaColor() const
Definition: progressiveLineGraph.h:70
bool myIsZoomed
Definition: progressiveLineGraph.h:305
double myDrawnRange
Definition: progressiveLineGraph.h:309
QColor myGridTextColor
Definition: progressiveLineGraph.h:291
QLinearGradient * myLinearGradient
Definition: progressiveLineGraph.h:296
int myMinimumRange
Definition: progressiveLineGraph.h:271
#define DT_DLL_LGRGUI
Definition: lgrGui.h:19
bool myGraphNeedsUpdating
Definition: progressiveLineGraph.h:297
Widget which draws a line graphic where the data is progressively added over time.
Definition: progressiveLineGraph.h:34
bool myUseCachedGraph
Definition: progressiveLineGraph.h:302
bool myAutoScale
Definition: progressiveLineGraph.h:280
QColor checkpColor() const
Definition: progressiveLineGraph.h:72
SetMap mySets
Definition: progressiveLineGraph.h:283
Definition: lgrVerticalRangeSlider.h:22
int myInitialMaximumRange
Definition: progressiveLineGraph.h:269
int myInitialZoomedMaxRange
Definition: progressiveLineGraph.h:274
QPolygon * myPointCache
Definition: progressiveLineGraph.h:300
bool myNegativeReflection
Definition: progressiveLineGraph.h:299