Added the possibility to read coloringmethod to field line asset file

This commit is contained in:
Kollberg
2019-07-01 13:35:54 -04:00
parent 561bcd4a0f
commit decc49d522
5 changed files with 24 additions and 4 deletions

View File

@@ -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);
}
}
/**