Add DomainLimiting, Masking and AdditiveBlending options

This commit is contained in:
Oskar Carlbaum
2017-10-04 03:43:32 +02:00
parent dc597f59c4
commit adcd62dedd
5 changed files with 266 additions and 15 deletions

View File

@@ -31,6 +31,7 @@
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/triggerproperty.h>
#include <openspace/properties/vector/vec2property.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/rendering/transferfunction.h>
@@ -75,8 +76,10 @@ private:
bool _mustLoadNewStateFromDisk = false;
bool _needsUpdate = false; // If still in same state as previous frame == false
bool _shouldUpdateColorBuffer = false;
bool _shouldUpdateMaskingBuffer = false;
FieldlinesState _newState;
size_t _nStates = 0;
size_t _nStates = 0;
float _scalingFactor = 1.f;
double _sequenceEndTime;
SourceFileType _sourceFileType;
@@ -92,15 +95,18 @@ private:
std::vector<double> _startTimes;
std::vector<FieldlinesState> _states;
std::vector<glm::vec2> _colorTableRanges; // Values represents min & max values represented in the color table
std::vector<glm::vec2> _maskingRanges; // Values represents min & max values for valid masking range
GLuint _vertexArrayObject = 0;
GLuint _vertexPositionBuffer = 0;
GLuint _vertexColorBuffer = 0;
GLuint _vertexMaskingBuffer = 0;
// THESE MUST CORRESPOND TO THE SHADER PROGRAM
// TODO: THIS CAN BE DETERMINED BY ASKING THE SHADER PROGRAM TOO
const GLuint _VA_POSITION = 0;
const GLuint _VA_COLOR = 1;
const GLuint _VA_MASKING = 2;
// ----------------------------- Properties -----------------------------
properties::PropertyOwner _pColorGroup; // Group to hold the color properties
@@ -110,6 +116,14 @@ private:
properties::StringProperty _pColorQuantityMax; // Color table/transfer function max
properties::StringProperty _pColorTablePath; // Color table/transfer function for "By Quantity" coloring
properties::Vec4Property _pColorUniform; // Uniform Field Line Color
properties::BoolProperty _pColorABlendEnabled; // Whether or not to use additive blending
properties::BoolProperty _pDomainEnabled; // Whether or not to use Domain
properties::PropertyOwner _pDomainGroup; // Group to hold the Domain properties
properties::Vec2Property _pDomainX; // Domain Limits along x-axis
properties::Vec2Property _pDomainY; // Domain Limits along y-axis
properties::Vec2Property _pDomainZ; // Domain Limits along z-axis
properties::Vec2Property _pDomainR; // Domain Limits radially
properties::Vec4Property _pFlowColor; // Simulated particles' color
properties::BoolProperty _pFlowEnabled; // Toggle flow [ON/OFF]
@@ -119,6 +133,12 @@ private:
properties::BoolProperty _pFlowReversed; // Toggle flow direction [FORWARDS/BACKWARDS]
properties::IntProperty _pFlowSpeed; // Speed of simulated flow
properties::BoolProperty _pMaskingEnabled; // Whether or not to use masking
properties::PropertyOwner _pMaskingGroup; // Group to hold the masking properties
properties::StringProperty _pMaskingMin; // Lower limit for allowed values
properties::StringProperty _pMaskingMax; // Upper limit for allowed values
properties::OptionProperty _pMaskingQuantity; // Index of the extra quantity to use for masking
properties::TriggerProperty _pFocusOnOriginBtn; // Button which sets camera focus to parent node of the renderable
properties::TriggerProperty _pJumpToStartBtn; // Button which executes a time jump to start of sequence
@@ -136,6 +156,8 @@ private:
void definePropertyCallbackFunctions();
void setupProperties();
void setModelDependentConstants();
};
} // namespace openspace