mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-24 05:18:59 -05:00
Move the mapping target->frame from SpiceManager to SpacecraftInstrumentModule (#closes 21)
This commit is contained in:
@@ -94,4 +94,31 @@ SpacecraftInstrumentsModule::documentations() const
|
||||
};
|
||||
}
|
||||
|
||||
bool SpacecraftInstrumentsModule::addFrame(std::string body, std::string frame) {
|
||||
if (body.empty() || frame.empty()) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
_frameByBody.emplace_back(body, frame);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
std::string SpacecraftInstrumentsModule::frameFromBody(const std::string& body) {
|
||||
for (const std::pair<std::string, std::string>& pair : _frameByBody) {
|
||||
if (pair.first == body) {
|
||||
return pair.second;
|
||||
}
|
||||
}
|
||||
|
||||
constexpr const char* unionPrefix = "IAU_";
|
||||
|
||||
if (body.find(unionPrefix) == std::string::npos) {
|
||||
return unionPrefix + body;
|
||||
}
|
||||
else {
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user