Home

Download

Features

Screenshots

Handbook

Browse Source

Authors

SourceForge.net Logo
Hosted by SourceForge.net

OSI Certified


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Search  

parametricgraph.h

00001 /***************************************************************************
00002                           parametricgraph.h  -  description
00003                              -------------------
00004     begin                : Sun May 26 2002
00005     copyright            : (C) 2002 by Fungmeista
00006     email                : mizunoami44@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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         //virtual void callDrawExpression(Expression &, QPainter *painter);
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