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  

ExpressionGraph Class Reference

Subclass this class to create graphs that display graphs of expressions. More...

#include <expressiongraph.h>

Inheritance diagram for ExpressionGraph:

Inheritance graph
[legend]
Collaboration diagram for ExpressionGraph:

Collaboration graph
[legend]
List of all members.

Public Slots

void nextExpression ()
void prevExpression ()
void setDrawConnected (bool b)
void setShowCurrentExpression (bool state)
void setTrace (bool)
void slotNextFrame ()

Signals

void animationValueChanged (double)

Public Methods

 ExpressionGraph (QWidget *parent=0, const char *name=0)
 ~ExpressionGraph ()
void load_key (const char *key, const char *value)
void addExpression (const Expression &)
 Adds and thus graphs the expression.

void removeExpression (unsigned int index)
 Removes the expression at the given index.

unsigned int getCurrentExpressionIndex ()
void setCurrentExpressionIndex (int i)
Expression getExpression (unsigned int i) const
unsigned int expressionCount ()
virtual void print (QPrinter *)
 Prints graph as is.

void setAngle (int m)
int getAngle () const
bool isTracing () const
bool isDrawConnected () const
void exportAsImage (const QString &file, const QString &fileType)
 Saves the graph as an image.

void getPixmap (QPixmap &pm)
void onlyShowActive (bool b)
void setDisplayExpressionText (bool b)

Protected Methods

virtual int setXYForTrace (const double, const double, double *, double *, Expression &)
virtual void drawExpression (QPainter *, Expression &expression)=0
void drawExpressionAt (QPainter *painter, int i)
virtual void putUndefinedMessage (double x, double y)
virtual unsigned int var_count ()
virtual void drawAfterAxis (QPainter *)
virtual const char * independent_vars ()=0
 Returns a list of independent variables for the expression which, when there are more than one, are seperated by commas.

virtual const char * dependent_var (int i=0)=0
 Returns the dependent variable.

virtual double traceDepX (double d)
virtual double traceDepY (double d)
void reparseAll ()
FungParsergetParsedCurrentExpression (int i=0)
 Returns a pointer to a FungParser object which has the current expression parsed.

int parseExpression (std::string &expression, FungParser *fp, int i=0)
 Returns a pointer to a FungParser object which has the expression at the given index parsed.

bool isValidExpression (const Expression &, std::string *errorMsg=0)
void paintEvent (QPaintEvent *)
void mouseMoveEvent (QMouseEvent *)
virtual void nextFrameReady ()
 Classes that implement this class need to implement this function.


Friends

class MathFunction

Detailed Description

Subclass this class to create graphs that display graphs of expressions.

Author:
Fungmeista

Definition at line 36 of file expressiongraph.h.


Member Function Documentation

virtual const char* ExpressionGraph::dependent_var int    i = 0 [protected, pure virtual]
 

Returns the dependent variable.

The argument 'i' is used to get each dependent variable if there are more than one ( i.e. parametric graph ).

Implemented in DensityPlot, FunctionGraph, ParametricGraph, and PolarGraph.

Referenced by addExpression(), getParsedCurrentExpression(), parseExpression(), and removeExpression().

void ExpressionGraph::exportAsImage const QString &    file,
const QString &    fileType
[virtual]
 

Saves the graph as an image.

Parameters:
filename  Path plus the complete name of the image file to save to. This should include the suffix of the file name if one is desired.
suffix  This specifies what type of image format export the graph as. This should be the standard file suffix of the desired image format (png, jpg, bmp, etc.).

Implements CommonGraph.

Definition at line 120 of file expressiongraph.cpp.

FungParser * ExpressionGraph::getParsedCurrentExpression int    i = 0 [protected]
 

Returns a pointer to a FungParser object which has the current expression parsed.

This is allocated using 'new' and therefore should be deleted manually by the user.

Definition at line 419 of file expressiongraph.cpp.

References dependent_var().

Referenced by FunctionGraph::execMathFunction().

bool ExpressionGraph::isDrawConnected   const [inline, virtual]
 

Returns :
Whether or not the graph is connecting points calculated for the value of the function.

Reimplemented from CommonGraph.

Definition at line 73 of file expressiongraph.h.

bool ExpressionGraph::isTracing   const [inline, virtual]
 

Returns :
Whether or not tracing is active.

Reimplemented from CommonGraph.

Definition at line 70 of file expressiongraph.h.

void ExpressionGraph::nextFrameReady   [protected, virtual]
 

Classes that implement this class need to implement this function.

This function is called everytime the next frame is ready and the subclass should implement an animation with it

Implements Animator.

Definition at line 426 of file expressiongraph.cpp.

References Animator::animatorValue().

int ExpressionGraph::parseExpression std::string &    expression,
FungParser   fp,
int    i = 0
[protected]
 

Returns a pointer to a FungParser object which has the expression at the given index parsed.

This is allocated using 'new' and therefore should be deleted manually by the user.

Definition at line 378 of file expressiongraph.cpp.

References dependent_var(), independent_vars(), and FungParser::Parse().

Referenced by addExpression().

void ExpressionGraph::print QPrinter *    [virtual]
 

Prints graph as is.

A printer setup dialog will be opened.

Reimplemented from BasicGraph.

Definition at line 137 of file expressiongraph.cpp.

References BasicGraph::backgroundColor().


The documentation for this class was generated from the following files: