Skip to content

Commit

Permalink
Store DataObject::Type in the DataObjectModification struct.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Oct 25, 2023
1 parent 17a2a05 commit 58b2165
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ IFilter::PreflightResult RotateEulerRefFrameFilter::preflightImpl(const DataStru

std::vector<PreflightValue> 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)};
Expand Down
14 changes: 5 additions & 9 deletions src/complex/Filter/Output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/complex/Utilities/FilterUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Result<> CreateOutputDirectories(const fs::path& outputPath)
void AppendDataObjectModifications(const DataStructure& dataStructure, std::vector<DataObjectModification>& modifiedActions, const DataPath& parentPath, const std::vector<DataPath>& ignoredDataPaths)
{
std::optional<std::vector<DataPath>> 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()});
}
}

Expand Down

0 comments on commit 58b2165

Please sign in to comment.