From ffdf9cbe061e119856563c0b6110d9695309d2ec Mon Sep 17 00:00:00 2001 From: roseej Date: Mon, 17 Jan 2022 10:35:06 -0500 Subject: [PATCH 1/4] Add files via upload --- WGS84ReferenceFrame.cpp | 59 +++++++++++++++++++++++++++ WGS84ReferenceFrame.h | 90 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 WGS84ReferenceFrame.cpp create mode 100644 WGS84ReferenceFrame.h diff --git a/WGS84ReferenceFrame.cpp b/WGS84ReferenceFrame.cpp new file mode 100644 index 0000000..5ed97b6 --- /dev/null +++ b/WGS84ReferenceFrame.cpp @@ -0,0 +1,59 @@ +//#################################################################### +// +// FILENAME: WGS84ReferenceFrame.cpp +// +// CLASSIFICATION: Unclassified +// +// DESCRIPTION: +// +// Implementation for WGS84 reference frame realization and epoch. +// +// LIMITATIONS: None +// +// +// SOFTWARE HISTORY: +// Date Author Comment +// ----------- ------ ------- +// 31-December-2021 Eugene Rose CCB Change +// +// NOTES: +// As of writing this, these are the WGS84 realizations to date. +// WGS84 ORIGINAL 1984.0 +// G730 1994.0 +// G873 1997.0 +// G1150 2001.0 +// G1674 2005.0 +// G1762 2005.0 +// +//################################################################### +#define CSM_LIBRARY + +#include "csm.h" +#include "WGS84ReferenceFrame.h" + +namespace csm +{ + //**************************************************************************** + // WGS84ReferenceFrame::setDefinition() + //**************************************************************************** + void WGS84ReferenceFrame::setDefinition(std::string name, const float epoch) + { + m_realization = realizationDefinition(name, epoch); + } + + //**************************************************************************** + // WGS84ReferenceFrame::setDefinition() + //**************************************************************************** + void WGS84ReferenceFrame::setDefinition(const realizationDefinition& rd) + { + m_realization = rd; + } + + //**************************************************************************** + // WGS84ReferenceFrame::getDefinition() + //**************************************************************************** + csm::WGS84ReferenceFrame::realizationDefinition WGS84ReferenceFrame::getDefinition() const + { + return m_realization; + } +} \ No newline at end of file diff --git a/WGS84ReferenceFrame.h b/WGS84ReferenceFrame.h new file mode 100644 index 0000000..b0e0984 --- /dev/null +++ b/WGS84ReferenceFrame.h @@ -0,0 +1,90 @@ +//#################################################################### +// +// FILENAME: WGS84ReferenceFrame.h +// +// CLASSIFICATION: Unclassified +// +// DESCRIPTION: +// +// Header for WGS84 reference frame realization and epoch. +// +// LIMITATIONS: None +// +// +// SOFTWARE HISTORY: +// Date Author Comment +// ----------- ------ ------- +// 31-December-2021 Eugene Rose CCB Change +// +// NOTES: +// As of writing this, these are the WGS84 realizations to date. +// WGS84 ORIGINAL 1984.0 +// G730 1994.0 +// G873 1997.0 +// G1150 2001.0 +// G1674 2005.0 +// G1762 2005.0 +// +//################################################################### + +#ifndef __CSM_WGS84REFERENCEFRAME_H +#define __CSM_WGS84REFERENCEFRAME_H + +#include "csm.h" +#include + +#define WGS84_ORIGINAL "WGS84 ORIGINAL" +#define WGS84_G730 "G730" +#define WGS84_G873 "G873" +#define WGS84_G1150 "G1150" +#define WGS84_G1674 "G1674" +#define WGS84_G1762 "G1762" + +namespace csm +{ + + class CSM_EXPORT_API WGS84ReferenceFrame + { + public: + + struct CSM_EXPORT_API realizationDefinition { + public: + realizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {}; + realizationDefinition(std::string name, float epoch) : m_name(name), m_epoch(epoch) {}; + std::string m_name; + float m_epoch; + }; + //> Realizations are defined by a string name and a float epoch which is in terms of years since 0AD. + // The default realization is the original one from 1984.0 + //< + + realizationDefinition m_realization; + + WGS84ReferenceFrame() {}; + //> construct default realization + //< + + WGS84ReferenceFrame(std::string name, const float epoch) : m_realization(name,epoch) {}; + //> construct custom realization + //< + + void setDefinition(std::string name, const float epoch); + //> convenience to set the internal structure (it is public) + //< + + void setDefinition(const realizationDefinition& rd); + //> convenience to set the internal structure (it is public) + //< + + realizationDefinition getDefinition() const; + //> convenience to get the internal structure (it is public) + //< + + private: + + }; + +} // namespace csm + +#endif // __CSM_WGS84REFERENCEFRAME_H + From 8cb67eb49dd6896a5bf355cbad292c59046bcc8f Mon Sep 17 00:00:00 2001 From: roseej Date: Fri, 28 Jan 2022 16:02:00 -0500 Subject: [PATCH 2/4] Update WGS84ReferenceFrame.cpp Address Scott Minster comments --- WGS84ReferenceFrame.cpp | 89 ++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/WGS84ReferenceFrame.cpp b/WGS84ReferenceFrame.cpp index 5ed97b6..1d695d8 100644 --- a/WGS84ReferenceFrame.cpp +++ b/WGS84ReferenceFrame.cpp @@ -1,12 +1,12 @@ //#################################################################### // -// FILENAME: WGS84ReferenceFrame.cpp +// FILENAME: WGS84ReferenceFrame.h // // CLASSIFICATION: Unclassified // // DESCRIPTION: // -// Implementation for WGS84 reference frame realization and epoch. +// Header for WGS84 reference frame realization and epoch. // // LIMITATIONS: None // @@ -26,34 +26,67 @@ // G1762 2005.0 // //################################################################### -#define CSM_LIBRARY + +#ifndef __CSM_WGS84REFERENCEFRAME_H +#define __CSM_WGS84REFERENCEFRAME_H #include "csm.h" -#include "WGS84ReferenceFrame.h" +#include + +#define WGS84_ORIGINAL "WGS84 ORIGINAL" +#define WGS84_G730 "G730" +#define WGS84_G873 "G873" +#define WGS84_G1150 "G1150" +#define WGS84_G1674 "G1674" +#define WGS84_G1762 "G1762" namespace csm { - //**************************************************************************** - // WGS84ReferenceFrame::setDefinition() - //**************************************************************************** - void WGS84ReferenceFrame::setDefinition(std::string name, const float epoch) - { - m_realization = realizationDefinition(name, epoch); - } - - //**************************************************************************** - // WGS84ReferenceFrame::setDefinition() - //**************************************************************************** - void WGS84ReferenceFrame::setDefinition(const realizationDefinition& rd) - { - m_realization = rd; - } - - //**************************************************************************** - // WGS84ReferenceFrame::getDefinition() - //**************************************************************************** - csm::WGS84ReferenceFrame::realizationDefinition WGS84ReferenceFrame::getDefinition() const - { - return m_realization; - } -} \ No newline at end of file + +class CSM_EXPORT_API WGS84ReferenceFrame +{ +public: + + struct CSM_EXPORT_API RealizationDefinition + { + public: + RealizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {}; + RealizationDefinition(const std::string &name, float epoch) : m_name(name), m_epoch(epoch) {}; + std::string m_name; + float m_epoch; + }; + //> Realizations are defined by a string name and a float epoch which is in terms of years since 0AD. + // The default realization is the original one from 1984.0 + //< + + WGS84ReferenceFrame() {}; + //> construct default realization + //< + + WGS84ReferenceFrame(const std::string &name, const float epoch) : m_realization(name,epoch) {}; + //> construct custom realization + //< + + void setDefinition(const std::string &name, const float epoch); + //> convenience to set the internal structure (it is public) + //< + + void setDefinition(const RealizationDefinition& rd); + //> convenience to set the internal structure (it is public) + //< + + RealizationDefinition getDefinition() const; + //> convenience to get the internal structure (it is public) + //< + +private: + RealizationDefinition m_realization; + //> the name and epoch of the realization are here + //< + +}; + +} // namespace csm + +#endif // __CSM_WGS84REFERENCEFRAME_H + From 38f1c1a6a620d126c34263335763abf993d81ccb Mon Sep 17 00:00:00 2001 From: roseej Date: Fri, 28 Jan 2022 16:12:27 -0500 Subject: [PATCH 3/4] Update WGS84ReferenceFrame.cpp fix previous update which inserted header file code into .cpp file. This addresses Scott's comments to the .cpp file. --- WGS84ReferenceFrame.cpp | 83 +++++++++++++---------------------------- 1 file changed, 25 insertions(+), 58 deletions(-) diff --git a/WGS84ReferenceFrame.cpp b/WGS84ReferenceFrame.cpp index 1d695d8..8d3799c 100644 --- a/WGS84ReferenceFrame.cpp +++ b/WGS84ReferenceFrame.cpp @@ -1,12 +1,12 @@ //#################################################################### // -// FILENAME: WGS84ReferenceFrame.h +// FILENAME: WGS84ReferenceFrame.cpp // // CLASSIFICATION: Unclassified // // DESCRIPTION: // -// Header for WGS84 reference frame realization and epoch. +// Implementation for WGS84 reference frame realization and epoch. // // LIMITATIONS: None // @@ -26,67 +26,34 @@ // G1762 2005.0 // //################################################################### - -#ifndef __CSM_WGS84REFERENCEFRAME_H -#define __CSM_WGS84REFERENCEFRAME_H +#define CSM_LIBRARY #include "csm.h" -#include - -#define WGS84_ORIGINAL "WGS84 ORIGINAL" -#define WGS84_G730 "G730" -#define WGS84_G873 "G873" -#define WGS84_G1150 "G1150" -#define WGS84_G1674 "G1674" -#define WGS84_G1762 "G1762" +#include "WGS84ReferenceFrame.h" namespace csm { - -class CSM_EXPORT_API WGS84ReferenceFrame +//**************************************************************************** +// WGS84ReferenceFrame::setDefinition() +//**************************************************************************** +void WGS84ReferenceFrame::setDefinition(const std::string &name, const float epoch) { -public: - - struct CSM_EXPORT_API RealizationDefinition - { - public: - RealizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {}; - RealizationDefinition(const std::string &name, float epoch) : m_name(name), m_epoch(epoch) {}; - std::string m_name; - float m_epoch; - }; - //> Realizations are defined by a string name and a float epoch which is in terms of years since 0AD. - // The default realization is the original one from 1984.0 - //< - - WGS84ReferenceFrame() {}; - //> construct default realization - //< - - WGS84ReferenceFrame(const std::string &name, const float epoch) : m_realization(name,epoch) {}; - //> construct custom realization - //< - - void setDefinition(const std::string &name, const float epoch); - //> convenience to set the internal structure (it is public) - //< - - void setDefinition(const RealizationDefinition& rd); - //> convenience to set the internal structure (it is public) - //< + m_realization = RealizationDefinition(name, epoch); +} - RealizationDefinition getDefinition() const; - //> convenience to get the internal structure (it is public) - //< - -private: - RealizationDefinition m_realization; - //> the name and epoch of the realization are here - //< - -}; - -} // namespace csm - -#endif // __CSM_WGS84REFERENCEFRAME_H +//**************************************************************************** +// WGS84ReferenceFrame::setDefinition() +//**************************************************************************** +void WGS84ReferenceFrame::setDefinition(const RealizationDefinition& rd) +{ + m_realization = rd; +} +//**************************************************************************** +// WGS84ReferenceFrame::getDefinition() +//**************************************************************************** +csm::WGS84ReferenceFrame::RealizationDefinition WGS84ReferenceFrame::getDefinition() const +{ + return m_realization; +} +} From cd7b36411cf16b027fefb6f0d25dca845b454b68 Mon Sep 17 00:00:00 2001 From: roseej Date: Fri, 28 Jan 2022 16:13:50 -0500 Subject: [PATCH 4/4] Update WGS84ReferenceFrame.h Address Scott's comments. --- WGS84ReferenceFrame.h | 72 ++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/WGS84ReferenceFrame.h b/WGS84ReferenceFrame.h index b0e0984..1d695d8 100644 --- a/WGS84ReferenceFrame.h +++ b/WGS84ReferenceFrame.h @@ -43,46 +43,48 @@ namespace csm { - class CSM_EXPORT_API WGS84ReferenceFrame - { - public: - - struct CSM_EXPORT_API realizationDefinition { - public: - realizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {}; - realizationDefinition(std::string name, float epoch) : m_name(name), m_epoch(epoch) {}; - std::string m_name; - float m_epoch; - }; - //> Realizations are defined by a string name and a float epoch which is in terms of years since 0AD. - // The default realization is the original one from 1984.0 - //< +class CSM_EXPORT_API WGS84ReferenceFrame +{ +public: + + struct CSM_EXPORT_API RealizationDefinition + { + public: + RealizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {}; + RealizationDefinition(const std::string &name, float epoch) : m_name(name), m_epoch(epoch) {}; + std::string m_name; + float m_epoch; + }; + //> Realizations are defined by a string name and a float epoch which is in terms of years since 0AD. + // The default realization is the original one from 1984.0 + //< - realizationDefinition m_realization; + WGS84ReferenceFrame() {}; + //> construct default realization + //< - WGS84ReferenceFrame() {}; - //> construct default realization - //< + WGS84ReferenceFrame(const std::string &name, const float epoch) : m_realization(name,epoch) {}; + //> construct custom realization + //< - WGS84ReferenceFrame(std::string name, const float epoch) : m_realization(name,epoch) {}; - //> construct custom realization - //< + void setDefinition(const std::string &name, const float epoch); + //> convenience to set the internal structure (it is public) + //< + + void setDefinition(const RealizationDefinition& rd); + //> convenience to set the internal structure (it is public) + //< - void setDefinition(std::string name, const float epoch); - //> convenience to set the internal structure (it is public) - //< - - void setDefinition(const realizationDefinition& rd); - //> convenience to set the internal structure (it is public) - //< + RealizationDefinition getDefinition() const; + //> convenience to get the internal structure (it is public) + //< + +private: + RealizationDefinition m_realization; + //> the name and epoch of the realization are here + //< - realizationDefinition getDefinition() const; - //> convenience to get the internal structure (it is public) - //< - - private: - - }; +}; } // namespace csm