From 055a9b4fa319311502ae69828b86dc59db727a66 Mon Sep 17 00:00:00 2001 From: elon Date: Fri, 19 Feb 2021 11:48:32 -0500 Subject: [PATCH] fixup --- .../volume/rendering/basicvolumeraycaster.h | 4 +-- .../rendering/renderabletimevaryingvolume.cpp | 26 ++++++++++--------- .../rendering/renderabletimevaryingvolume.h | 6 ++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/volume/rendering/basicvolumeraycaster.h b/modules/volume/rendering/basicvolumeraycaster.h index fd4daf5285..638a40e2f9 100644 --- a/modules/volume/rendering/basicvolumeraycaster.h +++ b/modules/volume/rendering/basicvolumeraycaster.h @@ -76,7 +76,7 @@ public: void setVolumeTexture(std::shared_ptr texture); std::shared_ptr volumeTexture() const; - void setTransferFunction(std::shared_ptr transferFunction); + void setTransferFunction(std::shared_ptr transferFunction); void setStepSize(float stepSize); float opacity() const; @@ -94,7 +94,7 @@ private: std::shared_ptr _clipPlanes; std::shared_ptr _volumeTexture; - std::shared_ptr _transferFunction; + std::shared_ptr _transferFunction; BoxGeometry _boundingBox; VolumeGridType _gridType; glm::mat4 _modelTransform = glm::mat4(1.f); diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index 386b2b4bf5..afb8848238 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -219,30 +219,32 @@ namespace openspace::volume { }); _gridType = static_cast(volume::VolumeGridType::Cartesian); - if (dictionary.hasKeyAndValue(KeyStepSize)) { - _stepSize = dictionary.value(KeyStepSize); + if (dictionary.hasValue(KeyStepSize)) { + _stepSize = static_cast(dictionary.value(KeyStepSize)); } - if (dictionary.hasValue(KeyOpacity)) { - _opacity = dictionary.value(KeyOpacity) * VolumeMaxOpacity; + if (dictionary.hasValue(KeyOpacity)) { + _opacity = static_cast(dictionary.value(KeyOpacity) * VolumeMaxOpacity); } - if (dictionary.hasKeyAndValue(KeySecondsBefore)) { - _secondsBefore = dictionary.value(KeySecondsBefore); + if (dictionary.hasValue(KeySecondsBefore)) { + _secondsBefore = static_cast(dictionary.value(KeySecondsBefore)); } - _secondsAfter = dictionary.value(KeySecondsAfter); + _secondsAfter = static_cast(dictionary.value(KeySecondsAfter)); - if (dictionary.hasKey(KeyInvertDataAtZ)) { + if (dictionary.hasKey(static_cast(KeyInvertDataAtZ))) { _invertDataAtZ = dictionary.value(KeyInvertDataAtZ); } ghoul::Dictionary clipPlanesDictionary; - dictionary.getValue(KeyClipPlanes, clipPlanesDictionary); + if (dictionary.hasValue(KeyClipPlanes)) { + clipPlanesDictionary = dictionary.value(KeyClipPlanes); + } _clipPlanes = std::make_shared(clipPlanesDictionary); _clipPlanes->setIdentifier("clipPlanes"); _clipPlanes->setGuiName("Clip Planes"); - if (dictionary.hasKeyAndValue(KeyGridType)) { + if (dictionary.hasValue(KeyGridType)) { VolumeGridType gridType = volume::parseGridType( dictionary.value(KeyGridType) ); @@ -363,9 +365,9 @@ namespace openspace::volume { _transferFunctionPath.onChange([this] { _transferFunction = std::make_shared( _transferFunctionPath - ); + ); _raycaster->setTransferFunction(_transferFunction); - }); + }); } void RenderableTimeVaryingVolume::loadTimestepMetadata(const std::string& path) { diff --git a/modules/volume/rendering/renderabletimevaryingvolume.h b/modules/volume/rendering/renderabletimevaryingvolume.h index 3ed365cc58..538e28c19b 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.h +++ b/modules/volume/rendering/renderabletimevaryingvolume.h @@ -34,7 +34,7 @@ #include #include // #include -#include +// #include // #include // #include @@ -43,16 +43,16 @@ // #include // #include // #include -// #include + #include namespace openspace { class Histogram; struct RenderData; - class TransferFunction; } // namespace openspace namespace openspace::volume { + //class TransferFunction; class BasicVolumeRaycaster; template class RawVolume; class VolumeClipPlanes;