mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 22:40:41 -05:00
Change data loader i/o directories
This commit is contained in:
@@ -65,34 +65,14 @@ constexpr const char *KeyMin = "Min";
|
||||
constexpr const char *KeyMax = "Max";
|
||||
}
|
||||
|
||||
// namespace {
|
||||
// static const openspace::properties::Property::PropertyInfo ReadVolumesTriggerInfo = {
|
||||
// "ReadVolumesTrigger",
|
||||
// "Trigger load volume data files",
|
||||
// "If this property is triggered it will call the function to load volume data"
|
||||
// };
|
||||
|
||||
// static const openspace::properties::Property::PropertyInfo ReadFieldlinesTriggerInfo = {
|
||||
// "ReadFieldlinesTrigger",
|
||||
// "Trigger load fieldline data files",
|
||||
// "If this property is triggered it will call the function to load fieldline data"
|
||||
// };
|
||||
// }
|
||||
|
||||
namespace openspace::dataloader
|
||||
{
|
||||
|
||||
Reader::Reader()
|
||||
: PropertyOwner({"Reader"})
|
||||
// , _readVolumesTrigger(ReadVolumesTriggerInfo)
|
||||
{
|
||||
_topDir = ghoul::filesystem::Directory("${DATA}/.internal", RawPath::No);
|
||||
|
||||
// _readVolumesTrigger.onChange([this](){
|
||||
// readVolumeDataItems();
|
||||
// });
|
||||
|
||||
// addProperty(_readVolumesTrigger);
|
||||
_generatedDir = ghoul::filesystem::Directory("${DATA}/generated", RawPath::No);
|
||||
_internalDir = ghoul::filesystem::Directory("${DATA}/.internal", RawPath::No);
|
||||
}
|
||||
|
||||
void Reader::readVolumeDataItems()
|
||||
@@ -123,42 +103,18 @@ void Reader::readVolumeDataItems()
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// Store a reference somehow if necessary
|
||||
}
|
||||
|
||||
std::string Reader::readTransferFunctionPresets()
|
||||
{
|
||||
Directory d(_topDir.path() + ghoul::filesystem::FileSystem::PathSeparator + "tf_presets", RawPath::Yes);
|
||||
Directory d(_internalDir.path() + ghoul::filesystem::FileSystem::PathSeparator + "tf_presets", RawPath::Yes);
|
||||
|
||||
std::vector<std::string> tfFiles = d.readFiles(Recursive::No, Sort::No);
|
||||
std::vector<std::pair<std::string, std::string>> tfLinkList;
|
||||
|
||||
// Put last line of transferfunction preset files together with file path in tfLinkList
|
||||
// for (auto file : tfFiles)
|
||||
// {
|
||||
// std::ifstream in;
|
||||
// in.open(file);
|
||||
// if (in.is_open())
|
||||
// {
|
||||
// std::vector<std::string> lines;
|
||||
// copy(std::istream_iterator<std::string>(in),
|
||||
// std::istream_iterator<std::string>(),
|
||||
// back_inserter(lines));
|
||||
// tfLinkList.push_back(std::make_pair(file, lines.back()));
|
||||
// }
|
||||
// in.close();
|
||||
// }
|
||||
|
||||
// auto j = json::array();
|
||||
// for (auto pair : tfLinkList)
|
||||
// {
|
||||
// j.push_back(json::object({{"path", pair.first}, {"image", pair.second}}));
|
||||
// }
|
||||
|
||||
json j;
|
||||
|
||||
unsigned int jsonIdx = 0;
|
||||
|
||||
for (auto file : tfFiles)
|
||||
{
|
||||
File fileHandle = File(file);
|
||||
@@ -200,7 +156,7 @@ std::string Reader::readTransferFunctionPresets()
|
||||
Directory Reader::getVolumeDir()
|
||||
{
|
||||
return Directory(
|
||||
_topDir.path() +
|
||||
_generatedDir.path() +
|
||||
ghoul::filesystem::FileSystem::PathSeparator +
|
||||
"volumes_from_cdf");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user