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 "graphtypes.h" 00013 00014 #define MAX_NR 200 // maximum number of graphs of one type 00015 00016 class GraphList { 00017 public: 00018 GraphList(); 00019 void clear(); 00020 int addGraph2D(Graph2D *g); 00021 int addGraph3D(Graph3D *g); 00022 int addGraphM(GraphM *g); 00023 int addGraph4D(Graph4D *g); 00024 int addGraphIMAGE(GraphIMAGE *g); 00025 int delGraph(unsigned int index); 00026 GRAPHType getStruct(int index); 00027 int Index(int index); 00028 Graph *getGraph(unsigned int index); 00029 Graph2D *getGraph2D(int index); 00030 Graph3D *getGraph3D(int index); 00031 GraphM *getGraphM(int index); 00032 Graph4D *getGraph4D(int index); 00033 GraphIMAGE *getGraphIMAGE(int index); 00034 unsigned int Number() { return nr2D+nr3D+nrM+nrGRASS+nr4D+nrIMAGE; } 00035 unsigned int isNotFull() { return 7*MAX_NR-nr2D-nr3D-nrM-nrGRASS-nr4D-nrIMAGE; } 00036 private: 00037 unsigned int nr2D, nr3D, nrM, nrGRASS, nr4D, nrIMAGE; // number of graphs 00038 Graph2D list2D[MAX_NR]; 00039 Graph3D list3D[MAX_NR]; 00040 GraphM listM[MAX_NR]; 00041 Graph4D list4D[MAX_NR]; 00042 GraphIMAGE listIMAGE[MAX_NR]; 00043 int id[7*MAX_NR]; // ID īs (0,1,-1,-1,-1,-1,...,2,4,-1,-1,...,3,-1,-1,-1,...) 00044 }; 00045 00046 #endif //GRAPHLIST_H