2011-08-25 06:11:44 +00:00
|
|
|
/*
|
2011-06-26 08:30:44 +00:00
|
|
|
gFlagsLine Header
|
|
|
|
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
|
|
|
License: GPL
|
2011-08-25 06:11:44 +00:00
|
|
|
*/
|
2011-06-26 08:30:44 +00:00
|
|
|
|
|
|
|
#ifndef GFLAGSLINE_H
|
|
|
|
#define GFLAGSLINE_H
|
|
|
|
|
2011-08-25 06:11:44 +00:00
|
|
|
#include "gGraphView.h"
|
2011-06-26 08:30:44 +00:00
|
|
|
|
2011-07-11 04:54:53 +00:00
|
|
|
class gFlagsGroup;
|
|
|
|
|
2011-08-25 06:11:44 +00:00
|
|
|
class gFlagsLine:public Layer
|
2011-06-26 08:30:44 +00:00
|
|
|
{
|
2011-07-11 04:54:53 +00:00
|
|
|
friend class gFlagsGroup;
|
2011-06-26 08:30:44 +00:00
|
|
|
public:
|
2011-07-31 20:24:43 +00:00
|
|
|
gFlagsLine(ChannelID code,QColor col=Qt::black,QString label="",bool always_visible=false,FlagType flt=FT_Bar);
|
2011-06-26 08:30:44 +00:00
|
|
|
virtual ~gFlagsLine();
|
|
|
|
|
2011-08-25 06:11:44 +00:00
|
|
|
virtual void paint(gGraph & w,int left, int top, int width, int height);
|
2011-07-20 16:01:31 +00:00
|
|
|
bool isAlwaysVisible() { return m_always_visible; }
|
|
|
|
void setAlwaysVisible(bool b) { m_always_visible=b; }
|
2011-07-27 15:28:46 +00:00
|
|
|
QString label() { return m_label; }
|
|
|
|
void setLabel(QString s) { m_label=s; }
|
2011-07-27 09:21:53 +00:00
|
|
|
void setTotalLines(int i) { total_lines=i; }
|
|
|
|
void setLineNum(int i) { line_num=i; }
|
2011-06-26 08:30:44 +00:00
|
|
|
protected:
|
2011-07-27 15:28:46 +00:00
|
|
|
QString m_label;
|
2011-07-20 16:01:31 +00:00
|
|
|
bool m_always_visible;
|
2011-07-24 17:50:27 +00:00
|
|
|
int total_lines,line_num;
|
2011-07-27 15:28:46 +00:00
|
|
|
FlagType m_flt;
|
2011-08-02 04:20:26 +00:00
|
|
|
QColor m_flag_color;
|
2011-09-28 11:46:32 +00:00
|
|
|
GLShortBuffer *quads, *lines;
|
2011-09-01 03:37:25 +00:00
|
|
|
int m_lx, m_ly;
|
2011-06-26 08:30:44 +00:00
|
|
|
};
|
|
|
|
|
2011-08-25 06:11:44 +00:00
|
|
|
class gFlagsGroup:public LayerGroup
|
2011-07-11 04:54:53 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
gFlagsGroup();
|
|
|
|
virtual ~gFlagsGroup();
|
|
|
|
|
2011-08-25 06:11:44 +00:00
|
|
|
virtual void paint(gGraph & w,int left, int top, int width, int height);
|
2011-07-27 09:21:53 +00:00
|
|
|
virtual qint64 Minx();
|
|
|
|
virtual qint64 Maxx();
|
2011-09-01 03:37:25 +00:00
|
|
|
virtual void SetDay(Day *);
|
2011-12-05 10:50:58 +00:00
|
|
|
int count() { return lvisible.size(); }
|
|
|
|
int barHeight() { return m_barh; }
|
|
|
|
QVector<gFlagsLine *> & visibleLayers() { return lvisible; }
|
|
|
|
|
2011-08-31 11:44:53 +00:00
|
|
|
protected:
|
2011-09-28 11:46:32 +00:00
|
|
|
GLShortBuffer *quads, *lines;
|
2011-09-01 03:37:25 +00:00
|
|
|
QVector<gFlagsLine *> lvisible;
|
2011-12-05 10:50:58 +00:00
|
|
|
float m_barh;
|
2011-07-11 04:54:53 +00:00
|
|
|
};
|
2011-06-26 08:30:44 +00:00
|
|
|
|
|
|
|
#endif // GFLAGSLINE_H
|