00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_IO_PDB_WRITER_HH
00020 #define OST_IO_PDB_WRITER_HH
00021
00022
00023
00024
00025
00026 #include <fstream>
00027
00028 #include <boost/filesystem/fstream.hpp>
00029 #include <boost/iostreams/filtering_stream.hpp>
00030
00031 #include <ost/mol/mol.hh>
00032
00033 #include <ost/io/module_config.hh>
00034 #include <ost/io/formatted_line.hh>
00035
00036
00037 #include "pdb_io.hh"
00038
00039 namespace ost { namespace io {
00040
00041 class DLLEXPORT_OST_IO PDBWriter {
00042 public:
00043 PDBWriter(const String& filename);
00044 PDBWriter(const boost::filesystem::path& filename);
00045 PDBWriter(std::ostream& outstream);
00046
00047 void Write(const mol::EntityView& ent);
00048 void Write(const mol::EntityHandle& ent);
00049
00050 void Write(const mol::AtomHandleList& atoms);
00051
00052 ~PDBWriter();
00053 private:
00054 template <typename H>
00055 void WriteModel(H ent);
00056
00057 void WriteModelLeader();
00058 void WriteModelTrailer();
00059 std::ofstream outfile_;
00060 std::ostream& outstream_;
00061 int mol_count_;
00062 std::map<long, int> atom_indices_;
00063 FormattedLine line_;
00064 };
00065
00066 }}
00067
00068 #endif