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