-
Notifications
You must be signed in to change notification settings - Fork 21
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
roseej
wants to merge
4
commits into
master
Choose a base branch
from
ReferenceFrameEnhancements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{ | ||
//**************************************************************************** | ||
// WGS84ReferenceFrame::setDefinition() | ||
//**************************************************************************** | ||
void WGS84ReferenceFrame::setDefinition(const 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
//#################################################################### | ||
// | ||
// 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 | ||
{ | ||
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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this inner struct provides much benefit. I think you should change
WGSReferenceFrame
to hold the two items (the string and float) and provides getter and setter methods for those. That would make this class simpler.