Main Lemma Repository
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

TEMSurveyData.h 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 03/03/2015 09:54:25
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2015, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2015, Trevor Irons
  16. */
  17. #ifndef TEMSURVEYDATA_INC
  18. #define TEMSURVEYDATA_INC
  19. #include "LemmaObject.h"
  20. #include "TEMSurveyLineData.h"
  21. namespace Lemma {
  22. /**
  23. \brief Holds data from a TEMSurvey.
  24. \details Any form of TEMSurvey may be represented here. The
  25. majority of the specification can be found in the associated
  26. TEMSurvey. The TEMSurveyData object is intended to be lightweight.
  27. */
  28. class TEMSurveyData : public LemmaObject {
  29. friend std::ostream &operator<<(std::ostream &stream,
  30. const TEMSurveyData &ob);
  31. friend class TEMSurvey;
  32. public:
  33. // ==================== LIFECYCLE =======================
  34. /**
  35. * @copybrief LemmaObject::New()
  36. * @copydetails LemmaObject::New()
  37. */
  38. static TEMSurveyData* New();
  39. /**
  40. * @return a deep copy of this, this is acomplished through Serialize
  41. * and DeSerialize methods.
  42. */
  43. TEMSurveyData* Clone();
  44. /**
  45. * @copybrief LemmaObject::Delete()
  46. * @copydetails LemmaObject::Delete()
  47. */
  48. void Delete();
  49. // ==================== OPERATORS =======================
  50. /** Surveys can be added or subtracted from each other, throws a
  51. * pointer that will need to be managed (Deleted)
  52. */
  53. TEMSurveyData* operator+(const TEMSurveyData& Survey);
  54. /** Surveys can be added or subtracted from each other, throws a
  55. * pointer that will need to be managed (Deleted).
  56. */
  57. TEMSurveyData* operator-(const TEMSurveyData& Survey);
  58. /** Surveys can be added or subtracted from each other
  59. */
  60. void operator+=(const TEMSurveyData& Survey);
  61. /** Surveys can be added or subtracted from each other
  62. */
  63. void operator-=(const TEMSurveyData& Survey);
  64. /** @param[in] idx the index to return
  65. * @return the SurveyLine with index idx
  66. */
  67. TEMSurveyLineData* operator( ) ( const int& idx ) const;
  68. /** @param[in] iline the line index to return
  69. * @param[in] irec the line index to return
  70. * @return the SurveyLine with index iline, irec
  71. */
  72. TEMSurveyLineRecordData* operator( ) ( const int& iline, const int& irec ) const;
  73. // ==================== OPERATIONS =======================
  74. /** Sets the number of lines
  75. */
  76. void SetNumberOfLines( const int& nlines );
  77. // ==================== ACCESS =======================
  78. /** @return the number of lines in the data
  79. */
  80. int GetNumberOfLines() const;
  81. /**
  82. * @return pointer to line
  83. */
  84. TEMSurveyLineData* GetLine(const int& iline) const;
  85. // ==================== INQUIRY =======================
  86. #ifdef HAVE_YAMLCPP
  87. /**
  88. * Uses YAML to serialize this object.
  89. * @return a YAML::Node
  90. */
  91. YAML::Node Serialize() const;
  92. /**
  93. * Constructs an object from a YAML::Node.
  94. */
  95. static TEMSurveyData* DeSerialize(const YAML::Node& node);
  96. #endif
  97. protected:
  98. // ==================== LIFECYCLE =======================
  99. /** Default protected constructor, use New */
  100. TEMSurveyData (const std::string& name);
  101. #ifdef HAVE_YAMLCPP
  102. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  103. TEMSurveyData (const YAML::Node& node);
  104. #endif
  105. /** Default protected destructor, use Delete */
  106. ~TEMSurveyData ();
  107. /**
  108. * @copybrief LemmaObject::Release()
  109. * @copydetails LemmaObject::Release()
  110. */
  111. void Release();
  112. private:
  113. // ==================== DATA MEMBERS =========================
  114. std::vector<TEMSurveyLineData*> LineData;
  115. }; // ----- end of class TEMSurveyData -----
  116. } // ----- end of Lemma name -----
  117. #endif // ----- #ifndef TEMSURVEYDATA_INC -----