From dbe90fd94b736603bd972f0cccf78d12eeb7be28 Mon Sep 17 00:00:00 2001 From: Lovisa Hassler Date: Tue, 13 Nov 2018 11:51:48 -0500 Subject: [PATCH] cleanup and renaming some variables --- modules/dsn/managers/signalmanager.h | 6 --- modules/dsn/rendering/renderablesignals.cpp | 41 ++++----------------- 2 files changed, 8 insertions(+), 39 deletions(-) diff --git a/modules/dsn/managers/signalmanager.h b/modules/dsn/managers/signalmanager.h index d24fca52a0..7052059f06 100644 --- a/modules/dsn/managers/signalmanager.h +++ b/modules/dsn/managers/signalmanager.h @@ -30,12 +30,6 @@ #include #include - -//#include -//#include -//#include -//#include -//#include #include #include diff --git a/modules/dsn/rendering/renderablesignals.cpp b/modules/dsn/rendering/renderablesignals.cpp index b911611523..1828c28074 100644 --- a/modules/dsn/rendering/renderablesignals.cpp +++ b/modules/dsn/rendering/renderablesignals.cpp @@ -43,7 +43,6 @@ namespace { constexpr const char* _loggerCat = "RenderableSignals"; constexpr const char* KeyStationSites = "StationSites"; - constexpr const std::array UniformNames = { "modelViewStation","modelViewSpacecraft", "projectionTransform" }; @@ -51,8 +50,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SiteColorsInfo = { "SiteColors", "SiteColors", - "This value determines the RGB main color for the lines " - "of communication to and from different sites on Earth." + "This value determines the RGB main color for the communication " + "signals to and from different sites on Earth." }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { @@ -71,13 +70,6 @@ documentation::Documentation RenderableSignals::Documentation() { "Renderable Signals", "dsn_renderable_renderablesignals", { - { - KeyTranslation, - new ReferencingVerifier("core_transform_translation"), - Optional::No, - "This object is used to compute locations along the path. Any " - "Translation object can be used here." - }, { SiteColorsInfo.identifier, new TableVerifier, @@ -105,27 +97,21 @@ RenderableSignals::RenderableSignals(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _lineWidth(LineWidthInfo, 2.f, 1.f, 20.f) { - _translation = Translation::createFromDictionary( - dictionary.value(KeyTranslation) - ); - addPropertySubOwner(_translation.get()); - if (dictionary.hasKeyAndValue(SiteColorsInfo.identifier)) { - ghoul::Dictionary colorDictionary = dictionary.value(SiteColorsInfo.identifier); - std::vector siteNames = colorDictionary.keys(); + ghoul::Dictionary siteColorDictionary = dictionary.value(SiteColorsInfo.identifier); + std::vector siteNames = siteColorDictionary.keys(); - // Create for (int siteIndex = 0; siteIndex < siteNames.size(); siteIndex++) { - const char* str = siteNames.at(siteIndex).c_str(); + const char* siteColorIdentifier = siteNames.at(siteIndex).c_str(); openspace::properties::Property::PropertyInfo SiteColorsInfo = { - str, - str, + siteColorIdentifier, + siteColorIdentifier, "This value determines the RGB main color for signals " "of communication to and from different sites on Earth." }; std::string site = siteNames[siteIndex]; - glm::vec3 siteColor = colorDictionary.value(siteNames.at(siteIndex)); + glm::vec3 siteColor = siteColorDictionary.value(siteNames.at(siteIndex)); _siteColors.push_back(std::make_unique(SiteColorsInfo, siteColor, glm::vec3(0.f), glm::vec3(1.f))); _siteToIndex[siteNames.at(siteIndex)] = siteIndex; addProperty(_siteColors.back().get()); @@ -243,8 +229,6 @@ void RenderableSignals::render(const RenderData& data, RendererTasks&) { _programObject->deactivate(); } - - void RenderableSignals::update(const UpdateData& data) { double currentTime = data.time.j2000Seconds(); @@ -311,7 +295,6 @@ void RenderableSignals::update(const UpdateData& data) { unbindGL(); } - int RenderableSignals::findFileIndexForCurrentTime(double time, std::vector vec) { // upper_bound has O(log n) for sorted vectors, more efficient than for loop auto iter = std::upper_bound(vec.begin(), vec.end(), time); @@ -355,11 +338,9 @@ void RenderableSignals::extractData(std::unique_ptr &dictiona } } - void RenderableSignals::pushSignalDataToVertexArray(SignalManager::Signal signal) { glm::dvec4 color = { getStationColor(signal.dishName), 1.0 }; - //glm::vec4 color = { signal.color, 1.0 }; glm::vec3 posStation = getPositionForGeocentricSceneGraphNode(signal.dishName.c_str()); glm::vec3 posSpacecraft = getSuitablePrecisionPositionForSceneGraphNode(signal.spacecraft.c_str()); @@ -400,7 +381,6 @@ glm::dvec3 RenderableSignals::getCoordinatePosFromFocusNode(SceneGraphNode* node return diff; } - glm::vec3 RenderableSignals::getSuitablePrecisionPositionForSceneGraphNode(std::string id) { glm::vec3 position; @@ -411,13 +391,11 @@ glm::vec3 RenderableSignals::getSuitablePrecisionPositionForSceneGraphNode(std:: } else { LERROR(fmt::format("No scengraphnode found for the spacecraft {}", id)); - } return position; } - glm::vec3 RenderableSignals::getPositionForGeocentricSceneGraphNode(const char* id) { glm::dvec3 position; @@ -433,8 +411,6 @@ glm::vec3 RenderableSignals::getPositionForGeocentricSceneGraphNode(const char* return position; } - - glm::vec3 RenderableSignals::getStationColor(std::string dishidentifier) { glm::dvec3 color(0.0f, 0.0f, 1.0f); @@ -453,5 +429,4 @@ glm::vec3 RenderableSignals::getStationColor(std::string dishidentifier) { return color; } - } // namespace openspace