Use more filesystem::path where applicable

This commit is contained in:
Alexander Bock
2024-04-06 19:50:39 +02:00
parent 2af06fb641
commit 4328476d26
148 changed files with 712 additions and 705 deletions
@@ -203,7 +203,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(Fadeable::_opacity);
_speckFile = absPath(p.file).string();
_speckFile = absPath(p.file);
_drawElements.onChange([this]() { _hasSpeckFile = !_hasSpeckFile; });
addProperty(_drawElements);
@@ -230,7 +230,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_lineWidth);
if (p.labelFile.has_value()) {
_labelFile = absPath(*p.labelFile).string();
_labelFile = absPath(*p.labelFile);
_hasLabel = true;
_drawLabels = p.drawLabels.value_or(_drawLabels);
@@ -456,8 +456,7 @@ bool RenderableDUMeshes::loadData() {
}
}
const std::string labelFile = _labelFile;
if (!labelFile.empty()) {
if (!_labelFile.empty()) {
_labelset = dataloader::label::loadFileWithCache(_labelFile);
}
@@ -37,6 +37,7 @@
#include <openspace/util/distanceconversion.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <filesystem>
#include <unordered_map>
namespace ghoul::filesystem { class File; }
@@ -124,8 +125,8 @@ private:
color) _uniformCache;
std::shared_ptr<ghoul::fontrendering::Font> _font = nullptr;
std::string _speckFile;
std::string _labelFile;
std::filesystem::path _speckFile;
std::filesystem::path _labelFile;
DistanceUnit _unit = DistanceUnit::Parsec;
@@ -494,7 +494,7 @@ void RenderablePlanesCloud::update(const UpdateData&) {
void RenderablePlanesCloud::loadTextures() {
for (const dataloader::Dataset::Texture& tex : _dataset.textures) {
std::filesystem::path fullPath = absPath(_texturesPath.string() + '/' + tex.file);
std::filesystem::path fullPath = absPath(_texturesPath / tex.file);
std::filesystem::path pngPath = fullPath;
pngPath.replace_extension(".png");
@@ -513,7 +513,7 @@ void RenderablePlanesCloud::loadTextures() {
}
std::unique_ptr<ghoul::opengl::Texture> t =
ghoul::io::TextureReader::ref().loadTexture(path.string(), 2);
ghoul::io::TextureReader::ref().loadTexture(path, 2);
if (t) {
LINFOC("RenderablePlanesCloud", std::format("Loaded texture '{}'", path));