mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-14 22:10:50 -05:00
Update file structure in globebrowsing
This commit is contained in:
@@ -26,15 +26,14 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
|
||||
|
||||
set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/globes/renderableglobe.h
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunkedlodglobe.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/globes/chunkedlodglobe.h
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunknode.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunk.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunkrenderer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator.h
|
||||
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/trianglesoup.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/grid.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/basicgrid.h
|
||||
@@ -64,29 +63,28 @@ set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovidermanager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tile/pixelregion.h
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextureshaderprovider.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextures.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/perlayersetting.h
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/distanceswitch.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/lrucache.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentjobmanager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentqueue.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/statscollector.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/threadpool.h
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextureshaderprovider.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextures.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/perlayersetting.h
|
||||
)
|
||||
|
||||
set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/globes/renderableglobe.cpp
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunkedlodglobe.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/globes/chunkedlodglobe.cpp
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunknode.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunk.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunkrenderer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator.cpp
|
||||
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/trianglesoup.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/grid.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/meshes/basicgrid.cpp
|
||||
@@ -115,15 +113,15 @@ set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovidermanager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tile/pixelregion.cpp
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextureshaderprovider.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextures.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/perlayersetting.cpp
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/distanceswitch.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/lrucache.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentjobmanager.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/statscollector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/other/threadpool.cpp
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextureshaderprovider.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/layeredtextures.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/layered_rendering/perlayersetting.cpp
|
||||
)
|
||||
source_group("Source Files" FILES ${SOURCE_FILES})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <modules/globebrowsing/chunk/chunk.h>
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/layered_rendering/layeredtextures.h>
|
||||
#include <modules/globebrowsing/tile/tileioresult.h>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <modules/globebrowsing/chunk/chunklevelevaluator.h>
|
||||
#include <modules/globebrowsing/chunk/chunk.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <modules/globebrowsing/layered_rendering/layeredtextures.h>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
|
||||
#include <modules/globebrowsing/chunk/chunknode.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/chunk/culling.h>
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
#include <modules/globebrowsing/chunk/chunkrenderer.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <modules/globebrowsing/layered_rendering/layeredtextures.h>
|
||||
#include <modules/globebrowsing/tile/tileprovidermanager.h>
|
||||
@@ -160,9 +160,9 @@ namespace openspace {
|
||||
size_t layerIndex,
|
||||
PerLayerSettings settings) {
|
||||
|
||||
for (int i = 0; i < settings.array.size(); i++) {
|
||||
settings.array[i]->uploadUniform(
|
||||
&uniformIdHandler->programObject(),
|
||||
for (int i = 0; i < settings.array().size(); i++) {
|
||||
settings.array()[i]->uploadUniform(
|
||||
uniformIdHandler->programObject(),
|
||||
uniformIdHandler->getSettingsId(
|
||||
textureCategory,
|
||||
layerIndex,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <modules/globebrowsing/meshes/skirtedgrid.h>
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <ghoul/misc/threadpool.h>
|
||||
|
||||
#include <modules/globebrowsing/tile/tileselector.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/tile/tileprovidermanager.h>
|
||||
|
||||
// open space includes
|
||||
@@ -91,7 +91,7 @@ namespace openspace {
|
||||
tileProvider.isActive = prop.isEnabled;
|
||||
});
|
||||
|
||||
for (auto setting : tileProvider.settings.array) {
|
||||
for (auto setting : tileProvider.settings.array()) {
|
||||
prop.addProperty(setting->property());
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace openspace {
|
||||
|
||||
_chunkedLodGlobe = std::make_shared<ChunkedLodGlobe>(
|
||||
*this, patchSegments, _tileProviderManager);
|
||||
_distanceSwitch.addSwitchValue(_chunkedLodGlobe, 1e12);
|
||||
_distanceSwitch.addSwitchValue(_chunkedLodGlobe, 1e10);
|
||||
|
||||
_debugPropertyOwner.setName("Debug");
|
||||
_texturePropertyOwner.setName("Textures");
|
||||
|
||||
@@ -92,7 +92,6 @@ public:
|
||||
properties::BoolProperty atmosphereEnabled;
|
||||
properties::FloatProperty lodScaleFactor;
|
||||
properties::FloatProperty cameraMinHeight;
|
||||
|
||||
};
|
||||
|
||||
RenderableGlobe(const ghoul::Dictionary& dictionary);
|
||||
|
||||
@@ -81,4 +81,40 @@ namespace openspace {
|
||||
"multiplier",
|
||||
};
|
||||
|
||||
PerLayerSettings::PerLayerSettings()
|
||||
{
|
||||
// Here, all the per layer settings are specified and added
|
||||
_array[LayeredTextures::LayerSettingsIds::opacity] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::opacity],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::opacity],
|
||||
1,
|
||||
0,
|
||||
1);
|
||||
_array[LayeredTextures::LayerSettingsIds::gamma] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::gamma],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::gamma],
|
||||
1,
|
||||
0,
|
||||
5);
|
||||
_array[LayeredTextures::LayerSettingsIds::multiplier] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::multiplier],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::multiplier],
|
||||
1,
|
||||
0,
|
||||
20);
|
||||
|
||||
// Make sure all settings have been spacified and added
|
||||
for (int i = 0; i < LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES; ++i) {
|
||||
ghoul_assert(_array[i], "The setting " +
|
||||
LayeredTextures::layerSettingsIds[i] + "is not specified!");
|
||||
}
|
||||
}
|
||||
|
||||
PerLayerSettings::~PerLayerSettings() {};
|
||||
|
||||
const std::array<std::shared_ptr<PerLayerSetting>,
|
||||
LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES>& PerLayerSettings::array() const {
|
||||
return _array;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -124,37 +124,14 @@ namespace openspace {
|
||||
|
||||
class PerLayerSettings {
|
||||
public:
|
||||
PerLayerSettings()
|
||||
{
|
||||
// Here, all the per layer settings are specified and added
|
||||
array[LayeredTextures::LayerSettingsIds::opacity] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::opacity],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::opacity],
|
||||
1,
|
||||
0,
|
||||
1);
|
||||
array[LayeredTextures::LayerSettingsIds::gamma] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::gamma],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::gamma],
|
||||
1,
|
||||
0,
|
||||
5);
|
||||
array[LayeredTextures::LayerSettingsIds::multiplier] = std::make_shared<PerLayerFloatSetting>(
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::multiplier],
|
||||
LayeredTextures::layerSettingsIds[LayeredTextures::LayerSettingsIds::multiplier],
|
||||
1,
|
||||
0,
|
||||
20);
|
||||
|
||||
// Make sure all settings have been spacified and added
|
||||
for (int i = 0; i < LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES; ++i) {
|
||||
ghoul_assert(array[i], "The setting " +
|
||||
LayeredTextures::layerSettingsIds[i] + "is not specified!");
|
||||
}
|
||||
}
|
||||
|
||||
PerLayerSettings();
|
||||
~PerLayerSettings();
|
||||
|
||||
const std::array<std::shared_ptr<PerLayerSetting>,
|
||||
LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES>& array() const;
|
||||
private:
|
||||
std::array<std::shared_ptr<PerLayerSetting>,
|
||||
LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES> array;
|
||||
LayeredTextures::NUM_LAYER_SETTINGS_VARIABLES> _array;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace openspace {
|
||||
PerLayerFloatSetting::~PerLayerFloatSetting(){};
|
||||
|
||||
void PerLayerFloatSetting::uploadUniform(
|
||||
ProgramObject* programObject,
|
||||
ProgramObject& programObject,
|
||||
GLint settingsId) {
|
||||
programObject->setUniform(settingsId, _property);
|
||||
programObject.setUniform(settingsId, _property);
|
||||
}
|
||||
|
||||
properties::Property* PerLayerFloatSetting::property() {
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __PER_LAYER_SETTING_H__
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace openspace {
|
||||
~PerLayerSetting();
|
||||
|
||||
virtual void uploadUniform(
|
||||
ProgramObject* programObject,
|
||||
ProgramObject& programObject,
|
||||
GLint settingsId) = 0;
|
||||
virtual properties::Property* property() = 0;
|
||||
private:
|
||||
@@ -56,7 +57,7 @@ namespace openspace {
|
||||
float minimumValue,
|
||||
float maximumValue);
|
||||
~PerLayerFloatSetting();
|
||||
virtual void uploadUniform(ProgramObject* programObject, GLint settingsId);
|
||||
virtual void uploadUniform(ProgramObject& programObject, GLint settingsId);
|
||||
virtual properties::Property* property();
|
||||
private:
|
||||
properties::FloatProperty _property;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <modules/globebrowsing/chunk/chunkedlodglobe.h>
|
||||
#include <modules/globebrowsing/globes/chunkedlodglobe.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user