Skip to content

Commit

Permalink
ENH: Use more specific parameters instead of generic parameters. (#1165)
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Kleingers <[email protected]>
  • Loading branch information
joeykleingers authored Dec 20, 2024
1 parent 6e8df9c commit ddcd126
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ Parameters ComputeTriangleGeomShapesFilter::parameters() const
ArraySelectionParameter::AllowedTypes{nx::core::DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{2}}));

params.insertSeparator(Parameters::Separator{"Input Face Feature Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix",
"The DataPath to the AttributeMatrix that holds feature data for the faces", DataPath({"TriangleDataContainer", "Face Feature Data"}),
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(
k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix", "The DataPath to the AttributeMatrix that holds feature data for the faces",
DataPath({"TriangleDataContainer", "Face Feature Data"}), DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<ArraySelectionParameter>(k_CentroidsArrayPath_Key, "Face Feature Centroids", "Input DataPath to the **Feature Centroids** for the face data",
DataPath({"Face Feature Data", "Centroids"}), ArraySelectionParameter::AllowedTypes{DataType::float32}));
params.insert(std::make_unique<ArraySelectionParameter>(k_VolumesArrayPath_Key, "Face Feature Volumes", "Input DataPath to the **Feature Volumes** for the face data",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "simplnx/Filter/Actions/CreateVertexGeometryAction.hpp"
#include "simplnx/Parameters/DataGroupCreationParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/DataPathSelectionParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"
#include "simplnx/Parameters/NumberParameter.hpp"
#include "simplnx/Parameters/VectorParameter.hpp"

Expand Down Expand Up @@ -67,7 +67,8 @@ Parameters ApproximatePointCloudHullFilter::parameters() const
params.insert(std::make_unique<UInt64Parameter>(k_MinEmptyNeighbors_Key, "Minimum Number of Empty Neighbors", "Minimum number of empty neighbors", 0));

params.insertSeparator(Parameters::Separator{"Input Vertex Geometry"});
params.insert(std::make_unique<DataPathSelectionParameter>(k_VertexGeomPath_Key, "Vertex Geometry", "Path to the target Vertex geometry", DataPath()));
params.insert(std::make_unique<GeometrySelectionParameter>(k_VertexGeomPath_Key, "Vertex Geometry", "Path to the target Vertex geometry", DataPath(),
GeometrySelectionParameter::AllowedTypes{IGeometry::Type::Vertex}));

params.insertSeparator(Parameters::Separator{"Output Vertex Geometry"});
params.insert(std::make_unique<DataGroupCreationParameter>(k_HullVertexGeomPath_Key, "Hull Vertex Geometry", "Path to create the hull Vertex geometry", DataPath{}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArrayCreationParameter.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/DataPathSelectionParameter.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"

#include <optional>
Expand Down Expand Up @@ -141,8 +140,8 @@ Parameters ComputeDifferencesMapFilter::parameters() const
Parameters params;

params.insertSeparator(Parameters::Separator{"Input Parameter(s)"});
params.insert(std::make_unique<DataPathSelectionParameter>(k_FirstInputArrayPath_Key, "First Input Array", "DataPath to the first input DataArray", DataPath{}));
params.insert(std::make_unique<DataPathSelectionParameter>(k_SecondInputArrayPath_Key, "Second Input Array", "DataPath to the second input DataArray", DataPath{}));
params.insert(std::make_unique<ArraySelectionParameter>(k_FirstInputArrayPath_Key, "First Input Array", "DataPath to the first input DataArray", DataPath{}, GetAllDataTypes()));
params.insert(std::make_unique<ArraySelectionParameter>(k_SecondInputArrayPath_Key, "Second Input Array", "DataPath to the second input DataArray", DataPath{}, GetAllDataTypes()));
params.insert(std::make_unique<ArrayCreationParameter>(k_DifferenceMapArrayPath_Key, "Difference Map", "DataPath for created Difference Map DataArray", DataPath{}));
return params;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"

#include "simplnx/Utilities/SIMPLConversion.hpp"

Expand Down Expand Up @@ -54,9 +53,8 @@ Parameters ComputeFeatureRectFilter::parameters() const
params.insertSeparator(Parameters::Separator{"Input Data Objects"});
params.insert(std::make_unique<ArraySelectionParameter>(k_FeatureIdsArrayPath_Key, "Cell Feature Ids", "Data Array that specifies to which Feature each Element belongs", DataPath{{"FeatureIds"}},
ArraySelectionParameter::AllowedTypes{nx::core::DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}}));
params.insert(std::make_unique<DataGroupSelectionParameter>(k_FeatureDataAttributeMatrixPath_Key, "Feature Data Attribute Matrix",
"The path to the feature data attribute matrix associated with the input feature ids array", DataPath{},
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_FeatureDataAttributeMatrixPath_Key, "Feature Data Attribute Matrix",
"The path to the feature data attribute matrix associated with the input feature ids array", DataPath{}));
params.insertSeparator(Parameters::Separator{"Output Data Object(s)"});
params.insert(std::make_unique<DataObjectNameParameter>(k_FeatureRectArrayName_Key, "Feature Rect", "The feature rect calculated from the feature ids", "FeatureRect"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"

#include "simplnx/Utilities/SIMPLConversion.hpp"

Expand Down Expand Up @@ -56,9 +55,9 @@ Parameters ComputeNumFeaturesFilter::parameters() const
DataPath({"DataContainer", "Feature Data", "Phases"}), nx::core::GetAllDataTypes()));

params.insertSeparator(Parameters::Separator{"Input Ensemble Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_EnsembleAttributeMatrixPath_Key, "Ensemble Attribute Matrix",
"The path to the ensemble attribute matrix where the number of features array will be stored",
DataPath({"DataContainer", "Ensemble Data"}), DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_EnsembleAttributeMatrixPath_Key, "Ensemble Attribute Matrix",
"The path to the ensemble attribute matrix where the number of features array will be stored",
DataPath({"DataContainer", "Ensemble Data"})));

params.insertSeparator(Parameters::Separator{"Output Ensemble Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_NumFeaturesArrayName_Key, "Number of Features", "The number of Features that belong to each Ensemble", "Number of Features"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "ComputeSurfaceFeaturesFilter.hpp"
#include <simplnx/Parameters/DataGroupSelectionParameter.hpp>

#include "simplnx/Common/Array.hpp"
#include "simplnx/DataStructure/DataPath.hpp"
Expand All @@ -7,7 +8,6 @@
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/BoolParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"

Expand Down Expand Up @@ -239,9 +239,8 @@ Parameters ComputeSurfaceFeaturesFilter::parameters() const
params.insert(std::make_unique<ArraySelectionParameter>(k_CellFeatureIdsArrayPath_Key, "Cell Feature Ids", "Specifies to which Feature each cell belongs", DataPath({"Cell Data", "FeatureIds"}),
ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}}));
params.insertSeparator(Parameters::Separator{"Input Cell Feature Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_CellFeatureAttributeMatrixPath_Key, "Feature Attribute Matrix",
"The path to the cell feature attribute matrix associated with the input feature ids array", DataPath{},
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_CellFeatureAttributeMatrixPath_Key, "Feature Attribute Matrix",
"The path to the cell feature attribute matrix associated with the input feature ids array", DataPath{}));
params.insertSeparator(Parameters::Separator{"Output Feature Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_SurfaceFeaturesArrayName_Key, "Surface Features",
"The created surface features array. Flag of 1 if Feature touches an outer surface or of 0 if it does not", "SurfaceFeatures"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "simplnx/DataStructure/DataPath.hpp"
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"

Expand Down Expand Up @@ -55,9 +55,9 @@ Parameters ComputeTriangleGeomCentroidsFilter::parameters() const
params.insert(std::make_unique<ArraySelectionParameter>(k_FaceLabelsArrayPath_Key, "Face Labels", "The DataPath to the FaceLabels values.", DataPath{},
ArraySelectionParameter::AllowedTypes{nx::core::DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{2}}));
params.insertSeparator(Parameters::Separator{"Input Face Feature Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix",
"The DataPath to the AttributeMatrix that holds feature data for the faces", DataPath({"TriangleDataContainer", "Face Feature Data"}),
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix",
"The DataPath to the AttributeMatrix that holds feature data for the faces",
DataPath({"TriangleDataContainer", "Face Feature Data"})));
params.insertSeparator(Parameters::Separator{"Output Face Feature Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_CentroidsArrayName_Key, "Calculated Centroids", "Centroid values created in the Face Feature Data", "Centroids"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "simplnx/DataStructure/DataPath.hpp"
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
#include "simplnx/Parameters/GeometrySelectionParameter.hpp"

Expand Down Expand Up @@ -56,9 +56,9 @@ Parameters ComputeTriangleGeomVolumesFilter::parameters() const
params.insert(std::make_unique<ArraySelectionParameter>(k_FaceLabelsArrayPath_Key, "Face Labels", "The DataPath to the FaceLabels values.", DataPath{},
ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{2}}));
params.insertSeparator(Parameters::Separator{"Input Face Feature Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix",
"The DataPath to the AttributeMatrix that holds feature data for the faces", DataPath({"TriangleDataContainer", "Face Feature Data"}),
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_FeatureAttributeMatrixPath_Key, "Face Feature Attribute Matrix",
"The DataPath to the AttributeMatrix that holds feature data for the faces",
DataPath({"TriangleDataContainer", "Face Feature Data"})));
params.insertSeparator(Parameters::Separator{"Output Face Feature Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_VolumesArrayName_Key, "Calculated Volumes", "Calculated volumes data created in the Face Feature Data Attribute Matrix", "Volumes"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"

#include "simplnx/Utilities/SIMPLConversion.hpp"

Expand Down Expand Up @@ -57,9 +56,9 @@ Parameters ComputeVolumeFractionsFilter::parameters() const
DataPath({"DataContainer", "Cell Data", "Phases"}), ArraySelectionParameter::AllowedTypes{DataType::int32},
ArraySelectionParameter::AllowedComponentShapes{{1}}));
params.insertSeparator(Parameters::Separator{"Input Ensemble Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_CellEnsembleAttributeMatrixPath_Key, "Cell Ensemble Attribute Matrix",
"The path to the cell ensemble attribute matrix where the output volume fractions array will be stored",
DataPath({"DataContainer", "Cell Ensemble Data"}), DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_CellEnsembleAttributeMatrixPath_Key, "Cell Ensemble Attribute Matrix",
"The path to the cell ensemble attribute matrix where the output volume fractions array will be stored",
DataPath({"DataContainer", "Cell Ensemble Data"})));
params.insertSeparator(Parameters::Separator{"Output Ensemble Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_VolFractionsArrayName_Key, "Volume Fractions", "Fraction of volume that belongs to each Ensemble", "Volume Fractions"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/DataGroupSelectionParameter.hpp"
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
#include "simplnx/Utilities/DataObjectUtilities.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
Expand Down Expand Up @@ -115,9 +114,9 @@ Parameters CreateFeatureArrayFromElementArrayFilter::parameters() const
params.insert(std::make_unique<ArraySelectionParameter>(k_CellFeatureIdsArrayPath_Key, "Cell Feature Ids", "Specifies to which Feature each Element belongs", DataPath{},
ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}}));
params.insertSeparator(Parameters::Separator{"Input Feature Data"});
params.insert(std::make_unique<DataGroupSelectionParameter>(k_CellFeatureAttributeMatrixPath_Key, "Feature Attribute Matrix",
"The path to the cell feature attribute matrix where the converted output feature array will be stored",
DataPath({"DataContainer", "Cell Feature Data"}), DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::AttributeMatrix}));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_CellFeatureAttributeMatrixPath_Key, "Feature Attribute Matrix",
"The path to the cell feature attribute matrix where the converted output feature array will be stored",
DataPath({"DataContainer", "Cell Feature Data"})));
params.insertSeparator(Parameters::Separator{"Output Feature Data"});
params.insert(std::make_unique<DataObjectNameParameter>(k_CreatedArrayName_Key, "Created Feature Attribute Array", "The path to the copied AttributeArray", ""));

Expand Down
Loading

0 comments on commit ddcd126

Please sign in to comment.