mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-02 17:51:35 -06:00
Use more filesystem::path where applicable
This commit is contained in:
@@ -42,7 +42,7 @@ namespace {
|
||||
|
||||
namespace openspace {
|
||||
|
||||
TransferFunction::TransferFunction(const std::string& filepath,
|
||||
TransferFunction::TransferFunction(const std::filesystem::path& filepath,
|
||||
TfChangedCallback tfChangedCallback)
|
||||
: _filepath(filepath)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ TransferFunction::TransferFunction(const std::string& filepath,
|
||||
|
||||
TransferFunction::~TransferFunction() {}
|
||||
|
||||
void TransferFunction::setPath(const std::string& filepath) {
|
||||
void TransferFunction::setPath(const std::filesystem::path& filepath) {
|
||||
if (_file) {
|
||||
_file = nullptr;
|
||||
}
|
||||
@@ -95,11 +95,10 @@ void TransferFunction::setCallback(TfChangedCallback callback) {
|
||||
}
|
||||
|
||||
void TransferFunction::setTextureFromTxt() {
|
||||
std::ifstream in;
|
||||
in.open(_filepath);
|
||||
std::ifstream in = std::ifstream(_filepath);
|
||||
|
||||
if (!in.is_open()) {
|
||||
throw ghoul::FileNotFoundError(_filepath.string());
|
||||
throw ghoul::FileNotFoundError(_filepath);
|
||||
}
|
||||
|
||||
int width = 512;
|
||||
@@ -209,7 +208,7 @@ void TransferFunction::setTextureFromTxt() {
|
||||
}
|
||||
|
||||
void TransferFunction::setTextureFromImage() {
|
||||
_texture = ghoul::io::TextureReader::ref().loadTexture(_filepath.string(), 1);
|
||||
_texture = ghoul::io::TextureReader::ref().loadTexture(_filepath, 1);
|
||||
_texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user