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  

graph.cpp

00001 /***************************************************************************
00002                           graph.cpp  -  description
00003                              -------------------
00004     begin                : Thu May 16 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 #include <qpixmap.h>
00019 #include <qworkspace.h>
00020 
00021 #include "graph.h"
00022 #include "basicgraph.h"
00023 
00024 Graph::~Graph()
00025 {                 
00026 }
00027 
00028 CommonGraphMain* Graph::createGraph(int graphType, QWidget *parent)
00029 {                     
00030     switch(graphType)
00031     {
00032         case FUNCTIONGRAPH:
00033         {
00034             FunctionGraphMain* f = new FunctionGraphMain(parent, "functiongraph");
00035             f->getGraph()->installMathFunctions();
00036             f->setIcon( QPixmap(functiongraph_xpm) );
00037             return f;
00038             break;
00039         }
00040         case POLARGRAPH:
00041         {
00042             PolarGraphMain* po = new PolarGraphMain(parent, "polargraph");
00043             po->getGraph()->installMathFunctions();
00044             po->setIcon( QPixmap(polargraph_xpm) );
00045             return po;
00046             break;
00047         }
00048         case PARAMETRICGRAPH:
00049         {
00050             ParametricGraphMain* p = new ParametricGraphMain(parent, "parametricgraph");
00051             p->getGraph()->installMathFunctions();
00052             p->setIcon( QPixmap(parametricgraph_xpm) );
00053             return p;
00054             break;
00055         }
00056         case STATGRAPH:
00057         {
00058             StatPlotGraphMain* s = new StatPlotGraphMain(parent, "statplot");
00059             s->getGraph()->installMathFunctions();
00060             s->setIcon( QPixmap(statplot_xpm) );
00061             return s;
00062             break;
00063         }
00064         case DENSITYPLOT:
00065         {
00066             DensityPlotMain* s = new DensityPlotMain(parent, "densityplot");
00067             s->getGraph()->installMathFunctions();
00068             s->setIcon( QPixmap(functiongraph_xpm) );
00069             return s;
00070             break;
00071         }
00072         #ifdef GLGRAPH
00073         case GLFUNCTIONGRAPH:
00074         {
00075             GLFunctionGraphMain* s = new GLFunctionGraphMain(parent, "glfunctiongraph");
00076             s->setIcon( QPixmap(glfunctiongraph_xpm) );
00077             return s;
00078             break;
00079         }
00080         case GLPOLARGRAPH:
00081         {
00082             GLPolarGraphMain* s = new GLPolarGraphMain(parent, "glpolargraph");
00083             s->setIcon( QPixmap(glpolargraph_xpm) );
00084             return s;
00085             break;
00086         }
00087         case GLCYLINDRICALGRAPH:
00088         {
00089             GLCylindricalGraphMain* s = new GLCylindricalGraphMain(parent, "glcylindricalgraph");
00090             s->setIcon( QPixmap(glcylindricalgraph_xpm) );
00091             return s;
00092             break;
00093         }
00094         #endif //GLGRAPH
00095     }
00096     return 0;
00097 }
00098