| 1 | 
< | 
 /* | 
| 1 | 
> | 
/* | 
| 2 | 
  | 
 * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. | 
| 3 | 
  | 
 * | 
| 4 | 
  | 
 * The University of Notre Dame grants you ("Licensee") a | 
| 39 | 
  | 
 * such damages. | 
| 40 | 
  | 
 */ | 
| 41 | 
  | 
  | 
| 42 | 
< | 
 /** | 
| 43 | 
< | 
  * @file DumpReader.hpp | 
| 44 | 
< | 
  * @author tlin | 
| 45 | 
< | 
  * @date 11/15/2004 | 
| 46 | 
< | 
  * @time 09:25am | 
| 47 | 
< | 
  * @version 2.0 | 
| 48 | 
< | 
  */ | 
| 42 | 
> | 
/** | 
| 43 | 
> | 
 * @file DumpReader.hpp | 
| 44 | 
> | 
 * @author tlin | 
| 45 | 
> | 
 * @date 11/15/2004 | 
| 46 | 
> | 
 * @time 09:25am | 
| 47 | 
> | 
 * @version 2.0 | 
| 48 | 
> | 
 */ | 
| 49 | 
  | 
 | 
| 50 | 
  | 
#ifndef IO_DUMPREADER_HPP | 
| 51 | 
  | 
#define IO_DUMPREADER_HPP | 
| 56 | 
  | 
#include "primitives/StuntDouble.hpp" | 
| 57 | 
  | 
namespace oopse { | 
| 58 | 
  | 
 | 
| 59 | 
< | 
/** | 
| 60 | 
< | 
 * @class DumpReader DumpReader.hpp "io/DumpReader.hpp" | 
| 61 | 
< | 
 * @todo get rid of more junk code from DumpReader | 
| 62 | 
< | 
 */ | 
| 63 | 
< | 
class DumpReader { | 
| 64 | 
< | 
    public: | 
| 59 | 
> | 
  /** | 
| 60 | 
> | 
   * @class DumpReader DumpReader.hpp "io/DumpReader.hpp" | 
| 61 | 
> | 
   * @todo get rid of more junk code from DumpReader | 
| 62 | 
> | 
   */ | 
| 63 | 
> | 
  class DumpReader { | 
| 64 | 
> | 
  public: | 
| 65 | 
  | 
 | 
| 66 | 
< | 
        DumpReader(SimInfo* info, const std::string & filename); | 
| 67 | 
< | 
        //DumpReader(SimInfo * info, istream & is); | 
| 66 | 
> | 
    DumpReader(SimInfo* info, const std::string & filename); | 
| 67 | 
> | 
    //DumpReader(SimInfo * info, istream & is); | 
| 68 | 
  | 
 | 
| 69 | 
< | 
        ~DumpReader(); | 
| 69 | 
> | 
    ~DumpReader(); | 
| 70 | 
  | 
 | 
| 71 | 
< | 
        /** Returns the number of frames in the dump file*/ | 
| 72 | 
< | 
        int getNFrames(); | 
| 71 | 
> | 
    /** Returns the number of frames in the dump file*/ | 
| 72 | 
> | 
    int getNFrames(); | 
| 73 | 
  | 
 | 
| 74 | 
  | 
         | 
| 75 | 
< | 
        void readFrame(int whichFrame); | 
| 75 | 
> | 
    void readFrame(int whichFrame); | 
| 76 | 
  | 
 | 
| 77 | 
< | 
    private: | 
| 77 | 
> | 
  private: | 
| 78 | 
  | 
 | 
| 79 | 
< | 
        void scanFile(); | 
| 79 | 
> | 
    void scanFile(); | 
| 80 | 
  | 
 | 
| 81 | 
< | 
        void readSet(int whichFrame); | 
| 81 | 
> | 
    void readSet(int whichFrame); | 
| 82 | 
  | 
 | 
| 83 | 
< | 
        void parseDumpLine(char *line, StuntDouble* integrableObject); | 
| 83 | 
> | 
    void parseDumpLine(char *line, StuntDouble* integrableObject); | 
| 84 | 
  | 
 | 
| 85 | 
< | 
        void parseCommentLine(char* line, Snapshot* s); | 
| 85 | 
> | 
    void parseCommentLine(char* line, Snapshot* s); | 
| 86 | 
  | 
 | 
| 87 | 
  | 
 | 
| 88 | 
  | 
#ifdef IS_MPI | 
| 89 | 
  | 
 | 
| 90 | 
< | 
        void anonymousNodeDie(void); | 
| 91 | 
< | 
        void nodeZeroError(void); | 
| 90 | 
> | 
    void anonymousNodeDie(void); | 
| 91 | 
> | 
    void nodeZeroError(void); | 
| 92 | 
  | 
 | 
| 93 | 
  | 
#endif                 | 
| 94 | 
< | 
        // the maximum length of a typical MPI package is 15k | 
| 95 | 
< | 
        const static int maxBufferSize = 8192; | 
| 94 | 
> | 
    // the maximum length of a typical MPI package is 15k | 
| 95 | 
> | 
    const static int maxBufferSize = 8192; | 
| 96 | 
  | 
         | 
| 97 | 
< | 
        SimInfo* info_; | 
| 97 | 
> | 
    SimInfo* info_; | 
| 98 | 
  | 
 | 
| 99 | 
< | 
        std::string filename_; | 
| 100 | 
< | 
        bool isScanned_; | 
| 99 | 
> | 
    std::string filename_; | 
| 100 | 
> | 
    bool isScanned_; | 
| 101 | 
  | 
 | 
| 102 | 
< | 
        int nframes_; | 
| 102 | 
> | 
    int nframes_; | 
| 103 | 
  | 
 | 
| 104 | 
< | 
        FILE* inFile_; | 
| 105 | 
< | 
        std::vector<fpos_t*> framePos_; | 
| 106 | 
< | 
}; | 
| 104 | 
> | 
    FILE* inFile_; | 
| 105 | 
> | 
    std::vector<fpos_t*> framePos_; | 
| 106 | 
  | 
 | 
| 107 | 
+ | 
    bool needPos_; | 
| 108 | 
+ | 
    bool needVel_; | 
| 109 | 
+ | 
    bool needQuaternion_; | 
| 110 | 
+ | 
    bool needAngMom_; | 
| 111 | 
+ | 
  }; | 
| 112 | 
+ | 
 | 
| 113 | 
  | 
}      //end namespace oopse | 
| 114 | 
  | 
 | 
| 115 | 
  | 
#endif //IO_DUMPREADER_HPP |