mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Merge remote-tracking branch 'origin/master' into feature/video-module
# Conflicts: # modules/globebrowsing/src/tileprovider/tileprovider.cpp
This commit is contained in:
@@ -249,7 +249,7 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) {
|
||||
|
||||
// Initialize
|
||||
global::callback::initializeGL->emplace_back([&]() {
|
||||
ZoneScopedN("GlobeBrowsingModule")
|
||||
ZoneScopedN("GlobeBrowsingModule");
|
||||
|
||||
_tileCache = std::make_unique<cache::MemoryAwareTileCache>(_tileCacheSizeMB);
|
||||
addPropertySubOwner(_tileCache.get());
|
||||
@@ -265,21 +265,21 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) {
|
||||
});
|
||||
|
||||
global::callback::deinitializeGL->emplace_back([]() {
|
||||
ZoneScopedN("GlobeBrowsingModule")
|
||||
ZoneScopedN("GlobeBrowsingModule");
|
||||
|
||||
TileProvider::deinitializeDefaultTile();
|
||||
});
|
||||
|
||||
// Render
|
||||
global::callback::render->emplace_back([&]() {
|
||||
ZoneScopedN("GlobeBrowsingModule")
|
||||
ZoneScopedN("GlobeBrowsingModule");
|
||||
|
||||
_tileCache->update();
|
||||
});
|
||||
|
||||
// Deinitialize
|
||||
global::callback::deinitialize->emplace_back([&]() {
|
||||
ZoneScopedN("GlobeBrowsingModule")
|
||||
ZoneScopedN("GlobeBrowsingModule");
|
||||
|
||||
GdalWrapper::destroy();
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ AsyncTileDataProvider::AsyncTileDataProvider(std::string name,
|
||||
, _rawTileDataReader(std::move(rawTileDataReader))
|
||||
, _concurrentJobManager(LRUThreadPool<TileIndex::TileHashKey>(1, 10))
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
performReset(ResetRawTileDataReader::No);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ const RawTileDataReader& AsyncTileDataProvider::rawTileDataReader() const {
|
||||
}
|
||||
|
||||
bool AsyncTileDataProvider::enqueueTileIO(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_resetMode == ResetMode::ShouldNotReset && satisfiesEnqueueCriteria(tileIndex)) {
|
||||
auto job = std::make_unique<TileLoadJob>(*_rawTileDataReader, tileIndex);
|
||||
@@ -95,7 +95,7 @@ std::optional<RawTile> AsyncTileDataProvider::popFinishedRawTile() {
|
||||
}
|
||||
|
||||
bool AsyncTileDataProvider::satisfiesEnqueueCriteria(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Only satisfies if it is not already enqueued. Also bumps the request to the top.
|
||||
const bool alreadyEnqueued = _concurrentJobManager.touch(tileIndex.hashKey());
|
||||
@@ -185,7 +185,7 @@ bool AsyncTileDataProvider::shouldBeDeleted() {
|
||||
}
|
||||
|
||||
void AsyncTileDataProvider::performReset(ResetRawTileDataReader resetRawTileDataReader) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(_enqueuedTileRequests.empty(), "No enqueued requests left");
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ struct RawTile;
|
||||
|
||||
/**
|
||||
* The responsibility of this class is to enqueue tile requests and fetching finished
|
||||
* <code>RawTile</code>s that has been asynchronously loaded.
|
||||
* `RawTile`s that has been asynchronously loaded.
|
||||
*/
|
||||
class AsyncTileDataProvider {
|
||||
public:
|
||||
@@ -80,7 +80,7 @@ protected:
|
||||
};
|
||||
|
||||
/**
|
||||
* \returns true if tile of index <code>tileIndex</code> is not already enqueued.
|
||||
* \returns true if tile of index `tileIndex` is not already enqueued.
|
||||
*/
|
||||
bool satisfiesEnqueueCriteria(const TileIndex& tileIndex);
|
||||
|
||||
|
||||
@@ -125,9 +125,8 @@ public:
|
||||
Unavailable,
|
||||
|
||||
/**
|
||||
* Can be set by <code>TileProvider</code>s if the requested
|
||||
* <code>TileIndex</code> is undefined for that particular
|
||||
* provider.
|
||||
* Can be set by `TileProvider`s if the requested `TileIndex` is undefined for
|
||||
* that particular provider.
|
||||
* texture and metaData are both null
|
||||
*/
|
||||
OutOfRange,
|
||||
|
||||
@@ -138,7 +138,7 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation(
|
||||
}
|
||||
|
||||
void DashboardItemGlobeLocation::render(glm::vec2& penPosition) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
GlobeBrowsingModule* module = global::moduleEngine->module<GlobeBrowsingModule>();
|
||||
|
||||
@@ -200,7 +200,7 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) {
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemGlobeLocation::size() const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return _font->boundingBox(
|
||||
fmt::format("Position: {}, {} Altitude: {}", 1.f, 1.f, 1.f)
|
||||
|
||||
@@ -89,7 +89,7 @@ bool GdalWrapper::logGdalErrors() const {
|
||||
}
|
||||
|
||||
GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize)
|
||||
: PropertyOwner({ "GdalWrapper" })
|
||||
: PropertyOwner({ "GdalWrapper", "Gdal Wrapper" })
|
||||
, _logGdalErrors(LogGdalErrorInfo, false)
|
||||
, _gdalMaximumCacheSize(
|
||||
GdalMaximumCacheInfo,
|
||||
@@ -99,7 +99,7 @@ GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize
|
||||
1 // Step: One MB
|
||||
)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
addProperty(_logGdalErrors);
|
||||
addProperty(_gdalMaximumCacheSize);
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
double edgeLatitudeNearestEquator() const;
|
||||
|
||||
/**
|
||||
* Returns \c true if the center above the equator
|
||||
* Returns `true` if the center above the equator
|
||||
*/
|
||||
double isNorthern() const;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
double maxLon() const;
|
||||
|
||||
/**
|
||||
* Returns \c true if the specified coordinate is contained within the patch
|
||||
* Returns `true` if the specified coordinate is contained within the patch
|
||||
*/
|
||||
bool contains(const Geodetic2& p) const;
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ GlobeLabelsComponent::GlobeLabelsComponent()
|
||||
void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
|
||||
globebrowsing::RenderableGlobe* globe)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
_globe = globe;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace openspace::globebrowsing {
|
||||
void GPULayerGroup::setValue(ghoul::opengl::ProgramObject& program,
|
||||
const LayerGroup& layerGroup, const TileIndex& tileIndex)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(
|
||||
layerGroup.activeLayers().size() == _gpuActiveLayers.size(),
|
||||
|
||||
@@ -45,27 +45,26 @@ struct LayerGroup;
|
||||
struct TileIndex;
|
||||
|
||||
/**
|
||||
* Manages a GPU representation of a <code>LayerGroup</code>
|
||||
* Manages a GPU representation of a `LayerGroup`
|
||||
*/
|
||||
class GPULayerGroup {
|
||||
public:
|
||||
/**
|
||||
* Sets the value of <code>LayerGroup</code> to its corresponding
|
||||
* GPU struct. OBS! Users must ensure bind has been
|
||||
* called before setting using this method.
|
||||
* Sets the value of `LayerGroup` to its corresponding GPU struct. OBS! Users must
|
||||
* ensure bind has been called before setting using this method.
|
||||
*/
|
||||
void setValue(ghoul::opengl::ProgramObject& programObject,
|
||||
const LayerGroup& layerGroup, const TileIndex& tileIndex);
|
||||
|
||||
/**
|
||||
* Binds this object with GLSL variables with identifiers starting
|
||||
* with nameBase within the provided shader program.
|
||||
* After this method has been called, users may invoke setValue.
|
||||
* Binds this object with GLSL variables with identifiers starting with nameBase
|
||||
* within the provided shader program. After this method has been called, users may
|
||||
* invoke setValue.
|
||||
*/
|
||||
void bind(ghoul::opengl::ProgramObject& programObject, const LayerGroup& layerGroup);
|
||||
|
||||
/**
|
||||
* Deactivates any <code>TextureUnit</code>s assigned by this object.
|
||||
* Deactivates any `TextureUnit`s assigned by this object.
|
||||
* This method should be called after the OpenGL draw call.
|
||||
*/
|
||||
void deactivate();
|
||||
|
||||
@@ -96,8 +96,8 @@ namespace {
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(Layer), codegen::noexhaustive()]] Parameters {
|
||||
// The unique identifier for this layer. May not contain '.' or spaces
|
||||
std::string identifier;
|
||||
// The unique identifier for this layer.
|
||||
std::string identifier [[codegen::identifier()]];
|
||||
|
||||
// A human-readable name for the user interface. If this is omitted, the
|
||||
// identifier is used instead
|
||||
@@ -366,7 +366,7 @@ Layer::Layer(layers::Group::ID id, const ghoul::Dictionary& layerDict, LayerGrou
|
||||
}
|
||||
|
||||
void Layer::initialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_tileProvider) {
|
||||
_tileProvider->initialize();
|
||||
@@ -380,7 +380,7 @@ void Layer::deinitialize() {
|
||||
}
|
||||
|
||||
ChunkTilePile Layer::chunkTilePile(const TileIndex& tileIndex, int pileSize) const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_tileProvider) {
|
||||
return _tileProvider->chunkTilePile(tileIndex, pileSize);
|
||||
@@ -446,7 +446,7 @@ void Layer::onChange(std::function<void(Layer*)> callback) {
|
||||
}
|
||||
|
||||
void Layer::update() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_tileProvider) {
|
||||
_tileProvider->update();
|
||||
|
||||
@@ -69,7 +69,7 @@ void LayerGroup::setLayersFromDict(const ghoul::Dictionary& dict) {
|
||||
}
|
||||
|
||||
void LayerGroup::initialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (const std::unique_ptr<Layer>& l : _layers) {
|
||||
l->initialize();
|
||||
@@ -77,7 +77,7 @@ void LayerGroup::initialize() {
|
||||
}
|
||||
|
||||
void LayerGroup::deinitialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (const std::unique_ptr<Layer>& l : _layers) {
|
||||
l->deinitialize();
|
||||
@@ -85,7 +85,7 @@ void LayerGroup::deinitialize() {
|
||||
}
|
||||
|
||||
void LayerGroup::update() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_activeLayers.clear();
|
||||
|
||||
@@ -98,7 +98,7 @@ void LayerGroup::update() {
|
||||
}
|
||||
|
||||
Layer* LayerGroup::addLayer(const ghoul::Dictionary& layerDict) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
documentation::TestResult res = documentation::testSpecification(
|
||||
Layer::Documentation(),
|
||||
|
||||
@@ -36,7 +36,7 @@ class Layer;
|
||||
struct TileProvider;
|
||||
|
||||
/**
|
||||
* Convenience class for dealing with multiple <code>Layer</code>s.
|
||||
* Convenience class for dealing with multiple `Layer`s.
|
||||
*/
|
||||
struct LayerGroup : public properties::PropertyOwner {
|
||||
LayerGroup(layers::Group group);
|
||||
|
||||
@@ -54,7 +54,7 @@ documentation::Documentation LayerManager::Documentation() {
|
||||
LayerManager::LayerManager() : properties::PropertyOwner({ "Layers" }) {}
|
||||
|
||||
void LayerManager::initialize(const ghoul::Dictionary& layerGroupsDict) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// First create empty layer groups in case not all are specified
|
||||
for (size_t i = 0; i < _layerGroups.size(); ++i) {
|
||||
@@ -91,7 +91,7 @@ void LayerManager::deinitialize() {
|
||||
}
|
||||
|
||||
Layer* LayerManager::addLayer(layers::Group::ID id, const ghoul::Dictionary& layerDict) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(id != layers::Group::ID::Unknown, "Layer group ID must be known");
|
||||
|
||||
@@ -109,7 +109,7 @@ Layer* LayerManager::addLayer(layers::Group::ID id, const ghoul::Dictionary& lay
|
||||
}
|
||||
|
||||
void LayerManager::deleteLayer(layers::Group::ID id, const std::string& layerName) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(id != layers::Group::ID::Unknown, "Layer group ID must be known");
|
||||
_layerGroups[static_cast<size_t>(id)]->deleteLayer(layerName);
|
||||
@@ -124,7 +124,7 @@ const LayerGroup& LayerManager::layerGroup(layers::Group::ID groupId) const {
|
||||
}
|
||||
|
||||
bool LayerManager::hasAnyBlendingLayersEnabled() const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return std::any_of(
|
||||
_layerGroups.begin(),
|
||||
@@ -136,7 +136,7 @@ bool LayerManager::hasAnyBlendingLayersEnabled() const {
|
||||
}
|
||||
|
||||
std::array<LayerGroup*, LayerManager::NumLayerGroups> LayerManager::layerGroups() const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
std::array<LayerGroup*, NumLayerGroups> res = {};
|
||||
for (size_t i = 0; i < NumLayerGroups; ++i) {
|
||||
@@ -146,7 +146,7 @@ std::array<LayerGroup*, LayerManager::NumLayerGroups> LayerManager::layerGroups(
|
||||
}
|
||||
|
||||
void LayerManager::update() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<LayerGroup>& layerGroup : _layerGroups) {
|
||||
layerGroup->update();
|
||||
@@ -154,7 +154,7 @@ void LayerManager::update() {
|
||||
}
|
||||
|
||||
void LayerManager::reset(bool includeDisabled) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<LayerGroup>& layerGroup : _layerGroups) {
|
||||
for (Layer* layer : layerGroup->layers()) {
|
||||
@@ -166,7 +166,7 @@ void LayerManager::reset(bool includeDisabled) {
|
||||
}
|
||||
|
||||
void LayerManager::onChange(std::function<void(Layer*)> callback) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<LayerGroup>& layerGroup : _layerGroups) {
|
||||
layerGroup->onChange(callback);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace openspace::globebrowsing::cache {
|
||||
|
||||
/**
|
||||
* Templated class implementing a Least-Recently-Used Cache.
|
||||
* <code>KeyType</code> needs to be an enumerable type.
|
||||
* `KeyType` needs to be an enumerable type.
|
||||
*/
|
||||
template <typename KeyType, typename ValueType, typename HasherType>
|
||||
class LRUCache {
|
||||
|
||||
@@ -59,7 +59,7 @@ bool LRUCache<KeyType, ValueType, HasherType>::exist(const KeyType& key) const {
|
||||
|
||||
template<typename KeyType, typename ValueType, typename HasherType>
|
||||
bool LRUCache<KeyType, ValueType, HasherType>::touch(const KeyType& key) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const auto it = _itemMap.find(key);
|
||||
if (it != _itemMap.end()) {
|
||||
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* The <code>LRUThreadPool</code> will only enqueue a certain number of tasks. The most
|
||||
* The `LRUThreadPool` will only enqueue a certain number of tasks. The most
|
||||
* recently enqueued task is the one that will be executed first. This class is templated
|
||||
* on a key type which used as an identifier to determine wheter or not a task with the
|
||||
* given key has been enqueued or not. This means that a task can be enqueued several
|
||||
|
||||
@@ -195,14 +195,14 @@ MemoryAwareTileCache::TextureContainer::TextureContainer(TileTextureInitData ini
|
||||
: _initData(std::move(initData))
|
||||
, _numTextures(numTextures)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_textures.reserve(_numTextures);
|
||||
reset();
|
||||
}
|
||||
|
||||
void MemoryAwareTileCache::TextureContainer::reset() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_textures.clear();
|
||||
_freeTexture = 0;
|
||||
@@ -228,7 +228,7 @@ void MemoryAwareTileCache::TextureContainer::reset() {
|
||||
}
|
||||
|
||||
void MemoryAwareTileCache::TextureContainer::reset(size_t numTextures) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_numTextures = numTextures;
|
||||
reset();
|
||||
@@ -260,7 +260,7 @@ size_t MemoryAwareTileCache::TextureContainer::size() const {
|
||||
//
|
||||
|
||||
MemoryAwareTileCache::MemoryAwareTileCache(int tileCacheSize)
|
||||
: PropertyOwner({ "TileCache" })
|
||||
: PropertyOwner({ "TileCache", "Tile Cache" })
|
||||
, _numTextureBytesAllocatedOnCPU(0)
|
||||
, _cpuAllocatedTileData(CpuAllocatedDataInfo, tileCacheSize, 128, 16384, 1)
|
||||
, _gpuAllocatedTileData(GpuAllocatedDataInfo, tileCacheSize, 128, 16384, 1)
|
||||
@@ -268,7 +268,7 @@ MemoryAwareTileCache::MemoryAwareTileCache(int tileCacheSize)
|
||||
, _applyTileCacheSize(ApplyTileCacheInfo)
|
||||
, _clearTileCache(ClearTileCacheInfo)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
createDefaultTextureContainers();
|
||||
|
||||
@@ -313,7 +313,7 @@ void MemoryAwareTileCache::clear() {
|
||||
}
|
||||
|
||||
void MemoryAwareTileCache::createDefaultTextureContainers() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (const layers::Group& gi : layers::Groups) {
|
||||
TileTextureInitData initData = tileTextureInitData(gi.id, true);
|
||||
@@ -324,7 +324,7 @@ void MemoryAwareTileCache::createDefaultTextureContainers() {
|
||||
void MemoryAwareTileCache::assureTextureContainerExists(
|
||||
const TileTextureInitData& initData)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
TileTextureInitData::HashKey initDataKey = initData.hashKey;
|
||||
if (_textureContainerMap.find(initDataKey) == _textureContainerMap.end()) {
|
||||
@@ -339,7 +339,7 @@ void MemoryAwareTileCache::assureTextureContainerExists(
|
||||
}
|
||||
|
||||
void MemoryAwareTileCache::setSizeEstimated(size_t estimatedSize) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
ghoul_assert(!_textureContainerMap.empty(), "Texture containers must exist");
|
||||
|
||||
LDEBUG("Resetting tile cache size");
|
||||
@@ -366,7 +366,7 @@ void MemoryAwareTileCache::setSizeEstimated(size_t estimatedSize) {
|
||||
}
|
||||
|
||||
void MemoryAwareTileCache::resetTextureContainerSize(size_t numTexturesPerTextureType) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_numTextureBytesAllocatedOnCPU = 0;
|
||||
for (std::pair<const TileTextureInitData::HashKey,
|
||||
@@ -391,7 +391,7 @@ bool MemoryAwareTileCache::exist(const ProviderTileKey& key) const {
|
||||
}
|
||||
|
||||
Tile MemoryAwareTileCache::get(const ProviderTileKey& key) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const TextureContainerMap::const_iterator it = std::find_if(
|
||||
_textureContainerMap.cbegin(),
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
std::vector<KeyType> keysToEnqueuedJobs();
|
||||
|
||||
/**
|
||||
* Bumps the job identified with <code>key</code> to the beginning of the queue.
|
||||
* Bumps the job identified with `key` to the beginning of the queue.
|
||||
* In case the job was not already enqueued the function simply returns false and
|
||||
* no state is changed.
|
||||
* \param key is the identifier of the job to bump.
|
||||
|
||||
@@ -426,7 +426,7 @@ RawTileDataReader::RawTileDataReader(std::string filePath,
|
||||
, _initData(std::move(initData))
|
||||
, _preprocess(preprocess)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
initialize();
|
||||
}
|
||||
@@ -440,7 +440,7 @@ RawTileDataReader::~RawTileDataReader() {
|
||||
}
|
||||
|
||||
void RawTileDataReader::initialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_datasetFilePath.empty()) {
|
||||
throw ghoul::RuntimeError("File path must not be empty");
|
||||
@@ -450,7 +450,7 @@ void RawTileDataReader::initialize() {
|
||||
|
||||
std::string content = _datasetFilePath;
|
||||
if (module.isWMSCachingEnabled()) {
|
||||
ZoneScopedN("WMS Caching")
|
||||
ZoneScopedN("WMS Caching");
|
||||
std::string c;
|
||||
if (std::filesystem::is_regular_file(_datasetFilePath)) {
|
||||
// Only replace the 'content' if the dataset is an XML file and we want to do
|
||||
@@ -520,7 +520,7 @@ void RawTileDataReader::initialize() {
|
||||
}
|
||||
|
||||
{
|
||||
ZoneScopedN("GDALOpen")
|
||||
ZoneScopedN("GDALOpen");
|
||||
_dataset = static_cast<GDALDataset*>(GDALOpen(content.c_str(), GA_ReadOnly));
|
||||
if (!_dataset) {
|
||||
throw ghoul::RuntimeError(fmt::format(
|
||||
|
||||
@@ -64,6 +64,8 @@ namespace std {
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
constexpr std::string_view _loggerCat = "RenderableGlobe";
|
||||
|
||||
// Global flags to modify the RenderableGlobe
|
||||
constexpr bool LimitLevelByAvailableData = true;
|
||||
constexpr bool PerformFrustumCulling = true;
|
||||
@@ -318,7 +320,7 @@ using ChunkTileVector =
|
||||
ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup,
|
||||
const TileIndex& tileIndex)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__))
|
||||
ChunkTileVector tilesAndSettings;
|
||||
@@ -338,7 +340,7 @@ ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup,
|
||||
}
|
||||
|
||||
BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager& lm) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
using ChunkTileSettingsPair = std::pair<ChunkTile, const LayerRenderSettings*>;
|
||||
|
||||
@@ -403,7 +405,7 @@ BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager&
|
||||
}
|
||||
|
||||
bool colorAvailableForChunk(const Chunk& chunk, const LayerManager& lm) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const LayerGroup& colorLayers = lm.layerGroup(layers::Group::ID::ColorLayers);
|
||||
for (Layer* lyr : colorLayers.activeLayers()) {
|
||||
@@ -422,7 +424,7 @@ std::array<glm::dvec4, 8> boundingCornersForChunk(const Chunk& chunk,
|
||||
const Ellipsoid& ellipsoid,
|
||||
const BoundingHeights& heights)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// assume worst case
|
||||
const double patchCenterRadius = ellipsoid.maximumRadius();
|
||||
@@ -664,6 +666,10 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
_generalProperties.shadowMapping = true;
|
||||
}
|
||||
_generalProperties.shadowMapping.onChange(notifyShaderRecompilation);
|
||||
|
||||
// Use a secondary renderbin for labels, and other things that we want to be able to
|
||||
// render with transparency, on top of the globe, after the atmosphere step
|
||||
_secondaryRenderBin = RenderBin::PostDeferredTransparent;
|
||||
}
|
||||
|
||||
void RenderableGlobe::initializeGL() {
|
||||
@@ -735,9 +741,6 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
|
||||
if ((distanceToCamera < distance) || (_generalProperties.renderAtDistance)) {
|
||||
try {
|
||||
// Before Shadows
|
||||
_globeLabelsComponent.draw(data);
|
||||
|
||||
if (_hasShadows && _shadowComponent.isEnabled()) {
|
||||
// Set matrices and other GL states
|
||||
RenderData lightRenderData(_shadowComponent.begin(data));
|
||||
@@ -806,8 +809,17 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
_lastChangedLayer = nullptr;
|
||||
}
|
||||
|
||||
void RenderableGlobe::renderSecondary(const RenderData& data, RendererTasks&) {
|
||||
try {
|
||||
_globeLabelsComponent.draw(data);
|
||||
}
|
||||
catch (const ghoul::opengl::TextureUnit::TextureUnitError& e) {
|
||||
LERROR(fmt::format("Error on drawing globe labels: '{}'", e.message));
|
||||
}
|
||||
}
|
||||
|
||||
void RenderableGlobe::update(const UpdateData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_localRenderer.program && _localRenderer.program->isDirty()) {
|
||||
_localRenderer.program->rebuildFromFile();
|
||||
@@ -914,7 +926,7 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
||||
const ShadowComponent::ShadowMapData& shadowData,
|
||||
bool renderGeomOnly)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
|
||||
if (_layerManagerDirty) {
|
||||
@@ -1147,7 +1159,7 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
||||
int& iGlobal, std::vector<const Chunk*>& local, int& iLocal, int cutoff,
|
||||
std::vector<const Chunk*>& traversalMemory)
|
||||
{
|
||||
ZoneScopedN("traversal")
|
||||
ZoneScopedN("traversal");
|
||||
|
||||
traversalMemory.clear();
|
||||
|
||||
@@ -1244,8 +1256,8 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData&
|
||||
const ShadowComponent::ShadowMapData& shadowData,
|
||||
bool renderGeomOnly)
|
||||
{
|
||||
ZoneScoped
|
||||
TracyGpuZone("renderChunkGlobally")
|
||||
ZoneScoped;
|
||||
TracyGpuZone("renderChunkGlobally");
|
||||
|
||||
const TileIndex& tileIndex = chunk.tileIndex;
|
||||
ghoul::opengl::ProgramObject& program = *_globalRenderer.program;
|
||||
@@ -1335,8 +1347,8 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
|
||||
const ShadowComponent::ShadowMapData& shadowData,
|
||||
bool renderGeomOnly)
|
||||
{
|
||||
ZoneScoped
|
||||
TracyGpuZone("renderChunkLocally")
|
||||
ZoneScoped;
|
||||
TracyGpuZone("renderChunkLocally");
|
||||
|
||||
//PerfMeasure("locally");
|
||||
const TileIndex& tileIndex = chunk.tileIndex;
|
||||
@@ -1473,7 +1485,7 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
|
||||
void RenderableGlobe::debugRenderChunk(const Chunk& chunk, const glm::dmat4& mvp,
|
||||
bool renderBounds) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const std::array<glm::dvec4, 8>& modelSpaceCorners = chunk.corners;
|
||||
|
||||
@@ -1511,7 +1523,7 @@ void RenderableGlobe::setCommonUniforms(ghoul::opengl::ProgramObject& programObj
|
||||
{
|
||||
using namespace layers;
|
||||
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_generalProperties.useAccurateNormals &&
|
||||
!_layerManager.layerGroup(Group::ID::HeightLayers).activeLayers().empty())
|
||||
@@ -1559,7 +1571,7 @@ void RenderableGlobe::setCommonUniforms(ghoul::opengl::ProgramObject& programObj
|
||||
}
|
||||
|
||||
void RenderableGlobe::recompileShaders() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
struct LayerShaderPreprocessingData {
|
||||
struct LayerGroupPreprocessingData {
|
||||
@@ -1787,7 +1799,7 @@ void RenderableGlobe::recompileShaders() {
|
||||
SurfacePositionHandle RenderableGlobe::calculateSurfacePositionHandle(
|
||||
const glm::dvec3& targetModelSpace) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
glm::dvec3 centerToEllipsoidSurface =
|
||||
_ellipsoid.geodeticSurfaceProjection(targetModelSpace);
|
||||
@@ -1820,7 +1832,7 @@ bool RenderableGlobe::testIfCullable(const Chunk& chunk,
|
||||
const BoundingHeights& heights,
|
||||
const glm::dmat4& mvp) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return (PreformHorizonCulling && isCullableByHorizon(chunk, renderData, heights)) ||
|
||||
(PerformFrustumCulling && isCullableByFrustum(chunk, renderData, mvp));
|
||||
@@ -1829,7 +1841,7 @@ bool RenderableGlobe::testIfCullable(const Chunk& chunk,
|
||||
int RenderableGlobe::desiredLevel(const Chunk& chunk, const RenderData& renderData,
|
||||
const BoundingHeights& heights) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const int desiredLevel = _debugProperties.levelByProjectedAreaElseDistance ?
|
||||
desiredLevelByProjectedArea(chunk, renderData, heights) :
|
||||
@@ -1846,7 +1858,7 @@ int RenderableGlobe::desiredLevel(const Chunk& chunk, const RenderData& renderDa
|
||||
}
|
||||
|
||||
float RenderableGlobe::getHeight(const glm::dvec3& position) const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
float height = 0;
|
||||
|
||||
@@ -1996,7 +2008,7 @@ float RenderableGlobe::getHeight(const glm::dvec3& position) const {
|
||||
void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& programObject,
|
||||
const RenderData& data, ShadowCompType stype)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
constexpr double KM_TO_M = 1000.0;
|
||||
|
||||
@@ -2159,7 +2171,7 @@ int RenderableGlobe::desiredLevelByDistance(const Chunk& chunk,
|
||||
const RenderData& data,
|
||||
const BoundingHeights& heights) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Calculations are done in the reference frame of the globe
|
||||
// (model space). Hence, the camera position needs to be transformed
|
||||
@@ -2195,7 +2207,7 @@ int RenderableGlobe::desiredLevelByProjectedArea(const Chunk& chunk,
|
||||
const RenderData& data,
|
||||
const BoundingHeights& heights) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Calculations are done in the reference frame of the globe
|
||||
// (model space). Hence, the camera position needs to be transformed
|
||||
@@ -2277,7 +2289,7 @@ int RenderableGlobe::desiredLevelByProjectedArea(const Chunk& chunk,
|
||||
}
|
||||
|
||||
int RenderableGlobe::desiredLevelByAvailableTileData(const Chunk& chunk) const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const int currLevel = chunk.tileIndex.level;
|
||||
|
||||
@@ -2302,7 +2314,7 @@ bool RenderableGlobe::isCullableByFrustum(const Chunk& chunk,
|
||||
const RenderData&,
|
||||
const glm::dmat4& mvp) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const std::array<glm::dvec4, 8>& corners = chunk.corners;
|
||||
|
||||
@@ -2323,7 +2335,7 @@ bool RenderableGlobe::isCullableByHorizon(const Chunk& chunk,
|
||||
const RenderData& renderData,
|
||||
const BoundingHeights& heights) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Calculations are done in the reference frame of the globe. Hence, the camera
|
||||
// position needs to be transformed with the inverse model matrix
|
||||
@@ -2394,7 +2406,7 @@ bool RenderableGlobe::isCullableByHorizon(const Chunk& chunk,
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RenderableGlobe::splitChunkNode(Chunk& cn, int depth) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (depth > 0 && isLeaf(cn)) {
|
||||
std::vector<void*> memory = _chunkPool.allocate(
|
||||
@@ -2424,7 +2436,7 @@ void RenderableGlobe::splitChunkNode(Chunk& cn, int depth) {
|
||||
}
|
||||
|
||||
void RenderableGlobe::freeChunkNode(Chunk* n) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_chunkPool.free(n);
|
||||
for (Chunk* c : n->children) {
|
||||
@@ -2436,7 +2448,7 @@ void RenderableGlobe::freeChunkNode(Chunk* n) {
|
||||
}
|
||||
|
||||
void RenderableGlobe::mergeChunkNode(Chunk& cn) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (Chunk* child : cn.children) {
|
||||
if (child) {
|
||||
@@ -2450,7 +2462,7 @@ void RenderableGlobe::mergeChunkNode(Chunk& cn) {
|
||||
bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data,
|
||||
const glm::dmat4& mvp)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// abock: I tried turning this into a queue and use iteration, rather than recursion
|
||||
// but that made the code harder to understand as the breadth-first traversal
|
||||
@@ -2458,7 +2470,7 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data,
|
||||
// children and then again it self to be processed after the children finish).
|
||||
// In addition, this didn't even improve performance --- 2018-10-04
|
||||
if (isLeaf(cn)) {
|
||||
ZoneScopedN("leaf")
|
||||
ZoneScopedN("leaf");
|
||||
updateChunk(cn, data, mvp);
|
||||
|
||||
if (cn.status == Chunk::Status::WantSplit) {
|
||||
@@ -2472,7 +2484,7 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data,
|
||||
return cn.status == Chunk::Status::WantMerge;
|
||||
}
|
||||
else {
|
||||
ZoneScopedN("!leaf")
|
||||
ZoneScopedN("!leaf");
|
||||
char requestedMergeMask = 0;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (updateChunkTree(*cn.children[i], data, mvp)) {
|
||||
@@ -2500,7 +2512,7 @@ bool RenderableGlobe::updateChunkTree(Chunk& cn, const RenderData& data,
|
||||
void RenderableGlobe::updateChunk(Chunk& chunk, const RenderData& data,
|
||||
const glm::dmat4& mvp) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const BoundingHeights& heights = boundingHeightsForChunk(chunk, _layerManager);
|
||||
chunk.heightTileOK = heights.tileOK;
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
bool isReady() const override;
|
||||
|
||||
void render(const RenderData& data, RendererTasks& rendererTask) override;
|
||||
void renderSecondary(const RenderData& data, RendererTasks&) override;
|
||||
void update(const UpdateData& data) override;
|
||||
|
||||
SurfacePositionHandle calculateSurfacePositionHandle(
|
||||
@@ -153,8 +154,8 @@ private:
|
||||
* Test if a specific chunk can safely be culled without affecting the rendered
|
||||
* image.
|
||||
*
|
||||
* Goes through all available <code>ChunkCuller</code>s and check if any of them
|
||||
* allows culling of the <code>Chunk</code>s in question.
|
||||
* Goes through all available `ChunkCuller`s and check if any of them
|
||||
* allows culling of the `Chunk`s in question.
|
||||
*/
|
||||
bool testIfCullable(const Chunk& chunk, const RenderData& renderData,
|
||||
const BoundingHeights& heights, const glm::dmat4& mvp) const;
|
||||
@@ -163,10 +164,10 @@ private:
|
||||
* Gets the desired level which can be used to determine if a chunk should split
|
||||
* or merge.
|
||||
*
|
||||
* Using <code>ChunkLevelEvaluator</code>s, the desired level can be higher or
|
||||
* lower than the current level of the <code>Chunks</code>s
|
||||
* <code>TileIndex</code>. If the desired level is higher than that of the
|
||||
* <code>Chunk</code>, it wants to split. If it is lower, it wants to merge with
|
||||
* Using `ChunkLevelEvaluator`s, the desired level can be higher or
|
||||
* lower than the current level of the `Chunks`s
|
||||
* `TileIndex`. If the desired level is higher than that of the
|
||||
* `Chunk`, it wants to split. If it is lower, it wants to merge with
|
||||
* its siblings.
|
||||
*/
|
||||
int desiredLevel(const Chunk& chunk, const RenderData& renderData,
|
||||
@@ -178,8 +179,8 @@ private:
|
||||
*
|
||||
* The height can be negative if the height map contains negative values.
|
||||
*
|
||||
* \param <code>position</code> is the position of a point that gets geodetically
|
||||
* projected on the reference ellipsoid. <code>position</code> must be in
|
||||
* \param `position` is the position of a point that gets geodetically
|
||||
* projected on the reference ellipsoid. `position` must be in
|
||||
* cartesian model space.
|
||||
* \returns the height from the reference ellipsoid to the globe surface.
|
||||
*/
|
||||
|
||||
@@ -241,7 +241,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
void RingsComponent::initialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
using ghoul::filesystem::File;
|
||||
|
||||
@@ -328,7 +328,7 @@ bool RingsComponent::isReady() const {
|
||||
}
|
||||
|
||||
void RingsComponent::initializeGL() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
loadTexture();
|
||||
compileShadowShader();
|
||||
@@ -582,7 +582,7 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass,
|
||||
}
|
||||
|
||||
void RingsComponent::update(const UpdateData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (_shader && _shader->isDirty()) {
|
||||
compileShadowShader();
|
||||
|
||||
@@ -204,7 +204,7 @@ bool ShadowComponent::isReady() const {
|
||||
}
|
||||
|
||||
void ShadowComponent::initializeGL() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
createDepthTexture();
|
||||
createShadowFBO();
|
||||
@@ -353,7 +353,7 @@ void ShadowComponent::end() {
|
||||
}
|
||||
|
||||
void ShadowComponent::update(const UpdateData&) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
SceneGraphNode* sun = global::renderEngine->scene()->sceneGraphNode("Sun");
|
||||
if (sun) {
|
||||
|
||||
@@ -36,8 +36,8 @@ class RawTileDataReader;
|
||||
|
||||
struct TileLoadJob : public Job<RawTile> {
|
||||
/**
|
||||
* Allocates enough data for one tile. When calling <code>product()</code>, the
|
||||
* ownership of this data will be released. If <code>product()</code> has not been
|
||||
* Allocates enough data for one tile. When calling `product()`, the
|
||||
* ownership of this data will be released. If `product()` has not been
|
||||
* called before the TileLoadJob is finished, the data will be deleted as it has not
|
||||
* been exposed outside of this object.
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary)
|
||||
: _filePath(FilePathInfo, "")
|
||||
, _tilePixelSize(TilePixelSizeInfo, 32, 32, 2048)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -116,7 +116,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
void DefaultTileProvider::initAsyncTileDataReader(TileTextureInitData initData) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_asyncTextureDataProvider = std::make_unique<AsyncTileDataProvider>(
|
||||
name,
|
||||
@@ -129,7 +129,7 @@ void DefaultTileProvider::initAsyncTileDataReader(TileTextureInitData initData)
|
||||
}
|
||||
|
||||
Tile DefaultTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(_asyncTextureDataProvider, "No data provider");
|
||||
if (tileIndex.level > maxLevel()) {
|
||||
|
||||
@@ -71,7 +71,7 @@ ImageSequenceTileProvider::ImageSequenceTileProvider(const ghoul::Dictionary& di
|
||||
, _folderPath(FolderPathInfo)
|
||||
, _initDict(dictionary)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -90,7 +90,7 @@ ImageSequenceTileProvider::ImageSequenceTileProvider(const ghoul::Dictionary& di
|
||||
}
|
||||
|
||||
Tile ImageSequenceTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return _currentTileProvider ? _currentTileProvider->tile(tileIndex) : Tile();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ documentation::Documentation SingleImageProvider::Documentation() {
|
||||
SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary)
|
||||
: _filePath(FilePathInfo)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -62,7 +62,7 @@ SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
Tile SingleImageProvider::tile(const TileIndex&) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
return _tile;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ documentation::Documentation SizeReferenceTileProvider::Documentation() {
|
||||
SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& dictionary)
|
||||
: TextTileProvider(tileTextureInitData(layers::Group::ID::ColorLayers, false))
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -65,7 +65,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di
|
||||
}
|
||||
|
||||
Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const GeodeticPatch patch(tileIndex);
|
||||
const bool aboveEquator = patch.isNorthern();
|
||||
|
||||
@@ -52,7 +52,7 @@ documentation::Documentation SpoutImageProvider::Documentation() {
|
||||
SpoutImageProvider::SpoutImageProvider(
|
||||
[[maybe_unused]] const ghoul::Dictionary& dictionary)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_SPOUT
|
||||
spoutReceiver = std::make_unique<spout::SpoutReceiverPropertyProxy>(
|
||||
@@ -159,7 +159,7 @@ SpoutImageProvider::SpoutImageProvider(
|
||||
}
|
||||
|
||||
void SpoutImageProvider::internalInitialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_SPOUT
|
||||
spoutReceiver->updateReceiver();
|
||||
@@ -173,7 +173,7 @@ void SpoutImageProvider::internalDeinitialize() {
|
||||
}
|
||||
|
||||
Tile SpoutImageProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
spoutUpdate = true;
|
||||
return tiles[tileIndex.x];
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace {
|
||||
#include "temporaltileprovider_codegen.cpp"
|
||||
|
||||
std::string_view timeStringify(const std::string& format, const openspace::Time& t) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
constexpr int BufferSize = 64;
|
||||
ghoul_assert(format.size() < BufferSize, "Format string too long");
|
||||
@@ -165,7 +165,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary)
|
||||
, _useFixedTime(UseFixedTimeInfo, false)
|
||||
, _fixedTime(FixedTimeInfo)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -314,7 +314,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
Tile TemporalTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
if (!_currentTileProvider) {
|
||||
update();
|
||||
}
|
||||
@@ -389,7 +389,7 @@ float TemporalTileProvider::noDataValueAsFloat() {
|
||||
DefaultTileProvider TemporalTileProvider::createTileProvider(
|
||||
std::string_view timekey) const
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
std::string value;
|
||||
switch (_mode) {
|
||||
@@ -425,7 +425,7 @@ DefaultTileProvider TemporalTileProvider::createTileProvider(
|
||||
}
|
||||
|
||||
DefaultTileProvider* TemporalTileProvider::retrieveTileProvider(const Time& t) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const double time = t.j2000Seconds();
|
||||
if (const auto it = _tileProviderMap.find(time); it != _tileProviderMap.end()) {
|
||||
@@ -665,7 +665,7 @@ TileProvider* TemporalTileProvider::tileProvider(const Time& time) {
|
||||
TemporalTileProvider::InterpolateTileProvider::InterpolateTileProvider(
|
||||
const ghoul::Dictionary&)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
glGenFramebuffers(1, &fbo);
|
||||
glGenVertexArrays(1, &vaoQuad);
|
||||
@@ -712,7 +712,7 @@ TemporalTileProvider::InterpolateTileProvider::~InterpolateTileProvider() {
|
||||
}
|
||||
|
||||
Tile TemporalTileProvider::InterpolateTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
TracyGpuZone("tile");
|
||||
|
||||
// prev and next are the two tiles to interpolate between
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
/**
|
||||
* Provide <code>Tile</code>s from web map services that have temporal resolution.
|
||||
* Provide `Tile`s from web map services that have temporal resolution.
|
||||
*
|
||||
* TemporalTileProviders are instantiated using a ghoul::Dictionary, and must define a
|
||||
* filepath to a Openspace Temporal dataset description file. This is an xml-file that
|
||||
* defines the same meta data as the GDAL wms description
|
||||
* (http://www.gdal.org/frmt_wms.html), but augmented with some extra tags describing the
|
||||
* temporal properties of the dataset. See
|
||||
* <code>TemporalTileProvider::TemporalXMLTags</code>
|
||||
* `TemporalTileProvider::TemporalXMLTags`
|
||||
*/
|
||||
class TemporalTileProvider : public TileProvider {
|
||||
public:
|
||||
|
||||
@@ -39,7 +39,7 @@ TextTileProvider::TextTileProvider(TileTextureInitData initData_, size_t fontSiz
|
||||
: initData(std::move(initData_))
|
||||
, fontSize(fontSize_)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
tileCache = global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
}
|
||||
@@ -47,7 +47,7 @@ TextTileProvider::TextTileProvider(TileTextureInitData initData_, size_t fontSiz
|
||||
TextTileProvider::~TextTileProvider() {}
|
||||
|
||||
void TextTileProvider::internalInitialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
font = global::fontManager->font("Mono", static_cast<float>(fontSize));
|
||||
fontRenderer = ghoul::fontrendering::FontRenderer::createDefault();
|
||||
@@ -62,8 +62,8 @@ void TextTileProvider::internalDeinitialize() {
|
||||
Tile TextTileProvider::renderTile(const TileIndex& tileIndex, const std::string& text,
|
||||
const glm::vec2& position, const glm::vec4& color)
|
||||
{
|
||||
ZoneScoped
|
||||
TracyGpuZone("tile")
|
||||
ZoneScoped;
|
||||
TracyGpuZone("tile");
|
||||
|
||||
cache::ProviderTileKey key = { tileIndex, uniqueIdentifier };
|
||||
Tile tile = tileCache->get(key);
|
||||
@@ -101,7 +101,7 @@ Tile TextTileProvider::renderTile(const TileIndex& tileIndex, const std::string&
|
||||
}
|
||||
|
||||
void TextTileProvider::reset() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
tileCache->clear();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ TileIndexTileProvider::TileIndexTileProvider(const ghoul::Dictionary&)
|
||||
{}
|
||||
|
||||
Tile TileIndexTileProvider::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
std::string text = fmt::format(
|
||||
"level: {}\nx: {}\ny: {}", tileIndex.level, tileIndex.x, tileIndex.y
|
||||
);
|
||||
|
||||
@@ -73,7 +73,7 @@ std::unique_ptr<TileProvider> TileProvider::createFromDictionary(
|
||||
layers::Layer::ID layerTypeID,
|
||||
const ghoul::Dictionary& dictionary)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
std::string_view type = layers::Layers[static_cast<int>(layerTypeID)].identifier;
|
||||
|
||||
@@ -86,7 +86,7 @@ std::unique_ptr<TileProvider> TileProvider::createFromDictionary(
|
||||
}
|
||||
|
||||
void TileProvider::initializeDefaultTile() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(!DefaultTile.texture, "Default tile should not have been created");
|
||||
using namespace ghoul::opengl;
|
||||
@@ -118,10 +118,12 @@ void TileProvider::deinitializeDefaultTile() {
|
||||
DefaultTileTexture = nullptr;
|
||||
}
|
||||
|
||||
TileProvider::TileProvider() : properties::PropertyOwner({ "TileProvider" }) {}
|
||||
TileProvider::TileProvider() :
|
||||
properties::PropertyOwner({ "TileProvider", "Tile Provider" })
|
||||
{}
|
||||
|
||||
void TileProvider::initialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(!isInitialized, "TileProvider can only be initialized once");
|
||||
|
||||
@@ -145,7 +147,7 @@ void TileProvider::initialize() {
|
||||
}
|
||||
|
||||
void TileProvider::deinitialize() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
internalDeinitialize();
|
||||
}
|
||||
@@ -192,7 +194,7 @@ void TileProvider::internalInitialize() {}
|
||||
void TileProvider::internalDeinitialize() {}
|
||||
|
||||
ChunkTile TileProvider::chunkTile(TileIndex tileIndex, int parents, int maxParents) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(isInitialized, "TileProvider was not initialized");
|
||||
|
||||
@@ -216,7 +218,7 @@ ChunkTile TileProvider::chunkTile(TileIndex tileIndex, int parents, int maxParen
|
||||
}
|
||||
|
||||
ChunkTilePile TileProvider::chunkTilePile(TileIndex tileIndex, int pileSize) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
ghoul_assert(isInitialized, "TileProvider was not initialized");
|
||||
ghoul_assert(pileSize >= 0, "pileSize must be positive");
|
||||
|
||||
@@ -91,10 +91,9 @@ struct TileProvider : public properties::PropertyOwner {
|
||||
virtual Tile tile(const TileIndex& tileIndex) = 0;
|
||||
|
||||
/**
|
||||
* Returns the status of a <code>Tile</code>. The <code>Tile::Status</code>
|
||||
* corresponds the <code>Tile</code> that would be returned if the function
|
||||
* <code>tile</code> would be invoked with the same <code>TileIndex</code> argument at
|
||||
* this point in time.
|
||||
* Returns the status of a `Tile`. The `Tile::Status` corresponds the `Tile` that
|
||||
* would be returned if the function `tile` would be invoked with the same `TileIndex`
|
||||
* argument at this point in time.
|
||||
*/
|
||||
virtual Tile::Status tileStatus(const TileIndex& index) = 0;
|
||||
|
||||
@@ -118,13 +117,13 @@ struct TileProvider : public properties::PropertyOwner {
|
||||
virtual void reset() = 0;
|
||||
|
||||
/**
|
||||
* \return The minimum level as defined by the <code>TileIndex</code> that this
|
||||
* \return The minimum level as defined by the `TileIndex` that this
|
||||
* TileProvider is capable of providing.
|
||||
*/
|
||||
virtual int minLevel() = 0;
|
||||
|
||||
/**
|
||||
* \return The maximum level as defined by <code>TileIndex</code> that this
|
||||
* \return The maximum level as defined by `TileIndex` that this
|
||||
* TileProvider is able provide.
|
||||
*/
|
||||
virtual int maxLevel() = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ documentation::Documentation TileProviderByIndex::Documentation() {
|
||||
}
|
||||
|
||||
TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -108,7 +108,7 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) {
|
||||
}
|
||||
|
||||
Tile TileProviderByIndex::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
const auto it = _providers.find(tileIndex.hashKey());
|
||||
const bool hasProvider = it != _providers.end();
|
||||
return hasProvider ? it->second->tile(tileIndex) : Tile();
|
||||
|
||||
@@ -46,7 +46,7 @@ documentation::Documentation TileProviderByLevel::Documentation() {
|
||||
}
|
||||
|
||||
TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -107,7 +107,7 @@ void TileProviderByLevel::internalDeinitialize() {
|
||||
}
|
||||
|
||||
Tile TileProviderByLevel::tile(const TileIndex& tileIndex) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
TileProvider* provider = levelProvider(tileIndex.level);
|
||||
if (provider) {
|
||||
@@ -124,7 +124,7 @@ Tile::Status TileProviderByLevel::tileStatus(const TileIndex& index) {
|
||||
}
|
||||
|
||||
TileProvider* TileProviderByLevel::levelProvider(int level) const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (!_levelTileProviders.empty()) {
|
||||
int clampedLevel = glm::clamp(
|
||||
|
||||
@@ -479,7 +479,7 @@ double TimeQuantizer::computeSecondsFromResolution(const int valueIn, const char
|
||||
}
|
||||
|
||||
bool TimeQuantizer::quantize(Time& t, bool clamp) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
constexpr const char Format[] = "YYYY-MM-DDTHR:MN:SC.###";
|
||||
constexpr int BufferSize = sizeof(Format);
|
||||
@@ -551,7 +551,7 @@ bool TimeQuantizer::quantize(Time& t, bool clamp) {
|
||||
void TimeQuantizer::doFirstApproximation(DateTime& quantized, DateTime& unQ, double value,
|
||||
char unit)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
switch (unit) {
|
||||
case 'y':
|
||||
|
||||
Reference in New Issue
Block a user