mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 19:50:03 -06:00
Moving potential targets into ProjectionComponent
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
|
||||
namespace {
|
||||
const std::string _loggerCat = "RenderablePlanetProjection";
|
||||
const std::string keyPotentialTargets = "PotentialTargets";
|
||||
|
||||
const std::string keyFrame = "Frame";
|
||||
const std::string keyGeometry = "Geometry";
|
||||
@@ -84,18 +83,6 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
|
||||
success = initializeProjectionSettings(dictionary);
|
||||
ghoul_assert(success, "");
|
||||
|
||||
// @TODO copy-n-paste from renderablefov ---abock
|
||||
ghoul::Dictionary potentialTargets;
|
||||
success = dictionary.getValue(keyPotentialTargets, potentialTargets);
|
||||
ghoul_assert(success, "");
|
||||
|
||||
_potentialTargets.resize(potentialTargets.size());
|
||||
for (int i = 0; i < potentialTargets.size(); ++i) {
|
||||
std::string target;
|
||||
potentialTargets.getValue(std::to_string(i + 1), target);
|
||||
_potentialTargets[i] = target;
|
||||
}
|
||||
|
||||
// TODO: textures need to be replaced by a good system similar to the geometry as soon
|
||||
// as the requirements are fixed (ab)
|
||||
std::string texturePath = "";
|
||||
@@ -113,7 +100,6 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
|
||||
addProperty(_performProjection);
|
||||
addProperty(_clearAllProjections);
|
||||
|
||||
|
||||
addProperty(_colorTexturePath);
|
||||
_colorTexturePath.onChange(std::bind(&RenderablePlanetProjection::loadTextures, this));
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <ghoul/systemcapabilities/openglcapabilitiescomponent.h>
|
||||
|
||||
namespace {
|
||||
const std::string keyPotentialTargets = "PotentialTargets";
|
||||
|
||||
const std::string keyInstrument = "Instrument.Name";
|
||||
const std::string keyInstrumentFovy = "Instrument.Fovy";
|
||||
const std::string keyInstrumentAspect = "Instrument.Aspect";
|
||||
@@ -99,6 +101,19 @@ bool ProjectionComponent::initializeProjectionSettings(const Dictionary& diction
|
||||
completeSuccess &= s;
|
||||
ghoul_assert(completeSuccess, "All neccessary attributes not found in modfile");
|
||||
|
||||
|
||||
if (dictionary.hasKeyAndValue<ghoul::Dictionary>(keyPotentialTargets)) {
|
||||
ghoul::Dictionary potentialTargets = dictionary.value<ghoul::Dictionary>(
|
||||
keyPotentialTargets
|
||||
);
|
||||
|
||||
_potentialTargets.resize(potentialTargets.size());
|
||||
for (int i = 0; i < potentialTargets.size(); ++i) {
|
||||
std::string target;
|
||||
potentialTargets.getValue(std::to_string(i + 1), target);
|
||||
_potentialTargets[i] = target;
|
||||
}
|
||||
}
|
||||
return completeSuccess;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user