From acc6095ba3154c82c20071ef09bea111d1338d20 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 20 Apr 2016 13:06:40 +0200 Subject: [PATCH] Removing classes PlanetGeometryProject and SimpleSphereGeometryProjection and replace their use with the generic PlanetGeometry and SImpleSphereGeometry classes --- .../callistoprojection/callistoprojection.mod | 2 +- .../europaprojection/europaprojection.mod | 2 +- .../ganymedeprojection/ganymedeprojection.mod | 2 +- .../jupiter/ioprojection/ioprojection.mod | 2 +- .../jupiterprojection/jupiterprojection.mod | 2 +- .../charonprojection/charonprojection.mod | 2 +- .../pluto/plutoprojection/plutoprojection.mod | 2 +- ext/ghoul | 2 +- modules/base/rendering/planetgeometry.cpp | 4 +- modules/base/rendering/planetgeometry.h | 4 +- .../base/rendering/simplespheregeometry.cpp | 2 +- modules/base/rendering/simplespheregeometry.h | 4 +- modules/newhorizons/CMakeLists.txt | 4 - modules/newhorizons/newhorizonsmodule.cpp | 6 - .../rendering/planetgeometryprojection.cpp | 79 ----------- .../rendering/planetgeometryprojection.h | 53 -------- .../rendering/renderableplanetprojection.cpp | 8 +- .../rendering/renderableplanetprojection.h | 6 +- .../simplespheregeometryprojection.cpp | 126 ------------------ .../simplespheregeometryprojection.h | 63 --------- 20 files changed, 24 insertions(+), 351 deletions(-) delete mode 100644 modules/newhorizons/rendering/planetgeometryprojection.cpp delete mode 100644 modules/newhorizons/rendering/planetgeometryprojection.h delete mode 100644 modules/newhorizons/rendering/simplespheregeometryprojection.cpp delete mode 100644 modules/newhorizons/rendering/simplespheregeometryprojection.h diff --git a/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod b/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod index b5eb0eac9b..fae2d6575a 100644 --- a/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod +++ b/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod @@ -8,7 +8,7 @@ return { Frame = "IAU_CALLISTO", Body = "CALLISTO", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 1.8213, 6 }, Segments = 100 }, diff --git a/data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod b/data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod index 60f8ebce98..dc6141286c 100644 --- a/data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod +++ b/data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod @@ -8,7 +8,7 @@ return { Frame = "IAU_EUROPA", Body = "EUROPA", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 1.8213, 6 }, Segments = 100 }, diff --git a/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod b/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod index c39d5c8264..97d1683311 100644 --- a/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod +++ b/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod @@ -8,7 +8,7 @@ return { Frame = "IAU_GANYMEDE", Body = "GANYMEDE", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 1.8213, 6 }, Segments = 100 }, diff --git a/data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod b/data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod index 1f700d66d4..efab4ba1ea 100644 --- a/data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod +++ b/data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod @@ -8,7 +8,7 @@ return { Frame = "IAU_IO", Body = "IO", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 1.8213, 6 }, Segments = 100 }, diff --git a/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod b/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod index 706938f06b..3da31853b4 100644 --- a/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod +++ b/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod @@ -22,7 +22,7 @@ return { Frame = "IAU_JUPITER", Body = "JUPITER", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 0.71492, 8 }, Segments = 200, }, diff --git a/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod b/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod index 5e1c3ad60c..0f87f05ae9 100644 --- a/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod +++ b/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod @@ -19,7 +19,7 @@ return { Frame = "IAU_CHARON", Body = "CHARON", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 6.035 , 5 }, Segments = 100 }, diff --git a/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod index 2338b3653d..1e2f8a3d17 100644 --- a/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod +++ b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod @@ -31,7 +31,7 @@ return { Frame = "IAU_PLUTO", Body = "PLUTO", Geometry = { - Type = "SimpleSphereProjection", + Type = "SimpleSphere", Radius = { 1.173 , 6 }, Segments = 100 }, diff --git a/ext/ghoul b/ext/ghoul index fb0ce7bfbd..ba88e7fb74 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit fb0ce7bfbd859efa02beab4c84b62991a25d1666 +Subproject commit ba88e7fb74a17fc00a698f6ecb6ac3640cb14472 diff --git a/modules/base/rendering/planetgeometry.cpp b/modules/base/rendering/planetgeometry.cpp index a53b7e2f7d..4d66907b21 100644 --- a/modules/base/rendering/planetgeometry.cpp +++ b/modules/base/rendering/planetgeometry.cpp @@ -54,7 +54,7 @@ PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& di } PlanetGeometry::PlanetGeometry() - : _parent(nullptr) + //: _parent(nullptr) { setName("PlanetGeometry"); } @@ -63,7 +63,7 @@ PlanetGeometry::~PlanetGeometry() { } -bool PlanetGeometry::initialize(RenderablePlanet* parent) +bool PlanetGeometry::initialize(Renderable* parent) { _parent = parent; return true; diff --git a/modules/base/rendering/planetgeometry.h b/modules/base/rendering/planetgeometry.h index 566ad261ad..3a38f3be81 100644 --- a/modules/base/rendering/planetgeometry.h +++ b/modules/base/rendering/planetgeometry.h @@ -39,12 +39,12 @@ public: PlanetGeometry(); virtual ~PlanetGeometry(); - virtual bool initialize(RenderablePlanet* parent); + virtual bool initialize(Renderable* parent); virtual void deinitialize(); virtual void render() = 0; protected: - RenderablePlanet* _parent; + Renderable* _parent; }; } // namespace planetgeometry diff --git a/modules/base/rendering/simplespheregeometry.cpp b/modules/base/rendering/simplespheregeometry.cpp index c02d4e4b4d..ff037a8ef3 100644 --- a/modules/base/rendering/simplespheregeometry.cpp +++ b/modules/base/rendering/simplespheregeometry.cpp @@ -91,7 +91,7 @@ SimpleSphereGeometry::~SimpleSphereGeometry() { } -bool SimpleSphereGeometry::initialize(RenderablePlanet* parent) +bool SimpleSphereGeometry::initialize(Renderable* parent) { bool success = PlanetGeometry::initialize(parent); createSphere(); diff --git a/modules/base/rendering/simplespheregeometry.h b/modules/base/rendering/simplespheregeometry.h index acd61c0112..1b752a2b48 100644 --- a/modules/base/rendering/simplespheregeometry.h +++ b/modules/base/rendering/simplespheregeometry.h @@ -31,7 +31,7 @@ namespace openspace { -class RenderablePlanet; +class Renderable; class PowerScaledSphere; namespace planetgeometry { @@ -42,7 +42,7 @@ public: ~SimpleSphereGeometry(); - bool initialize(RenderablePlanet* parent) override; + bool initialize(Renderable* parent) override; void deinitialize() override; void render() override; PowerScaledSphere* _planet; diff --git a/modules/newhorizons/CMakeLists.txt b/modules/newhorizons/CMakeLists.txt index f49c4af7cf..beff9e3a8b 100644 --- a/modules/newhorizons/CMakeLists.txt +++ b/modules/newhorizons/CMakeLists.txt @@ -25,13 +25,11 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableshadowcylinder.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodelprojection.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/writeToTexture.h ${CMAKE_CURRENT_SOURCE_DIR}/util/decoder.h @@ -46,13 +44,11 @@ set(HEADER_FILES source_group("Header Files" FILES ${HEADER_FILES}) set(SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableshadowcylinder.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodelprojection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/util/decoder.cpp ${CMAKE_CURRENT_SOURCE_DIR}/util/hongkangparser.cpp diff --git a/modules/newhorizons/newhorizonsmodule.cpp b/modules/newhorizons/newhorizonsmodule.cpp index 3476c91b40..479afd7e5b 100644 --- a/modules/newhorizons/newhorizonsmodule.cpp +++ b/modules/newhorizons/newhorizonsmodule.cpp @@ -29,13 +29,11 @@ #include -#include #include #include #include #include #include -#include #include #include @@ -53,7 +51,6 @@ NewHorizonsModule::NewHorizonsModule() void NewHorizonsModule::internalInitialize() { ImageSequencer::initialize(); - FactoryManager::ref().addFactory(std::make_unique>()); FactoryManager::ref().addFactory(std::make_unique>()); auto fRenderable = FactoryManager::ref().factory(); @@ -66,9 +63,6 @@ void NewHorizonsModule::internalInitialize() { fRenderable->registerClass("RenderablePlanetProjection"); fRenderable->registerClass("RenderableModelProjection"); - auto fPlanetGeometryProjection = FactoryManager::ref().factory(); - fPlanetGeometryProjection->registerClass("SimpleSphereProjection"); - auto fDecoder = FactoryManager::ref().factory(); fDecoder->registerClass("Instrument"); fDecoder->registerClass("Target"); diff --git a/modules/newhorizons/rendering/planetgeometryprojection.cpp b/modules/newhorizons/rendering/planetgeometryprojection.cpp deleted file mode 100644 index 1517b26942..0000000000 --- a/modules/newhorizons/rendering/planetgeometryprojection.cpp +++ /dev/null @@ -1,79 +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. * - ****************************************************************************************/ - -#include -#include -#include - -namespace { - const std::string _loggerCat = "PlanetGeometryProjection"; - const std::string KeyType = "Type"; -} - -namespace openspace { -namespace planetgeometryprojection { - -PlanetGeometryProjection* PlanetGeometryProjection::createFromDictionary(const ghoul::Dictionary& dictionary) -{ - std::string geometryType; - const bool success = dictionary.getValue(KeyType, geometryType); - if (!success) { - LERROR("PlanetGeometry did not contain a correct value of the key '" - << KeyType << "'"); - return nullptr; - } - ghoul::TemplateFactory* factory - = FactoryManager::ref().factory(); - - PlanetGeometryProjection* result = factory->create(geometryType, dictionary); - if (result == nullptr) { - LERROR("Failed to create a PlanetGeometry object of type '" << geometryType - << "'"); - return nullptr; - } - return result; -} - -PlanetGeometryProjection::PlanetGeometryProjection() - : _parent(nullptr) -{ - setName("PlanetGeometryProjection"); -} - -PlanetGeometryProjection::~PlanetGeometryProjection() -{ -} - -bool PlanetGeometryProjection::initialize(RenderablePlanetProjection* parent) -{ - _parent = parent; - return true; -} - -void PlanetGeometryProjection::deinitialize() -{ -} - -} // namespace planetgeometry -} // namespace openspace diff --git a/modules/newhorizons/rendering/planetgeometryprojection.h b/modules/newhorizons/rendering/planetgeometryprojection.h deleted file mode 100644 index 056637c309..0000000000 --- a/modules/newhorizons/rendering/planetgeometryprojection.h +++ /dev/null @@ -1,53 +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. * - ****************************************************************************************/ - -#ifndef __PlanetGeometryProjection_H__ -#define __PlanetGeometryProjection_H__ - -#include -#include -#include - -namespace openspace { - -namespace planetgeometryprojection { - -class PlanetGeometryProjection : public properties::PropertyOwner { -public: - static PlanetGeometryProjection* createFromDictionary(const ghoul::Dictionary& dictionary); - - PlanetGeometryProjection(); - virtual ~PlanetGeometryProjection(); - virtual bool initialize(RenderablePlanetProjection* parent); - virtual void deinitialize(); - virtual void render() = 0; - -protected: - RenderablePlanetProjection* _parent; -}; - -} // namespace planetgeometry -} // namespace openspace - -#endif // __PLANETGEOMETRY_H__ diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 3fb24e11e7..83b8f60cbd 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -24,7 +24,11 @@ // open space includes #include -#include +//#include + +#include + +//#include @@ -111,7 +115,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& keyGeometry, geometryDictionary); if (success) { geometryDictionary.setValue(SceneGraphNode::KeyName, name); - _geometry = planetgeometryprojection::PlanetGeometryProjection::createFromDictionary(geometryDictionary); + _geometry = planetgeometry::PlanetGeometry::createFromDictionary(geometryDictionary); } dictionary.getValue(keyFrame, _frame); diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index d5daaca21b..78df9c999b 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -53,8 +53,8 @@ namespace openspace { -namespace planetgeometryprojection { -class PlanetGeometryProjection; +namespace planetgeometry{ +class PlanetGeometry; } @@ -102,7 +102,7 @@ private: std::unique_ptr _textureOriginal; std::unique_ptr _textureProj; std::unique_ptr _textureWhiteSquare; - planetgeometryprojection::PlanetGeometryProjection* _geometry; + planetgeometry::PlanetGeometry* _geometry; glm::vec2 _camScaling; glm::vec3 _up; diff --git a/modules/newhorizons/rendering/simplespheregeometryprojection.cpp b/modules/newhorizons/rendering/simplespheregeometryprojection.cpp deleted file mode 100644 index 965aa44846..0000000000 --- a/modules/newhorizons/rendering/simplespheregeometryprojection.cpp +++ /dev/null @@ -1,126 +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. * - ****************************************************************************************/ - -#include -#include - -namespace { - const std::string _loggerCat = "SimpleSphereGeometryProjection"; -} - -namespace openspace { - -namespace constants { -namespace simplespheregeometryprojection { -const std::string keyRadius = "Radius"; -const std::string keySegments = "Segments"; -} // namespace simplespheregeometry -} - -namespace planetgeometryprojection { - -SimpleSphereGeometryProjection::SimpleSphereGeometryProjection(const ghoul::Dictionary& dictionary) - : PlanetGeometryProjection() - , _realRadius("radius", "Radius", glm::vec4(1.f, 1.f, 1.f, 0.f), glm::vec4(-10.f, -10.f, -10.f, -20.f), - glm::vec4(10.f, 10.f, 10.f, 20.f)) - , _segments("segments", "Segments", 20, 1, 1000) - , _planet(nullptr) -{ - using constants::simplespheregeometryprojection::keyRadius; - using constants::simplespheregeometryprojection::keySegments; - - // The name is passed down from the SceneGraphNode - bool success = dictionary.getValue(SceneGraphNode::KeyName, _name); - assert(success); - - // removing "Projection"-suffix from name for SPICE compability, TODO: better solution @AA - if(_name.find("Projection")) - _name = _name.substr(0, _name.size() - 10); - - glm::vec4 radius; - success = dictionary.getValue(keyRadius, _modRadius); - if (!success) { - LERROR("SimpleSphereGeometry of '" << _name << "' did not provide a key '" - << keyRadius << "'"); - } - else { - radius[0] = _modRadius[0]; - radius[1] = _modRadius[0]; - radius[2] = _modRadius[0]; - radius[3] = _modRadius[1]; - _realRadius = radius; - } - double segments; - success = dictionary.getValue(keySegments, segments); - if (!success) { - LERROR("SimpleSphereGeometry of '" << _name << "' did not provide a key '" - << keySegments << "'"); - } - else - _segments = static_cast(segments); - - addProperty(_realRadius); - //_realRadius.onChange(std::bind(&SimpleSphereGeometryProjection::createSphere, this)); - addProperty(_segments); - _segments.onChange(std::bind(&SimpleSphereGeometryProjection::createSphere, this)); -} - -SimpleSphereGeometryProjection::~SimpleSphereGeometryProjection() -{ -} - -bool SimpleSphereGeometryProjection::initialize(RenderablePlanetProjection* parent) -{ - bool success = PlanetGeometryProjection::initialize(parent); - createSphere(); - - //need to have this accessible in planetgeometryprojection for now -- Michal - return success; -} - -void SimpleSphereGeometryProjection::deinitialize() -{ - delete _planet; - _planet = nullptr; -} - -void SimpleSphereGeometryProjection::render() -{ - _planet->render(); -} - -void SimpleSphereGeometryProjection::createSphere() -{ - //create the power scaled scalar - - PowerScaledScalar planetSize(_modRadius); - _parent->setBoundingSphere(planetSize); - - delete _planet; - _planet = new PowerScaledSphere(_realRadius, _segments, _name); - _planet->initialize(); -} - -} // namespace planetgeometry -} // namespace openspace diff --git a/modules/newhorizons/rendering/simplespheregeometryprojection.h b/modules/newhorizons/rendering/simplespheregeometryprojection.h deleted file mode 100644 index 8907ed0739..0000000000 --- a/modules/newhorizons/rendering/simplespheregeometryprojection.h +++ /dev/null @@ -1,63 +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. * - ****************************************************************************************/ - -#ifndef __SIMPLESPHEREGEOMETRYPROJECTION_H__ -#define __SIMPLESPHEREGEOMETRYPROJECTION_H__ - -#include -#include -#include -#include - -namespace openspace { - -class RenderablePlanet; - -namespace planetgeometryprojection { - -class SimpleSphereGeometryProjection : public PlanetGeometryProjection { -public: - SimpleSphereGeometryProjection(const ghoul::Dictionary& dictionary); - ~SimpleSphereGeometryProjection(); - - - bool initialize(RenderablePlanetProjection* parent) override; - void deinitialize() override; - void render() override; - -private: - void createSphere(); - - glm::vec2 _modRadius; - properties::Vec4Property _realRadius; - properties::IntProperty _segments; - std::string _name; - - PowerScaledSphere* _planet; -}; - -} // namespace planetgeometry -} // namespace openspace - -#endif // __SIMPLESPHEREGEOMETRY_H__