Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"

#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

#include <random>
Expand Down Expand Up @@ -138,6 +139,10 @@ IFilter::PreflightResult AddBadDataFilter::preflightImpl(const DataStructure& da
resultOutputActions.value().appendAction(std::move(createAction));
}

// Inform users that the following arrays are going to be modified in place
// Cell Data is going to be modified
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, imgGeomPtr->getCellDataPath(), {});

// 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 @@ -6,6 +6,7 @@
#include "simplnx/Parameters/ChoicesParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

#include <string>
Expand Down Expand Up @@ -75,8 +76,13 @@ IFilter::UniquePointer AlignGeometriesFilter::clone() const
IFilter::PreflightResult AlignGeometriesFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
OutputActions actions;
return {std::move(actions)};
nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the moving geometry is going to be modified in place
auto pMovingGeomPath = filterArgs.value<DataPath>(k_MovingGeometry_Key);
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, pMovingGeomPath, {});

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "simplnx/Parameters/VectorParameter.hpp"
#include "simplnx/Utilities/DataArrayUtilities.hpp"
#include "simplnx/Utilities/DataGroupUtilities.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/GeometryHelpers.hpp"
#include "simplnx/Utilities/ImageRotationUtilities.hpp"
#include "simplnx/Utilities/Math/MatrixMath.hpp"
Expand Down Expand Up @@ -462,6 +463,9 @@ IFilter::PreflightResult ApplyTransformationToGeometryFilter::preflightImpl(cons
pCellAttributeMatrixPath.getTargetName())};
resultOutputActions.warnings().push_back(warning);
}

// For non-ImageGeom geometries, vertex data is modified in place
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, pSelectedGeometryPathValue, {});
}

// Are we saving the transform matrix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/BoolParameter.hpp"
#include "simplnx/Parameters/StringParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"
#include "simplnx/Utilities/StringInterpretationUtilities.hpp"

Expand Down Expand Up @@ -132,7 +133,12 @@ IFilter::PreflightResult ConditionalSetValueFilter::preflightImpl(const DataStru
__LINE__, removeValueString, fmt::underlying(inputDataObject->getDataObjectType())));
}

return {};
nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the following arrays are going to be modified in place
nx::core::MarkDataPathModified(dataStructure, resultOutputActions, selectedArrayPath);

return {std::move(resultOutputActions)};
}

Result<> ConditionalSetValueFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/MultiArraySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

using namespace nx::core;
Expand Down Expand Up @@ -97,6 +98,10 @@ IFilter::PreflightResult ErodeDilateCoordinationNumberFilter::preflightImpl(cons
nx::core::Result<OutputActions> resultOutputActions;
std::vector<PreflightValue> preflightUpdatedValues;

// Inform users that the following arrays are going to be modified in place
// Cell Data is going to be modified
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, pFeatureIdsArrayPathValue.getParent(), pIgnoredDataArrayPathsValue);

// 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 @@ -9,6 +9,7 @@
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

using namespace nx::core;
Expand Down Expand Up @@ -84,7 +85,15 @@ IFilter::UniquePointer ErodeDilateMaskFilter::clone() const
IFilter::PreflightResult ErodeDilateMaskFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
return {};
auto pMaskArrayPathValue = filterArgs.value<DataPath>(k_MaskArrayPath_Key);

nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the following arrays are going to be modified in place
// Mask array is going to be modified
nx::core::MarkDataPathModified(dataStructure, resultOutputActions, pMaskArrayPathValue);

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/MultiArraySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

using namespace nx::core;
Expand Down Expand Up @@ -107,6 +108,12 @@ IFilter::PreflightResult FillBadDataFilter::preflightImpl(const DataStructure& d
preflightUpdatedValues.emplace_back(PreflightValue{"Feature Data Modification Warning", featureModificationWarning});
resultOutputActions.warnings().push_back(Warning{-14600, featureModificationWarning});

// Inform users that the following arrays are going to be modified in place
// Cell Data is going to be modified
auto featureIdsPath = filterArgs.value<DataPath>(k_CellFeatureIdsArrayPath_Key);
auto ignoredDataArrayPaths = filterArgs.value<MultiArraySelectionParameter::ValueType>(k_IgnoredDataArrayPaths_Key);
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, featureIdsPath.getParent(), ignoredDataArrayPaths);

return {std::move(resultOutputActions), std::move(preflightUpdatedValues)};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ IFilter::PreflightResult InitializeDataFilter::preflightImpl(const DataStructure
}
}

