00001 00005 class FieldReader 00006 00007 { 00008 private: 00009 00010 static long int int_SIZE; 00011 static long int long_SIZE; 00012 00013 String name_of_dataset; 00014 String fname; 00015 00016 00017 Is fieldfile; 00018 Is gridfile; 00019 00020 VecSimple(long) grid_ix; 00021 VecSimple(long) field_ix; 00022 00023 00024 bool files_open; 00025 bool xdr_format; 00026 00027 void ignoreString (Is& input, const String& string); 00028 void readGridHeader (int& gridnumber, int& checknumber, String& classname, 00029 int& dimensions); 00030 long findGridAddress (int gridnum); 00031 void loadGridIndexFile(); 00032 void loadFieldIndexFile(); 00033 00034 void readFieldHeader 00035 ( 00036 int& fieldnum, 00037 String& header, 00038 real& time, 00039 String& description, 00040 int& gridrefnum, 00041 String& field_classname, 00042 int& component, 00043 int& maxcomponent 00044 ); 00045 00046 long findFieldAddress (int fieldnum); 00047 00048 void open(); 00049 void close(); 00050 00051 public: 00052 00053 FieldReader (); 00054 FieldReader (const String& dataset_name); 00055 ~FieldReader (); 00056 00057 00058 void setDatasetName (const String& dataset_name); 00059 00060 int getNoFields (); 00061 int getNoGrids (); 00062 00063 00064 void getFieldInfo 00065 ( 00066 int fieldnum, 00067 String* header, 00068 real* time = NULL, 00069 int* dimensions = NULL, 00070 String* description = NULL, 00071 int* component = NULL, 00072 int* maxcomponent = NULL, 00073 String* fieldtype = NULL, 00074 String* gridtype = NULL 00075 ); 00076 00077 00078 00079 00080 00081 00082 00083 00084 void getFieldInfo 00085 ( 00086 const String header, 00087 int* fieldnum, 00088 real* time = NULL, 00089 int* dimensions = NULL, 00090 String* description = NULL, 00091 int* component = NULL, 00092 int* maxcomponent = NULL, 00093 String* fieldtype = NULL, 00094 String* gridtype = NULL 00095 ); 00096 00097 00098 void getGridInfo 00099 ( 00100 int gridnum, 00101 int* checknum = NULL, 00102 int* dimensions = NULL, 00103 String* gridtype = NULL 00104 ); 00105 00106 00107 void readField 00108 ( 00109 Handle(Field)& field, 00110 int fieldnum = 1, 00111 String* header = NULL, 00112 real* time = NULL, 00113 String* description = NULL, 00114 int* component = NULL, 00115 int* maxcomponent = NULL 00116 ); 00117 }; 00118 00119