00001
00002
00003
00004
00005
00006 #ifndef BALL_FORMAT_CCP4FILE_H
00007 #define BALL_FORMAT_CCP4FILE_H
00008
00009 #ifndef BALL_SYSTEM_FILE_H
00010 # include <BALL/SYSTEM/file.h>
00011 #endif
00012
00013 #ifndef BALL_DATATYPE_REGULARDATA3D_H
00014 # include <BALL/DATATYPE/regularData3D.h>
00015 #endif
00016
00017 namespace BALL
00018 {
00026 class BALL_EXPORT CCP4File
00027 : public File
00028 {
00029
00030 public:
00031
00035
00037 CCP4File();
00038
00040 CCP4File(const String& name, File::OpenMode open_mode = std::ios::in)
00041 throw(Exception::FileNotFound);
00042
00044 virtual ~CCP4File();
00045
00047
00050
00052 virtual void clear();
00053
00055
00058
00060 bool operator == (const CCP4File& file) const;
00061
00063
00064
00065
00068 virtual bool open(const String& name, File::OpenMode open_mode = std::ios::in)
00069 throw(Exception::FileNotFound);
00070
00074 virtual bool readHeader();
00075
00079 virtual bool readSymmetryRecords();
00080
00083 virtual bool read(RegularData3D& map);
00084
00088 virtual bool writeHeader();
00089
00093 virtual bool write(RegularData3D& map);
00094
00096
00099
00101
00102 private:
00103 const CCP4File& operator = (const CCP4File& file);
00104
00105 protected:
00106
00107 int readBinValueasInt_(char* header, Position pos);
00108
00109 float readBinValueasFloat_(char* header, Position pos);
00110
00112 bool swap_bytes_;
00113
00115 int offset_symops_;
00116
00118 int col_axis_;
00119 int row_axis_;
00120 int sec_axis_;
00121
00123 Vector3 start_;
00124
00126 Vector3 extent_;
00127
00129 Vector3 sampling_rate_;
00130
00132 Vector3 cell_dimension_;
00133
00135 Angle alpha_, beta_, gamma_;
00136
00138 float mean_density_;
00139
00141 float deviation_sigma_;
00142
00144 int space_group_;
00145
00147 Vector3 origin_, xaxis_, yaxis_, zaxis_;
00148 };
00149 }
00150
00151 #endif // BALL_FORMAT_DCDFILE_H