From 58b216546a533e87165a560bf7b380b45ec20e70 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Tue, 24 Oct 2023 14:39:56 -0400 Subject: [PATCH] Store DataObject::Type in the DataObjectModification struct. Signed-off-by: Michael Jackson --- .../BadDataNeighborOrientationCheckFilter.cpp | 3 ++- .../Filters/RotateEulerRefFrameFilter.cpp | 3 ++- src/complex/Filter/Output.hpp | 14 +++++--------- src/complex/Utilities/FilterUtilities.cpp | 4 ++-- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.cpp index f205c7e7ee..58b4cf21f3 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.cpp @@ -189,7 +189,8 @@ IFilter::PreflightResult BadDataNeighborOrientationCheckFilter::preflightImpl(co fmt::format("The following DataArrays all must have equal number of tuples but this was not satisfied.\n{}", tupleValidityCheck.error()))}; } - resultOutputActions.value().modifiedActions.emplace_back(DataObjectModification{pGoodVoxelsArrayPathValue, DataObjectModification::ModifiedType::DataArrayModified}); + resultOutputActions.value().modifiedActions.emplace_back( + DataObjectModification{pGoodVoxelsArrayPathValue, DataObjectModification::ModifiedType::Modified, dataStructure.getData(pGoodVoxelsArrayPathValue)->getDataObjectType()}); // Return both the resultOutputActions and the preflightUpdatedValues via std::move() return {std::move(resultOutputActions), std::move(preflightUpdatedValues)}; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.cpp index ed05d7b911..a625bf8118 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.cpp @@ -74,7 +74,8 @@ IFilter::PreflightResult RotateEulerRefFrameFilter::preflightImpl(const DataStru std::vector preflightUpdatedValues; - resultOutputActions.value().modifiedActions.emplace_back(DataObjectModification{pCellEulerAnglesArrayPathValue, DataObjectModification::ModifiedType::DataArrayModified}); + resultOutputActions.value().modifiedActions.emplace_back( + DataObjectModification{pCellEulerAnglesArrayPathValue, DataObjectModification::ModifiedType::Modified, dataStructure.getData(pCellEulerAnglesArrayPathValue)->getDataObjectType()}); // Return both the resultOutputActions and the preflightUpdatedValues via std::move() return {std::move(resultOutputActions), std::move(preflightUpdatedValues)}; diff --git a/src/complex/Filter/Output.hpp b/src/complex/Filter/Output.hpp index 25b5349461..25e1df639f 100644 --- a/src/complex/Filter/Output.hpp +++ b/src/complex/Filter/Output.hpp @@ -115,18 +115,14 @@ struct COMPLEX_EXPORT DataObjectModification enum class ModifiedType : uint64 { - DataArrayModified = 0, - DataArrayPossiblyDeleted = 1, - AttributeMatrixModified = 2, - DataGroupModified = 3, - AttributeMatrixPossiblyDeleted = 4, - DataGroupPossiblyDeleted = 5, - GeometryModified = 6, - GeometryPossiblyDeleted = 7 + Modified = 0, + PossiblyDeleted = 1, + Unknown = 2, }; DataPath modifiedPath; - ModifiedType modifiedType; + ModifiedType modifiedType = ModifiedType::Unknown; + DataObject::Type dataObjectType = DataObject::Type::Unknown; }; /** diff --git a/src/complex/Utilities/FilterUtilities.cpp b/src/complex/Utilities/FilterUtilities.cpp index c7616bbb58..5365fb2d21 100644 --- a/src/complex/Utilities/FilterUtilities.cpp +++ b/src/complex/Utilities/FilterUtilities.cpp @@ -28,14 +28,14 @@ Result<> CreateOutputDirectories(const fs::path& outputPath) void AppendDataObjectModifications(const DataStructure& dataStructure, std::vector& modifiedActions, const DataPath& parentPath, const std::vector& ignoredDataPaths) { std::optional> result = complex::GetAllChildArrayDataPaths(dataStructure, parentPath, ignoredDataPaths); - if(result->empty()) + if(!result) { return; } for(const auto& child : result.value()) { - modifiedActions.push_back(DataObjectModification{child, DataObjectModification::ModifiedType::DataArrayModified}); + modifiedActions.push_back(DataObjectModification{child, DataObjectModification::ModifiedType::Modified, dataStructure.getDataRef(child).getDataObjectType()}); } }