From e51d69f0026922bd9bd344bddfb9acbd9a137692 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Sat, 2 Sep 2023 07:46:34 -0400 Subject: [PATCH] ENH: Changed STLFileReader filter to allow user setting of FaceNormals. (#680) * ENH: Changed STLFileReader filter to allow user setting of FaceNormals. * remove ability to set the SharedVertexList and SharedTriangleList names. Those should stay constant where possible. * The parameter key values also changed which may mess up some pipelines and the python bindings. --------- Signed-off-by: Michael Jackson --- .../ApplyTransformation_Node.d3dpipeline | 8 +-- .../pipelines/Import_STL_Model.d3dpipeline | 2 +- .../Triangle_Face_Data_Demo.d3dpipeline | 4 +- .../Filters/Algorithms/CombineStlFiles.cpp | 4 +- .../Filters/FeatureFaceCurvatureFilter.cpp | 6 +- .../Filters/QuickSurfaceMeshFilter.cpp | 4 +- .../Filters/StlFileReaderFilter.cpp | 56 ++++++++++--------- .../Filters/StlFileReaderFilter.hpp | 17 +++--- .../test/ApproximatePointCloudHullTest.cpp | 2 +- .../test/CalculateTriangleAreasFilterTest.cpp | 2 +- .../ComplexCore/test/CombineStlFilesTest.cpp | 4 +- .../test/LaplacianSmoothingFilterTest.cpp | 2 +- .../PointSampleTriangleGeometryFilterTest.cpp | 2 +- .../ComplexCore/test/StlFileReaderTest.cpp | 2 +- .../test/TriangleNormalFilterTest.cpp | 10 ++-- 15 files changed, 64 insertions(+), 61 deletions(-) diff --git a/src/Plugins/ComplexCore/pipelines/ApplyTransformation_Node.d3dpipeline b/src/Plugins/ComplexCore/pipelines/ApplyTransformation_Node.d3dpipeline index a6e6afa0d7..a9f106f564 100644 --- a/src/Plugins/ComplexCore/pipelines/ApplyTransformation_Node.d3dpipeline +++ b/src/Plugins/ComplexCore/pipelines/ApplyTransformation_Node.d3dpipeline @@ -5,7 +5,7 @@ "pipeline": [ { "args": { - "geometry_data_path": "Blade", + "triangle_geometry_name": "Blade", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/ASTMD638_specimen.stl" @@ -19,7 +19,7 @@ }, { "args": { - "geometry_data_path": "Blade [Rotation]", + "triangle_geometry_name": "Blade [Rotation]", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/ASTMD638_specimen.stl" @@ -90,7 +90,7 @@ }, { "args": { - "geometry_data_path": "Blade [Translation]", + "triangle_geometry_name": "Blade [Translation]", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/ASTMD638_specimen.stl" @@ -161,7 +161,7 @@ }, { "args": { - "geometry_data_path": "Blade [Scale]", + "triangle_geometry_name": "Blade [Scale]", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/ASTMD638_specimen.stl" diff --git a/src/Plugins/ComplexCore/pipelines/Import_STL_Model.d3dpipeline b/src/Plugins/ComplexCore/pipelines/Import_STL_Model.d3dpipeline index 15ea9443de..839fa18be7 100644 --- a/src/Plugins/ComplexCore/pipelines/Import_STL_Model.d3dpipeline +++ b/src/Plugins/ComplexCore/pipelines/Import_STL_Model.d3dpipeline @@ -5,7 +5,7 @@ "pipeline": [ { "args": { - "geometry_data_path": "[Triangle Geometry]", + "triangle_geometry_name": "[Triangle Geometry]", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/Cylinder.stl" diff --git a/src/Plugins/ComplexCore/pipelines/Triangle_Face_Data_Demo.d3dpipeline b/src/Plugins/ComplexCore/pipelines/Triangle_Face_Data_Demo.d3dpipeline index c767c3d57d..6d25bad0ac 100644 --- a/src/Plugins/ComplexCore/pipelines/Triangle_Face_Data_Demo.d3dpipeline +++ b/src/Plugins/ComplexCore/pipelines/Triangle_Face_Data_Demo.d3dpipeline @@ -5,7 +5,7 @@ "pipeline": [ { "args": { - "geometry_data_path": "[Triangle Geometry]", + "triangle_geometry_name": "[Triangle Geometry]", "scale_factor": 1.0, "scale_output": false, "stl_file_path": "Data/STL_Models/ASTMD638_specimen.stl" @@ -31,7 +31,7 @@ }, { "args": { - "surface_mesh_triangle_normals_array_path": "Face Normals", + "surface_mesh_triangle_normals_array_path": "Face Normals (Calculated)", "tri_geometry_data_path": "[Triangle Geometry]" }, "comments": "", diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/CombineStlFiles.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/CombineStlFiles.cpp index 8c49e6b7a0..c94c4b6d44 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/CombineStlFiles.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/Algorithms/CombineStlFiles.cpp @@ -94,7 +94,7 @@ Result<> CombineStlFiles::operator()() StlFileReaderFilter stlFileReader; Arguments args; args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(stlFilePath)); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(DataPath({stlFilePath.stem().string()}))); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(DataPath({stlFilePath.stem().string()}))); auto executeResult = stlFileReader.execute(tempDataStructure, args); if(executeResult.result.invalid()) { @@ -151,7 +151,7 @@ Result<> CombineStlFiles::operator()() } triCounter += geom->getNumberOfVertices(); INodeGeometry0D::SharedVertexList& curVertices = geom->getVerticesRef(); - auto& curFaceNormals = tempDataStructure.getDataRefAs(geom->getFaceAttributeMatrixDataPath().createChildPath(StlFileReaderFilter::k_FaceNormals)); + auto& curFaceNormals = tempDataStructure.getDataRefAs(geom->getFaceAttributeMatrixDataPath().createChildPath("Face Normals")); taskRunner.execute(CombineStlImpl{triangles, vertices, combinedFaceNormals, curTriangles, curVertices, curFaceNormals, triOffset, vertexOffset, faceNormalsOffset}); diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/FeatureFaceCurvatureFilter.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/FeatureFaceCurvatureFilter.cpp index ad2ea32ef5..cfe1907639 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/FeatureFaceCurvatureFilter.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/FeatureFaceCurvatureFilter.cpp @@ -75,11 +75,11 @@ Parameters FeatureFaceCurvatureFilter::parameters() const params.insert(std::make_unique(k_FaceLabels_Key, "Face Labels", "", DataPath(), ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{2}})); params.insert(std::make_unique(k_FeatureFaceIds_Key, "Feature Face IDs", "", DataPath(), ArraySelectionParameter::AllowedTypes{DataType::int32}, - ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{{1}}})); + ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{1}})); params.insert(std::make_unique(k_FaceNormals_Key, "Feature Normals", "", DataPath(), ArraySelectionParameter::AllowedTypes{DataType::float64}, - ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{{3}}})); + ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{3}})); params.insert(std::make_unique(k_FaceCentroids_Key, "Face Centroids", "", DataPath(), ArraySelectionParameter::AllowedTypes{DataType::float64}, - ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{{3}}})); + ArraySelectionParameter::AllowedComponentShapes{IArray::ShapeType{3}})); params.insert(std::make_unique(k_PrincipalCurvature1_Key, "Principal Curvature 1", "", DataPath())); params.insert(std::make_unique(k_PrincipalCurvature2_Key, "Principal Curvature 2", "", DataPath())); diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/QuickSurfaceMeshFilter.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/QuickSurfaceMeshFilter.cpp index 01dff80744..d035fc2afd 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/QuickSurfaceMeshFilter.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/QuickSurfaceMeshFilter.cpp @@ -77,13 +77,13 @@ Parameters QuickSurfaceMeshFilter::parameters() const params.insertSeparator(Parameters::Separator{"Created Vertex Data"}); params.insert(std::make_unique(k_VertexDataGroupName_Key, "Vertex Data [AttributeMatrix]", "The complete path to the DataGroup where the Vertex Data of the Triangle Geometry will be created", INodeGeometry0D::k_VertexDataName)); - params.insert(std::make_unique(k_NodeTypesArrayName_Key, "NodeType", "The complete path to the Array specifying the type of node in the Triangle Geometry", "NodeTypes")); + params.insert(std::make_unique(k_NodeTypesArrayName_Key, "NodeType", "The name of the Array specifying the type of node in the Triangle Geometry", "NodeTypes")); params.insertSeparator(Parameters::Separator{"Created Face Data"}); params.insert(std::make_unique(k_FaceDataGroupName_Key, "Face Data [AttributeMatrix]", "The complete path to the DataGroup where the Face Data of the Triangle Geometry will be created", INodeGeometry2D::k_FaceDataName)); params.insert(std::make_unique(k_FaceLabelsArrayName_Key, "Face Labels", - "The complete path to the Array specifying which Features are on either side of each Face in the Triangle Geometry", "FaceLabels")); + "The name of the Array specifying which Features are on either side of each Face in the Triangle Geometry", "FaceLabels")); params.insertSeparator(Parameters::Separator{"Created Face Feature Data"}); params.insert(std::make_unique(k_FaceFeatureAttributeMatrixName_Key, "Face Feature Data [AttributeMatrix]", "The complete path to the DataGroup where the Feature Data will be stored.", INodeGeometry1D::k_FaceFeatureAttributeMatrix)); diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.cpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.cpp index e2b318091f..d0d08a664d 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.cpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.cpp @@ -8,6 +8,7 @@ #include "complex/Filter/Actions/CreateGeometry2DAction.hpp" #include "complex/Parameters/BoolParameter.hpp" #include "complex/Parameters/DataGroupCreationParameter.hpp" +#include "complex/Parameters/DataObjectNameParameter.hpp" #include "complex/Parameters/FileSystemPathParameter.hpp" #include "complex/Parameters/NumberParameter.hpp" #include "complex/Parameters/StringParameter.hpp" @@ -65,18 +66,23 @@ Parameters StlFileReaderFilter::parameters() const params.insert(std::make_unique(k_StlFilePath_Key, "STL File", "Input STL File", fs::path(""), FileSystemPathParameter::ExtensionsType{".stl"}, FileSystemPathParameter::PathType::InputFile)); - params.insertSeparator(Parameters::Separator{"Created Objects"}); + params.insertSeparator(Parameters::Separator{"Created Triangle Geometry"}); + params.insert( + std::make_unique(k_TriangleGeometryName_Key, "Created Triangle Geometry", "The name of the created Triangle Geometry", DataPath({"TriangleDataContainer"}))); - params.insert(std::make_unique(k_GeometryDataPath_Key, "Geometry Name [Data Group]", "The complete path to the DataGroup containing the created Geometry data", - DataPath({"[Triangle Geometry]"}))); + params.insertSeparator(Parameters::Separator{"Created Vertex Data"}); + params.insert(std::make_unique(k_VertexAttributeMatrix_Key, "Vertex Data [AttributeMatrix]", + "The name of the AttributeMatrix where the Vertex Data of the Triangle Geometry will be created", INodeGeometry0D::k_VertexDataName)); - params.insert(std::make_unique(k_VertexMatrix_Key, "Vertex Matrix Name", "Name of the created Vertex Attribute Matrix", INodeGeometry0D::k_VertexDataName)); - params.insert(std::make_unique(k_FaceMatrix_Key, "Face Matrix Name", "Name of the created Face Attribute Matrix", INodeGeometry2D::k_FaceDataName)); + params.insertSeparator(Parameters::Separator{"Created Face Data"}); + params.insert(std::make_unique(k_FaceAttributeMatrix_Key, "Face Data [AttributeMatrix]", + "The name of the AttributeMatrix where the Face Data of the Triangle Geometry will be created", INodeGeometry2D::k_FaceDataName)); + params.insert(std::make_unique(k_FaceNormalsName_Key, "Face Labels", "The name of the triangle normals data array", "Face Normals")); - params.insert(std::make_unique(k_SharedVertexMatrix_Key, "Shared Vertex Matrix Name", "Name of the created Shared Vertex Attribute Matrix", - CreateTriangleGeometryAction::k_DefaultVerticesName)); - params.insert( - std::make_unique(k_SharedFaceMatrix_Key, "Shared Face Matrix Name", "Name of the created Shared Face Attribute Matrix", CreateTriangleGeometryAction::k_DefaultFacesName)); + // params.insert(std::make_unique(k_SharedVertexMatrix_Key, "Shared Vertex Matrix Name", "Name of the created Shared Vertex Attribute Matrix", + // CreateTriangleGeometryAction::k_DefaultVerticesName)); + // params.insert( + // std::make_unique(k_SharedFaceMatrix_Key, "Shared Face Matrix Name", "Name of the created Shared Face Attribute Matrix", CreateTriangleGeometryAction::k_DefaultFacesName)); return params; } @@ -91,17 +97,11 @@ IFilter::UniquePointer StlFileReaderFilter::clone() const IFilter::PreflightResult StlFileReaderFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const { - /** - * These are the values that were gathered from the UI or the pipeline file or - * otherwise passed into the filter. These are here for your convenience. If you - * do not need some of them remove them. - */ auto pStlFilePathValue = filterArgs.value(k_StlFilePath_Key); - auto pTriangleGeometryPath = filterArgs.value(k_GeometryDataPath_Key); - auto vertexMatrixName = filterArgs.value(k_VertexMatrix_Key); - auto faceMatrixName = filterArgs.value(k_FaceMatrix_Key); - auto sharedVertexMatrixName = filterArgs.value(k_SharedVertexMatrix_Key); - auto sharedFaceMatrixName = filterArgs.value(k_SharedFaceMatrix_Key); + auto pTriangleGeometryPath = filterArgs.value(k_TriangleGeometryName_Key); + auto vertexMatrixName = filterArgs.value(k_VertexAttributeMatrix_Key); + auto faceMatrixName = filterArgs.value(k_FaceAttributeMatrix_Key); + auto faceNormalsName = filterArgs.value(k_FaceNormalsName_Key); PreflightResult preflightResult; @@ -155,9 +155,9 @@ IFilter::PreflightResult StlFileReaderFilter::preflightImpl(const DataStructure& // past this point, we are going to scope each section so that we don't accidentally introduce bugs // Create the Triangle Geometry action and store it - auto createTriangleGeometryAction = - std::make_unique(pTriangleGeometryPath, numTriangles, 1, vertexMatrixName, faceMatrixName, sharedVertexMatrixName, sharedFaceMatrixName); - auto faceNormalsPath = createTriangleGeometryAction->getFaceDataPath().createChildPath(k_FaceNormals); + auto createTriangleGeometryAction = std::make_unique(pTriangleGeometryPath, numTriangles, 1, vertexMatrixName, faceMatrixName, + CreateTriangleGeometryAction::k_DefaultVerticesName, CreateTriangleGeometryAction::k_DefaultFacesName); + auto faceNormalsPath = createTriangleGeometryAction->getFaceDataPath().createChildPath(faceNormalsName); resultOutputActions.value().appendAction(std::move(createTriangleGeometryAction)); // Create the face Normals DataArray action and store it auto createArrayAction = std::make_unique(complex::DataType::float64, std::vector{static_cast(numTriangles)}, std::vector{3}, faceNormalsPath); @@ -175,12 +175,18 @@ Result<> StlFileReaderFilter::executeImpl(DataStructure& data, const Arguments& const std::atomic_bool& shouldCancel) const { auto pStlFilePathValue = filterArgs.value(k_StlFilePath_Key); - auto pTriangleGeometryPath = filterArgs.value(k_GeometryDataPath_Key); - auto pFaceDataGroupPath = pTriangleGeometryPath.createChildPath(INodeGeometry2D::k_FaceDataName); - auto pFaceNormalsPath = pFaceDataGroupPath.createChildPath(k_FaceNormals); + auto pTriangleGeometryPath = filterArgs.value(k_TriangleGeometryName_Key); + auto vertexMatrixName = filterArgs.value(k_VertexAttributeMatrix_Key); + auto faceMatrixName = filterArgs.value(k_FaceAttributeMatrix_Key); + auto faceNormalsName = filterArgs.value(k_FaceNormalsName_Key); + + auto pFaceDataGroupPath = pTriangleGeometryPath.createChildPath(faceMatrixName); + + auto pFaceNormalsPath = pFaceDataGroupPath.createChildPath(faceNormalsName); auto scaleOutput = filterArgs.value(k_ScaleOutput); auto scaleFactor = filterArgs.value(k_ScaleFactor); + // The actual STL File Reading is placed in a separate class `StlFileReader` Result<> result = StlFileReader(data, pStlFilePathValue, pTriangleGeometryPath, pFaceDataGroupPath, pFaceNormalsPath, scaleOutput, scaleFactor, shouldCancel)(); return result; diff --git a/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.hpp b/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.hpp index b0b3ab5462..de9a9cd096 100644 --- a/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.hpp +++ b/src/Plugins/ComplexCore/src/ComplexCore/Filters/StlFileReaderFilter.hpp @@ -26,19 +26,16 @@ class COMPLEXCORE_EXPORT StlFileReaderFilter : public IFilter StlFileReaderFilter& operator=(StlFileReaderFilter&&) noexcept = delete; // Parameter Keys - static inline constexpr StringLiteral k_StlFilePath_Key = "stl_file_path"; - static inline constexpr StringLiteral k_GeometryDataPath_Key = "geometry_data_path"; - - static inline constexpr StringLiteral k_FaceGroupDataPath_Key = "face_data_path"; - static inline constexpr StringLiteral k_FaceNormalsDataPath_Key = "face_normals_data_path"; static inline constexpr StringLiteral k_ScaleOutput = "scale_output"; static inline constexpr StringLiteral k_ScaleFactor = "scale_factor"; - static inline constexpr StringLiteral k_VertexMatrix_Key = "vertex_matrix"; - static inline constexpr StringLiteral k_FaceMatrix_Key = "face_matrix"; - static inline constexpr StringLiteral k_SharedVertexMatrix_Key = "shared_vertex_matrix"; - static inline constexpr StringLiteral k_SharedFaceMatrix_Key = "shared_face_matrix"; + static inline constexpr StringLiteral k_StlFilePath_Key = "stl_file_path"; + + static inline constexpr StringLiteral k_TriangleGeometryName_Key = "triangle_geometry_name"; + + static inline constexpr StringLiteral k_VertexAttributeMatrix_Key = "vertex_attribute_matrix"; + static inline constexpr StringLiteral k_FaceAttributeMatrix_Key = "face_attribute_matrix"; - static inline constexpr StringLiteral k_FaceNormals = "FaceNormals"; + static inline constexpr StringLiteral k_FaceNormalsName_Key = "face_normals_data_path"; /** * @brief Returns the name of the filter. diff --git a/src/Plugins/ComplexCore/test/ApproximatePointCloudHullTest.cpp b/src/Plugins/ComplexCore/test/ApproximatePointCloudHullTest.cpp index 5f2cce8cd8..20befcb6df 100644 --- a/src/Plugins/ComplexCore/test/ApproximatePointCloudHullTest.cpp +++ b/src/Plugins/ComplexCore/test/ApproximatePointCloudHullTest.cpp @@ -54,7 +54,7 @@ TEST_CASE("ComplexCore::ApproximatePointCloudHull: Instantiate Filter", "[Approx // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); diff --git a/src/Plugins/ComplexCore/test/CalculateTriangleAreasFilterTest.cpp b/src/Plugins/ComplexCore/test/CalculateTriangleAreasFilterTest.cpp index a71ea387a1..50658c54c9 100644 --- a/src/Plugins/ComplexCore/test/CalculateTriangleAreasFilterTest.cpp +++ b/src/Plugins/ComplexCore/test/CalculateTriangleAreasFilterTest.cpp @@ -36,7 +36,7 @@ TEST_CASE("ComplexCore::CalculateTriangleAreasFilter", "[ComplexCore][CalculateT // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); diff --git a/src/Plugins/ComplexCore/test/CombineStlFilesTest.cpp b/src/Plugins/ComplexCore/test/CombineStlFilesTest.cpp index fde3e3780d..d509d766cb 100644 --- a/src/Plugins/ComplexCore/test/CombineStlFilesTest.cpp +++ b/src/Plugins/ComplexCore/test/CombineStlFilesTest.cpp @@ -40,7 +40,7 @@ TEST_CASE("ComplexCore::CombineStlFilesFilter: Valid Filter Execution", "[Comple args.insertOrAssign(CombineStlFilesFilter::k_StlFilesPath_Key, std::make_any(fs::path(inputStlDir))); args.insertOrAssign(CombineStlFilesFilter::k_TriangleDataContainerName_Key, std::make_any(k_ComputedTriangleDataContainerName)); args.insertOrAssign(CombineStlFilesFilter::k_FaceAttributeMatrixName_Key, std::make_any(k_FaceData)); - args.insertOrAssign(CombineStlFilesFilter::k_FaceNormalsArrayName_Key, std::make_any(k_FaceNormals)); + args.insertOrAssign(CombineStlFilesFilter::k_FaceNormalsArrayName_Key, std::make_any("Face Normals")); args.insertOrAssign(CombineStlFilesFilter::k_VertexAttributeMatrixName_Key, std::make_any(k_VertexData)); // Preflight the filter and check result @@ -58,7 +58,7 @@ TEST_CASE("ComplexCore::CombineStlFilesFilter: Valid Filter Execution", "[Comple REQUIRE(computedTriangleGeom.getFaceAttributeMatrix()->getShape() == exemplarTriangleGeom.getFaceAttributeMatrix()->getShape()); UnitTest::CompareArrays(dataStructure, k_ExemplarTriangleDataContainerName.createChildPath(k_FaceData).createChildPath(k_FaceNormals), - k_ComputedTriangleDataContainerName.createChildPath(k_FaceData).createChildPath(k_FaceNormals)); + k_ComputedTriangleDataContainerName.createChildPath(k_FaceData).createChildPath("Face Normals")); } TEST_CASE("ComplexCore::CombineStlFilesFilter: InValid Filter Execution") diff --git a/src/Plugins/ComplexCore/test/LaplacianSmoothingFilterTest.cpp b/src/Plugins/ComplexCore/test/LaplacianSmoothingFilterTest.cpp index ce905261da..eda30403bc 100644 --- a/src/Plugins/ComplexCore/test/LaplacianSmoothingFilterTest.cpp +++ b/src/Plugins/ComplexCore/test/LaplacianSmoothingFilterTest.cpp @@ -40,7 +40,7 @@ TEST_CASE("ComplexCore::LaplacianSmoothingFilter", "[SurfaceMeshing][LaplacianSm // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); diff --git a/src/Plugins/ComplexCore/test/PointSampleTriangleGeometryFilterTest.cpp b/src/Plugins/ComplexCore/test/PointSampleTriangleGeometryFilterTest.cpp index 3510decbca..cf9e3ae2c8 100644 --- a/src/Plugins/ComplexCore/test/PointSampleTriangleGeometryFilterTest.cpp +++ b/src/Plugins/ComplexCore/test/PointSampleTriangleGeometryFilterTest.cpp @@ -91,7 +91,7 @@ TEST_CASE("ComplexCore::PointSampleTriangleGeometryFilter", "[DREAM3DReview][Poi // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); diff --git a/src/Plugins/ComplexCore/test/StlFileReaderTest.cpp b/src/Plugins/ComplexCore/test/StlFileReaderTest.cpp index b00d2ebcb0..c51fe89d86 100644 --- a/src/Plugins/ComplexCore/test/StlFileReaderTest.cpp +++ b/src/Plugins/ComplexCore/test/StlFileReaderTest.cpp @@ -29,7 +29,7 @@ TEST_CASE("ComplexCore::StlFileReaderFilter", "[ComplexCore][StlFileReaderFilter // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); diff --git a/src/Plugins/ComplexCore/test/TriangleNormalFilterTest.cpp b/src/Plugins/ComplexCore/test/TriangleNormalFilterTest.cpp index 3402a1f2b1..5cd3e0bc41 100644 --- a/src/Plugins/ComplexCore/test/TriangleNormalFilterTest.cpp +++ b/src/Plugins/ComplexCore/test/TriangleNormalFilterTest.cpp @@ -28,7 +28,7 @@ TEST_CASE("ComplexCore::TriangleNormalFilter", "[ComplexCore][TriangleNormalFilt { std::string triangleGeometryName = "[Triangle Geometry]"; std::string triangleFaceDataGroupName = "Face Data"; - std::string normalsDataArrayName = "FaceNormals"; + std::string normalsDataArrayName = "Face Normals"; DataStructure dataStructure; @@ -44,7 +44,7 @@ TEST_CASE("ComplexCore::TriangleNormalFilter", "[ComplexCore][TriangleNormalFilt // Create default Parameters for the filter. args.insertOrAssign(StlFileReaderFilter::k_StlFilePath_Key, std::make_any(fs::path(inputFile))); - args.insertOrAssign(StlFileReaderFilter::k_GeometryDataPath_Key, std::make_any(triangleGeomDataPath)); + args.insertOrAssign(StlFileReaderFilter::k_TriangleGeometryName_Key, std::make_any(triangleGeomDataPath)); // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); @@ -62,7 +62,7 @@ TEST_CASE("ComplexCore::TriangleNormalFilter", "[ComplexCore][TriangleNormalFilt { TriangleNormalFilter filter; Arguments args; - std::string triangleNormalsName = "Triangle Normals"; + std::string triangleNormalsName = "Face Normals (computed)"; DataPath geometryPath = DataPath({triangleGeometryName}); @@ -72,11 +72,11 @@ TEST_CASE("ComplexCore::TriangleNormalFilter", "[ComplexCore][TriangleNormalFilt // Preflight the filter and check result auto preflightResult = filter.preflight(dataStructure, args); - REQUIRE(preflightResult.outputActions.valid()); + COMPLEX_RESULT_REQUIRE_VALID(preflightResult.outputActions); // Execute the filter and check the result auto executeResult = filter.execute(dataStructure, args); - REQUIRE(executeResult.result.valid()); + COMPLEX_RESULT_REQUIRE_VALID(executeResult.result); DataPath triangleNormalsDataPath = geometryPath.createChildPath(triangleFaceDataGroupName).createChildPath(triangleNormalsName);