OSCAR-code/Graphs/gYAxis.h

89 lines
2.5 KiB
C
Raw Normal View History

/*
2011-06-26 08:30:44 +00:00
gYAxis Header
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
License: GPL
*/
2011-06-26 08:30:44 +00:00
#ifndef GYAXIS_H
#define GYAXIS_H
#include "gGraphView.h"
2011-06-26 08:30:44 +00:00
class gYSpacer:public Layer
{
public:
gYSpacer(int spacer=20);
virtual void paint(gGraph & w,int left,int top, int width, int height) {
Q_UNUSED(w)
Q_UNUSED(left)
Q_UNUSED(top)
Q_UNUSED(width)
Q_UNUSED(height)
}
};
2011-08-25 10:38:42 +00:00
class gXGrid:public Layer
{
2011-08-25 10:38:42 +00:00
public:
gXGrid(QColor col=QColor("black"));
virtual ~gXGrid();
virtual void paint(gGraph & w,int left,int top, int width, int height);
void setShowMinorLines(bool b) { m_show_minor_lines=b; }
void setShowMajorLines(bool b) { m_show_major_lines=b; }
bool showMinorLines() { return m_show_minor_lines; }
bool showMajorLines() { return m_show_major_lines; }
protected:
bool m_show_major_lines;
bool m_show_minor_lines;
QColor m_major_color;
QColor m_minor_color;
};
class gYAxis:public Layer
2011-06-26 08:30:44 +00:00
{
public:
2011-09-17 12:39:00 +00:00
gYAxis(ChannelID code="",QColor col=QColor("black"));
2011-06-26 08:30:44 +00:00
virtual ~gYAxis();
virtual void paint(gGraph & w,int left,int top, int width, int height);
void SetShowMinorLines(bool b) { m_show_minor_lines=b; }
void SetShowMajorLines(bool b) { m_show_major_lines=b; }
bool ShowMinorLines() { return m_show_minor_lines; }
bool ShowMajorLines() { return m_show_major_lines; }
void SetShowMinorTicks(bool b) { m_show_minor_ticks=b; }
void SetShowMajorTicks(bool b) { m_show_major_ticks=b; }
bool ShowMinorTicks() { return m_show_minor_ticks; }
bool ShowMajorTicks() { return m_show_major_ticks; }
virtual const QString Format(EventDataType v, int dp);
2011-12-07 10:19:28 +00:00
static const int Margin=60; // Left margin space
void SetScale(float f) { m_yaxis_scale=f; } // Scale yaxis ticker values (only what's displayed)
float Scale() { return m_yaxis_scale; }
2011-09-05 13:26:10 +00:00
2011-06-26 08:30:44 +00:00
protected:
bool m_show_major_lines;
bool m_show_minor_lines;
bool m_show_minor_ticks;
bool m_show_major_ticks;
float m_yaxis_scale;
QColor m_line_color;
QColor m_text_color;
GLShortBuffer * lines;
2011-09-05 13:26:10 +00:00
virtual bool mouseMoveEvent(QMouseEvent * event);
2011-06-26 08:30:44 +00:00
};
class gYAxisTime:public gYAxis
{
public:
gYAxisTime(QColor col=Qt::black);
virtual ~gYAxisTime();
protected:
virtual const QString Format(EventDataType v, int dp);
bool show_12hr;
};
2011-06-26 08:30:44 +00:00
#endif // GYAXIS_H