00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef U2D_LOAD_PLOTMTV_H
00024 #define U2D_LOAD_PLOTMTV_H
00025
00026 #include <u2d_GLmesh.h>
00027
00028 #define KNOWN_FOMARTS 27
00029 #define UNDEFINED -1
00030
00031
00032
00033
00034 #define CURVE2D 1
00035 #define CURVE3D 2
00036 #define CONTCURV 3
00037 #define RECTGRID 4
00038 #define GRID4D 5
00039 #define MESH4D 6
00040 #define POLYGON 7
00041 #define VECTOR 8
00042 #define MESH 9
00043 #define COLUMN 10
00044 #define PROBAB 11
00045 #define HISTOG 12
00046 #define BARCHART 13
00047 #define UNRECOG 14
00048
00049 typedef struct {
00050 const char *label;
00051 int value;
00052 } MPdata_format;
00053
00054 static MPdata_format format_pairs[] = {
00055 {"curve2d" , CURVE2D },
00056 {"2d" , CURVE2D },
00057 {"twod" , CURVE2D },
00058 {"curve3d" , CURVE3D },
00059 {"3d" , CURVE3D },
00060 {"threed" , CURVE3D },
00061 {"contcurv" , CONTCURV},
00062 {"contcurve" , CONTCURV},
00063 {"contourcurve" , CONTCURV},
00064 {"contour-curve", CONTCURV},
00065 {"contour" , RECTGRID},
00066 {"rectgrid" , RECTGRID},
00067 {"grid4d" , GRID4D },
00068 {"4d" , GRID4D },
00069 {"poly" , POLYGON },
00070 {"polygon" , POLYGON },
00071 {"vector" , VECTOR },
00072 {"vect" , VECTOR },
00073 {"column" , COLUMN },
00074 {"prob" , PROBAB },
00075 {"probab" , PROBAB },
00076 {"probability" , PROBAB },
00077 {"hist" , HISTOG },
00078 {"histog" , HISTOG },
00079 {"histogram" , HISTOG },
00080 {"bar" , BARCHART},
00081 {"barchart" , BARCHART},
00082 };
00083
00084
00085 class u2d_Load_PlotMtv {
00086
00087 public:
00088 u2d_Load_PlotMtv(const char *filename);
00089 ~u2d_Load_PlotMtv();
00090 vector<u2d_Display_Set> display_set;
00091
00092 private:
00093 int set_filename(const char *filename);
00094 void open_plotmtv_file();
00095 void read_plotmtv_file();
00096 char *skip_white_spaces(char *str, int length);
00097 int parse_header(char *header, int length);
00098 int parse_option(char *cur_pos,\
00099 u2d_Display_Set *m_display_set);
00100 int parse_CURVE2D(char *cur_pos,\
00101 u2d_Display_Set *m_display_set);
00102 void select_appropriate_GLtype(int data_type,\
00103 u2d_Display_Set *m_display_set);
00104 char *filename_expanded;
00105 FILE *file;
00106 };
00107
00108 #endif