| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_IO_PDBFORMAT_H |
| 7 |
#define AVOGADRO_IO_PDBFORMAT_H |
| 8 |
|
| 9 |
#include "fileformat.h" |
| 10 |
|
| 11 |
namespace Avogadro::Io { |
| 12 |
|
| 13 |
/** |
| 14 |
* @class PdbFormat pdbformat.h <avogadro/io/pdbformat.h> |
| 15 |
* @brief Parser for the PDB format. |
| 16 |
* @author Tanuj Kumar |
| 17 |
*/ |
| 18 |
|
| 19 |
class AVOGADROIO_EXPORT PdbFormat : public FileFormat |
| 20 |
{ |
| 21 |
public: |
| 22 |
PdbFormat() = default; |
| 23 |
~PdbFormat() override = default; |
| 24 |
|
| 25 |
Operations supportedOperations() const override |
| 26 |
{ |
| 27 |
return Read | File | Stream | String; |
| 28 |
} |
| 29 |
|
| 30 |
FileFormat* newInstance() const override { return new PdbFormat; } |
| 31 |
std::string identifier() const override { return "Avogadro: PDB"; } |
| 32 |
std::string name() const override { return "PDB"; } |
| 33 |
std::string description() const override |
| 34 |
{ |
| 35 |
return "Format that contains atoms, bonds, positions and secondary" |
| 36 |
"structures of proteins."; |
| 37 |
} |
| 38 |
|
| 39 |
std::string specificationUrl() const override |
| 40 |
{ |
| 41 |
return "http://www.wwpdb.org/documentation/file-format-content/" |
| 42 |
"format33/v3.3.html"; |
| 43 |
} |
| 44 |
|
| 45 |
std::vector<std::string> fileExtensions() const override; |
| 46 |
std::vector<std::string> mimeTypes() const override; |
| 47 |
|
| 48 |
[[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override; |
| 49 |
[[nodiscard]] bool write(std::ostream&, const Core::Molecule&) override |
| 50 |
{ |
| 51 |
// Writing a PDB file is not currently supported |
| 52 |
return false; |
| 53 |
} |
| 54 |
|
| 55 |
void perceiveSubstitutedCations(Core::Molecule& molecule); |
| 56 |
}; |
| 57 |
|
| 58 |
} // namespace Avogadro::Io |
| 59 |
|
| 60 |
#endif // AVOGADRO_IO_PDBFORMAT_H |