mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-20 19:21:00 -06:00
Added the possibility to read coloringmethod to field line asset file
This commit is contained in:
@@ -30,7 +30,8 @@ local fieldlines = {
|
||||
SimulationModel = "wsa",
|
||||
Color = {
|
||||
Uniform = {0.1, 0.725, 0, 1}
|
||||
}
|
||||
},
|
||||
ColoringMethod = "Uniform",
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Heliosphere",
|
||||
|
||||
@@ -30,7 +30,8 @@ local fieldlines = {
|
||||
SimulationModel = "wsa",
|
||||
Color = {
|
||||
Uniform = {0.725, 0.1, 0, 1}
|
||||
}
|
||||
},
|
||||
ColoringMethod = "Quantity",
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Heliosphere",
|
||||
|
||||
@@ -31,6 +31,7 @@ local fieldlines = {
|
||||
Color = {
|
||||
Uniform = {0, 0.725, 0.75, 1}
|
||||
},
|
||||
ColoringMethod = "Quantity",
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Heliosphere",
|
||||
|
||||
@@ -81,6 +81,8 @@ namespace {
|
||||
// [STRING] Value should be path to folder where states are saved (JSON/CDF input
|
||||
// => osfls output & oslfs input => JSON output)
|
||||
constexpr const char* KeyOutputFolder = "OutputFolder";
|
||||
// [STRING] Value should either be "Quantity" or "Uniform"
|
||||
constexpr const char* KeyColoringMethod = "ColoringMethod";
|
||||
|
||||
// ------------- POSSIBLE STRING VALUES FOR CORRESPONDING MODFILE KEY ------------- //
|
||||
constexpr const char* ValueInputFileTypeCdf = "cdf";
|
||||
@@ -330,8 +332,7 @@ void RenderableFieldlinesSequence::initializeGL() {
|
||||
return;
|
||||
}
|
||||
|
||||
// dictionary is no longer needed as everything is extracted
|
||||
_dictionary.reset();
|
||||
|
||||
|
||||
// No need to store source paths in memory if they are already in RAM!
|
||||
if (!_loadingStatesDynamically) {
|
||||
@@ -349,6 +350,11 @@ void RenderableFieldlinesSequence::initializeGL() {
|
||||
|
||||
setupProperties();
|
||||
|
||||
extractPropertyInfoFromDictionary();
|
||||
|
||||
// dictionary is no longer needed as everything is extracted
|
||||
_dictionary.reset();
|
||||
|
||||
// Setup shader program
|
||||
_shaderProgram = global::renderEngine.buildRenderProgram(
|
||||
"FieldlinesSequence",
|
||||
@@ -522,6 +528,16 @@ void RenderableFieldlinesSequence::extractOptionalInfoFromDictionary(
|
||||
else {
|
||||
_maskingRanges.push_back(glm::vec2(-100000, 100000)); // Just some default values!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RenderableFieldlinesSequence::extractPropertyInfoFromDictionary() {
|
||||
// Specified weather to use uniform coloring or by specified quantity.
|
||||
std::string coloringMethodDictionary;
|
||||
if (_dictionary->getValue(KeyColoringMethod, coloringMethodDictionary)) {
|
||||
if(coloringMethodDictionary == "Quantity")
|
||||
_pColorMethod = static_cast<int>(ColorMethod::ByQuantity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -214,6 +214,7 @@ private:
|
||||
std::vector<std::string>& extraMagVars);
|
||||
bool extractMandatoryInfoFromDictionary(SourceFileType& sourceFileType);
|
||||
void extractOptionalInfoFromDictionary(std::string& outputFolderPath);
|
||||
void extractPropertyInfoFromDictionary();
|
||||
void extractOsflsInfoFromDictionary();
|
||||
bool extractSeedPointsFromFile(const std::string& path,
|
||||
std::vector<glm::vec3>& outVec);
|
||||
|
||||
Reference in New Issue
Block a user