-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.h
70 lines (60 loc) · 2.07 KB
/
canvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Canvas Class Header File
#ifndef CANVAS_H
#define CANVAS_H
#include <stdio.h>
#include <stdlib.h>
#include <qmainwindow.h>
#include <qpainter.h>
#include <qpushbt.h>
#include <qbttngrp.h>
#include <qapp.h>
#include <math.h>
#include <qpixmap.h>
#include <qmsgbox.h>
#include <qlabel.h>
#include "transfo.h"
//#include "qwidget.h"
//******************************************************************************
// Drawing subroutines: Canvas Class
//******************************************************************************
//extern Canvas canv; // global application object
class Canvas : public QWidget
{
Q_OBJECT
public:
Canvas( QWidget *parent=0, const char *name=0 );
long testme;
void drawxy();
void linkcanvas(typecanvas *cv2,QLabel *status2);
void init();
private slots:
void butfw();
void butbw();
protected:
void resizeEvent( QResizeEvent * );
void paintEvent( QPaintEvent * );
void mouseMoveEvent( QMouseEvent *e );
void mousePressEvent( QMouseEvent *e );
void mouseReleaseEvent(QMouseEvent *);
private:
typecanvas *cv;
Transfo transfo;
QLabel *status;
QPushButton *fw,*bw;
QPushButton *sl_plus,*sl_minus;
long drawindex,maxindex;
void find_color(double val,QColor *c);
double find_data(double pi, double pj, long pk);
void draw_color_legend(QPainter *p);
void draw_xyaxis_values(QPainter *p, double pixelsx,
double pixelsy, double fictresi, double fictresj);
void draw_nodes(QPainter *p, double pixelsx,
double pixelsy, double fictresi, double fictresj);
void draw_axis_legend(QPainter *p);
void draw_rectangles(QPainter *p, double fictresi,
double fictresj, double pixelsx, double pixelsy);
bool mousebuttonpressed;
void drawz(double i, double j, bool active);
long maxnodelength;
};
#endif // CANVAS_H