mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 10:59:47 -05:00
Rename DashboardGlobeLocation to DashboardItemGlobeLocation
Remove JSON from iswa module and use openspace one instead Remove warnings General code cleanup
This commit is contained in:
@@ -35,6 +35,7 @@ set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/transferfunction.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/transferfunctionhandler.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/transferfunctionproperty.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rawvolumemetadata.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lrucache.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lrucache.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linearlrucache.h
|
||||
|
||||
@@ -188,7 +188,7 @@ std::string EnvelopePoint::hexadecimalFromVec3(const glm::vec3& vec) const {
|
||||
|
||||
json Envelope::jsonPoints() const {
|
||||
json j;
|
||||
for (int i = 0; i < _points.size(); i++) {
|
||||
for (size_t i = 0; i < _points.size(); i++) {
|
||||
j[i] = {
|
||||
{
|
||||
"color",
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#ifndef __OPENSPACE_MODULE_VOLUME___ENVELOPE___H__
|
||||
#define __OPENSPACE_MODULE_VOLUME___ENVELOPE___H__
|
||||
|
||||
#include <openspace/json.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ext/json/json.hpp>
|
||||
|
||||
struct lua_State;
|
||||
|
||||
|
||||
@@ -29,19 +29,19 @@
|
||||
#include <openspace/util/time.h>
|
||||
|
||||
namespace {
|
||||
const constexpr char* KeyDimensions = "Dimensions";
|
||||
const constexpr char* KeyLowerDomainBound = "LowerDomainBound";
|
||||
const constexpr char* KeyUpperDomainBound = "UpperDomainBound";
|
||||
constexpr const char* KeyDimensions = "Dimensions";
|
||||
constexpr const char* KeyLowerDomainBound = "LowerDomainBound";
|
||||
constexpr const char* KeyUpperDomainBound = "UpperDomainBound";
|
||||
|
||||
const constexpr char* KeyMinValue = "MinValue";
|
||||
const constexpr char* KeyMaxValue = "MaxValue";
|
||||
constexpr const char* KeyMinValue = "MinValue";
|
||||
constexpr const char* KeyMaxValue = "MaxValue";
|
||||
|
||||
const constexpr char* KeyTime = "Time";
|
||||
const constexpr char* KeyDomainUnit = "DomainUnit";
|
||||
const constexpr char* KeyValueUnit = "ValueUnit";
|
||||
constexpr const char* KeyTime = "Time";
|
||||
constexpr const char* KeyDomainUnit = "DomainUnit";
|
||||
constexpr const char* KeyValueUnit = "ValueUnit";
|
||||
|
||||
const constexpr char* KeyGridType = "GridType";
|
||||
}
|
||||
constexpr const char* KeyGridType = "GridType";
|
||||
} // namespace
|
||||
|
||||
namespace openspace::volume {
|
||||
|
||||
@@ -104,8 +104,8 @@ ghoul::Dictionary RawVolumeMetadata::dictionary() {
|
||||
}
|
||||
|
||||
if (hasValueRange) {
|
||||
dict.setValue<double>(KeyMinValue, static_cast<float>(minValue));
|
||||
dict.setValue<double>(KeyMaxValue, static_cast<float>(maxValue));
|
||||
dict.setValue<double>(KeyMinValue, minValue);
|
||||
dict.setValue<double>(KeyMaxValue, maxValue);
|
||||
}
|
||||
if (hasDomainUnit) {
|
||||
dict.setValue<std::string>(KeyValueUnit, valueUnit);
|
||||
|
||||
@@ -50,9 +50,9 @@ BasicVolumeRaycaster::BasicVolumeRaycaster(
|
||||
std::shared_ptr<ghoul::opengl::Texture> volumeTexture,
|
||||
std::shared_ptr<openspace::TransferFunction> transferFunction,
|
||||
std::shared_ptr<VolumeClipPlanes> clipPlanes)
|
||||
: _volumeTexture(volumeTexture)
|
||||
: _clipPlanes(clipPlanes)
|
||||
, _volumeTexture(volumeTexture)
|
||||
, _transferFunction(transferFunction)
|
||||
, _clipPlanes(clipPlanes)
|
||||
, _boundingBox(glm::vec3(1.0))
|
||||
{}
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ void RenderableTimeVaryingVolume::initializeGL() {
|
||||
}
|
||||
|
||||
t.histogram = std::make_shared<Histogram>(0.f, 1.f, 100);
|
||||
for (int i = 0; i < t.rawVolume->nCells(); ++i) {
|
||||
for (size_t i = 0; i < t.rawVolume->nCells(); ++i) {
|
||||
t.histogram->add(data[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,41 +26,41 @@
|
||||
|
||||
#include <ghoul/lua/ghoul_lua.h>
|
||||
|
||||
namespace {
|
||||
|
||||
openspace::volume::TransferFunction fromLuaConversion(lua_State* state, bool& success) {
|
||||
openspace::volume::TransferFunction tf;
|
||||
success = tf.setEnvelopesFromLua(state);
|
||||
return tf;
|
||||
}
|
||||
|
||||
bool toLuaConversion(lua_State* state, openspace::volume::TransferFunction value) {
|
||||
return value.envelopesToLua(state);
|
||||
}
|
||||
|
||||
openspace::volume::TransferFunction fromStringConversion(std::string val, bool& success) {
|
||||
openspace::volume::TransferFunction tf;
|
||||
success = tf.setEnvelopesFromString(val);
|
||||
return tf;
|
||||
}
|
||||
|
||||
bool toStringConversion(std::string& outValue,
|
||||
openspace::volume::TransferFunction inValue)
|
||||
{
|
||||
outValue = inValue.serializedToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
#define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \
|
||||
[](lua_State* state, bool& success) -> TYPE { \
|
||||
TYPE TF; \
|
||||
success = true; \
|
||||
TF.setEnvelopesFromLua(state); \
|
||||
return TF; \
|
||||
}
|
||||
|
||||
#define DEFAULT_TO_LUA_LAMBDA(TYPE) \
|
||||
[](lua_State* state, TYPE value) -> bool { \
|
||||
bool success = value.envelopesToLua(state); \
|
||||
return success; \
|
||||
}
|
||||
|
||||
#define DEFAULT_FROM_STRING_LAMBDA(TYPE, DEFAULT_VALUE) \
|
||||
[](std::string val, bool& success) -> TYPE { \
|
||||
TYPE TF; \
|
||||
success = TF.setEnvelopesFromString(val); \
|
||||
return TF; \
|
||||
}
|
||||
|
||||
#define DEFAULT_TO_STRING_LAMBDA(TYPE) \
|
||||
[](std::string& outValue, TYPE inValue) -> bool { \
|
||||
outValue = inValue.serializedToString(); \
|
||||
return true; \
|
||||
}
|
||||
|
||||
REGISTER_TEMPLATEPROPERTY_SOURCE(TransferFunctionProperty, volume::TransferFunction,
|
||||
volume::TransferFunction(),
|
||||
DEFAULT_FROM_LUA_LAMBDA(volume::TransferFunction, volume::TransferFunction()),
|
||||
DEFAULT_TO_LUA_LAMBDA(volume::TransferFunction),
|
||||
DEFAULT_FROM_STRING_LAMBDA(volume::TransferFunction, volume::TransferFunction()),
|
||||
DEFAULT_TO_STRING_LAMBDA(volume::TransferFunction),
|
||||
fromLuaConversion,
|
||||
toLuaConversion,
|
||||
fromStringConversion,
|
||||
toStringConversion,
|
||||
LUA_TTABLE);
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
Reference in New Issue
Block a user