Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members Related Pages Search
mathfunctionimplementor.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "mathfunctionimplementor.h"
00019
00020 #include "mathfunction.h"
00021
00022 MathFunctionImplementor::MathFunctionImplementor()
00023 {
00024 }
00025
00026
00027 MathFunctionImplementor::~MathFunctionImplementor()
00028 {
00029 for (MathFunctionMap::const_iterator it = math_functions.begin(); it != math_functions.end(); it++)
00030 delete it->second;
00031 }
00032
00033 void MathFunctionImplementor::addMathFunction( MathFunction *function, const char * id )
00034 {
00035 math_functions.insert( math_functions.end(), MathFunctionPair(id,function) );
00036 }
00037
00038 MathFunction * MathFunctionImplementor::getMathFunction( const char * id )
00039 {
00040
00041
00042
00043
00044
00045
00046 for (MathFunctionMap::const_iterator it = math_functions.begin(); it != math_functions.end(); it++)
00047 {
00048 if ( it->first == id )
00049 return it->second;
00050 }
00051
00052 return 0;
00053 }
00054
00055 void MathFunctionImplementor::cancelMathFunctions()
00056 {
00057 for (MathFunctionMap::const_iterator it = math_functions.begin(); it != math_functions.end(); it++)
00058 if (it->second->active()){it->second->cancel();}
00059 }
00060
00061 void MathFunctionImplementor::drawMathFunctions(QPainter *p)
00062 {
00063 for (MathFunctionMap::const_iterator it = math_functions.begin(); it != math_functions.end(); it++)
00064 if (it->second->active()){it->second->drawFunction(p);}
00065 }
00066
00067 void MathFunctionImplementor::mathFunctionClick(QMouseEvent *e, double x, double y)
00068 {
00069 for (MathFunctionMap::const_iterator it = math_functions.begin(); it != math_functions.end(); it++)
00070 if (it->second->active()){sendCustomClick(e,it->second,x,y);}
00071
00072 }
00073
00074 void MathFunctionImplementor::sendCustomClick(QMouseEvent *e, MathFunction *m, double x, double y)
00075 {
00076 m->sendClick(e,x,y);
00077 }
00078
00079
|