[de0af2] | 1 | /*
|
---|
| 2 | * ExportGraph_ToFiles.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: 08.03.2012
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef EXPORTGRAPH_TOFILES_HPP_
|
---|
| 9 | #define EXPORTGRAPH_TOFILES_HPP_
|
---|
| 10 |
|
---|
| 11 | // include config.h
|
---|
| 12 | #ifdef HAVE_CONFIG_H
|
---|
| 13 | #include <config.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
[ca8bea] | 16 | #include <string>
|
---|
| 17 | #include <vector>
|
---|
| 18 |
|
---|
| 19 | #include "Fragmentation/HydrogenSaturation_enum.hpp"
|
---|
[de0af2] | 20 | #include "Fragmentation/Exporters/ExportGraph.hpp"
|
---|
[ca8bea] | 21 | #include "MoleculeListClass.hpp"
|
---|
| 22 |
|
---|
| 23 | class ListOfLocalAtoms_t;
|
---|
[b4f72c] | 24 | class molecule;
|
---|
[de0af2] | 25 |
|
---|
| 26 | /** ExportGraph_ToFiles implements an ExportGraph as storing all fragmentary
|
---|
| 27 | * systems to files.
|
---|
| 28 | */
|
---|
| 29 | class ExportGraph_ToFiles : public ExportGraph
|
---|
| 30 | {
|
---|
| 31 | public:
|
---|
[276ac6] | 32 | ExportGraph_ToFiles(
|
---|
| 33 | const Graph &_graph,
|
---|
| 34 | const enum HydrogenTreatment _treatment,
|
---|
| 35 | const enum HydrogenSaturation _saturation);
|
---|
[ca8bea] | 36 | virtual ~ExportGraph_ToFiles();
|
---|
[de0af2] | 37 |
|
---|
| 38 | void operator()();
|
---|
[ca8bea] | 39 |
|
---|
| 40 | void setPrefix(const std::string &_prefix) {
|
---|
| 41 | prefix = _prefix;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | void setOutputTypes(const std::vector<std::string> &_typelist) {
|
---|
| 45 | typelist = _typelist;
|
---|
| 46 | }
|
---|
| 47 |
|
---|
[7cdf58] | 48 | private:
|
---|
| 49 | /** Helper function to store a fragment for all desired types to file.
|
---|
| 50 | *
|
---|
| 51 | * \param CurrentFragment SaturatedFragment to store to file
|
---|
| 52 | * \param FragmentNumber number padded with zeros used in filename
|
---|
| 53 | * \param FragmentCounter enumeration of this fragment
|
---|
| 54 | * \return true - file written successfully, false - writing failed
|
---|
| 55 | */
|
---|
| 56 | bool storeFragmentForAllTypes(
|
---|
| 57 | SaturatedFragment_ptr &CurrentFragment,
|
---|
| 58 | char *FragmentNumber,
|
---|
| 59 | size_t FragmentCounter) const;
|
---|
| 60 |
|
---|
| 61 | /** Helper function to append the key sets in this SaturatedFragment without
|
---|
| 62 | * added hydrogens to an open stream.
|
---|
| 63 | *
|
---|
| 64 | * \param CurrentFragment fragment whose indices to write
|
---|
| 65 | * \param ForcesFile open stream to write to
|
---|
| 66 | * \param SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
|
---|
| 67 | * \return true - file written successfully, false - writing failed
|
---|
| 68 | */
|
---|
| 69 | bool appendToForcesFile(
|
---|
| 70 | SaturatedFragment_ptr &CurrentFragment,
|
---|
| 71 | std::ostream &ForcesFile,
|
---|
| 72 | const SortIndex_t &SortIndex) const;
|
---|
| 73 |
|
---|
[ca8bea] | 74 | private:
|
---|
| 75 | //!> prefix for fragment files
|
---|
| 76 | std::string prefix;
|
---|
| 77 | //!> list of parser types for which a configuration file per fragment is stored
|
---|
| 78 | std::vector<std::string> typelist;
|
---|
[de0af2] | 79 | };
|
---|
| 80 |
|
---|
| 81 | #endif /* EXPORTGRAPH_TOFILES_HPP_ */
|
---|