Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WGS84 Reference Frames Enhancement #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions WGS84ReferenceFrame.cpp
Original file line number Diff line number Diff line change
@@ -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
{
//****************************************************************************
roseej marked this conversation as resolved.
Show resolved Hide resolved
// 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;
}
}
roseej marked this conversation as resolved.
Show resolved Hide resolved
90 changes: 90 additions & 0 deletions WGS84ReferenceFrame.h
Original file line number Diff line number Diff line change
@@ -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 <string>

#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
roseej marked this conversation as resolved.
Show resolved Hide resolved
{
public:

struct CSM_EXPORT_API realizationDefinition {
roseej marked this conversation as resolved.
Show resolved Hide resolved
roseej marked this conversation as resolved.
Show resolved Hide resolved
public:
realizationDefinition() : m_name("WGS84_ORIGINAL"), m_epoch(1984.0) {};
realizationDefinition(std::string name, float epoch) : m_name(name), m_epoch(epoch) {};
roseej marked this conversation as resolved.
Show resolved Hide resolved
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;
roseej marked this conversation as resolved.
Show resolved Hide resolved

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