Last change
on this file since 0f7883 was 0f7883, checked in by Saskia Metzler <metzler@…>, 15 years ago |
Merge Till's structure refactoring
Merge commit 'till/StructureRefactoring' into StateAndFormatParser
Conflicts:
molecuilder/src/Makefile.am
molecuilder/src/unittests/Makefile.am
|
-
Property mode
set to
100644
|
File size:
1.7 KB
|
Rev | Line | |
---|
[eb94c1] | 1 | /*
|
---|
| 2 | * TremoloParser.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Mar 2, 2010
|
---|
| 5 | * Author: metzler
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef TREMOLOPARSER_HPP_
|
---|
| 9 | #define TREMOLOPARSER_HPP_
|
---|
| 10 |
|
---|
[2704e2] | 11 | #include <string>
|
---|
[eb94c1] | 12 | #include "FormatParser.hpp"
|
---|
| 13 |
|
---|
[0f7883] | 14 | /**
|
---|
| 15 | * Holds tremolo-specific information which is not store in the atom class.
|
---|
| 16 | */
|
---|
| 17 | class TremoloAtomInfoContainer {
|
---|
| 18 | public:
|
---|
| 19 | TremoloAtomInfoContainer();
|
---|
| 20 | std::string F;
|
---|
| 21 | std::string stress;
|
---|
| 22 | std::string imprData;
|
---|
| 23 | std::string GroupMeasureTypeNo;
|
---|
| 24 | std::string extType;
|
---|
| 25 | std::string name;
|
---|
| 26 | std::string resName;
|
---|
| 27 | std::string chainID;
|
---|
| 28 | std::string resSeq;
|
---|
| 29 | std::string occupancy;
|
---|
| 30 | std::string tempFactor;
|
---|
| 31 | std::string segID;
|
---|
| 32 | std::string Charge;
|
---|
| 33 | std::string charge;
|
---|
| 34 | std::string GrpTypeNo;
|
---|
| 35 | };
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | * Loads a tremolo file into the World and saves the World as a tremolo file.
|
---|
| 39 | */
|
---|
[2704e2] | 40 | class TremoloParser:public FormatParser
|
---|
| 41 | {
|
---|
[eb94c1] | 42 | public:
|
---|
[2704e2] | 43 | TremoloParser();
|
---|
| 44 | ~TremoloParser();
|
---|
| 45 | void load(std::istream* file);
|
---|
| 46 | void save(std::ostream* file);
|
---|
[eb94c1] | 47 |
|
---|
| 48 | private:
|
---|
[2704e2] | 49 | void readAtomDataLine(string line);
|
---|
| 50 | void parseAtomDataKeysLine(string line, int offset);
|
---|
| 51 |
|
---|
| 52 | /**
|
---|
| 53 | * Known keys for the ATOMDATA line.
|
---|
| 54 | */
|
---|
[0f7883] | 55 | enum atomDataKey {
|
---|
| 56 | noKey,
|
---|
[2704e2] | 57 | x,
|
---|
| 58 | u,
|
---|
| 59 | F,
|
---|
| 60 | stress,
|
---|
| 61 | Id,
|
---|
| 62 | neighbors,
|
---|
| 63 | imprData,
|
---|
| 64 | GroupMeasureTypeNo,
|
---|
| 65 | Type,
|
---|
| 66 | extType,
|
---|
| 67 | name,
|
---|
| 68 | resName,
|
---|
| 69 | chainID,
|
---|
| 70 | resSeq,
|
---|
| 71 | occupancy,
|
---|
| 72 | tempFactor,
|
---|
| 73 | segID,
|
---|
| 74 | Charge,
|
---|
| 75 | charge,
|
---|
| 76 | GrpTypeNo
|
---|
| 77 | };
|
---|
| 78 |
|
---|
| 79 | /**
|
---|
| 80 | * Map to associate the known keys with numbers.
|
---|
| 81 | */
|
---|
[0f7883] | 82 | std::map<std::string, atomDataKey> knownKeys;
|
---|
[2704e2] | 83 |
|
---|
| 84 | /**
|
---|
| 85 | * Fields used in the tremolo file.
|
---|
| 86 | */
|
---|
| 87 | std::vector<std::string> usedFields;
|
---|
| 88 |
|
---|
| 89 | /**
|
---|
| 90 | * Data which is currently not stored in atoms but was provided by the input
|
---|
| 91 | * file.
|
---|
| 92 | */
|
---|
[0f7883] | 93 | std::map<int, TremoloAtomInfoContainer> moreData;
|
---|
[eb94c1] | 94 | };
|
---|
| 95 |
|
---|
| 96 | #endif /* TREMOLOPARSER_HPP_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.