diff --git a/data/assets/scene/solarsystem/heliosphere/cutplane/test.asset b/data/assets/scene/solarsystem/heliosphere/cutplane/test.asset new file mode 100644 index 0000000000..d9cbbd71fb --- /dev/null +++ b/data/assets/scene/solarsystem/heliosphere/cutplane/test.asset @@ -0,0 +1,40 @@ +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local path = "C:/Users/eolsson/Documents/openspace/data/2012/3d__var_1_e20120714-160000-000.out.cdf" + +local cutplane = { + Identifier = "Test-cutplane", + Parent = transforms.Earth, + Renderable = { + Type = "RenderableCutPlane", + Input = path, + Size = {100000, 100000}, + DataProperty = "T" + }, + GUI = { + Name = "Volume Slicer", + Path = "/Solar System/Heliosphere", + Description = [[]] + } +} + + +asset.onInitialize(function() + openspace.addSceneGraphNode(cutplane) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(cutplane) +end) + +asset.export(cutplane) + + + +asset.meta = { + Name = "Volume slicer creating cut plane of CDF volume data", + Version = "1.0", + Description = [[Volume slicer creating cut plane of CDF volume data]], + Author = "CCMC, OpenSpace team", + URL = "", + License = "CC-BY" +} diff --git a/modules/base/rendering/renderablecutplane.cpp b/modules/base/rendering/renderablecutplane.cpp index bb92d18aff..156f12d804 100644 --- a/modules/base/rendering/renderablecutplane.cpp +++ b/modules/base/rendering/renderablecutplane.cpp @@ -25,9 +25,12 @@ #include #include #include +#include #include namespace { +constexpr std::string_view _loggerCat = "RenderableCutPlane"; + constexpr openspace::properties::Property::PropertyInfo FilePathInfo = { "FilePath", "Filepath to the file to create texture from", @@ -66,31 +69,18 @@ RenderableCutPlane::RenderableCutPlane(const ghoul::Dictionary& dictionary) { const Parameters p = codegen::bake(dictionary); - _inputPath = absPath(p.input.string()); + _inputPath = absPath(p.input); _dataProperty = p.dataProperty; } void RenderableCutPlane::initialize() { - -} - -void RenderableCutPlane::initializeGL() { - - //kameleonvolume::KameleonVolumeReader volumeReader(_inputPath.string()); - - std::string _path = "C:/Users/alundkvi/Documents/work/data/Tracing/cdf/3d__var_1_e20230323-000000-000.out.cdf"; + if (!std::filesystem::is_regular_file(_inputPath)) { + throw ghoul::FileNotFoundError(_inputPath.string()); + } std::unique_ptr kameleon = kameleonHelper::createKameleonObject( _inputPath.string() ); - - - if (!std::filesystem::is_regular_file( - _inputPath)) { - throw ghoul::FileNotFoundError( - _inputPath.string()); - } - long status = kameleon->open(_inputPath.string()); if (status != ccmc::FileReader::OK) { throw ghoul::RuntimeError(fmt::format( @@ -99,20 +89,21 @@ void RenderableCutPlane::initializeGL() { )); } - std::cout << "Model name: " << kameleon->getModelName() << std::endl; + LINFO(fmt::format("Model name: '{}'", kameleon->getModelName())); std::cout << "Filename: " << kameleon->getCurrentFilename() << std::endl; std::cout << "Number of variables: " << kameleon->getNumberOfVariables() << std::endl; std::cout << "Number of variable attributes: " << kameleon->getNumberOfVariableAttributes() << std::endl; std::cout << "Current time: " << kameleon->getCurrentTime() << std::endl; - //long status; - //status = _kameleon->open("C:/Users/alundkvi/Documents/work/data/Tracing/cdf/3d__var_1_e20230323-000000-000.out.cdf"); - // Load cdf file //Extract slice from data } +void RenderableCutPlane::initializeGL() { + +} + void RenderableCutPlane::deinitializeGL() { //RenderablePlane::deinitializeGL();