SeExpr
ExprGrapher2d.h
Go to the documentation of this file.
1/*
2* Copyright Disney Enterprises, Inc. All rights reserved.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License
6* and the following modification to it: Section 6 Trademarks.
7* deleted and replaced with:
8*
9* 6. Trademarks. This License does not grant permission to use the
10* trade names, trademarks, service marks, or product names of the
11* Licensor and its affiliates, except as required for reproducing
12* the content of the NOTICE file.
13*
14* You may obtain a copy of the License at
15* http://www.apache.org/licenses/LICENSE-2.0
16*
17* @file ExprGrapher2d.h
18* @brief A 2d image graph view for expression editing previewing
19* @author jlacewel
20*/
21#ifndef ExprGrapher2d_h
22#define ExprGrapher2d_h
23
24#include <QObject>
25#include <QPalette>
26#include <QGLWidget>
27#include <QMouseEvent>
28
29#include "BasicExpression.h"
30
32class QLineEdit;
33
34class ExprGrapherView : public QGLWidget {
35 Q_OBJECT;
37
38 public:
39 ExprGrapherView(ExprGrapherWidget& widget, QWidget* parent, int width, int height);
40 virtual ~ExprGrapherView();
41
42 void update();
43 void setWindow(float xmin, float xmax, float ymin, float ymax, float z);
44 void getWindow(float& xmin, float& xmax, float& ymin, float& ymax, float& z);
45
46 protected:
47 void clear();
48 void paintGL();
49 void mousePressEvent(QMouseEvent* event);
50 void mouseReleaseEvent(QMouseEvent* event);
51 void mouseMoveEvent(QMouseEvent* event);
53
54signals:
56 void clicked();
57
58 private:
59 float* _image;
60 int _width;
62
63 float xmin, xmax, ymin, ymax, z;
64 float dx, dy;
65
67};
68
69class ExprGrapherWidget : public QWidget {
70 Q_OBJECT
71 QLineEdit* scale;
72
73 public:
76
77 ExprGrapherWidget(QWidget* parent, int width, int height);
78
79 void update();
80signals:
81 void preview();
82 private
83slots:
84 void scaleValueEdited();
86 void forwardPreview();
87};
88
89#endif
void getWindow(float &xmin, float &xmax, float &ymin, float &ymax, float &z)
void scaleValueManipulated()
virtual ~ExprGrapherView()
void setWindow(float xmin, float xmax, float ymin, float ymax, float z)
void mouseReleaseEvent(QMouseEvent *event)
void mousePressEvent(QMouseEvent *event)
ExprGrapherWidget & widget
Definition: ExprGrapher2d.h:36
void mouseMoveEvent(QMouseEvent *event)
ExprGrapherView * view
Definition: ExprGrapher2d.h:74
BasicExpression expr
Definition: ExprGrapher2d.h:75
void scaleValueManipulated()
QLineEdit * scale
Definition: ExprGrapher2d.h:71