| 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_LAMMPSFORMAT_H |
| 7 |
#define AVOGADRO_IO_LAMMPSFORMAT_H |
| 8 |
|
| 9 |
#include "fileformat.h" |
| 10 |
|
| 11 |
namespace Avogadro::Io { |
| 12 |
|
| 13 |
/** |
| 14 |
* @class LammpsTrajectoryFormat lammpsformat.h <avogadro/io/lammpsformat.h> |
| 15 |
* @brief Implementation of the generic lammps trajectory format. |
| 16 |
* @author Adarsh B |
| 17 |
*/ |
| 18 |
|
| 19 |
class AVOGADROIO_EXPORT LammpsTrajectoryFormat : public FileFormat |
| 20 |
{ |
| 21 |
public: |
| 22 |
LammpsTrajectoryFormat() = default; |
| 23 |
~LammpsTrajectoryFormat() override = default; |
| 24 |
|
| 25 |
Operations supportedOperations() const override |
| 26 |
{ |
| 27 |
return Read | MultiMolecule | File | Stream | String; |
| 28 |
} |
| 29 |
|
| 30 |
FileFormat* newInstance() const override |
| 31 |
{ |
| 32 |
return new LammpsTrajectoryFormat; |
| 33 |
} |
| 34 |
std::string identifier() const override |
| 35 |
{ |
| 36 |
return "Avogadro: LAMMPS Trajectory dump"; |
| 37 |
} |
| 38 |
std::string name() const override { return "LAMMPS"; } |
| 39 |
std::string description() const override |
| 40 |
{ |
| 41 |
return "Generic LAMMPS Trajectory format."; |
| 42 |
} |
| 43 |
|
| 44 |
std::string specificationUrl() const override |
| 45 |
{ |
| 46 |
return "https://www.lammps.org/"; |
| 47 |
} |
| 48 |
|
| 49 |
std::vector<std::string> fileExtensions() const override; |
| 50 |
std::vector<std::string> mimeTypes() const override; |
| 51 |
|
| 52 |
[[nodiscard]] bool read(std::istream& inStream, |
| 53 |
Core::Molecule& molecule) override; |
| 54 |
[[nodiscard]] bool write(std::ostream& outStream, |
| 55 |
const Core::Molecule& molecule) override; |
| 56 |
}; |
| 57 |
|
| 58 |
class AVOGADROIO_EXPORT LammpsDataFormat : public FileFormat |
| 59 |
{ |
| 60 |
public: |
| 61 |
LammpsDataFormat() = default; |
| 62 |
~LammpsDataFormat() override = default; |
| 63 |
|
| 64 |
Operations supportedOperations() const override |
| 65 |
{ |
| 66 |
return Write | MultiMolecule | File | Stream | String; |
| 67 |
} |
| 68 |
|
| 69 |
FileFormat* newInstance() const override { return new LammpsDataFormat; } |
| 70 |
std::string identifier() const override { return "Avogadro: LAMMPS Data"; } |
| 71 |
std::string name() const override { return "LAMMPS"; } |
| 72 |
std::string description() const override |
| 73 |
{ |
| 74 |
return "Generic LAMMPS Data format."; |
| 75 |
} |
| 76 |
|
| 77 |
std::string specificationUrl() const override |
| 78 |
{ |
| 79 |
return "https://www.lammps.org/"; |
| 80 |
} |
| 81 |
|
| 82 |
std::vector<std::string> fileExtensions() const override; |
| 83 |
std::vector<std::string> mimeTypes() const override; |
| 84 |
|
| 85 |
[[nodiscard]] bool read(std::istream& inStream, |
| 86 |
Core::Molecule& molecule) override; |
| 87 |
[[nodiscard]] bool write(std::ostream& outStream, |
| 88 |
const Core::Molecule& molecule) override; |
| 89 |
}; |
| 90 |
|
| 91 |
} // namespace Avogadro::Io |
| 92 |
// end Avogadro namespace |
| 93 |
|
| 94 |
#endif // AVOGADRO_IO_LAMMPSFORMAT_H |