mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Cleanup minor things
This commit is contained in:
@@ -46,8 +46,8 @@ namespace {
|
||||
|
||||
// ----- KEYS POSSIBLE IN MODFILE. EXPECTED DATA TYPE OF VALUE IN [BRACKETS] ----- //
|
||||
// ---------------------------- MANDATORY MODFILE KEYS ---------------------------- //
|
||||
const char* KEY_INPUT_FILE_TYPE = "InputFileType"; // [STRING]
|
||||
const char* KEY_SOURCE_FOLDER = "SourceFolder"; // [STRING]
|
||||
const char* KEY_INPUT_FILE_TYPE = "InputFileType"; // [STRING] "cdf", "json" or "osfls"
|
||||
const char* KEY_SOURCE_FOLDER = "SourceFolder"; // [STRING] should be path to folder containing the input files
|
||||
|
||||
// ---------------------- MANDATORY INPUT TYPE SPECIFIC KEYS ---------------------- //
|
||||
const char* KEY_CDF_SEED_POINT_FILE = "SeedPointFile"; // [STRING] Path to a .txt file containing seed points
|
||||
@@ -213,7 +213,7 @@ void RenderableFieldlinesSequence::initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the default color table, just in case the (optional) user defined paths are corrupt!
|
||||
// Set a default color table, just in case the (optional) user defined paths are corrupt/not provided!
|
||||
_colorTablePaths.push_back("${OPENSPACE_DATA}/colortables/kroyw.txt");
|
||||
_transferFunction = std::make_shared<TransferFunction>(absPath(_colorTablePaths[0]));
|
||||
|
||||
@@ -292,7 +292,9 @@ void RenderableFieldlinesSequence::initialize() {
|
||||
_isReady = true;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Extracts the general information (from the lua modfile) that is mandatory for the class
|
||||
* to function; such as the file type and the location of the source files.
|
||||
* Returns false if it fails to extract mandatory information!
|
||||
*/
|
||||
bool RenderableFieldlinesSequence::extractMandatoryInfoFromDictionary(
|
||||
@@ -413,7 +415,7 @@ void RenderableFieldlinesSequence::extractOptionalInfoFromDictionary(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns false if it fails to extract mandatory information!
|
||||
*/
|
||||
bool RenderableFieldlinesSequence::extractJsonInfoFromDictionary(fls::Model& model) {
|
||||
|
||||
@@ -22,14 +22,13 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include "fragment.glsl"
|
||||
|
||||
in vec4 vs_color;
|
||||
in float vs_depth;
|
||||
|
||||
uniform bool usingAdditiveBlending;
|
||||
|
||||
#include "fragment.glsl"
|
||||
#include "PowerScaling/powerScaling_fs.hglsl"
|
||||
|
||||
Fragment getFragment() {
|
||||
if (vs_color.a == 0) {
|
||||
discard;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#version __CONTEXT__
|
||||
|
||||
#include "PowerScaling/powerScaling_vs.hglsl"
|
||||
|
||||
// General Uniforms that's always needed
|
||||
uniform vec4 lineColor;
|
||||
uniform mat4 modelViewProjection;
|
||||
@@ -123,6 +121,6 @@ void main() {
|
||||
|
||||
vec4 position_in_meters = vec4(in_position, 1);
|
||||
vec4 positionClipSpace = modelViewProjection * position_in_meters;
|
||||
gl_Position = z_normalization(positionClipSpace);
|
||||
gl_Position = vec4(positionClipSpace.xy, 0, positionClipSpace.w);
|
||||
vs_depth = gl_Position.w;
|
||||
}
|
||||
|
||||
@@ -51,11 +51,6 @@ namespace {
|
||||
|
||||
namespace openspace {
|
||||
|
||||
FieldlinesState::FieldlinesState() {}
|
||||
FieldlinesState::FieldlinesState(const std::string& PATH_TO_OSFLS_FILE, bool& loadSucessful) {
|
||||
loadSucessful = loadStateFromOsfls(PATH_TO_OSFLS_FILE);
|
||||
}
|
||||
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
/**
|
||||
* Traces and adds line vertices to state. (Also sets the simulation model variable: _model!)
|
||||
@@ -588,8 +583,8 @@ void FieldlinesState::saveStateToJson(const std::string& ABS_FILEPATH) {
|
||||
|
||||
// Returns one of the extra quantity vectors, _extraQuantities[INDEX].
|
||||
// If INDEX is out of scope an empty vector is returned and the referenced bool will be false.
|
||||
const vector<float>& FieldlinesState::extraQuantity(const size_t INDEX,
|
||||
bool& isSuccessful) const {
|
||||
const std::vector<float>& FieldlinesState::extraQuantity(const size_t INDEX,
|
||||
bool& isSuccessful) const {
|
||||
if (INDEX < _extraQuantities.size()) {
|
||||
isSuccessful = true;
|
||||
return _extraQuantities[INDEX];
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::vector;
|
||||
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
namespace ccmc {
|
||||
class Kameleon;
|
||||
@@ -45,15 +43,14 @@ namespace openspace {
|
||||
|
||||
class FieldlinesState {
|
||||
public:
|
||||
FieldlinesState();
|
||||
FieldlinesState(const std::string& PATH_TO_OSFLS_FILE, bool& loadSucessful);
|
||||
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
bool addLinesFromKameleon(ccmc::Kameleon* kameleon,
|
||||
const vector<glm::vec3>& SEED_POINTS,
|
||||
const std::vector<glm::vec3>& SEED_POINTS,
|
||||
const std::string TRACING_VAR);
|
||||
void addExtraQuantities(ccmc::Kameleon* kameleon, vector<std::string>& xtraScalarVars,
|
||||
vector<std::string>& xtraMagVars);
|
||||
void addExtraQuantities(ccmc::Kameleon* kameleon,
|
||||
std::vector<std::string>& xtraScalarVars,
|
||||
std::vector<std::string>& xtraMagVars);
|
||||
void convertLatLonToCartesian(const float SCALE = 1.f);
|
||||
void scalePositions(const float SCALE);
|
||||
#endif // OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
@@ -66,37 +63,36 @@ public:
|
||||
void saveStateToJson(const std::string& PATH_TO_JSON_FILE);
|
||||
|
||||
// ------------------------------GETTERS-----------------------------------------//
|
||||
const vector<vector<float>>& extraQuantities() const { return _extraQuantities; }
|
||||
const vector<std::string>& extraQuantityNames() const { return _extraQuantityNames; }
|
||||
const vector<GLsizei>& lineCount() const { return _lineCount; }
|
||||
const vector<GLint>& lineStart() const { return _lineStart; }
|
||||
size_t nExtraQuantities() const { return _extraQuantities.size(); }
|
||||
fls::Model model() const { return _model; }
|
||||
double triggerTime() const { return _triggerTime; }
|
||||
const vector<glm::vec3>& vertexPositions() const { return _vertexPositions; }
|
||||
const std::vector<std::vector<float>>& extraQuantities() const { return _extraQuantities; }
|
||||
const std::vector<std::string>& extraQuantityNames() const { return _extraQuantityNames; }
|
||||
const std::vector<GLsizei>& lineCount() const { return _lineCount; }
|
||||
const std::vector<GLint>& lineStart() const { return _lineStart; }
|
||||
size_t nExtraQuantities() const { return _extraQuantities.size(); }
|
||||
fls::Model model() const { return _model; }
|
||||
double triggerTime() const { return _triggerTime; }
|
||||
const std::vector<glm::vec3>& vertexPositions() const { return _vertexPositions; }
|
||||
|
||||
// Special getter. Returns extraQuantities[INDEX].
|
||||
const vector<float>& extraQuantity(const size_t INDEX, bool& isSuccesful) const;
|
||||
const std::vector<float>& extraQuantity(const size_t INDEX, bool& isSuccesful) const;
|
||||
|
||||
void setTriggerTime(const double T) { _triggerTime = T; }
|
||||
|
||||
private:
|
||||
bool _isMorphable = false;
|
||||
double _triggerTime = -1.0;
|
||||
fls::Model _model;
|
||||
bool _isMorphable = false;
|
||||
double _triggerTime = -1.0;
|
||||
fls::Model _model;
|
||||
|
||||
vector<glm::vec3> _vertexPositions;
|
||||
vector<GLint> _lineStart;
|
||||
vector<GLsizei> _lineCount;
|
||||
vector<vector<float>> _extraQuantities;
|
||||
vector<std::string> _extraQuantityNames;
|
||||
std::vector<std::vector<float>> _extraQuantities;
|
||||
std::vector<std::string> _extraQuantityNames;
|
||||
std::vector<GLsizei> _lineCount;
|
||||
std::vector<GLint> _lineStart;
|
||||
std::vector<glm::vec3> _vertexPositions;
|
||||
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
void loadExtrasIntoKameleon(ccmc::Kameleon* kameleon,
|
||||
vector<std::string>& xtraScalarVars,
|
||||
vector<std::string>& xtraMagVars);
|
||||
std::vector<std::string>& xtraScalarVars,
|
||||
std::vector<std::string>& xtraMagVars);
|
||||
#endif // OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
// TODO: Maybe introduce a vector containing seed point indices
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user