OSCAR-code/Graphs/gFlagsLine.h

59 lines
1.5 KiB
C
Raw Normal View History

/*
2011-06-26 08:30:44 +00:00
gFlagsLine Header
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
License: GPL
*/
2011-06-26 08:30:44 +00:00
#ifndef GFLAGSLINE_H
#define GFLAGSLINE_H
#include "gGraphView.h"
2011-06-26 08:30:44 +00:00
class gFlagsGroup;
class gFlagsLine:public Layer
2011-06-26 08:30:44 +00:00
{
friend class gFlagsGroup;
2011-06-26 08:30:44 +00:00
public:
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();
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; }
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:
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;
FlagType m_flt;
QColor m_flag_color;
GLShortBuffer *quads, *lines;
2011-09-01 03:37:25 +00:00
int m_lx, m_ly;
2011-06-26 08:30:44 +00:00
};
class gFlagsGroup:public LayerGroup
{
public:
gFlagsGroup();
virtual ~gFlagsGroup();
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; }
protected:
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-06-26 08:30:44 +00:00
#endif // GFLAGSLINE_H