@@ -99,6 +99,9 @@ Parameters RegularGridSampleSurfaceMeshFilter::parameters() const
9999 params.insert (std::make_unique<GeometrySelectionParameter>(k_ExistingImageGeomPath_Key, " Image Geometry" , " The path to the existing image geometry to use" , DataPath{},
100100 GeometrySelectionParameter::AllowedTypes{GeometrySelectionParameter::AllowedType::Image}));
101101
102+ params.insert (std::make_unique<ArraySelectionParameter>(k_SurfaceMeshPartNumbersArrayPath_Key, " Part Numbers" , " Array specifying the part number that the triangle belongs to." , DataPath{},
103+ ArraySelectionParameter::AllowedTypes{nx::core::DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1 }}));
104+
102105 params.insertSeparator (Parameters::Separator{" Output Image Geometry" });
103106 params.insert (std::make_unique<DataGroupCreationParameter>(k_ImageGeomPath_Key, " Image Geometry" , " The name and path for the image geometry to be created" , DataPath{}));
104107 params.insertSeparator (Parameters::Separator{" Output Cell Attribute Matrix" });
@@ -145,8 +148,8 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const
145148 auto triangleGeometryPath = filterArgs.value <DataPath>(k_TriangleGeometryPath_Key);
146149 auto geometryOptionIndex = filterArgs.value <ChoicesParameter::ValueType>(k_UseExistingGeometry_Key);
147150 auto existingImageGeomPathValue = filterArgs.value <DataPath>(k_ExistingImageGeomPath_Key);
148-
149151 GeometryOption geometryOption = ConvertIndexToGeometryOption (geometryOptionIndex);
152+ auto partNumbersPath = filterArgs.value <DataPath>(k_SurfaceMeshPartNumbersArrayPath_Key);
150153
151154 nx::core::Result<OutputActions> resultOutputActions;
152155 std::vector<PreflightValue> preflightUpdatedValues;
@@ -203,7 +206,6 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const
203206 DataPath pSliceDataContainerNameValue ({fmt::format (" .{}_sliced" , triangleGeometryPath.getTargetName ())});
204207 std::string pEdgeAttributeMatrixNameValue (" EdgeAttributeMatrix" );
205208 std::string pSliceIdArrayNameValue (" SliceIds" );
206- DataPath pRegionIdArrayPathValue ({" NOT USED" });
207209 std::string pSliceAttributeMatrixNameValue (" SliceAttributeMatrix" );
208210 // create the edge geometry
209211 {
@@ -225,9 +227,13 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const
225227 auto createAttributeMatrixAction = std::make_unique<CreateAttributeMatrixAction>(featureSliceAttrMatPath, tDims);
226228 resultOutputActions.value ().appendAction (std::move (createAttributeMatrixAction));
227229 }
228-
229- auto deferredDeleteGeometryAction = std::make_unique<DeleteDataAction>(pSliceDataContainerNameValue);
230- resultOutputActions.value ().appendDeferredAction (std::move (deferredDeleteGeometryAction));
230+ {
231+ DataPath path = pSliceDataContainerNameValue.createChildPath (pEdgeAttributeMatrixNameValue).createChildPath (partNumbersPath.getTargetName ());
232+ auto createArray = std::make_unique<CreateArrayAction>(DataType::int32, tDims, compDims, path);
233+ resultOutputActions.value ().appendAction (std::move (createArray));
234+ }
235+ // auto deferredDeleteGeometryAction = std::make_unique<DeleteDataAction>(pSliceDataContainerNameValue);
236+ // resultOutputActions.value().appendDeferredAction(std::move(deferredDeleteGeometryAction));
231237 }
232238 // ///////////////////////////////////////////////////////////////////////////
233239
@@ -269,6 +275,9 @@ Result<> RegularGridSampleSurfaceMeshFilter::executeImpl(DataStructure& dataStru
269275
270276 inputValues.TriangleGeometryPath = filterArgs.value <DataPath>(k_TriangleGeometryPath_Key);
271277 inputValues.SurfaceMeshFaceLabelsArrayPath = filterArgs.value <DataPath>(k_SurfaceMeshFaceLabelsArrayPath_Key);
278+ // inputValues.FeatureIdsArrayPath =
279+ // filterArgs.value<DataPath>(k_ImageGeomPath_Key).createChildPath(filterArgs.value<std::string>(k_CellAMName_Key)).createChildPath(filterArgs.value<std::string>(k_FeatureIdsArrayName_Key));
280+ inputValues.SurfaceMeshPartIdsArrayPath = filterArgs.value <DataPath>(k_SurfaceMeshPartNumbersArrayPath_Key);
272281
273282 return RegularGridSampleSurfaceMesh (dataStructure, messageHandler, shouldCancel, &inputValues)();
274283}
0 commit comments