00001 //LabPlot : GraphList.h 00002 00003 #ifndef GRAPHLIST_H 00004 #define GRAPHLIST_H 00005 00006 #include <qtextstream.h> 00007 #include "Graph2D.h" 00008 #include "Graph3D.h" 00009 #include "GraphM.h" 00010 #include "Graph4D.h" 00011 #include "GraphIMAGE.h" 00012 #include "GraphL.h" 00013 #include "graphtypes.h" 00014 00015 #define MAX_NR 200 // maximum number of graphs of one type 00016 #define NR_TYPES 8 00017 00018 class GraphList { 00019 public: 00020 GraphList(); 00021 void clear(); 00022 void saveXML(QDomDocument doc, QDomElement root); 00023 // void openXML(QDomNode node); 00024 int addGraph2D(Graph2D *g); 00025 int addGraph3D(Graph3D *g); 00026 int addGraphM(GraphM *g); 00027 int addGraph4D(Graph4D *g); 00028 int addGraphIMAGE(GraphIMAGE *g); 00029 int addGraphL(GraphL *g); 00030 int delGraph(unsigned int index); 00031 GRAPHType getStruct(int index); 00032 int Index(int index); 00033 Graph *getGraph(unsigned int index); 00034 Graph2D *getGraph2D(int index); 00035 Graph3D *getGraph3D(int index); 00036 GraphM *getGraphM(int index); 00037 Graph4D *getGraph4D(int index); 00038 GraphIMAGE *getGraphIMAGE(int index); 00039 GraphL *getGraphL(int index); 00040 unsigned int Number() { return nr2D+nr3D+nrM+nrGRASS+nr4D+nrIMAGE+nrL; } 00041 unsigned int isNotFull() { return NR_TYPES*MAX_NR-nr2D-nr3D-nrM-nrGRASS-nr4D-nrIMAGE-nrL; } 00042 private: 00043 unsigned int nr2D, nr3D, nrM, nrGRASS, nr4D, nrIMAGE, nrL; // number of graphs 00044 Graph2D list2D[MAX_NR]; 00045 Graph3D list3D[MAX_NR]; 00046 GraphM listM[MAX_NR]; 00047 Graph4D list4D[MAX_NR]; 00048 GraphIMAGE listIMAGE[MAX_NR]; 00049 GraphL listL[MAX_NR]; 00050 int id[NR_TYPES*MAX_NR]; // ID īs (0,1,-1,-1,-1,-1,...,2,4,-1,-1,...,3,-1,-1,-1,...) 00051 }; 00052 00053 #endif //GRAPHLIST_H