// Inform users that the following arrays are going to be modified in place
nx::core::MarkDataPathModified(dataStructure, resultOutputActions, filterArgs.value<DataPath>(k_ArrayPath_Key));

return {std::move(resultOutputActions), std::move(preflightUpdatedValues)};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ IFilter::PreflightResult InitializeImageGeomCellDataFilter::preflightImpl(const
resultOutputActions.value().appendAction(std::move(createAction));
}

// Inform users that the following arrays are going to be modified in place
for(const DataPath& path : cellArrayPaths)
{
nx::core::MarkDataPathModified(dataStructure, resultOutputActions, path);
}

return {std::move(resultOutputActions)};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/MessageHelper.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

Expand Down Expand Up @@ -86,6 +87,7 @@ IFilter::UniquePointer IterativeClosestPointFilter::clone() const
IFilter::PreflightResult IterativeClosestPointFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
auto movingVertexPath = filterArgs.value<DataPath>(k_MovingVertexPath_Key);
auto numIterations = filterArgs.value<uint64>(k_NumIterations_Key);
auto transformArrayPath = filterArgs.value<DataPath>(k_TransformArrayPath_Key);

Expand All @@ -97,10 +99,17 @@ IFilter::PreflightResult IterativeClosestPointFilter::preflightImpl(const DataSt

auto action = std::make_unique<CreateArrayAction>(DataType::float32, std::vector<usize>{4, 4}, std::vector<usize>{1}, transformArrayPath);

OutputActions actions;
actions.appendAction(std::move(action));
nx::core::Result<OutputActions> resultOutputActions;
resultOutputActions.value().appendAction(std::move(action));

return {std::move(actions)};
// If the transformation will be applied, the moving geometry's vertices are modified in place
auto applyTransformation = filterArgs.value<bool>(k_ApplyTransformation_Key);
if(applyTransformation)
{
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, movingVertexPath, {});
}

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "simplnx/Parameters/DataPathSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

using namespace nx::core;
Expand Down Expand Up @@ -96,7 +97,14 @@ IFilter::UniquePointer LaplacianSmoothingFilter::clone() const
IFilter::PreflightResult LaplacianSmoothingFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
return {};
auto pTriangleGeomPath = filterArgs.value<DataPath>(k_TriangleGeometryDataPath_Key);

nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the geometry vertex coordinates are going to be modified in place
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, pTriangleGeomPath, {});

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Utilities/ClusteringUtilities.hpp"
#include "simplnx/Utilities/DataGroupUtilities.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"

#include <stdexcept>

Expand Down Expand Up @@ -82,7 +83,18 @@ IFilter::UniquePointer RandomizeFeatureIdsFilter::clone() const
IFilter::PreflightResult RandomizeFeatureIdsFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
return {};
auto featureIdsPath = filterArgs.value<DataPath>(k_FeatureIdsPath_Key);
auto featureAMPath = filterArgs.value<DataPath>(k_FeatureAMPath_Key);

nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the following arrays are going to be modified in place
// FeatureIds array is going to be remapped
nx::core::MarkDataPathModified(dataStructure, resultOutputActions, featureIdsPath);
// Feature Attribute Matrix arrays are going to be reordered
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, featureAMPath, {});

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ IFilter::PreflightResult RequireMinimumSizeFeaturesFilter::preflightImpl(const D
return result;
}

// Inform users that the following arrays are going to be modified in place
// Cell Data is going to be modified
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, featureIdsPath.getParent(), {});

// 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 @@ -5,6 +5,7 @@
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"

#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/SIMPLConversion.hpp"

#include "simplnx/Utilities/ParallelDataAlgorithm.hpp"
Expand Down Expand Up @@ -112,7 +113,15 @@ IFilter::UniquePointer ReverseTriangleWindingFilter::clone() const
IFilter::PreflightResult ReverseTriangleWindingFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler,
const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const
{
return {};
auto pTriGeomPathValue = filterArgs.value<DataPath>(k_TriGeomPath_Key);

nx::core::Result<OutputActions> resultOutputActions;

// Inform users that the following arrays are going to be modified in place
// Triangle geometry face list is going to be modified
nx::core::AppendDataObjectModifications(dataStructure, resultOutputActions.value().modifiedActions, pTriGeomPathValue, {});

return {std::move(resultOutputActions)};
}

//------------------------------------------------------------------------------
Expand Down
Loading