From 6cd91ef44c5a4f128405e78ac414e55561cf5208 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 16:25:19 +0100 Subject: [PATCH] Clean up volume rendering code --- modules/kameleonvolume/kameleonvolumereader.h | 2 - .../kameleonvolume/kameleonvolumereader.inl | 52 ------------------- .../rendering/kameleonvolumeraycaster.cpp | 2 +- .../rendering/kameleonvolumeraycaster.h | 4 +- .../rendering/renderablekameleonvolume.cpp | 8 --- .../rendering/renderablekameleonvolume.h | 6 +-- 6 files changed, 6 insertions(+), 68 deletions(-) delete mode 100644 modules/kameleonvolume/kameleonvolumereader.inl diff --git a/modules/kameleonvolume/kameleonvolumereader.h b/modules/kameleonvolume/kameleonvolumereader.h index 785d7b5dca..4a03ac223e 100644 --- a/modules/kameleonvolume/kameleonvolumereader.h +++ b/modules/kameleonvolume/kameleonvolumereader.h @@ -72,6 +72,4 @@ private: } -#include - #endif diff --git a/modules/kameleonvolume/kameleonvolumereader.inl b/modules/kameleonvolume/kameleonvolumereader.inl deleted file mode 100644 index 3e6e4b3d9d..0000000000 --- a/modules/kameleonvolume/kameleonvolumereader.inl +++ /dev/null @@ -1,52 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014 - 2016 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - - - -namespace openspace { - - //KameleonMetaData KameleonVolumeReader::getMetaData() { - /* - using GridUnits = std::tuple; - GridUnits units = _kameleonWrapper.getGridUnits(); - std::string unit0 = std::get<0>(units); - std::string unit1 = std::get<1>(units); - std::string unit2 = std::get<2>(units); - - glm::vec3 scaling; - if (unit0 == 'R' && unit1 == 'R' && unit2 == 'R') { - scaling.x = scaling.y = scaling.z = openspace::distanceconstants::EarthRadius; - } - if (unit0 == '') - - VolumeMetaData metaData(VolumeMetaData::GridType::Cartesian, scaling ); - */ - - - //} - - - - -} \ No newline at end of file diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index 5667f73ac9..f221214ccb 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -161,7 +161,7 @@ std::string KameleonVolumeRaycaster::getRaycastPath() const { } std::string KameleonVolumeRaycaster::getHelperPath() const { - return GlslHelperPath; // no helper file + return GlslHelperPath; } void KameleonVolumeRaycaster::setStepSize(float stepSize) { diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 1892736d01..7d1e9c8fa0 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONVOLUMERAYCASTER_H__ -#define __KAMELEONVOLUMERAYCASTER_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ #include diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 3ec80484d6..4f421f433f 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -158,8 +158,6 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _autoGridType = true; } } - - // TODO: read transformation: position/rotation/scale from dictionary. } RenderableKameleonVolume::~RenderableKameleonVolume() {} @@ -189,10 +187,8 @@ bool RenderableKameleonVolume::initialize() { updateRaycasterModelTransform(); }); - _raycaster->initialize(); - OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); std::function onChange = [&](bool enabled) { @@ -221,9 +217,6 @@ bool RenderableKameleonVolume::initialize() { addProperty(_gridType); addProperty(_cache); addPropertySubOwner(_clipPlanes.get()); - - - return true; } @@ -369,7 +362,6 @@ bool RenderableKameleonVolume::isReady() const { } void RenderableKameleonVolume::update(const UpdateData& data) { - // forward this transformation! if (_raycaster) { _raycaster->setStepSize(_stepSize); } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index cddb542942..95224fa2b5 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __RENDERABLEKAMELEONVOLUME_H__ -#define __RENDERABLEKAMELEONVOLUME_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ #include #include @@ -99,4 +99,4 @@ private: }; } -#endif // __RENDERABLETOYVOLUME_H__ +#endif // __RENDERABLEKAMELEONVOLUME_H__