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 <QtCore/QObject>
25 #include <QtGui/QPalette>
26 #include <QtOpenGL/QGLWidget>
27 #include <QtGui/QMouseEvent>
28 
29 #include "BasicExpression.h"
30 
31 class ExprGrapherWidget;
32 class QLineEdit;
33 
34 class ExprGrapherView : public QGLWidget
35 {
36  Q_OBJECT;
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 
54  signals:
55  void scaleValueManipulated();
56  void clicked();
57 
58  private:
59  float * _image;
60  int _width;
61  int _height;
62 
63  float xmin,xmax,ymin,ymax,z;
64  float dx,dy;
65 
66 
68 
69 };
70 
71 class ExprGrapherWidget : public QWidget
72 {
73  Q_OBJECT
74  QLineEdit* scale;
75 
76  public:
79 
80  ExprGrapherWidget(QWidget* parent, int width, int height);
81 
82  void update();
83 signals:
84  void preview();
85 private slots:
86  void scaleValueEdited();
87  void scaleValueManipulated();
88  void forwardPreview();
89 
90 };
91 
92 #endif
BasicExpression expr
Definition: ExprGrapher2d.h:78
void mouseMoveEvent(QMouseEvent *event)
void mouseReleaseEvent(QMouseEvent *event)
ExprGrapherWidget & widget
Definition: ExprGrapher2d.h:36
void setWindow(float xmin, float xmax, float ymin, float ymax, float z)
ExprGrapherWidget(QWidget *parent, int width, int height)
ExprGrapherView(ExprGrapherWidget &widget, QWidget *parent, int width, int height)
QLineEdit * scale
Definition: ExprGrapher2d.h:74
void getWindow(float &xmin, float &xmax, float &ymin, float &ymax, float &z)
ExprGrapherView * view
Definition: ExprGrapher2d.h:77
void mousePressEvent(QMouseEvent *event)
void scaleValueManipulated()
virtual ~ExprGrapherView()
void scaleValueManipulated()