00001
00002
00003
00004
00005
00006
00007 #ifndef IO_FILES_HEADER
00008 #define IO_FILES_HEADER
00009
00010 #include <vector>
00011 #include <string>
00012 #include "hkl_datatypes.hh"
00013 #include "score_datatypes.hh"
00014 #include "hkl_symmetry.hh"
00015 #include "filetype.hh"
00016
00017 namespace scala
00018 {
00020 enum RefListType {NONE, MERGED, UNMERGED};
00021
00022 class HKLIN_data {
00023 public:
00024 HKLIN_data(const std::string& filename_in,
00025 const ReflectionFileType& type_in,
00026 const PxdName& pxdname_in,
00027 const int& series_in);
00028
00029 std::string filename;
00030 ReflectionFileType type;
00031 hkl_symmetry symmetry;
00032 PxdName pxdname;
00033 bool reindex_set;
00034 ReindexOp reindex;
00035 Scell cell;
00036 correl_coeff cc;
00037 int series;
00038
00039
00040 int unmerged;
00041 };
00042
00043 class IO_files
00044 {
00045 public:
00046 IO_files();
00047
00048
00049
00050
00051
00052 int AddHKLINfilename(const std::string& Filename,
00053 const ReflectionFileType& Type);
00054
00055 int AddHKLINfilename(const std::string& Filename,
00056 const ReflectionFileType& Type,
00057 const PxdName& Pxd);
00058
00059 int AddHKLINfilename(const std::vector<std::string>& Filenames,
00060 const ReflectionFileType& Type);
00061
00062 int AddHKLINfilename(const std::vector<std::string>& Filenames,
00063 const std::vector<PxdName> Pxds,
00064 const ReflectionFileType& Type);
00065
00066 int AddHKLINfilename(const std::vector<std::string>& Filenames,
00067 const std::vector<PxdName> Pxds,
00068 const ReflectionFileType& Type,
00069 const std::vector<std::string>& Seriesnames,
00070 const std::vector<int>& fileSeries);
00071
00072
00073
00074 void StoreFilename(const std::string& Streamname, const std::string& Filename);
00075
00076
00077 void StoreHKLINpxdname(const int& index, const PxdName& Pxd);
00078
00079
00080 std::string Filename(const std::string& Streamname) const;
00081 bool IsFile(const std::string& Streamname) const;
00082
00083 int NumberOfHKLINnames() const {return HKLIN_things.size();}
00084
00085
00086 int NumberOfFileSeries() const {return seriescount;}
00087
00088 int NumberOfFilesInSeries(const int& kseries) const;
00089
00090
00091 bool AreThereFileSeries() const;
00092
00093 std::vector<std::string> SeriesNames() const {return seriesnames;}
00094
00095
00096
00097 bool IsHKLINfile(const int& index) const
00098 {return (index >= 0 && index < HKLIN_things.size());}
00099
00100
00101 std::string HKLINfilename(const int& index,
00102 ReflectionFileType& Type,
00103 PxdName& Pxd, int& Series) const;
00104
00105 std::string HKLINfilename(const int& index) const;
00106
00107 std::string HKLINfilename(const int& index,
00108 ReflectionFileType& Type) const;
00109
00110 void RemoveHKLINfile(const int& index);
00111
00112
00113 void StoreHKLINreindex(const int& fileSeries,
00114 const ReindexOp& reindex, const correl_coeff& CC);
00115
00116 bool IsHKLINreindex() const;
00117 bool IsHKLINreindex(const int& index) const;
00118
00119 ReindexOp HKLINreindex(const int& index) const;
00120 correl_coeff HKLIN_CC(const int& index) const;
00121
00122 int HKLIN_fileSeries(const int& index) const;
00123
00124
00125 void StoreHKLINsymmetry(const int& index, const hkl_symmetry& symm_in);
00126
00127 hkl_symmetry HKLINsymmetry(const int& index) const;
00128
00129
00130 void StoreHKLINcell(const int& index, const Scell& cell);
00131
00132 Scell HKLINcell(const int& index) const;
00133
00134
00135 void SetMergedFlag(const int& index, const bool& Unmerged=false);
00136
00137 bool MergedFlag(const int& index) const;
00138
00139
00140 void CheckHklinFileType();
00141
00142 private:
00143 void CheckIndex(const int& index) const;
00144 void CheckSeries(const int& fileSeries) const;
00145
00146 std::vector<HKLIN_data> HKLIN_things;
00147 std::string HKLREF_filename;
00148 std::string HKLOUT_filename;
00149 std::string XMLOUT_filename;
00150 std::string XYZIN_filename;
00151 int seriescount;
00152 std::vector<std::string> seriesnames;
00153 };
00154
00155 }
00156 #endif