Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members Related Pages Search
parametricgraph.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PARAMETRICGRAPH_H
00019 #define PARAMETRICGRAPH_H
00020
00021 #include "expressiongraph.h"
00022
00028 class ParametricGraph : public ExpressionGraph
00029 {
00030 Q_OBJECT
00031
00032 public:
00033 ParametricGraph(QWidget *parent=0, const char *name=0);
00034 ~ParametricGraph();
00035
00036 virtual void load_key( const char *key, const char *value );
00037
00038 int setTMin(double);
00039 int setTMax(double);
00040 int setTStep(double);
00041 inline double getTStep() const{return tStep;}
00042 inline double getTMin() const{return tMin;}
00043 inline double getTMax() const{return tMax;}
00044
00045 virtual void installMathFunctions();
00046 virtual int execMathFunction( const char * );
00047
00048 virtual inline int getGraphType() const{return PARAMETRICGRAPH;}
00049
00050 protected:
00051 virtual void updateCoords();
00052 inline virtual const char * independent_vars(){return "t";}
00053 inline virtual const char * dependent_var(int i){return (i == X_VAR) ? "x" : "y";}
00054
00055 virtual int setXYForTrace(const double, const double, double *, double *, Expression &);
00056 virtual void putUndefinedMessage(double x, double y);
00057
00058 virtual void drawExpression(QPainter*, Expression &);
00059 inline virtual unsigned int var_count(){return 2;}
00060 inline virtual double snapIntervalX(){return (isTracing()) ? tStep : getXScale();}
00061 inline virtual double startSnap(){return (isTracing()) ? tMin : 0;}
00062 inline virtual double traceDepX(double x){return (x-getXMin())/((getXMax()-getXMin())/(tMax-tMin))+tMin;}
00063
00064 virtual void sendCustomClick(QMouseEvent *, MathFunction *, double, double);
00065
00066 private:
00067 double tMin,tMax,tStep;
00068
00069 static const int X_VAR = 0;
00070 static const int Y_VAR = 1;
00071
00072 double t_trace;
00073 };
00074
00075 #endif
|