mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-24 05:18:59 -05:00
Modularize the newhorizons and volume classes
This commit is contained in:
@@ -45,10 +45,6 @@
|
||||
#include <modules/base/rendering/modelgeometry.h>
|
||||
#include <modules/base/rendering/wavefrontgeometry.h>
|
||||
|
||||
namespace {
|
||||
const std::string _loggerCat = "BaseModule";
|
||||
}
|
||||
|
||||
namespace openspace {
|
||||
|
||||
bool BaseModule::initialize() {
|
||||
@@ -81,8 +77,4 @@ bool BaseModule::initialize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BaseModule::deinitialize() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace openspace {
|
||||
class BaseModule : public OpenSpaceModule {
|
||||
public:
|
||||
bool initialize() override;
|
||||
bool deinitialize() override;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.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/simplespheregeometryprojection.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/writeToTexture.h
|
||||
)
|
||||
source_group("Header Files" FILES ${HEADER_FILES})
|
||||
|
||||
set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.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/simplespheregeometryprojection.cpp
|
||||
)
|
||||
source_group("Source Files" FILES ${SOURCE_FILES})
|
||||
|
||||
set(MODULE_CLASS_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/newhorizonsmodule.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/newhorizonsmodule.cpp
|
||||
)
|
||||
|
||||
include_directories(${OPENSPACE_BASE_DIR}/include ${OPENSPACE_BASE_DIR})
|
||||
|
||||
add_library(openspace-module-newhorizons ${HEADER_FILES} ${SOURCE_FILES} ${MODULE_CLASS_FILES})
|
||||
@@ -0,0 +1,56 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2015 *
|
||||
* *
|
||||
* 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 <modules/newhorizons/newhorizonsmodule.h>
|
||||
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
|
||||
#include <modules/newhorizons/rendering/planetgeometryprojection.h>
|
||||
#include <modules/newhorizons/rendering/renderablefov.h>
|
||||
#include <modules/newhorizons/rendering/renderableplaneprojection.h>
|
||||
#include <modules/newhorizons/rendering/renderableplanetprojection.h>
|
||||
#include <modules/newhorizons/rendering/simplespheregeometryprojection.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
bool NewHorizonsModule::initialize() {
|
||||
FactoryManager::ref().addFactory(new ghoul::TemplateFactory<planetgeometryprojection::PlanetGeometryProjection>);
|
||||
|
||||
auto fRenderable = FactoryManager::ref().factory<Renderable>();
|
||||
ghoul_assert(fRenderable, "No renderable factory existed");
|
||||
|
||||
fRenderable->registerClass<RenderableFov>("RenderableFov");
|
||||
fRenderable->registerClass<RenderablePlaneProjection>("RenderablePlaneProjection");
|
||||
fRenderable->registerClass<RenderablePlanetProjection>("RenderablePlanetProjection");
|
||||
|
||||
auto fPlanetGeometryProjection = FactoryManager::ref().factory<planetgeometryprojection::PlanetGeometryProjection>();
|
||||
fPlanetGeometryProjection->registerClass<planetgeometryprojection::SimpleSphereGeometryProjection>("SimpleSphereProjection");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
@@ -0,0 +1,39 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2015 *
|
||||
* *
|
||||
* 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 __NEWHORIZONSMODULE_H__
|
||||
#define __NEWHORIZONSMODULE_H__
|
||||
|
||||
#include <openspace/util/openspacemodule.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class NewHorizonsModule : public OpenSpaceModule {
|
||||
public:
|
||||
bool initialize() override;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __NEWHORIZONSMODULE_H__
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/planets/planetgeometryprojection.h>
|
||||
#include <modules/newhorizons/rendering/planetgeometryprojection.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
#define __PlanetGeometryProjection_H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/rendering/planets/renderableplanetprojection.h>
|
||||
#include <modules/newhorizons/rendering/renderableplanetprojection.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
|
||||
namespace openspace {
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/renderablefov.h>
|
||||
#include <modules/newhorizons/rendering/renderablefov.h>
|
||||
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/renderableplaneprojection.h>
|
||||
#include <modules/newhorizons/rendering/renderableplaneprojection.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/util/constants.h>
|
||||
+2
-2
@@ -23,9 +23,9 @@
|
||||
****************************************************************************************/
|
||||
|
||||
// open space includes
|
||||
#include <openspace/rendering/planets/renderableplanetprojection.h>
|
||||
#include <modules/newhorizons/rendering/renderableplanetprojection.h>
|
||||
#include <openspace/util/constants.h>
|
||||
#include <openspace/rendering/planets/planetgeometryprojection.h>
|
||||
#include <modules/newhorizons/rendering/planetgeometryprojection.h>
|
||||
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/planets/simplespheregeometryprojection.h>
|
||||
#include <modules/newhorizons/rendering/simplespheregeometryprojection.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
namespace {
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
#ifndef __SIMPLESPHEREGEOMETRYPROJECTION_H__
|
||||
#define __SIMPLESPHEREGEOMETRYPROJECTION_H__
|
||||
|
||||
#include <openspace/rendering/planets/planetgeometryprojection.h>
|
||||
#include <modules/newhorizons/rendering/planetgeometryprojection.h>
|
||||
#include <openspace/properties/vectorproperty.h>
|
||||
#include <openspace/properties/scalarproperty.h>
|
||||
#include <openspace/util/powerscaledsphere.h>
|
||||
@@ -0,0 +1,20 @@
|
||||
set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolume.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolumegl.h
|
||||
)
|
||||
source_group("Header Files" FILES ${HEADER_FILES})
|
||||
|
||||
set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolume.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolumegl.cpp
|
||||
)
|
||||
source_group("Source Files" FILES ${SOURCE_FILES})
|
||||
|
||||
set(MODULE_CLASS_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/volumemodule.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/volumemodule.cpp
|
||||
)
|
||||
|
||||
include_directories(${OPENSPACE_BASE_DIR}/include ${OPENSPACE_BASE_DIR})
|
||||
|
||||
add_library(openspace-module-volume ${HEADER_FILES} ${SOURCE_FILES} ${MODULE_CLASS_FILES})
|
||||
@@ -23,7 +23,7 @@
|
||||
****************************************************************************************/
|
||||
|
||||
// open space includes
|
||||
#include <openspace/rendering/renderablevolume.h>
|
||||
#include <modules/volume/rendering/renderablevolume.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/kameleonwrapper.h>
|
||||
#include <openspace/util/constants.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/rendering/renderablevolumegl.h>
|
||||
#include <modules/volume/rendering/renderablevolumegl.h>
|
||||
|
||||
#include <openspace/abuffer/abuffer.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __RENDERABLEVOLUMEGL_H__
|
||||
#define __RENDERABLEVOLUMEGL_H__
|
||||
|
||||
#include <openspace/rendering/renderablevolume.h>
|
||||
#include <modules/volume/rendering/renderablevolume.h>
|
||||
#include <openspace/util/powerscaledcoordinate.h>
|
||||
|
||||
// Forward declare to minimize dependencies
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2015 *
|
||||
* *
|
||||
* 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 <modules/volume/volumemodule.h>
|
||||
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
|
||||
#include <modules/volume/rendering/renderablevolumegl.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
bool VolumeModule::initialize() {
|
||||
|
||||
auto fRenderable = FactoryManager::ref().factory<Renderable>();
|
||||
ghoul_assert(fRenderable, "No renderable factory existed");
|
||||
|
||||
fRenderable->registerClass<RenderableVolumeGL>("RenderableVolumeGL");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
@@ -0,0 +1,39 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2015 *
|
||||
* *
|
||||
* 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 __VOLUMEMODULE_H__
|
||||
#define __VOLUMEMODULE_H__
|
||||
|
||||
#include <openspace/util/openspacemodule.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class VolumeModule : public OpenSpaceModule {
|
||||
public:
|
||||
bool initialize() override;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __VOLUMEMODULE_H__
|
||||
Reference in New Issue
Block a user