#ifndef DIAGRAMWIDGET_H #define DIAGRAMWIDGET_H #include "GraphCore_global.h" #include <QtGui> enum OP {ADD, SUB, MUL, DIV, POW}; enum TYPE {X, OPERATION, OPERAND}; struct operationOrOperand { TYPE type; OP operation; qreal operand; }; class expression { public: QVector<operationOrOperand> steps; }; class GRAPHCORESHARED_EXPORT DiagramWidget : public QWidget { Q_OBJECT public: explicit DiagramWidget(QWidget *parent = 0); void drawFunc(QString fun); protected: void paintEvent(QPaintEvent *); private: qreal XtoPlanCoords(qreal xcoord); qreal YtoScreenCoords(qreal ycoord); qreal applyExp(int index, qreal x); bool m_functionSet; expression myExp; signals: public slots: }; extern "C" GRAPHCORESHARED_EXPORT DiagramWidget* createWidget(); #endif // DIAGRAMWIDGET_H
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)