Main Lemma Repository
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

RectilinearGridReader.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. */
  6. /**
  7. @file
  8. @date 09/23/2013 11:05:11 AM
  9. @version $Id$
  10. @author Trevor Irons (ti)
  11. @email Trevor.Irons@xri-geo.com
  12. @copyright Copyright (c) 2013, XRI Geophysics, LLC
  13. @copyright Copyright (c) 2013, Trevor Irons
  14. **/
  15. #ifndef RECTILINEARGRIDREADER_INC
  16. #define RECTILINEARGRIDREADER_INC
  17. #include "GridReader.h"
  18. #include "rectilineargrid.h"
  19. #include "ASCIIParser.h"
  20. namespace Lemma {
  21. /**
  22. @class
  23. \brief
  24. \details
  25. */
  26. class RectilinearGridReader : public GridReader {
  27. friend std::ostream &operator<<(std::ostream &stream,
  28. const RectilinearGridReader &ob);
  29. public:
  30. // ==================== LIFECYCLE =======================
  31. /**
  32. * @copybrief LemmaObject::New()
  33. * @copydetails LemmaObject::New()
  34. */
  35. static RectilinearGridReader* New();
  36. /**
  37. * @copybrief LemmaObject::Delete()
  38. * @copydetails LemmaObject::Delete()
  39. */
  40. void Delete();
  41. // ==================== OPERATORS =======================
  42. // ==================== OPERATIONS =======================
  43. /**
  44. Reads a .mod file, a simple representation of the grid. These files
  45. have the following format:
  46. @verbatim
  47. nx ny nz // number of cells in x, y, and z
  48. ox oy oz // grid offset of top SW corner
  49. hx[0] hx[1] ... hx[nx-1] // grid cell spacing in x, from 0 to nx-1
  50. hy[0] hy[1] ... hy[ny-1] // grid cell spacing in y, from 0 to ny-1
  51. hz[0] hz[1] ... hz[nz-1] // grid cell spacing in z, from 0 to nz-1
  52. // c++ style (//) comments are allowed anywhere, c-style are not
  53. @endverbatim
  54. */
  55. void ReadASCIIGridFile( const std::string& name );
  56. // ==================== ACCESS =======================
  57. /**
  58. * Accessor method for the underlying RectilinearGrid class constructed
  59. * from the input file.
  60. */
  61. RectilinearGrid* GetGrid();
  62. // ==================== INQUIRY =======================
  63. protected:
  64. // ==================== LIFECYCLE =======================
  65. /** Default protected constructor, use New */
  66. RectilinearGridReader (const std::string& name);
  67. /** Default protected constructor, use Delete */
  68. ~RectilinearGridReader ();
  69. /**
  70. * @copybrief LemmaObject::Release()
  71. * @copydetails LemmaObject::Release()
  72. */
  73. void Release();
  74. private:
  75. // ==================== DATA MEMBERS =========================
  76. /** Object holding constructed Grid */
  77. RectilinearGrid* Grid;
  78. /** Performs actual file parsing */
  79. ASCIIParser* Parser;
  80. }; // ----- end of class RectilinearGridReader -----
  81. } // ----- end of Lemma name -----
  82. #endif // ----- #ifndef RECTILINEARGRIDREADER_INC -----