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  

polargraph.h

00001 /***************************************************************************
00002                           polargraph.h  -  description
00003                              -------------------
00004     begin                : Thu May 30 2002
00005     copyright            : (C) 2002 by Fungmeista
00006     email                : confederacy2@excite.com
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 POLARGRAPH_H
00019 #define POLARGRAPH_H
00020 
00021 #include "expressiongraph.h"
00022 
00027 class PolarGraph : public ExpressionGraph
00028 {
00029     Q_OBJECT
00030 
00031     public: 
00032         PolarGraph(QWidget *parent=0, const char *name=0);
00033 
00034         virtual void load_key( const char *key, const char *value );
00035 
00036         int setTMin(double);
00037         int setTMax(double);
00038         int setTStep(double);
00039         double getTMin(){return tMin;}
00040         double getTStep(){return tStep;}
00041         double getTMax(){return tMax;}
00042 
00043         virtual int getGraphType() const{return POLARGRAPH;}
00044 
00045     protected:
00046         inline virtual double snapIntervalX(){return (isTracing()) ? tStep : getXScale();}
00047         inline virtual double startSnap(){return (isTracing()) ? tMin : 0;}
00048 
00049         virtual void updateCoords();
00050 
00051         virtual void drawExpression(QPainter*,Expression &);
00052         virtual const char * independent_vars(){return "t";}
00053         virtual const char * dependent_var(int=0){return "r";}
00054         virtual int setXYForTrace(const double, const double, double *, double *, Expression &);
00055 
00056         inline virtual double traceDepX(double x){return (x-getXMin())/((getXMax()-getXMin())/(tMax-tMin))+tMin;}
00057 
00058     private:
00059         double tMin,tMax,tStep,t_trace;
00060 };
00061 
00062 #endif