Commit 76fb3c76 authored by Jan Kremer's avatar Jan Kremer

Made the file path of the data set relative to the project dir.

parent 74a5ea16
......@@ -10,3 +10,4 @@
/Plugins/PointCloudPlugin/Intermediate
/Saved/Config/Windows/EditorPerProjectUserSettings.ini
/Intermediate/ProjectFiles
/Resources/*.h5part
// Fill out your copyright notice in the Description page of Project Settings.
#include "HDF5Library.h"
#include "Runtime/Core/Public/Misc/Paths.h"
#include "Runtime/Core/Public/GenericPlatform/GenericPlatformFile.h"
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("D:\\HDF Test\\data.h5part");
bool UHDF5Library::TestHDF5(TArray<float>& X, TArray<float>& Y, TArray<float>& Z, TArray<float>& U, TArray<float>& V, TArray<float>& W)
{
/*
......@@ -19,7 +17,19 @@ bool UHDF5Library::TestHDF5(TArray<float>& X, TArray<float>& Y, TArray<float>& Z
/*
* Open the file and group
*/
H5File file(FILE_NAME, H5F_ACC_RDONLY);
FString relpath = FPaths::ProjectDir();
TCHAR *dirname = TEXT("Resources");
relpath.PathAppend(dirname, _tcslen(dirname));
TCHAR *filename = TEXT("data.h5part");
relpath.PathAppend(filename, _tcslen(filename));
FString abspath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*relpath);
char* pathAsCharArray = TCHAR_TO_ANSI(*abspath);
H5File file(pathAsCharArray, H5F_ACC_RDONLY);
Group group = file.openGroup("Step#150");
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment