diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000000..34b097ee95 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,418 @@ +# Project Guidelines for Claude + +## Project Overview + +This is going to be a large refactoring of the simplnx code base. At a high level I would like the codebase to start using "Interfaces" and "Abstract" classes in places that are not currently being used, like the DataStructure class. I would like to implement more of a "COM" (Component Object Model) style of API for the simplnx library and the plugins. This is a very large undertaking so we should approach this in phases. Remember in C++, an 'Interface' class is a class with all pure virtual methods and a virtual destructor. AbstractBaseClasses have some shared code but are still not meant to be instantiated. + +### Phase 1 +Review the simplnx code and report which classes already inherit from an interface class. From this we can start formulating a plan to refactor the code. Do not proceed further until this part of the project is reviewed. Save the findings into a folder called "Code_Review". + +### Phase 2 +- [ ] Extract out an Inteface class from "SegmentFeatures" +- [ ] Make "SegmentFeatures" inherit from "ISegmentFeatures" +- [ ] Rename "SegmentFeatures" into "AbstractSegmentFeatures" +- [ ] All unit tests pass + +### Phase 3 +- [ ] Rename 'IFilter' to 'AbstractFilter' +- [ ] Create the "IFilter" interface from "AbstractFilter" class +- [ ] Update all code locations +- [ ] All unit tests pass + +### Phase 4 +- [ ] `AbstractPipelineNode`, Extract `IPipelineNode` +- [ ] Update all occurances +- [ ] All unit tests pass + +### Phase 5 +- [ ] `AbstractPlugin` Extract `IPlugin` +- [ ] Update all occurances +- [ ] All unit tests pass + +### Phase 6 +- [ ] `IGeometry` and subclasses +- [ ] Change names to replace "I" with "Abstract" and extract out each "IGeometry" pure virtual subclass +- [ ] "I" prefix but not pure interfaces +- [ ] Update all occurances +- [ ] All unit tests pass + +### Phase 7 +- [ ] Create the IDataStructure interface based on the current DataStructure header. Then update DataStructure to inherit from IDataStructure and also update all methods within DataStructure to 'override' the IDataStructure methods. +- [ ] Update all occurances +- [ ] All unit tests pass (except for the one expected failure) +- [ ] Update CLAUDE.md with implemented features +- [ ] Git Commit changes if all tests pass (except for the one expected failure) +- [ ] Git Push changes if all tests pass (except for the one expected failure) + +### Phase 8 +Rerun the phase 1 review of the source code and create a new document called 'Code_Review/Phase_8_Interface_Review.md' + +### Phase 9 +This phase we will clean up the last of the 'near-pure interface classes". Move concrete implementations to the Abstract class implementation. +- [x] Fix IDataStore +- [x] Fix IListStore +- [x] Fix IDataFactory + +### Phase 10 +- [x] Fix IParameter near-pure-virtual to create IParameter Interface and AbstractParameter +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + + +### Phase 11 +The "I" prefix is now **correctly** used for pure interfaces in most places. The two remaining misnomers are: + +| Class | Issue | Recommendation | +|-------|-------|----------------| +| `IArrayThreshold` | Has data members and concrete methods | Rename to `AbstractArrayThreshold`, extract `IArrayThreshold` interface | +| `IJsonPipelineParser` | Has data member and concrete method | Rename to `AbstractJsonPipelineParser`, extract `IJsonPipelineParser` interface | + +Additionally, several "I"-prefixed classes in the DataObject hierarchy (`IArray`, `IDataArray`, `INeighborList`) are abstract base classes, not pure interfaces. These follow the older naming pattern and could be candidates for future renaming if full consistency is desired. + +- [x] Fix remaining "I"-prefixed classes in the DataObject heirarchy and create the intermediate "Abstract" class where needed. +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + +### Phase 12 +- [x] Rename `IDataIOManager` → `AbstractDataIOManager` (file rename + class rename across 14 files + CMakeLists.txt) +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + +### Phase 13 +- [x] The Python wrapping now exposes "AbstractArray", "AbstractDataArray", "AbstractNeighborList" as Python class names — add + backwards-compatible aliases if Python API stability matters +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + +### Phase 14 +- [x] Convert the "DataObject" to have the proper Interface-ABC-Concrete class heirarchy. +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + +### Phase 15 +- [x] Quick naming fixes — Rename the 8 misnamed I-prefixed classes to Abstract* (`IDataCreationAction`, `IDataIO`, `IGeometryIO`, `IGridGeometryIO`, `INodeGeom0dIO`-`INodeGeom3dIO`) +- [x] Rename `AbstractStringStore` → `IStringStore` (already a pure interface — no data members) +- [x] Unit Tests must pass (except for the one allowed failure) +- [x] Update Phase_8_Interface_Review.md +- [x] Update Phase_8_Class_Hierarchy.dot +- [x] Git commit changes +- [x] Git push changes + +## Directory Structure +- `src/simplnx/` - Core library (Common, Core, DataStructure, Filter, Parameters, Pipeline, Plugin, Utilities) +- `src/Plugins/` - Plugin modules +- `src/nxrunner/` - CLI runner +- `test/` - Test files +- `cmake/` - CMake configuration +- Additional Plugin at "/Users/mjackson/Workspace5/DREAM3D_Plugins/SimplnxReview" +- Additional Plugin at "/Users/mjackson/Workspace5/DREAM3D_Plugins/FileStore" +- Additional Plugin at "/Users/mjackson/Workspace5/DREAM3D_Plugins/Synthetic" +- DREAM3DNX application located in "/Users/mjackson/Workspace5/DREAM3DNX" + +## Directories to Ignore +- `scripts/` - Build/utility scripts +- `conda/` - Conda packaging + +## Coding Standards + +### C++ Style (from .clang-format) +- C++20 standard +- Allman brace style (braces on new lines for classes, control statements, enums, functions, namespaces, structs, before else) +- 200 column limit +- 2-space indentation, no tabs +- Pointer alignment left (`int* ptr` not `int *ptr`) +- No space before parentheses +- Sort includes alphabetically +- No short functions on single line +- Always break template declarations +- Constructor initializers break before comma + +### Naming Conventions (from .clang-tidy) +- C++ header files: `.hpp` extension +- C++ source files: `.cpp` extension +- Namespaces: `lower_case` +- Classes: `CamelCase` +- Structs: `CamelCase` +- Class methods: `camelBack` +- Functions: `camelBack` +- Variables: `camelBack` +- Private members: `m_` prefix + `CamelCase` (e.g., `m_MemberVariable`) +- Global variables: `CamelCase` +- Global constants: `k_` prefix + `CamelCase` (e.g., `k_DefaultValue`) +- Local pointers: `camelBack` + `Ptr` suffix (e.g., `dataPtr`) +- Type aliases: `CamelCase` + `Type` suffix (e.g., `ValueType`) +- Macros: `UPPER_CASE` + +### Descriptive Variable Naming +Use suffixes to make variable types and purposes immediately clear: + +**Geometry variables use `Geom` suffix:** +- Correct: `const auto& imageGeom = dataStructure.getDataRefAs(path);` +- Incorrect: `const auto& image = dataStructure.getDataRefAs(path);` + +**DataStore references use `Ref` suffix:** +- Correct: `const auto& verticesRef = vertexGeom.getVertices()->getDataStoreRef();` +- Incorrect: `const auto& vertices = vertexGeom.getVertices()->getDataStoreRef();` + +Examples: +```cpp +// Geometry variables +auto& imageGeom = dataStructure.getDataRefAs(imagePath); +const auto& rectGridGeom = dataStructure.getDataRefAs(rectPath); +const auto& edgeGeom = dataStructure.getDataRefAs(edgePath); + +// DataStore references +const auto& xBoundsRef = rectGridGeom.getXBounds()->getDataStoreRef(); +const auto& yBoundsRef = rectGridGeom.getYBounds()->getDataStoreRef(); +const auto& verticesRef = edgeGeom.getVertices()->getDataStoreRef(); +``` + +These conventions improve code clarity and distinguish between geometry objects and their underlying data references. + +### File Organization +- When creating a C++ based simplnx filter inside a plugin, the complete filter will have a "NameFilter.hpp" and "NameFilter.cpp" file, an "Algorithm/Name.hpp" and "Algorithm/Name.cpp". +- Filter documentation files are created in Markdown and are in the "docs" subfolder inside the Plugins directory +- Unit tests should be created in the 'test' subfolder and use the 'catch2' unit testing framework. + +## Filter Implementation Guidelines + +### Parameter Validation +- Selection parameters (GeometrySelectionParameter, ArraySelectionParameter, DataGroupSelectionParameter, etc.) automatically validate that the selected object exists in the DataStructure. Do NOT add null checks for these in preflightImpl() or executeImpl(). +- Only add explicit existence checks for objects that are not validated by a selection parameter. + +### DataStructure Access +- Use `getDataRefAs()` to get a reference when you know the object exists (e.g., validated by a selection parameter). +- Use `getDataAs()` to get a pointer only when you need to check if an object exists or when the object may not be present. +- **IMPORTANT**: In unit tests, always wrap `getDataRefAs()` calls with `REQUIRE_NOTHROW()` to provide clear test failure messages if the object doesn't exist. + +Example - Correct: +```cpp +// Parameter already validated this exists, use reference +const auto& imageGeom = dataStructure.getDataRefAs(pInputImageGeometryPathValue); +SizeVec3 dims = imageGeom.getDimensions(); +``` + +Example - Incorrect: +```cpp +// Unnecessary null check - parameter already validated existence +const auto* imageGeomPtr = dataStructure.getDataAs(pInputImageGeometryPathValue); +if(imageGeomPtr == nullptr) +{ + return {MakeErrorResult(-1000, "Could not find geometry")}; +} +``` + +## Thread Safety + +### DataArray and DataStore Classes Are NOT Thread-Safe +- `DataArray`, `DataStore`, and `AbstractDataStore` classes are **NOT thread-safe** for concurrent read or write access. +- The subscript operator (`operator[]`) and other access methods may have internal state or go through virtual function calls that are not safe for concurrent access, even when accessing different indices. +- Some `DataStore` subclasses use out-of-core implementations where data may not be resident in memory. Getting raw pointers to the underlying data is dangerous and should be avoided. + +### Parallelization Guidelines +- When writing parallel algorithms using `ParallelDataAlgorithm`, be aware that passing `DataArray` or `DataStore` references to worker classes can cause random failures on different platforms. +- If parallel access to data arrays is required, consider: + 1. Disabling parallelization with `parallelAlgorithm.setParallelizationEnabled(false)` for correctness + 2. Using thread-local storage for intermediate results + 3. Structuring the algorithm to avoid concurrent access to the same DataArray +- Do NOT assume that writing to different indices of a DataArray from multiple threads is safe. + +Example - Potentially Unsafe: +```cpp +// This pattern can cause random failures even when threads write to different indices +class MyParallelWorker +{ + DataArray& m_OutputArray; // NOT thread-safe for concurrent access + void operator()(const Range& range) const + { + for(usize i = range.min(); i < range.max(); i++) + { + m_OutputArray[i] = computeValue(i); // May fail randomly + } + } +}; +``` + +## Build System +- vcpkg for dependency management +- CMake-based build system + +Example configuring the project +```bash +cd /Users/mjackson/Workspace5/DREAM3DNX && cmake --preset NX-Com-Qt69-Vtk95-Rel +``` + +- Build directory is located at "/Users/mjackson/Workspace5/DREAM3D-Build/NX-Com-Qt69-Vtk95-Rel" + +Example building the project +```bash +cd /Users/mjackson/Workspace5/DREAM3D-Build/NX-Com-Qt69-Vtk95-Rel && cmake --build . --target all +``` + +Ensuring all test data files are downloaded +```bash +cd /Users/mjackson/Workspace5/DREAM3D-Build/NX-Com-Qt69-Vtk95-Rel && cmake --build . --target Fetch_Remote_Data_Files +``` + +Ensuring the out-of-core version of simplnx is configured +```bash +cd /Users/mjackson/Workspace5/simplnx && cmake --preset simplnx-ooc-Rel +``` + +Ensuring the out-of-core version of simplnx is build +```bash +cd /Users/mjackson/Workspace5/DREAM3D-Build/simplnx-ooc-Rel && cmake --build . --target all +``` + +- Python anaconda environment 'dream3d' can be used if needed + +## Testing +- Unit tests use the Catch2 framework. +- Each `TEST_CASE` should include `UnitTest::CheckArraysInheritTupleDims(dataStructure);` near the end of the test to ensure all created data arrays have correct tuple dimensions inherited from their parent groups. +- Use the `ctest` to run unit tests + +### Running Unit Tests +- Always use `ctest` to run unit tests, NOT the test binary directly +- The `ctest` command handles test data extraction and cleanup automatically +- Use the `-R` flag to run specific tests by name pattern + +Example - Running a specific test: +```bash +cd /Users/mjackson/Workspace5/DREAM3D-Build/NX-Com-Qt69-Vtk95-Rel && ctest -R "SimplnxCore::FillBadData" --verbose +``` + +Example - Running all SimplnxCore tests: +```bash +cd /Users/mjackson/Workspace5/DREAM3D-Build/NX-Com-Qt69-Vtk95-Rel && ctest -R "SimplnxCore::" --verbose +``` + +### Printing debug statements in unit tests + +Example - Correct + +auto executeResult = filter.execute(dataStructure, args, nullptr, IFilter::MessageHandler{[](const IFilter::Message& message){ fmt::print("{}\n", message.message); }}); + +### Exemplar-Based Testing Pattern +- Many tests use "exemplar" datasets - pre-generated golden reference data stored in `.dream3d` files +- Exemplar datasets are generated by running pipeline files (`.d3dpipeline`) that configure and execute filters + +#### Workflow for Creating and Publishing Test Data: +1. **Generate test data locally**: Create pipeline file with filter configurations and `WriteDREAM3DFilter` to save results +2. **Execute pipeline**: Run the pipeline to generate exemplar `.dream3d` file and any input data files +3. **Package as tar.gz**: Compress test data (no `6_6_` prefix needed - that was only for legacy DREAM3D data) + ```bash + tar -zvcf test_name.tar.gz test_directory/ + ``` +4. **Compute SHA512 hash**: + ```bash + shasum -a 512 test_name.tar.gz + ``` +5. **Upload to GitHub**: Upload to the [DREAM3D data archive release](https://github.com/BlueQuartzSoftware/simplnx/releases/tag/Data_Archive) +6. **Update CMakeLists.txt**: Add `download_test_data()` call in `src/Plugins/[PluginName]/test/CMakeLists.txt`: + ```cmake + download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} + ARCHIVE_NAME test_name.tar.gz + SHA512 ) + ``` +7. **Test data auto-downloads**: When tests run, the sentinel mechanism automatically downloads and extracts the tar.gz to `unit_test::k_TestFilesDir` + +#### Test Data Archive Naming and Versioning: +- **Base naming**: Use descriptive names that match the test: `test_name.tar.gz` +- **Version suffixes**: When updating existing test data, append version numbers: `test_name_v2.tar.gz`, `test_name_v3.tar.gz` +- **When to version**: + - Original archive already exists in GitHub data archive + - Test requirements changed (new exemplars, different parameters, additional data files) + - Cannot overwrite original because other code may depend on it + - CMakeLists.txt may reference both old and new versions for different tests +- **Check before creating**: Browse the [Data_Archive release](https://github.com/BlueQuartzSoftware/simplnx/releases/tag/Data_Archive) to see if your test data name already exists +- **Legacy prefixes**: The `6_6_` and `6_5_` prefixes are for data from legacy DREAM3D/SIMPL versions - do NOT use for new DREAM3DNX test data + +#### Test Code Pattern: +```cpp +namespace +{ +const std::string k_TestDataDirName = "test_name"; +const fs::path k_TestDataDir = fs::path(unit_test::k_TestFilesDir.view()) / k_TestDataDirName; +const fs::path k_ExemplarFile = k_TestDataDir / "test_name.dream3d"; +const fs::path k_InputImageFile = k_TestDataDir / "input_file.tif"; +} +``` + +**Example**: If `import_image_stack_test.tar.gz` exists in the archive and you need to upload updated test data with new exemplars, create `import_image_stack_test_v2.tar.gz`. Update CMakeLists.txt to reference the new version, and optionally keep the old version if other tests depend on it. + +#### Comparing Test Results Against Exemplars: +- **Load exemplar DataStructure**: Use `UnitTest::LoadDataStructure(exemplarFilePath)` to load the .dream3d file +- **ALWAYS use `REQUIRE_NOTHROW()` before `getDataRefAs()`**: This applies to ALL `getDataRefAs` calls - both generated and exemplar data +- **Get generated data**: Use `getDataRefAs()` wrapped in `REQUIRE_NOTHROW()` since objects were just created by the filter +- **Get exemplar data**: Use `getDataRefAs()` wrapped in `REQUIRE_NOTHROW()` to verify the exemplar exists before accessing +- **Compare geometries**: Use `UnitTest::CompareImageGeometry(&exemplarGeom, &generatedGeom)` - takes two pointers +- **Compare arrays**: Use `UnitTest::CompareDataArrays(exemplarArray, generatedArray)` - type-specific template +- **Switch on data type** when comparing arrays to handle different types (uint8, uint16, uint32, float32, etc.) + +Example pattern: +```cpp +// Load exemplar +DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); + +// Get geometries - ALWAYS wrap getDataRefAs with REQUIRE_NOTHROW +REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedGeomPath)); +const auto& generatedGeom = dataStructure.getDataRefAs(generatedGeomPath); +REQUIRE_NOTHROW(exemplarDS.getDataRefAs(DataPath({exemplarGeomName}))); +const auto& exemplarGeom = exemplarDS.getDataRefAs(DataPath({exemplarGeomName})); + +// Compare geometries (dimensions, origin, spacing) - pass pointers +UnitTest::CompareImageGeometry(&exemplarGeom, &generatedGeom); + +// Get arrays - ALWAYS wrap getDataRefAs with REQUIRE_NOTHROW +REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); +const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); +REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); +const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + +// Compare arrays based on type +switch(generatedArray.getDataType()) +{ +case DataType::uint8: + UnitTest::CompareDataArrays(exemplarArray, generatedArray); + break; +case DataType::uint16: + UnitTest::CompareDataArrays(exemplarArray, generatedArray); + break; +// ... etc +} +``` + +**Important**: Use the standardized `UnitTest::` comparison methods directly in test code. + +### Test Organization +- Each test should call `UnitTest::LoadPlugins()` before executing filters +- Use `DYNAMIC_SECTION()` for parameterized tests that generate multiple test cases + +## Pipeline Files +- JSON format with `.d3dpipeline` extension +- Contains array of filter configurations with arguments +- Each filter has: + - `args`: Dictionary of parameter keys and values + - `comments`: Description of what the filter does + - `filter`: Name and UUID + - `isDisabled`: Boolean to skip filter execution +- Common pattern: Multiple filter configurations followed by WriteDREAM3DFilter to save all results to one `.dream3d` file +- Output geometry paths in pipeline must match exemplar names expected by tests + +## Additional Notes + diff --git a/CMakeLists.txt b/CMakeLists.txt index b55c1a73f5..a6d640d672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,13 +369,13 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/CoreDataIOManager.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/DataIOCollection.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/IDataFactory.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/IDataIOManager.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/AbstractDataIOManager.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/IOConstants.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataIOManager.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataStructureReader.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataStructureWriter.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IDataIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractDataIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IOUtilities.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataStoreIO.hpp @@ -390,12 +390,12 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/GridMontageIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/HexahedralGeomIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/ImageGeomIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IGeometryIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IGridGeometryIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom0dIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom1dIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom2dIO.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom3dIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractGeometryIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/NeighborListIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/QuadGeomIO.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/RectGridGeomIO.hpp @@ -422,6 +422,13 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/TriangleGeom.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/VertexGeom.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractGeometry.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractGridGeometry.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry0D.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry1D.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry2D.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry3D.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/IGeometry.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/IGridGeometry.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/INodeGeometry0D.hpp @@ -433,6 +440,7 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyDataStore.hpp ${SIMPLNX_SOURCE_DIR}/Plugin/AbstractPlugin.hpp + ${SIMPLNX_SOURCE_DIR}/Plugin/IPlugin.hpp ${SIMPLNX_SOURCE_DIR}/Plugin/PluginLoader.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Montage/AbstractMontage.hpp @@ -442,24 +450,26 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractDataStore.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractListStore.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractStringStore.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IStringStore.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/AttributeMatrix.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/BaseGroup.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataArray.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataGroup.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataMap.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/DataObject.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractDataObject.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IDataObject.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataPath.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataStore.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataStructure.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IDataStructure.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DynamicListArray.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyDataStore.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyListStore.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IArray.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IDataArray.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractArray.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractDataArray.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IDataStore.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IListStore.hpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/INeighborList.hpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractNeighborList.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/LinkedPath.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Metadata.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/NeighborList.hpp @@ -468,6 +478,7 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/DataStructure/StringArray.hpp ${SIMPLNX_SOURCE_DIR}/DataStructure/StringStore.hpp + ${SIMPLNX_SOURCE_DIR}/Filter/AbstractFilter.hpp ${SIMPLNX_SOURCE_DIR}/Filter/AbstractParameter.hpp ${SIMPLNX_SOURCE_DIR}/Filter/AnyCloneable.hpp ${SIMPLNX_SOURCE_DIR}/Filter/Arguments.hpp @@ -510,6 +521,7 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/Pipeline/AbstractPipelineFilter.hpp ${SIMPLNX_SOURCE_DIR}/Pipeline/AbstractPipelineNode.hpp + ${SIMPLNX_SOURCE_DIR}/Pipeline/IPipelineNode.hpp ${SIMPLNX_SOURCE_DIR}/Pipeline/Pipeline.hpp ${SIMPLNX_SOURCE_DIR}/Pipeline/PipelineFilter.hpp ${SIMPLNX_SOURCE_DIR}/Pipeline/PlaceholderFilter.hpp @@ -527,11 +539,13 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/Pipeline/Messaging/RenamedMessage.hpp ${SIMPLNX_SOURCE_DIR}/Plugin/AbstractPlugin.hpp + ${SIMPLNX_SOURCE_DIR}/Plugin/IPlugin.hpp ${SIMPLNX_SOURCE_DIR}/Plugin/PluginLoader.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ArrayCreationUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/AlignSections.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ArrayThreshold.hpp + ${SIMPLNX_SOURCE_DIR}/Utilities/IArrayThreshold.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/DataArrayUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/DataGroupUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/DataObjectUtilities.hpp @@ -549,13 +563,14 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/Utilities/StringUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/StringInterpretationUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/IntersectionUtilities.hpp - ${SIMPLNX_SOURCE_DIR}/Utilities/IParallelAlgorithm.hpp + ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelAlgorithm.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelDataAlgorithm.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelData2DAlgorithm.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelData3DAlgorithm.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelTaskAlgorithm.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/SamplingUtils.hpp - ${SIMPLNX_SOURCE_DIR}/Utilities/SegmentFeatures.hpp + ${SIMPLNX_SOURCE_DIR}/Utilities/ISegmentFeatures.hpp + ${SIMPLNX_SOURCE_DIR}/Utilities/AbstractSegmentFeatures.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/TimeUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/TooltipGenerator.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/TooltipRowItem.hpp @@ -619,13 +634,13 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/DataStructure/Observers/AbstractDataStructureObserver.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/DataIOCollection.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/IDataIOManager.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/AbstractDataIOManager.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/Generic/CoreDataIOManager.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataIOManager.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataStructureReader.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/DataStructureWriter.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IDataIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractDataIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IOUtilities.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IDataStoreIO.cpp @@ -637,12 +652,12 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/GridMontageIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/HexahedralGeomIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/ImageGeomIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IGeometryIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/IGridGeometryIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom0dIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom1dIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom2dIO.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/INodeGeom3dIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractGeometryIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractGridGeometryIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/QuadGeomIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/RectGridGeomIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/StringArrayIO.cpp @@ -650,6 +665,12 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/TriangleGeomIO.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/IO/HDF5/VertexGeomIO.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractGeometry.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractGridGeometry.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry0D.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry1D.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry2D.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/AbstractNodeGeometry3D.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/IGeometry.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/IGridGeometry.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Geometry/INodeGeometry0D.cpp @@ -670,15 +691,16 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/DataStructure/Montage/GridMontage.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Montage/GridTileIndex.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractStringStore.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IStringStore.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/AttributeMatrix.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/BaseGroup.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataGroup.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataMap.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/DataObject.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractDataObject.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataPath.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/DataStructure.cpp - ${SIMPLNX_SOURCE_DIR}/DataStructure/INeighborList.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/IDataStructure.cpp + ${SIMPLNX_SOURCE_DIR}/DataStructure/AbstractNeighborList.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/LinkedPath.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/Metadata.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/NeighborList.cpp @@ -686,6 +708,7 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/DataStructure/StringArray.cpp ${SIMPLNX_SOURCE_DIR}/DataStructure/StringStore.cpp + ${SIMPLNX_SOURCE_DIR}/Filter/AbstractFilter.cpp ${SIMPLNX_SOURCE_DIR}/Filter/AbstractParameter.cpp ${SIMPLNX_SOURCE_DIR}/Filter/Arguments.cpp ${SIMPLNX_SOURCE_DIR}/Filter/ConstDataParameter.cpp @@ -719,6 +742,7 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/Pipeline/AbstractPipelineFilter.cpp ${SIMPLNX_SOURCE_DIR}/Pipeline/AbstractPipelineNode.cpp + ${SIMPLNX_SOURCE_DIR}/Pipeline/IPipelineNode.cpp ${SIMPLNX_SOURCE_DIR}/Pipeline/Pipeline.cpp ${SIMPLNX_SOURCE_DIR}/Pipeline/PipelineFilter.cpp ${SIMPLNX_SOURCE_DIR}/Pipeline/PlaceholderFilter.cpp @@ -736,6 +760,7 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/Pipeline/Messaging/RenamedMessage.cpp ${SIMPLNX_SOURCE_DIR}/Plugin/AbstractPlugin.cpp + ${SIMPLNX_SOURCE_DIR}/Plugin/IPlugin.cpp ${SIMPLNX_SOURCE_DIR}/Plugin/PluginLoader.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/ArrayCreationUtilities.cpp @@ -752,12 +777,12 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/Utilities/MaskCompareUtilities.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/MemoryUtilities.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/MessageHelper.cpp - ${SIMPLNX_SOURCE_DIR}/Utilities/IParallelAlgorithm.cpp + ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelAlgorithm.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelDataAlgorithm.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelData2DAlgorithm.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelData3DAlgorithm.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/ParallelTaskAlgorithm.cpp - ${SIMPLNX_SOURCE_DIR}/Utilities/SegmentFeatures.cpp + ${SIMPLNX_SOURCE_DIR}/Utilities/AbstractSegmentFeatures.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/StringInterpretationUtilities.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/AlignSections.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/OStreamUtilities.cpp diff --git a/Code_Review/Phase_14_Post_Review.md b/Code_Review/Phase_14_Post_Review.md new file mode 100644 index 0000000000..d22ce58829 --- /dev/null +++ b/Code_Review/Phase_14_Post_Review.md @@ -0,0 +1,139 @@ +# Phase 14 Post-Review: COM-Style Compliance Assessment + +## Overview + +This document assesses the simplnx codebase's adherence to COM-style library layout after completion of all 14 phases of refactoring. It identifies remaining work and prioritizes next steps. + +--- + +## Core Hierarchies: Fully Compliant + +All major public API hierarchies now have clean **Interface -> Abstract Base -> Concrete** chains: + +| Hierarchy | Chain | Status | +|-----------|-------|--------| +| Filter | `IFilter` -> `AbstractFilter` -> concrete filters | Complete | +| Pipeline | `IPipelineNode` -> `AbstractPipelineNode` -> concrete nodes | Complete | +| Plugin | `IPlugin` -> `AbstractPlugin` -> concrete plugins | Complete | +| Parameter | `IParameter` -> `AbstractParameter` -> concrete params | Complete | +| DataStructure | `IDataStructure` -> `DataStructure` | Complete | +| DataObject | `IDataObject` -> `AbstractDataObject` -> all data objects | Complete | +| Geometry | `IGeometry`/`IGridGeometry`/`INodeGeometry*` -> `Abstract*` -> concrete geoms | Complete | +| DataStore | `IDataStore` -> `AbstractDataStore` -> `DataStore` | Complete | +| ListStore | `IListStore` -> `AbstractListStore` -> `ListStore` | Complete | +| SegmentFeatures | `ISegmentFeatures` -> `AbstractSegmentFeatures` -> concrete | Complete | +| ArrayThreshold | `IArrayThreshold` -> `AbstractArrayThreshold` -> concrete | Complete | +| JsonPipelineParser | `IJsonPipelineParser` -> `AbstractJsonPipelineParser` -> concrete | Complete | + +**14 complete chains, 100% `override` compliance, proper protected copy/move on all interfaces.** + +--- + +## Pure Interface Inventory (16 verified) + +| # | Interface | File | Pure Virtual Methods | +|---|-----------|------|---------------------| +| 1 | `IFilter` | `src/simplnx/Filter/IFilter.hpp` | 14 | +| 2 | `IPipelineNode` | `src/simplnx/Pipeline/IPipelineNode.hpp` | 22 | +| 3 | `IPlugin` | `src/simplnx/Plugin/IPlugin.hpp` | 12 | +| 4 | `IParameter` | `src/simplnx/Filter/IParameter.hpp` | 12 | +| 5 | `IDataStructure` | `src/simplnx/DataStructure/IDataStructure.hpp` | 41 | +| 6 | `IDataObject` | `src/simplnx/DataStructure/IDataObject.hpp` | 22 | +| 7 | `IGeometry` | `src/simplnx/DataStructure/Geometry/IGeometry.hpp` | 6 | +| 8 | `IGridGeometry` | `src/simplnx/DataStructure/Geometry/IGridGeometry.hpp` | 18 | +| 9 | `INodeGeometry0D` | `src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp` | 0 (marker) | +| 10 | `INodeGeometry1D` | `src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp` | 4 | +| 11 | `INodeGeometry2D` | `src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp` | 3 | +| 12 | `INodeGeometry3D` | `src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp` | 3 | +| 13 | `IDataStore` | `src/simplnx/DataStructure/IDataStore.hpp` | 17 | +| 14 | `IListStore` | `src/simplnx/DataStructure/IListStore.hpp` | 10 | +| 15 | `IArrayThreshold` | `src/simplnx/Utilities/IArrayThreshold.hpp` | 6 | +| 16 | `IJsonPipelineParser` | `src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp` | 2 | + +Additional verified pure interfaces (not I-prefixed): + +| Interface | File | Pure Virtual Methods | +|-----------|------|---------------------| +| `IDataAction` | `src/simplnx/Filter/Output.hpp` | 2 | +| `IDataFactory` | `src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp` | 1 | +| `IMaskCompare` | `src/simplnx/Utilities/MaskCompareUtilities.hpp` | 7 | +| `IJsonFilterParser` | `src/simplnx/Utilities/Parsing/JSON/IJsonFilterParser.hpp` | 2 | +| `IPluginLoader` | `src/simplnx/Plugin/PluginLoader.hpp` | 3 | + +--- + +## Remaining Naming Violations (I-prefix on non-pure classes) + +These 8 classes use the `I` prefix but have data members or concrete method bodies, violating the naming convention: + +| Class | File | Issue | Recommended Fix | +|-------|------|-------|-----------------| +| `IDataCreationAction` | `src/simplnx/Filter/Output.hpp` | Has `m_CreatedPath` data member + concrete `getCreatedPath()` | Rename to `AbstractDataCreationAction` | +| `IDataIO` (HDF5) | `src/simplnx/DataStructure/IO/HDF5/IDataIO.hpp` | Concrete methods, static helpers, template method | Rename to `AbstractDataIO` | +| `IGeometryIO` | `src/simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp` | Static concrete protected methods | Rename to `AbstractGeometryIO` | +| `IGridGeometryIO` | `src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp` | Same pattern | Rename to `AbstractGridGeometryIO` | +| `INodeGeom0dIO` | `src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp` | Same pattern | Rename to `AbstractNodeGeom0dIO` | +| `INodeGeom1dIO` | `src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp` | Same pattern | Rename to `AbstractNodeGeom1dIO` | +| `INodeGeom2dIO` | `src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp` | Same pattern | Rename to `AbstractNodeGeom2dIO` | +| `INodeGeom3dIO` | `src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp` | Same pattern | Rename to `AbstractNodeGeom3dIO` | + +--- + +## Abstract Bases Without Extracted Interfaces + +| Priority | Class | File | Pure Virtuals | Data Members | Notes | +|----------|-------|------|---------------|--------------|-------| +| **High** | `AbstractStringStore` | `src/simplnx/DataStructure/AbstractStringStore.hpp` | 9 | **None** | Already essentially a pure interface | +| Medium | `AbstractDataIOManager` | `src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp` | 1 | Yes (3) | IO infrastructure | +| Medium | `AbstractDataStructureMessage` | `src/simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp` | 1 | Yes | Messaging | +| Medium | `AbstractPipelineMessage` | `src/simplnx/Pipeline/Messaging/AbstractPipelineMessage.hpp` | 1 | Yes | Messaging | +| Medium | `PipelineNodeObserver` | `src/simplnx/Pipeline/Messaging/PipelineNodeObserver.hpp` | 1 | Yes | Observer pattern | +| Low | `AlignSections` | `src/simplnx/Utilities/AlignSections.hpp` | 1 | Yes (4) | Algorithm utility | +| Low | `SampleSurfaceMesh` | `src/simplnx/Utilities/SampleSurfaceMesh.hpp` | 1 | Yes | Algorithm utility | +| Low | `AbstractTileIndex` | `src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp` | 3 | Yes (1) | Montage subsystem | +| Low | `AbstractMontage` | `src/simplnx/DataStructure/Montage/AbstractMontage.hpp` | 5 | Yes | Montage subsystem | +| Low | `HDF5::ObjectIO` | `src/simplnx/Utilities/Parsing/HDF5/IO/ObjectIO.hpp` | 2 | Yes (heavy) | HDF5 implementation detail | + +--- + +## Utility Classes (No Interface Needed) + +The following were verified as value/utility classes with no virtual methods: + +`DataMap`, `DataPath`, `LinkedPath`, `Metadata`, `Application`, `Preferences`, `Arguments`, `FilterHandle`, `FilterList`, `Parameters` + +--- + +## Quality Metrics + +| Metric | Value | +|--------|-------| +| Pure interface classes | 21 | +| Abstract bases WITH interface | 17 | +| Abstract bases WITHOUT interface | 15 (1 high, 5 medium, 9 low priority) | +| I-prefixed naming violations | 8 | +| `override` compliance | 100% (17/17) | +| Protected copy/move compliance | 100% | +| Complete Interface-ABC-Concrete chains | 14 | +| Utility classes verified (no interface needed) | 10 | + +--- + +## Recommended Next Steps (Phase 15) + +### Priority 1: Fix I-prefix naming violations +Rename the 8 misnamed `I`-prefixed classes to `Abstract*`: +- `IDataCreationAction` -> `AbstractDataCreationAction` +- `IDataIO` -> `AbstractDataIO` +- `IGeometryIO` -> `AbstractGeometryIO` +- `IGridGeometryIO` -> `AbstractGridGeometryIO` +- `INodeGeom0dIO` -> `AbstractNodeGeom0dIO` +- `INodeGeom1dIO` -> `AbstractNodeGeom1dIO` +- `INodeGeom2dIO` -> `AbstractNodeGeom2dIO` +- `INodeGeom3dIO` -> `AbstractNodeGeom3dIO` + +### Priority 2: Easy interface extraction +- Rename `AbstractStringStore` to `IStringStore` (already has no data members — it IS a pure interface) + +### Priority 3: Optional interface extraction (medium priority) +- Extract interfaces for messaging/observer classes if full COM consistency is desired diff --git a/Code_Review/Phase_1_Interface_Review.md b/Code_Review/Phase_1_Interface_Review.md new file mode 100644 index 0000000000..0e43ec9cde --- /dev/null +++ b/Code_Review/Phase_1_Interface_Review.md @@ -0,0 +1,581 @@ +# Phase 1: Interface and Abstract Base Class Review + +## Overview + +This document catalogs every class in the `src/simplnx/` codebase that participates in an interface or abstract base class hierarchy. Classes are categorized as: + +- **Pure Interface**: All methods are pure virtual + virtual destructor, no data members, no concrete method bodies +- **Near-Pure Interface**: Almost all methods pure virtual, with only trivial delegation helpers +- **Abstract Base Class**: Mix of pure virtual methods and concrete implementations +- **Concrete Base Class**: No pure virtual methods but designed for inheritance + +--- + +## Summary Statistics + +| Category | Count | Classes | +|----------|-------|---------| +| **Pure Interface** | 4 | `IDataFactory`, `IPluginLoader`, `IJsonFilterParser`, `MaskCompare` | +| **Near-Pure Interface** | 2 | `IDataStore`, `IListStore` | +| **Abstract Base Class** | 28 | See below | +| **Concrete Base Class** (misleading "I" prefix) | 1 | `IParallelAlgorithm` | + +### Standalone Concrete Classes with No Interface + +| Class | Directory | Notes | +|-------|-----------|-------| +| `DataStructure` | DataStructure/ | **Primary Phase 2 target** - no interface at all | +| `DataMap` | DataStructure/ | Container utility | +| `DataPath` | DataStructure/ | Path representation | +| `LinkedPath` | DataStructure/ | Linked path representation | +| `Metadata` | DataStructure/ | Metadata storage | +| `Application` | Core/ | Singleton, no virtual methods | +| `Preferences` | Core/ | No virtual methods | +| `Arguments` | Filter/ | No inheritance | +| `FilterHandle` | Filter/ | No inheritance | +| `FilterList` | Filter/ | No inheritance | +| `Parameters` | Filter/ | No inheritance | +| All Common/ classes | Common/ | Range, Array, BoundingBox, etc. - all standalone | + +--- + +## Pure Interface Classes + +### 1. `IDataFactory` +- **File**: `src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods**: `getDataType() const = 0` +- **Notes**: Single-method interface. Copy/move deleted. + +### 2. `IPluginLoader` +- **File**: `src/simplnx/Plugin/PluginLoader.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods**: + - `isLoaded() const = 0` + - `getPlugin() = 0` + - `getPlugin() const = 0` +- **Concrete subclasses**: `InMemoryPluginLoader`, `PluginLoader` + +### 3. `IJsonFilterParser` +- **File**: `src/simplnx/Utilities/Parsing/JSON/IJsonFilterParser.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods**: + - `fromJson(const std::string&) const = 0` + - `toJson(AbstractFilter*) const = 0` +- **Concrete subclasses**: `JsonFilterParserV6`, `JsonFilterParserV7` + +### 4. `IMaskCompare` (struct) +- **File**: `src/simplnx/Utilities/MaskCompareUtilities.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods**: + - `bothTrue(usize, usize) const = 0` + - `bothFalse(usize, usize) const = 0` + - `isTrue(usize) const = 0` + - `setValue(usize, bool) = 0` + - `getNumberOfTuples() const = 0` + - `getNumberOfComponents() const = 0` + - `countTrueValues() const = 0` +- **Concrete subclasses**: `BoolMaskCompare`, `UInt8MaskCompare` + +--- + +## Near-Pure Interface Classes + +### 5. `IDataStore` +- **File**: `src/simplnx/DataStructure/IDataStore.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (13)**: + - `getNumberOfTuples()`, `getTupleShape()`, `getNumberOfComponents()`, `getComponentShape()`, `getChunkShape()`, `resizeTuples()`, `getDataType()`, `getStoreType()`, `getTypeSize()`, `deepCopy()`, `createNewInstance()`, `writeBinaryFile()` (x2 overloads) +- **Concrete helpers**: `getSize()`, `size()`, `empty()` (trivial delegations), `getDataFormat()` (virtual with default) +- **Concrete subclass chain**: `AbstractDataStore` -> `DataStore`, `EmptyDataStore` + +### 6. `IListStore` +- **File**: `src/simplnx/DataStructure/IListStore.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (9)**: + - `getNumberOfTuples()`, `getTupleShape()`, `resizeTuples()`, `clearAllLists()`, `getListSize()`, `getNumberOfLists()`, `clear()`, `readHdf5()`, `writeHdf5()` +- **Concrete helpers**: `size()` (trivial delegation) +- **Concrete subclass chain**: `AbstractListStore` -> `ListStore` + +--- + +## Abstract Base Classes + +### DataObject Hierarchy + +#### 7. `DataObject` +- **File**: `src/simplnx/DataStructure/DataObject.hpp` +- **Inherits from**: Nothing (root of DataObject hierarchy) +- **Pure virtual methods (3)**: `deepCopy()`, `shallowCopy()`, `getTypeName()` +- **Concrete methods**: `getId()`, `getName()`, `canRename()`, `rename()`, `getDataStructure()`, `getDataPaths()`, many more +- **Notes**: Root of the entire data object hierarchy. Extensive concrete infrastructure. + +#### 8. `IArray` +- **File**: `src/simplnx/DataStructure/IArray.hpp` +- **Inherits from**: `DataObject` +- **Own pure virtual methods (12)**: `getArrayType()`, `getSize()`, `size()`, `empty()`, `getTupleShape()`, `getComponentShape()`, `getNumberOfTuples()`, `getNumberOfComponents()`, `swapTuples()`, `resizeTuples()`, `toString()`, `setValueFromString()` + +#### 9. `IDataArray` +- **File**: `src/simplnx/DataStructure/IDataArray.hpp` +- **Inherits from**: `IArray` +- **Own pure virtual methods (4)**: `copyTuple()`, `getIDataStore()` (const/non-const), `getDataFormat()` +- **Concrete methods**: Various delegation methods to underlying store +- **Concrete subclass**: `DataArray` + +#### 10. `INeighborList` +- **File**: `src/simplnx/DataStructure/INeighborList.hpp` +- **Inherits from**: `IArray` +- **Own pure virtual methods (4)**: `getIListStore()` (const/non-const), `copyTuple()`, `getDataType()` +- **Concrete subclass**: `NeighborList` + +#### 11. `BaseGroup` +- **File**: `src/simplnx/DataStructure/BaseGroup.hpp` +- **Inherits from**: `DataObject` +- **Still-abstract**: Inherits `deepCopy()`, `shallowCopy()`, `getTypeName()` as pure virtual +- **Concrete methods**: Container management (`getSize()`, `contains()`, `insert()`, `remove()`, iterators) +- **Concrete subclasses**: `DataGroup`, `AttributeMatrix` + +### Geometry Hierarchy + +#### 12. `IGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/IGeometry.hpp` +- **Inherits from**: `BaseGroup` +- **Own pure virtual methods (6)**: `getGeomType()`, `getNumberOfCells()`, `findElementSizes()`, `getParametricCenter()`, `getShapeFunctions()`, `validate()` + +#### 13. `IGridGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/IGridGeometry.hpp` +- **Inherits from**: `IGeometry` +- **Own pure virtual methods (19)**: `getDimensions()`, `setDimensions()`, `getNumXCells()`, `getNumYCells()`, `getNumZCells()`, coordinate methods (14 overloads), `getIndex()` (x2) +- **Concrete subclasses**: `ImageGeom`, `RectGridGeom` + +#### 14. `INodeGeometry0D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp` +- **Inherits from**: `IGeometry` +- **Concrete methods**: Vertex management, bounding box, coordinate access +- **Concrete subclass**: `VertexGeom` + +#### 15. `INodeGeometry1D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp` +- **Inherits from**: `INodeGeometry0D` +- **Own pure virtual methods (4)**: `getNumberOfVerticesPerEdge()`, `findElementsContainingVert()`, `findElementNeighbors()`, `findElementCentroids()` +- **Concrete subclass**: `EdgeGeom` + +#### 16. `INodeGeometry2D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp` +- **Inherits from**: `INodeGeometry1D` +- **Own pure virtual methods (3)**: `getNumberOfVerticesPerFace()`, `findEdges()`, `findUnsharedEdges()` +- **Concrete subclasses**: `TriangleGeom`, `QuadGeom` + +#### 17. `INodeGeometry3D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp` +- **Inherits from**: `INodeGeometry2D` +- **Own pure virtual methods (3)**: `findFaces()`, `findUnsharedFaces()`, `getNumberOfVerticesPerCell()` +- **Concrete subclasses**: `TetrahedralGeom`, `HexahedralGeom` + +### Data Store Hierarchy + +#### 18. `AbstractDataStore` (template) +- **File**: `src/simplnx/DataStructure/AbstractDataStore.hpp` +- **Inherits from**: `IDataStore` +- **Own pure virtual methods (21+)**: Element access, arithmetic ops, chunk ops, HDF5 I/O +- **Concrete methods**: Iterators, `operator[]`, `fill()`, `copy()`, type queries +- **Concrete subclasses**: `DataStore`, `EmptyDataStore` + +#### 19. `AbstractListStore` (template) +- **File**: `src/simplnx/DataStructure/AbstractListStore.hpp` +- **Inherits from**: `IListStore` +- **Own pure virtual methods (14)**: List access, modification, data setting +- **Concrete methods**: Iterators +- **Concrete subclass**: `ListStore` + +#### 20. `AbstractStringStore` +- **File**: `src/simplnx/DataStructure/AbstractStringStore.hpp` +- **Inherits from**: Nothing (standalone) +- **Pure virtual methods (12)**: `deepCopy()`, `size()`, `empty()`, tuple operations, element access +- **Concrete methods**: Iterators, comparison operators +- **Concrete subclass**: `StringStore` + +### Filter/Parameter Hierarchy + +#### 21. `IFilter` +- **File**: `src/simplnx/Filter/IFilter.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (9)**: `name()`, `className()`, `uuid()`, `humanName()`, `parameters()`, `parametersVersion()`, `clone()`, `preflightImpl()`, `executeImpl()` +- **Concrete methods**: `preflight()`, `execute()`, `fromJson()`, `toJson()`, `getDefaultArguments()` +- **Notes**: Hundreds of concrete filter subclasses across Plugins/ + +#### 22. `IParameter` +- **File**: `src/simplnx/Filter/IParameter.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (11)**: `uuid()`, `name()`, `humanName()`, `helpText()`, `defaultValue()`, `type()`, `acceptedTypes()`, `getVersion()`, `clone()`, `toJsonImpl()`, `fromJsonImpl()` +- **Concrete methods**: `toJson()`, `fromJson()`, `construct()` + +#### 23. `AbstractParameter` +- **File**: `src/simplnx/Filter/AbstractParameter.hpp` +- **Inherits from**: `IParameter` +- **Implements** (final): `name()`, `humanName()`, `helpText()` +- **Still has 8 unresolved pure virtuals** + +#### 24. `ValueParameter` +- **File**: `src/simplnx/Filter/ValueParameter.hpp` +- **Inherits from**: `AbstractParameter` +- **Implements** (final): `type()` +- **Adds pure virtual**: `validate()` +- **18 concrete subclasses** (BoolParameter, StringParameter, NumberParameter, etc.) + +#### 25. `DataParameter` +- **File**: `src/simplnx/Filter/DataParameter.hpp` +- **Inherits from**: `AbstractParameter` +- **Implements** (final): `type()` +- **Adds pure virtuals**: `mutability()`, `validate(DataStructure&, ...)` + +#### 26. `MutableDataParameter` / `ConstDataParameter` +- **Files**: `src/simplnx/Filter/MutableDataParameter.hpp`, `ConstDataParameter.hpp` +- **Inherit from**: `DataParameter` +- **Implement** (final): `mutability()` +- **Add pure virtual**: `resolve()` +- **12 concrete subclasses** of MutableDataParameter (ArraySelectionParameter, GeometrySelectionParameter, etc.) + +### Pipeline Hierarchy + +#### 27. `AbstractPipelineNode` +- **File**: `src/simplnx/Pipeline/AbstractPipelineNode.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (7)**: `getType()`, `getName()`, `preflight()` (x2), `execute()`, `deepCopy()`, `toJsonImpl()` +- **Concrete methods**: Extensive state management (signals, fault state, DataStructure tracking) +- **Concrete subclass**: `Pipeline` + +#### 28. `AbstractPipelineFilter` +- **File**: `src/simplnx/Pipeline/AbstractPipelineFilter.hpp` +- **Inherits from**: `AbstractPipelineNode` +- **Implements**: `getType()` +- **Adds pure virtual**: `getFilterType()` +- **Concrete subclasses**: `PipelineFilter`, `PlaceholderFilter` + +### Action Hierarchy + +#### 29. `IDataAction` +- **File**: `src/simplnx/Filter/Output.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (2)**: `apply()`, `clone()` +- **Notes**: Very close to a pure interface but uses protected constructor pattern + +#### 30. `IDataCreationAction` +- **File**: `src/simplnx/Filter/Output.hpp` +- **Inherits from**: `IDataAction` +- **Adds pure virtual**: `getAllCreatedPaths()` +- **Adds concrete**: `getCreatedPath()` accessor +- **16 concrete subclasses** (CreateArrayAction, CreateImageGeometryAction, etc.) +- **5 concrete subclasses** of IDataAction directly (DeleteDataAction, EmptyAction, etc.) + +### Plugin Hierarchy + +#### 31. `AbstractPlugin` +- **File**: `src/simplnx/Plugin/AbstractPlugin.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (1)**: `getSimplToSimplnxMap()` +- **Concrete methods**: Nearly everything else (`getName()`, `createFilter()`, `getFilterHandles()`, etc.) +- **Notes**: Barely abstract - only 1 pure virtual. Prime candidate for extracting an `IPlugin` interface. + +### Montage Hierarchy + +#### 32. `AbstractMontage` +- **File**: `src/simplnx/DataStructure/Montage/AbstractMontage.hpp` +- **Inherits from**: `BaseGroup` +- **Own pure virtual methods (5)**: `getTooltipGenerator()`, `getGeometry()` (x2), `getTileIndex()`, `setGeometry()` +- **Concrete subclass**: `GridMontage` + +#### 33. `AbstractTileIndex` +- **File**: `src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (3)**: `getGeometry()`, `isValid()`, `getToolTipGenerator()` +- **Concrete subclass**: `GridTileIndex` + +### Messaging Hierarchy + +#### 34. `AbstractDataStructureMessage` +- **File**: `src/simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp` +- **Pure virtual methods (1)**: `getMsgType()` +- **Concrete subclasses**: `DataAddedMessage`, `DataRemovedMessage`, `DataRenamedMessage`, `DataReparentedMessage` + +#### 35. `AbstractPipelineMessage` +- **File**: `src/simplnx/Pipeline/Messaging/AbstractPipelineMessage.hpp` +- **Pure virtual methods (1)**: `toString()` +- **9 concrete subclasses** (PipelineNodeMessage, NodeAddedMessage, etc.) + +#### 36. `PipelineNodeObserver` +- **File**: `src/simplnx/Pipeline/Messaging/PipelineNodeObserver.hpp` +- **Pure virtual methods (1, protected)**: `onNotify()` +- **Concrete subclass**: `Pipeline` (protected inheritance) + +### IO Hierarchy + +#### 37. `IDataIOManager` +- **File**: `src/simplnx/DataStructure/IO/Generic/IDataIOManager.hpp` +- **Pure virtual methods (1)**: `formatName()` +- **Concrete methods**: Factory management, data store creation functions + +#### 38. `HDF5::IDataIO` +- **File**: `src/simplnx/DataStructure/IO/HDF5/IDataIO.hpp` +- **Inherits from**: `IDataFactory` +- **Own pure virtual methods (3)**: `readData()`, `writeDataObject()`, `getTypeName()` +- **All concrete HDF5 IO classes** inherit from this + +### Utilities Hierarchy + +#### 39. `IArrayThreshold` +- **File**: `src/simplnx/Utilities/ArrayThreshold.hpp` +- **Pure virtual methods (1)**: `getRequiredPaths()` +- **Concrete subclasses**: `ArrayThreshold`, `ArrayThresholdSet` + +#### 40. `AlignSections` +- **File**: `src/simplnx/Utilities/AlignSections.hpp` +- **Pure virtual methods (1, protected)**: `findShifts()` +- **Notes**: Template Method pattern. Subclassed in Plugins. + +#### 41. `SampleSurfaceMesh` +- **File**: `src/simplnx/Utilities/SampleSurfaceMesh.hpp` +- **Pure virtual methods (1, protected)**: `generatePoints()` +- **Notes**: Template Method pattern. Subclassed in Plugins. + +#### 42. `SegmentFeatures` +- **File**: `src/simplnx/Utilities/SegmentFeatures.hpp` +- **Pure virtual methods**: None (virtual methods have default implementations) +- **Notes**: Abstract by convention, not by language enforcement. Subclassed in Plugins. + +#### 43. `HDF5::ObjectIO` +- **File**: `src/simplnx/Utilities/Parsing/HDF5/IO/ObjectIO.hpp` +- **Pure virtual methods (2, protected)**: `open()`, `close()` +- **Concrete subclasses**: `GroupIO` -> `FileIO`, `DatasetIO` + +#### 44. `CSV::AbstractDataParser` +- **File**: `src/simplnx/Utilities/FileUtilities.hpp` +- **Pure virtual methods (1)**: `parse()` +- **Concrete subclass**: `CSVDataParser` + +#### 45. `IJsonPipelineParser` +- **File**: `src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp` +- **Pure virtual methods (2)**: `fromJson()`, `toJson()` +- **Notes**: **BUG** - destructor is NOT virtual despite being used polymorphically +- **Concrete subclasses**: `JsonPipelineParserV6`, `JsonPipelineParserV7` + +### Misleading "I" Prefix + +#### `IParallelAlgorithm` +- **File**: `src/simplnx/Utilities/IParallelAlgorithm.hpp` +- **Pure virtual methods**: **None** +- **Virtual methods**: **None** +- **Notes**: Despite the "I" prefix, this is a concrete base class with no polymorphism. Protected constructor/destructor prevents direct instantiation. Should be renamed to `ParallelAlgorithmBase` or converted to a true interface. +- **Concrete subclasses**: `ParallelDataAlgorithm`, `ParallelData2DAlgorithm`, `ParallelData3DAlgorithm`, `ParallelTaskAlgorithm` + +--- + +## Full Inheritance Hierarchy Tree + +``` +[PURE INTERFACES] + +IDataFactory [Pure Interface] + +-- HDF5::IDataIO [Abstract Base] + +-- All HDF5 IO classes [Concrete] + +IPluginLoader [Pure Interface] + +-- InMemoryPluginLoader [Concrete] + +-- PluginLoader [Concrete] + +IJsonFilterParser [Pure Interface] + +-- JsonFilterParserV6 [Concrete] + +-- JsonFilterParserV7 [Concrete] + +MaskCompare [Pure Interface] + +-- BoolMaskCompare [Concrete] + +-- UInt8MaskCompare [Concrete] + + +[NEAR-PURE INTERFACES -> ABSTRACT BASES -> CONCRETE] + +IDataStore [Near-Pure Interface] + +-- AbstractDataStore [Abstract Base, template] + +-- DataStore [Concrete] + +-- EmptyDataStore [Concrete] + +IListStore [Near-Pure Interface] + +-- AbstractListStore [Abstract Base, template] + +-- ListStore [Concrete] + +AbstractStringStore [Abstract Base] + +-- StringStore [Concrete] + + +[DATA OBJECT HIERARCHY] + +DataObject [Abstract Base - root] + | + +-- BaseGroup [Abstract Base] + | +-- DataGroup [Concrete] + | +-- AttributeMatrix [Concrete] + | +-- IGeometry [Abstract Base] + | | +-- IGridGeometry [Abstract Base] + | | | +-- ImageGeom [Concrete] + | | | +-- RectGridGeom [Concrete] + | | +-- INodeGeometry0D [Abstract Base] + | | +-- VertexGeom [Concrete] + | | +-- INodeGeometry1D [Abstract Base] + | | +-- EdgeGeom [Concrete] + | | +-- INodeGeometry2D [Abstract Base] + | | +-- TriangleGeom [Concrete] + | | +-- QuadGeom [Concrete] + | | +-- INodeGeometry3D [Abstract Base] + | | +-- TetrahedralGeom [Concrete] + | | +-- HexahedralGeom [Concrete] + | +-- AbstractMontage [Abstract Base] + | +-- GridMontage [Concrete] + | + +-- IArray [Abstract Base] + | +-- IDataArray [Abstract Base] + | | +-- DataArray [Concrete] + | +-- INeighborList [Abstract Base] + | | +-- NeighborList [Concrete] + | +-- StringArray [Concrete] + | + +-- ScalarData [Concrete] + +-- DynamicListArray [Concrete] + + +[FILTER/PARAMETER HIERARCHY] + +IFilter [Abstract Base] + +-- Hundreds of filter classes [Concrete, in Plugins/] + +IParameter [Abstract Base] + +-- AbstractParameter [Abstract Base] + +-- ValueParameter [Abstract Base] + | +-- 17 concrete parameters [Concrete] + | +-- VectorParameterBase [Abstract Base] + | +-- VectorParameter [Concrete] + +-- DataParameter [Abstract Base] + +-- MutableDataParameter [Abstract Base] + | +-- 12 concrete params [Concrete] + +-- ConstDataParameter [Abstract Base] + +IDataAction [Abstract Base / Near-Interface] + +-- IDataCreationAction [Abstract Base] + | +-- 16 concrete actions [Concrete] + +-- 5 concrete actions [Concrete] + + +[PIPELINE HIERARCHY] + +AbstractPipelineNode [Abstract Base] + +-- Pipeline [Concrete] (also inherits PipelineNodeObserver) + +-- AbstractPipelineFilter [Abstract Base] + +-- PipelineFilter [Concrete] + +-- PlaceholderFilter [Concrete] + +PipelineNodeObserver [Abstract Base] + +-- Pipeline [Concrete, protected inheritance] + +AbstractPipelineMessage [Abstract Base] + +-- 9 concrete message classes [Concrete] + + +[PLUGIN HIERARCHY] + +AbstractPlugin [Abstract Base] + +-- Concrete plugin classes [Concrete, in Plugins/] + + +[IO HIERARCHY] + +IDataIOManager [Abstract Base] + +-- CoreDataIOManager, etc. [Concrete] + +HDF5::ObjectIO [Abstract Base] + +-- GroupIO [Concrete] + | +-- FileIO [Concrete] + +-- DatasetIO [Concrete] + + +[UTILITIES HIERARCHY] + +IArrayThreshold [Abstract Base] + +-- ArrayThreshold [Concrete] + +-- ArrayThresholdSet [Concrete] + +AlignSections [Abstract Base, Template Method] + +-- Subclasses in Plugins/ [Concrete] + +SampleSurfaceMesh [Abstract Base, Template Method] + +-- Subclasses in Plugins/ [Concrete] + +SegmentFeatures [Abstract Base by convention] + +-- Subclasses in Plugins/ [Concrete] + +CSV::AbstractDataParser [Abstract Base] + +-- CSVDataParser [Concrete] + +IJsonPipelineParser [Abstract Base] + +-- JsonPipelineParserV6 [Concrete] + +-- JsonPipelineParserV7 [Concrete] + +IParallelAlgorithm [Concrete Base - misleading name] + +-- ParallelDataAlgorithm [Concrete] + +-- ParallelData2DAlgorithm [Concrete] + +-- ParallelData3DAlgorithm [Concrete] + +-- ParallelTaskAlgorithm [Concrete] + + +[STANDALONE - NO INTERFACE] + +DataStructure ** Phase 2 target ** +DataMap +DataPath +LinkedPath +Metadata +Application +Preferences +Arguments +FilterHandle +FilterList +Parameters (class) +All Common/ classes +``` + +--- + +## Key Findings for COM-Style Refactoring + +### 1. Very Few True Pure Interfaces Exist +Only 4 classes qualify as true pure interfaces: `IDataFactory`, `IPluginLoader`, `IJsonFilterParser`, and `IMaskCompare`. The vast majority of "I"-prefixed classes are actually abstract base classes with significant concrete implementations. + +### 2. Naming Inconsistency +The "I" prefix is used inconsistently: +- **True interfaces**: `IDataFactory`, `IPluginLoader`, `IJsonFilterParser` +- **Abstract base classes using "I" prefix**: `IFilter`, `IParameter`, `IDataAction`, `IDataArray`, `INeighborList`, `IArray`, `IGeometry`, `IGridGeometry`, `INodeGeometry0D/1D/2D/3D`, `IDataStore`, `IListStore`, `IDataIOManager`, `IArrayThreshold`, `IParallelAlgorithm` +- **Abstract base classes using "Abstract" prefix**: `AbstractParameter`, `AbstractDataStore`, `AbstractListStore`, `AbstractStringStore`, `AbstractPlugin`, `AbstractPipelineNode`, `AbstractPipelineFilter`, `AbstractMontage`, `AbstractTileIndex`, `AbstractPipelineMessage`, `AbstractDataStructureMessage`, `AbstractDataParser` + +For a COM-style refactoring, the "I" prefix should be reserved exclusively for pure interfaces. + +### 3. `DataStructure` Has No Interface +The `DataStructure` class is a standalone concrete class with no interface or abstract base class. This is the primary target for Phase 2 (creating `IDataStructure`). + +### 4. Classes Most in Need of Interface Extraction + +| Class | Why | Priority | +|-------|-----|----------| +| `DataStructure` | No interface at all, core class | **High** | +| `AbstractPlugin` | Only 1 pure virtual, mostly concrete. Extract `IPlugin` | **High** | +| `IFilter` | Has concrete methods mixed in. Extract pure `IFilter` interface | **Medium** | +| `AbstractPipelineNode` | Heavy concrete base. Extract `IPipelineNode` | **Medium** | +| `IGeometry` and subclasses | "I" prefix but not pure interfaces | **Low** (complex hierarchy) | + +### 5. Design Issues Found + +| Issue | Location | Description | +|-------|----------|-------------| +| Abstract by convention only | `SegmentFeatures` | Virtual methods have defaults instead of being pure virtual | + +### 6. Well-Designed Patterns Already in Use +- **Template Method Pattern**: `AlignSections`, `SampleSurfaceMesh` - public `execute()` calls protected pure virtual hooks +- **Layered Abstract Hierarchy**: `IParameter` -> `AbstractParameter` -> `ValueParameter`/`DataParameter` -> concrete +- **Store Abstraction**: `IDataStore` -> `AbstractDataStore` -> `DataStore` - clean separation of interface, shared implementation, and concrete storage diff --git a/Code_Review/Phase_8_Class_Hierarchy.dot b/Code_Review/Phase_8_Class_Hierarchy.dot new file mode 100644 index 0000000000..3fd80b42e2 --- /dev/null +++ b/Code_Review/Phase_8_Class_Hierarchy.dot @@ -0,0 +1,282 @@ +digraph simplnx_hierarchy { + rankdir=BT; + fontname="Helvetica"; + node [fontname="Helvetica", fontsize=10, shape=record]; + edge [arrowhead=empty]; + + // ===== Color Legend ===== + subgraph cluster_legend { + label="Legend"; + style=rounded; + fontsize=12; + fontname="Helvetica-Bold"; + legend_interface [label="Pure Interface", style=filled, fillcolor="#A8D8EA"]; + legend_nearpure [label="Near-Pure Interface", style=filled, fillcolor="#B8E6C8"]; + legend_abstract [label="Abstract Base Class", style=filled, fillcolor="#FFD580"]; + legend_concrete [label="Concrete Class", style=filled, fillcolor="#E8E8E8"]; + legend_concretebase [label="Concrete Base (protected ctor)", style=filled, fillcolor="#D4B8E0"]; + } + + // ===== Pure Interfaces (blue) ===== + IFilter [label="{IFilter|13 pure virtual methods|Phase 3}", style=filled, fillcolor="#A8D8EA"]; + IPlugin [label="{IPlugin|11 pure virtual methods|Phase 5}", style=filled, fillcolor="#A8D8EA"]; + IPipelineNode [label="{IPipelineNode|24 pure virtual methods|Phase 4}", style=filled, fillcolor="#A8D8EA"]; + IDataStructure [label="{IDataStructure|39+ pure virtual methods|Phase 7}", style=filled, fillcolor="#A8D8EA"]; + IGeometry [label="{IGeometry|6 pure virtual methods|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + IGridGeometry [label="{IGridGeometry|19 pure virtual methods|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + INodeGeometry0D [label="{INodeGeometry0D|marker interface|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + INodeGeometry1D [label="{INodeGeometry1D|4 pure virtual methods|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + INodeGeometry2D [label="{INodeGeometry2D|3 pure virtual methods|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + INodeGeometry3D [label="{INodeGeometry3D|3 pure virtual methods|Phase 6}", style=filled, fillcolor="#A8D8EA"]; + ISegmentFeatures [label="{ISegmentFeatures|5 pure virtual methods|Phase 2}", style=filled, fillcolor="#A8D8EA"]; + IMaskCompare [label="{IMaskCompare|7 pure virtual methods|pre-existing}", style=filled, fillcolor="#A8D8EA"]; + IJsonFilterParser [label="{IJsonFilterParser|2 pure virtual methods|pre-existing}", style=filled, fillcolor="#A8D8EA"]; + IPluginLoader [label="{IPluginLoader|3 pure virtual methods|pre-existing}", style=filled, fillcolor="#A8D8EA"]; + IDataAction [label="{IDataAction|2 pure virtual methods}", style=filled, fillcolor="#A8D8EA"]; + + IDataStore [label="{IDataStore|17 pure virtual methods|Phase 9}", style=filled, fillcolor="#A8D8EA"]; + IListStore [label="{IListStore|10 pure virtual methods|Phase 9}", style=filled, fillcolor="#A8D8EA"]; + IDataFactory [label="{IDataFactory|1 pure virtual method|Phase 9}", style=filled, fillcolor="#A8D8EA"]; + + // ===== Near-Pure Interfaces (green) ===== + // (none remaining — all promoted to Pure Interface) + + IParameter [label="{IParameter|14 pure virtual methods|Phase 10}", style=filled, fillcolor="#A8D8EA"]; + + // ===== Abstract Base Classes (orange) ===== + AbstractFilter [label="{AbstractFilter|Template Method pattern}", style=filled, fillcolor="#FFD580"]; + AbstractPlugin [label="{AbstractPlugin|1 pure virtual remains}", style=filled, fillcolor="#FFD580"]; + AbstractPipelineNode [label="{AbstractPipelineNode|7 pure virtual|18 concrete}", style=filled, fillcolor="#FFD580"]; + AbstractPipelineFilter [label="{AbstractPipelineFilter|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractGeometry [label="{AbstractGeometry|k_TypeName = \"IGeometry\"}", style=filled, fillcolor="#FFD580"]; + AbstractGridGeometry [label="{AbstractGridGeometry|k_TypeName = \"IGridGeometry\"}", style=filled, fillcolor="#FFD580"]; + AbstractNodeGeometry0D [label="{AbstractNodeGeometry0D|k_TypeName = \"INodeGeometry0D\"}", style=filled, fillcolor="#FFD580"]; + AbstractNodeGeometry1D [label="{AbstractNodeGeometry1D|k_TypeName = \"INodeGeometry1D\"}", style=filled, fillcolor="#FFD580"]; + AbstractNodeGeometry2D [label="{AbstractNodeGeometry2D|k_TypeName = \"INodeGeometry2D\"}", style=filled, fillcolor="#FFD580"]; + AbstractNodeGeometry3D [label="{AbstractNodeGeometry3D|k_TypeName = \"INodeGeometry3D\"}", style=filled, fillcolor="#FFD580"]; + AbstractSegmentFeatures [label="{AbstractSegmentFeatures}", style=filled, fillcolor="#FFD580"]; + IDataObject [label="{IDataObject|21 pure virtual methods|Phase 14}", style=filled, fillcolor="#A8D8EA"]; + AbstractDataObject [label="{AbstractDataObject|3 pure virtual|renamed from DataObject Phase 14}", style=filled, fillcolor="#FFD580"]; + BaseGroup [label="{BaseGroup}", style=filled, fillcolor="#FFD580"]; + AbstractArray [label="{AbstractArray|12 pure virtual|renamed from IArray Phase 11}", style=filled, fillcolor="#FFD580"]; + AbstractDataArray [label="{AbstractDataArray|4 pure virtual|renamed from IDataArray Phase 11}", style=filled, fillcolor="#FFD580"]; + AbstractNeighborList [label="{AbstractNeighborList|4 pure virtual|renamed from INeighborList Phase 11}", style=filled, fillcolor="#FFD580"]; + AbstractDataStore [label="{AbstractDataStore\|20 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractListStore [label="{AbstractListStore\|14 pure virtual}", style=filled, fillcolor="#FFD580"]; + IStringStore [label="{IStringStore|12 pure virtual|promoted Phase 15}", style=filled, fillcolor="#A8D8EA"]; + AbstractMontage [label="{AbstractMontage|5 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractTileIndex [label="{AbstractTileIndex|3 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractParameter [label="{AbstractParameter}", style=filled, fillcolor="#FFD580"]; + ValueParameter [label="{ValueParameter|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + DataParameter [label="{DataParameter|2 pure virtual}", style=filled, fillcolor="#FFD580"]; + MutableDataParameter [label="{MutableDataParameter|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + ConstDataParameter [label="{ConstDataParameter|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractDataCreationAction [label="{AbstractDataCreationAction|1 pure virtual|renamed Phase 15}", style=filled, fillcolor="#FFD580"]; + AbstractDataIOManager [label="{AbstractDataIOManager|1 pure virtual|renamed Phase 12}", style=filled, fillcolor="#FFD580"]; + HDF5_AbstractDataIO [label="{HDF5::AbstractDataIO|3 pure virtual|renamed Phase 15}", style=filled, fillcolor="#FFD580"]; + HDF5_ObjectIO [label="{HDF5::ObjectIO|2 pure virtual}", style=filled, fillcolor="#FFD580"]; + AlignSections [label="{AlignSections|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + SampleSurfaceMesh [label="{SampleSurfaceMesh|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + IArrayThreshold_iface [label="{IArrayThreshold|6 pure virtual|Phase 11}", style=filled, fillcolor="#A8D8EA"]; + AbstractArrayThreshold [label="{AbstractArrayThreshold|Phase 11}", style=filled, fillcolor="#FFD580"]; + IJsonPipelineParser_iface [label="{IJsonPipelineParser|2 pure virtual|Phase 11}", style=filled, fillcolor="#A8D8EA"]; + AbstractJsonPipelineParser [label="{AbstractJsonPipelineParser|Phase 11}", style=filled, fillcolor="#FFD580"]; + AbstractDataParser [label="{CSV::AbstractDataParser|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractDataStructureMessage [label="{AbstractDataStructureMessage|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + AbstractPipelineMessage [label="{AbstractPipelineMessage|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + PipelineNodeObserver [label="{PipelineNodeObserver|1 pure virtual}", style=filled, fillcolor="#FFD580"]; + + // ===== Concrete Base Class (purple) ===== + ParallelAlgorithm [label="{ParallelAlgorithm|protected ctor}", style=filled, fillcolor="#D4B8E0"]; + + // ===== Concrete Classes (gray) ===== + DataStructure [label="{DataStructure}", style=filled, fillcolor="#E8E8E8"]; + ConcreteFilters [label="{Concrete Filters|hundreds in Plugins/}", style=filled, fillcolor="#E8E8E8"]; + ConcretePlugins [label="{Concrete Plugins|in Plugins/}", style=filled, fillcolor="#E8E8E8"]; + Pipeline [label="{Pipeline}", style=filled, fillcolor="#E8E8E8"]; + PipelineFilter [label="{PipelineFilter}", style=filled, fillcolor="#E8E8E8"]; + PlaceholderFilter [label="{PlaceholderFilter}", style=filled, fillcolor="#E8E8E8"]; + ImageGeom [label="{ImageGeom}", style=filled, fillcolor="#E8E8E8"]; + RectGridGeom [label="{RectGridGeom}", style=filled, fillcolor="#E8E8E8"]; + VertexGeom [label="{VertexGeom}", style=filled, fillcolor="#E8E8E8"]; + EdgeGeom [label="{EdgeGeom}", style=filled, fillcolor="#E8E8E8"]; + TriangleGeom [label="{TriangleGeom}", style=filled, fillcolor="#E8E8E8"]; + QuadGeom [label="{QuadGeom}", style=filled, fillcolor="#E8E8E8"]; + TetrahedralGeom [label="{TetrahedralGeom}", style=filled, fillcolor="#E8E8E8"]; + HexahedralGeom [label="{HexahedralGeom}", style=filled, fillcolor="#E8E8E8"]; + DataGroup [label="{DataGroup}", style=filled, fillcolor="#E8E8E8"]; + AttributeMatrix [label="{AttributeMatrix}", style=filled, fillcolor="#E8E8E8"]; + DataArray [label="{DataArray\}", style=filled, fillcolor="#E8E8E8"]; + NeighborList [label="{NeighborList\}", style=filled, fillcolor="#E8E8E8"]; + StringArray [label="{StringArray}", style=filled, fillcolor="#E8E8E8"]; + DataStore [label="{DataStore\}", style=filled, fillcolor="#E8E8E8"]; + EmptyDataStore [label="{EmptyDataStore\}", style=filled, fillcolor="#E8E8E8"]; + ListStore [label="{ListStore\}", style=filled, fillcolor="#E8E8E8"]; + StringStore [label="{StringStore}", style=filled, fillcolor="#E8E8E8"]; + GridMontage [label="{GridMontage}", style=filled, fillcolor="#E8E8E8"]; + GridTileIndex [label="{GridTileIndex}", style=filled, fillcolor="#E8E8E8"]; + BoolMaskCompare [label="{BoolMaskCompare}", style=filled, fillcolor="#E8E8E8"]; + UInt8MaskCompare [label="{UInt8MaskCompare}", style=filled, fillcolor="#E8E8E8"]; + InMemoryPluginLoader [label="{InMemoryPluginLoader}", style=filled, fillcolor="#E8E8E8"]; + PluginLoader [label="{PluginLoader}", style=filled, fillcolor="#E8E8E8"]; + JsonFilterParserV6 [label="{JsonFilterParserV6}", style=filled, fillcolor="#E8E8E8"]; + JsonFilterParserV7 [label="{JsonFilterParserV7}", style=filled, fillcolor="#E8E8E8"]; + JsonPipelineParserV6 [label="{JsonPipelineParserV6}", style=filled, fillcolor="#E8E8E8"]; + JsonPipelineParserV7 [label="{JsonPipelineParserV7}", style=filled, fillcolor="#E8E8E8"]; + ArrayThreshold [label="{ArrayThreshold}", style=filled, fillcolor="#E8E8E8"]; + ArrayThresholdSet [label="{ArrayThresholdSet}", style=filled, fillcolor="#E8E8E8"]; + ConcreteValueParams [label="{17 ValueParameter subclasses}", style=filled, fillcolor="#E8E8E8"]; + ConcreteMutableParams [label="{12 MutableDataParameter subclasses}", style=filled, fillcolor="#E8E8E8"]; + ConcreteCreationActions [label="{16 creation actions}", style=filled, fillcolor="#E8E8E8"]; + ConcreteDirectActions [label="{5 direct actions}", style=filled, fillcolor="#E8E8E8"]; + ConcreteSegmentFeatures [label="{Concrete SegmentFeatures|in Plugins/}", style=filled, fillcolor="#E8E8E8"]; + ParallelDataAlgorithm [label="{ParallelDataAlgorithm}", style=filled, fillcolor="#E8E8E8"]; + ParallelData2DAlgorithm [label="{ParallelData2DAlgorithm}", style=filled, fillcolor="#E8E8E8"]; + ParallelData3DAlgorithm [label="{ParallelData3DAlgorithm}", style=filled, fillcolor="#E8E8E8"]; + ParallelTaskAlgorithm [label="{ParallelTaskAlgorithm}", style=filled, fillcolor="#E8E8E8"]; + HDF5_GroupIO [label="{HDF5::GroupIO}", style=filled, fillcolor="#E8E8E8"]; + HDF5_FileIO [label="{HDF5::FileIO}", style=filled, fillcolor="#E8E8E8"]; + HDF5_DatasetIO [label="{HDF5::DatasetIO}", style=filled, fillcolor="#E8E8E8"]; + CSVDataParser [label="{CSVDataParser\}", style=filled, fillcolor="#E8E8E8"]; + ConcreteDataStructureMessages [label="{4 DataStructure messages}", style=filled, fillcolor="#E8E8E8"]; + ConcretePipelineMessages [label="{9 Pipeline messages}", style=filled, fillcolor="#E8E8E8"]; + + // ======================================== + // EDGES: Inheritance (child -> parent) + // ======================================== + + // --- IDataStructure hierarchy --- + DataStructure -> IDataStructure; + + // --- Filter hierarchy --- + AbstractFilter -> IFilter; + ConcreteFilters -> AbstractFilter; + + // --- Plugin hierarchy --- + AbstractPlugin -> IPlugin; + ConcretePlugins -> AbstractPlugin; + + // --- Pipeline hierarchy --- + AbstractPipelineNode -> IPipelineNode; + Pipeline -> AbstractPipelineNode; + Pipeline -> PipelineNodeObserver [style=dashed, label="protected"]; + AbstractPipelineFilter -> AbstractPipelineNode; + PipelineFilter -> AbstractPipelineFilter; + PlaceholderFilter -> AbstractPipelineFilter; + + // --- Geometry hierarchy (dual inheritance) --- + AbstractGeometry -> BaseGroup; + AbstractGeometry -> IGeometry; + + AbstractGridGeometry -> AbstractGeometry; + AbstractGridGeometry -> IGridGeometry; + ImageGeom -> AbstractGridGeometry; + RectGridGeom -> AbstractGridGeometry; + + AbstractNodeGeometry0D -> AbstractGeometry; + AbstractNodeGeometry0D -> INodeGeometry0D; + VertexGeom -> AbstractNodeGeometry0D; + + AbstractNodeGeometry1D -> AbstractNodeGeometry0D; + AbstractNodeGeometry1D -> INodeGeometry1D; + EdgeGeom -> AbstractNodeGeometry1D; + + AbstractNodeGeometry2D -> AbstractNodeGeometry1D; + AbstractNodeGeometry2D -> INodeGeometry2D; + TriangleGeom -> AbstractNodeGeometry2D; + QuadGeom -> AbstractNodeGeometry2D; + + AbstractNodeGeometry3D -> AbstractNodeGeometry2D; + AbstractNodeGeometry3D -> INodeGeometry3D; + TetrahedralGeom -> AbstractNodeGeometry3D; + HexahedralGeom -> AbstractNodeGeometry3D; + + // --- DataObject hierarchy --- + AbstractDataObject -> IDataObject; + BaseGroup -> AbstractDataObject; + DataGroup -> BaseGroup; + AttributeMatrix -> BaseGroup; + AbstractMontage -> BaseGroup; + GridMontage -> AbstractMontage; + + AbstractArray -> AbstractDataObject; + AbstractDataArray -> AbstractArray; + DataArray -> AbstractDataArray; + AbstractNeighborList -> AbstractArray; + NeighborList -> AbstractNeighborList; + StringArray -> AbstractArray; + + // --- DataStore hierarchy --- + AbstractDataStore -> IDataStore; + DataStore -> AbstractDataStore; + EmptyDataStore -> AbstractDataStore; + + // --- ListStore hierarchy --- + AbstractListStore -> IListStore; + ListStore -> AbstractListStore; + + // --- StringStore hierarchy --- + StringStore -> IStringStore; + + // --- Montage hierarchy --- + GridTileIndex -> AbstractTileIndex; + + // --- Parameter hierarchy --- + AbstractParameter -> IParameter; + ValueParameter -> AbstractParameter; + DataParameter -> AbstractParameter; + MutableDataParameter -> DataParameter; + ConstDataParameter -> DataParameter; + ConcreteValueParams -> ValueParameter; + ConcreteMutableParams -> MutableDataParameter; + + // --- DataAction hierarchy --- + AbstractDataCreationAction -> IDataAction; + ConcreteCreationActions -> AbstractDataCreationAction; + ConcreteDirectActions -> IDataAction; + + // --- SegmentFeatures hierarchy --- + AbstractSegmentFeatures -> ISegmentFeatures; + ConcreteSegmentFeatures -> AbstractSegmentFeatures; + + // --- MaskCompare hierarchy --- + BoolMaskCompare -> IMaskCompare; + UInt8MaskCompare -> IMaskCompare; + + // --- PluginLoader hierarchy --- + InMemoryPluginLoader -> IPluginLoader; + PluginLoader -> IPluginLoader; + + // --- JsonFilterParser hierarchy --- + JsonFilterParserV6 -> IJsonFilterParser; + JsonFilterParserV7 -> IJsonFilterParser; + + // --- JsonPipelineParser hierarchy --- + AbstractJsonPipelineParser -> IJsonPipelineParser_iface; + JsonPipelineParserV6 -> AbstractJsonPipelineParser; + JsonPipelineParserV7 -> AbstractJsonPipelineParser; + + // --- ArrayThreshold hierarchy --- + AbstractArrayThreshold -> IArrayThreshold_iface; + ArrayThreshold -> AbstractArrayThreshold; + ArrayThresholdSet -> AbstractArrayThreshold; + + // --- IO hierarchy --- + HDF5_AbstractDataIO -> IDataFactory; + HDF5_GroupIO -> HDF5_ObjectIO; + HDF5_FileIO -> HDF5_GroupIO; + HDF5_DatasetIO -> HDF5_ObjectIO; + + // --- ParallelAlgorithm hierarchy --- + ParallelDataAlgorithm -> ParallelAlgorithm; + ParallelData2DAlgorithm -> ParallelAlgorithm; + ParallelData3DAlgorithm -> ParallelAlgorithm; + ParallelTaskAlgorithm -> ParallelAlgorithm; + + // --- CSV parser hierarchy --- + CSVDataParser -> AbstractDataParser; + + // --- Messaging hierarchies --- + ConcreteDataStructureMessages -> AbstractDataStructureMessage; + ConcretePipelineMessages -> AbstractPipelineMessage; +} diff --git a/Code_Review/Phase_8_Interface_Review.md b/Code_Review/Phase_8_Interface_Review.md new file mode 100644 index 0000000000..2d083bc96e --- /dev/null +++ b/Code_Review/Phase_8_Interface_Review.md @@ -0,0 +1,779 @@ +# Phase 8: Post-Refactoring Interface Review + +## Overview + +This document is an updated review of the `src/simplnx/` codebase **after** completion of Phases 2-7 of the COM-style API refactoring. It catalogs every class that participates in an interface or abstract base class hierarchy, reflecting all changes made during the refactoring effort. + +Classes are categorized as: + +- **Pure Interface**: All methods are pure virtual + virtual destructor, no data members, no concrete method bodies +- **Near-Pure Interface**: Almost all methods pure virtual, with only trivial delegation helpers +- **Abstract Base Class**: Mix of pure virtual methods and concrete implementations +- **Concrete Base Class**: No pure virtual methods but designed for inheritance + +--- + +## Summary Statistics + +| Category | Count | Classes | +|----------|-------|---------| +| **Pure Interface** | 21 | `IFilter`, `IPlugin`, `IPipelineNode`, `IDataObject`, `IGeometry`, `IGridGeometry`, `INodeGeometry0D`, `INodeGeometry1D`, `INodeGeometry2D`, `INodeGeometry3D`, `ISegmentFeatures`, `IMaskCompare`, `IJsonFilterParser`, `IPluginLoader`, `IDataStore`, `IListStore`, `IDataFactory`, `IParameter`, `IArrayThreshold`, `IJsonPipelineParser`, `IStringStore` | +| **Pure Interface (large)** | 1 | `IDataStructure` (39+ pure virtual methods) | +| **Near-Pure Interface** | 0 | *(all promoted to Pure Interface in Phases 9-14)* | +| **Abstract Base Class** | 35 | See detailed sections below | +| **Concrete Base Class** | 1 | `ParallelAlgorithm` (protected ctor, no virtuals) | + +### Changes Since Phase 1 Review + +| What Changed | Details | +|-------------|---------| +| **New pure interfaces extracted** | `IFilter` (Phase 3), `IPipelineNode` (Phase 4), `IPlugin` (Phase 5), `IGeometry` + `IGridGeometry` + `INodeGeometry0D-3D` (Phase 6), `IDataStructure` (Phase 7), `ISegmentFeatures` (Phase 2), `IParameter` promoted to pure (Phase 10), `IArrayThreshold` extracted (Phase 11), `IJsonPipelineParser` extracted (Phase 11), `IDataObject` extracted (Phase 14), `IStringStore` promoted (Phase 15) | +| **Classes renamed** | `IFilter` -> `AbstractFilter`, `SegmentFeatures` -> `AbstractSegmentFeatures`, `IGeometry` -> `AbstractGeometry`, `IGridGeometry` -> `AbstractGridGeometry`, `INodeGeometry0D-3D` -> `AbstractNodeGeometry0D-3D`, `IArray` -> `AbstractArray` (Phase 11), `IDataArray` -> `AbstractDataArray` (Phase 11), `INeighborList` -> `AbstractNeighborList` (Phase 11), `IArrayThreshold` -> `AbstractArrayThreshold` (Phase 11), `IJsonPipelineParser` -> `AbstractJsonPipelineParser` (Phase 11), `IDataIOManager` -> `AbstractDataIOManager` (Phase 12), `DataObject` -> `AbstractDataObject` (Phase 14), `IDataCreationAction` -> `AbstractDataCreationAction` (Phase 15), `IDataIO` -> `AbstractDataIO` + 6 HDF5 IO classes (Phase 15), `AbstractStringStore` -> `IStringStore` (Phase 15) | +| **Dead code removed** | `src/simplnx/Utilities/Parsing/JSON.deprecated/` directory (15 files) removed in Phase 13 — not compiled or referenced anywhere | +| **Misleading "I" prefix fixed** | `IParallelAlgorithm` -> `ParallelAlgorithm` | +| **Total new pure interfaces** | 15 (up from 4 in Phase 1) | + +--- + +## Pure Interface Classes + +### 1. `IFilter` +- **File**: `src/simplnx/Filter/IFilter.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 3 +- **Pure virtual methods (13)**: `name()`, `className()`, `uuid()`, `humanName()`, `defaultTags()`, `parameters()`, `parametersVersion()`, `clone()`, `preflight()`, `execute()`, `toJson()`, `fromJson()`, `getDefaultArguments()` +- **Nested types**: `UniquePointer`, `Message`, `ProgressMessage`, `MessageHandler`, `PreflightValue`, `PreflightResult`, `ExecuteResult` +- **Concrete methods**: 1 (`MakePreflightErrorResult` static helper) + +### 2. `IPlugin` +- **File**: `src/simplnx/Plugin/IPlugin.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 5 +- **Pure virtual methods (11)**: `getName()`, `getDescription()`, `getId()`, `getVendor()`, `containsFilterId()`, `createFilter()`, `getFilterHandles()`, `getFilterCount()`, `getDataIOManagers()`, `getSimplToSimplnxMap()`, `setOocTempDirectory()` +- **Nested types**: `IdType`, `FilterContainerType`, `IOManagerPointer`, `IOManagersContainerType`, `SIMPLData`, `SIMPLMapType` + +### 3. `IPipelineNode` +- **File**: `src/simplnx/Pipeline/IPipelineNode.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 4 +- **Pure virtual methods (24)**: `getType()`, `getName()`, `getParentPipeline()`, `setParentPipeline()`, `hasParentPipeline()`, `preflight()` (x2), `execute()`, `deepCopy()`, `getFaultState()`, `hasErrors()`, `hasWarnings()`, `isDisabled()`, `isEnabled()`, `setDisabled()`, `setEnabled()`, `getDataStructure()`, `getPreflightStructure()`, `clearDataStructure()`, `clearPreflightStructure()`, `isPreflighted()`, `toJson()`, `getPrecedingPipeline()`, `getPipelineExecutionContext()` +- **Nested types**: `NodeType`, `RenamedPath`, `RenamedPaths` + +### 4. `IDataStructure` +- **File**: `src/simplnx/DataStructure/IDataStructure.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 7 +- **Pure virtual methods (39+)**: All non-template public methods of `DataStructure` — `getSize()`, `clear()`, `getId()`, `containsData()` (x2), `getData()` (x7 overloads), `getDataRef()` (x4), `getSharedData()` (x4), `removeData()` (x3), `getLinkedPath()`, `makePath()`, `getDataPathsForId()`, `getAllDataPaths()`, `getAllDataObjectIds()`, `getTopLevelData()`, `getDataMap()`, `insert()`, `getNextId()`, `setAdditionalParent()`, `removeParent()`, `begin()` (x2), `end()` (x2), `validateNumberOfTuples()`, `resetIds()`, `exportHierarchyAsGraphViz()`, `exportHierarchyAsText()`, `setNextId()`, `getRootGroup()`, `flush()`, `memoryUsage()`, `transferDataArraysOoc()`, `validateGeometries()`, `validateAttributeMatrices()` +- **Type aliases**: `SignalType`, `Iterator`, `ConstIterator` +- **Note**: Template methods (`getDataAs`, `getDataRefAs`, etc.) remain on `DataStructure` since C++ templates cannot be virtual. + +### 5. `IGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/IGeometry.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods (6)**: `getGeomType()`, `getNumberOfCells()`, `findElementSizes()`, `getParametricCenter()`, `getShapeFunctions()`, `validate()` +- **Enums**: `Type` (8 geometry types), `LengthUnit` (27 units) +- **Type aliases (10)**: `StatusCode`, `MeshIndexType`, `MeshIndexArrayType`, `SharedVertexList`, `SharedEdgeList`, `SharedFaceList`, `SharedTriList`, `SharedQuadList`, `SharedTetList`, `SharedHexList`, `ElementDynamicList` +- **Constants**: `k_VoxelSizes`, `k_GeomTypeStrings` + +### 6. `IGridGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/IGridGeometry.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods (19)**: `getDimensions()`, `setDimensions()`, `getNumXCells()`, `getNumYCells()`, `getNumZCells()`, `getPlaneCoordsf()` (x3), `getPlaneCoords()` (x3), `getCoordsf()` (x3), `getCoords()` (x3), `getIndex()` (x2) +- **Constants**: `k_CellAttributeMatrixName` + +### 7. `INodeGeometry0D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods**: 0 (marker/constants-only interface) +- **Constants**: `k_SharedVertexListName`, `k_VertexAttributeMatrixName` + +### 8. `INodeGeometry1D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods (4)**: `getNumberOfVerticesPerEdge()`, `findElementsContainingVert()`, `findElementNeighbors()`, `findElementCentroids()` +- **Constants (6)**: `k_EdgeAttributeMatrixName`, `k_EdgeFeatureAttributeMatrix`, `k_SharedEdgeListName`, `k_UnsharedEdgesListName`, `k_UnsharedFacesListName`, `k_NumEdgeVerts` + +### 9. `INodeGeometry2D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods (3)**: `getNumberOfVerticesPerFace()`, `findEdges()`, `findUnsharedEdges()` +- **Constants (3)**: `k_FaceAttributeMatrixName`, `k_FaceFeatureAttributeMatrixName`, `k_SharedFacesListName` + +### 10. `INodeGeometry3D` +- **File**: `src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp` +- **Inherits from**: Nothing (standalone) +- **Created in**: Phase 6 +- **Pure virtual methods (3)**: `findFaces()`, `findUnsharedFaces()`, `getNumberOfVerticesPerCell()` +- **Constants (2)**: `k_PolyhedronDataName`, `k_SharedPolyhedronListName` + +### 11. `ISegmentFeatures` +- **File**: `src/simplnx/Utilities/ISegmentFeatures.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 2 +- **Pure virtual methods (5)**: `execute()`, `getSeed()`, `determineGrouping()`, `randomizeFeatureIds()`, `initializeStaticVoxelSeedGenerator()` +- **Nested types**: `SeedGenerator`, `NeighborScheme`, `CompareFunctor` + +### 12. `IMaskCompare` +- **File**: `src/simplnx/Utilities/MaskCompareUtilities.hpp` +- **Inherits from**: Nothing +- **Pre-existing** (unchanged) +- **Pure virtual methods (7)**: `bothTrue()`, `bothFalse()`, `isTrue()`, `setValue()`, `getNumberOfTuples()`, `getNumberOfComponents()`, `countTrueValues()` +- **Concrete subclasses**: `BoolMaskCompare`, `UInt8MaskCompare` + +### 13. `IJsonFilterParser` +- **File**: `src/simplnx/Utilities/Parsing/JSON/IJsonFilterParser.hpp` +- **Inherits from**: Nothing +- **Pre-existing** (unchanged) +- **Pure virtual methods (2)**: `fromJson()`, `toJson()` +- **Concrete subclasses**: `JsonFilterParserV6`, `JsonFilterParserV7` + +### 14. `IPluginLoader` +- **File**: `src/simplnx/Plugin/PluginLoader.hpp` +- **Inherits from**: Nothing +- **Pre-existing** (unchanged) +- **Pure virtual methods (3)**: `isLoaded()`, `getPlugin()` (const/non-const) +- **Concrete subclasses**: `InMemoryPluginLoader`, `PluginLoader` + +--- + +### 15. `IDataStore` *(promoted to Pure Interface in Phase 9)* +- **File**: `src/simplnx/DataStructure/IDataStore.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (17)**: `getNumberOfTuples()`, `getTupleShape()`, `getNumberOfComponents()`, `getComponentShape()`, `getChunkShape()`, `getSize()`, `size()`, `empty()`, `resizeTuples()`, `getDataType()`, `getStoreType()`, `getDataFormat()`, `getTypeSize()`, `deepCopy()`, `createNewInstance()`, `writeBinaryFile()` (x2) +- **Concrete methods**: 0 +- **Concrete subclass chain**: `AbstractDataStore` -> `DataStore`, `EmptyDataStore` + +### 16. `IListStore` *(promoted to Pure Interface in Phase 9)* +- **File**: `src/simplnx/DataStructure/IListStore.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (10)**: `getNumberOfTuples()`, `getTupleShape()`, `resizeTuples()`, `clearAllLists()`, `getListSize()`, `getNumberOfLists()`, `size()`, `clear()`, `readHdf5()`, `writeHdf5()` +- **Concrete methods**: 0 +- **Concrete subclass chain**: `AbstractListStore` -> `ListStore` + +### 17. `IDataFactory` *(confirmed Pure Interface in Phase 9)* +- **File**: `src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (1)**: `getDataType()` +- **Concrete methods**: 0 +- **Concrete subclass**: `HDF5::IDataIO` + +### 18. `IArrayThreshold` *(extracted in Phase 11)* +- **File**: `src/simplnx/Utilities/IArrayThreshold.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (6)**: `isInverted()`, `setInverted()`, `getUnionOperator()`, `setUnionOperator()`, `getRequiredPaths()`, `toJson()` +- **Nested types**: `UnionOperator` enum +- **Notes**: Extracted from old `IArrayThreshold` class (renamed to `AbstractArrayThreshold`). + +### 19. `IJsonPipelineParser` *(refactored to pure interface in Phase 11)* +- **File**: `src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (2)**: `fromJson()`, `toJson()` +- **Notes**: Data member and concrete method moved to `AbstractJsonPipelineParser`. + +### 20. `IDataObject` *(extracted in Phase 14)* +- **File**: `src/simplnx/DataStructure/IDataObject.hpp` +- **Inherits from**: Nothing +- **Created in**: Phase 14 +- **Pure virtual methods (21)**: `getDataObjectType()`, `isGroup()`, `getTypeName()`, `getId()`, `getDataStructure()` (x2), `getDataStructureRef()` (x2), `getName()`, `canRename()`, `rename()`, `getParentIds()`, `clearParents()`, `getDataPaths()`, `getMetadata()` (x2), `hasParent()`, `flush()`, `memoryUsage()` +- **Nested types**: `Type` enum (27 values), `EnumType`, `IdType`, `OptionalId`, `ParentCollectionType` +- **Notes**: Root pure interface for the entire data object hierarchy. `deepCopy()`/`shallowCopy()` remain on `AbstractDataObject` as they return concrete types. + +--- + +## Abstract Base Classes + +### DataObject Hierarchy + +#### 18. `AbstractDataObject` *(renamed from DataObject in Phase 14)* +- **File**: `src/simplnx/DataStructure/AbstractDataObject.hpp` +- **Inherits from**: `IDataObject` (Phase 14) +- **Pure virtual methods (3)**: `deepCopy()`, `shallowCopy()`, `getTypeName()` +- **Concrete overrides (18)**: All other IDataObject methods +- **Data members**: 5 +- **Notes**: Root of the entire data object hierarchy. Renamed from `DataObject` in Phase 14. + +#### 19. `BaseGroup` +- **File**: `src/simplnx/DataStructure/BaseGroup.hpp` +- **Inherits from**: `DataObject` +- **Own pure virtual methods**: 0 (3 inherited from DataObject remain unimplemented) +- **Concrete methods**: ~25 (container management, iterators) +- **Data members**: 1 (`m_DataMap`) + +#### 20. `AbstractArray` *(renamed from IArray in Phase 11)* +- **File**: `src/simplnx/DataStructure/AbstractArray.hpp` +- **Inherits from**: `DataObject` +- **Own pure virtual methods (12)**: `getArrayType()`, `getSize()`, `size()`, `empty()`, `getTupleShape()`, `getComponentShape()`, `getNumberOfTuples()`, `getNumberOfComponents()`, `swapTuples()`, `resizeTuples()`, `toString()`, `setValueFromString()` +- **Notes**: Near-pure — all own methods are pure virtual, no own data members. `k_TypeName = "IArray"` preserved for serialization. + +#### 21. `AbstractDataArray` *(renamed from IDataArray in Phase 11)* +- **File**: `src/simplnx/DataStructure/AbstractDataArray.hpp` +- **Inherits from**: `AbstractArray` +- **Own pure virtual methods (4)**: `copyTuple()`, `getIDataStore()` (const/non-const), `getDataFormat()` +- **Concrete methods**: ~10 (delegation to IDataStore) +- **Notes**: `k_TypeName = "IDataArray"` preserved for serialization. `DataObject::Type::AbstractDataArray` (numeric value 6 unchanged). + +#### 22. `AbstractNeighborList` *(renamed from INeighborList in Phase 11)* +- **File**: `src/simplnx/DataStructure/AbstractNeighborList.hpp` +- **Inherits from**: `AbstractArray` +- **Own pure virtual methods (4)**: `getIListStore()` (const/non-const), `copyTuple()`, `getDataType()` +- **Concrete methods**: ~12 +- **Data members**: 1 +- **Notes**: `k_TypeName = "INeighborList"` preserved for serialization. `DataObject::Type::AbstractNeighborList` (numeric value 22 unchanged). + +### Geometry Hierarchy (Refactored in Phase 6) + +#### 23. `AbstractGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractGeometry.hpp` +- **Inherits from**: `BaseGroup`, `IGeometry` (multiple inheritance) +- **Re-declares IGeometry pure virtuals (6)**: All `= 0` (deferred to concrete subclasses) +- **Concrete methods**: ~15 (element sizes, units, dimensionality) +- **Data members**: 4 +- **Key**: `k_TypeName = "IGeometry"` (serialization compatibility), `using IGeometry::Type;` (ambiguity resolution) + +#### 24. `AbstractGridGeometry` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp` +- **Inherits from**: `AbstractGeometry`, `IGridGeometry` (multiple inheritance) +- **Re-declares IGridGeometry pure virtuals (19)**: All `= 0` +- **Concrete methods**: ~11 (cell data management, `validate()`) +- **Data members**: 1 +- **Key**: `k_TypeName = "IGridGeometry"` +- **Concrete subclasses**: `ImageGeom`, `RectGridGeom` + +#### 25. `AbstractNodeGeometry0D` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp` +- **Inherits from**: `AbstractGeometry`, `INodeGeometry0D` (multiple inheritance) +- **Concrete methods**: ~26 (vertex management, bounding box, coordinate access) +- **Data members**: 2 +- **Key**: `k_TypeName = "INodeGeometry0D"` +- **Concrete subclass**: `VertexGeom` + +#### 26. `AbstractNodeGeometry1D` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp` +- **Inherits from**: `AbstractNodeGeometry0D`, `INodeGeometry1D` (multiple inheritance) +- **Re-declares 3 INodeGeometry1D pure virtuals as `= 0`**: `findElementsContainingVert()`, `findElementNeighbors()`, `findElementCentroids()` +- **Concrete methods**: ~37 (edge management) +- **Data members**: 5 +- **Key**: `k_TypeName = "INodeGeometry1D"` +- **Concrete subclass**: `EdgeGeom` + +#### 27. `AbstractNodeGeometry2D` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp` +- **Inherits from**: `AbstractNodeGeometry1D`, `INodeGeometry2D` (multiple inheritance) +- **Re-declares 3 INodeGeometry2D pure virtuals as `= 0`**: `getNumberOfVerticesPerFace()`, `findEdges()`, `findUnsharedEdges()` +- **Concrete methods**: ~27 (face management) +- **Data members**: 3 +- **Key**: `k_TypeName = "INodeGeometry2D"` +- **Concrete subclasses**: `TriangleGeom`, `QuadGeom` + +#### 28. `AbstractNodeGeometry3D` +- **File**: `src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp` +- **Inherits from**: `AbstractNodeGeometry2D`, `INodeGeometry3D` (multiple inheritance) +- **Re-declares 3 INodeGeometry3D pure virtuals as `= 0`**: `findFaces()`, `findUnsharedFaces()`, `getNumberOfVerticesPerCell()` +- **Concrete methods**: ~27 (polyhedra management) +- **Data members**: 3 +- **Key**: `k_TypeName = "INodeGeometry3D"` +- **Concrete subclasses**: `TetrahedralGeom`, `HexahedralGeom` + +### Filter/Parameter Hierarchy (Refactored in Phase 3) + +#### 29. `AbstractFilter` +- **File**: `src/simplnx/Filter/AbstractFilter.hpp` +- **Inherits from**: `IFilter` +- **Own pure virtual methods (2)**: `preflightImpl()`, `executeImpl()` (both protected) +- **Concrete overrides (6)**: `defaultTags()`, `preflight()`, `execute()`, `toJson()`, `fromJson()`, `getDefaultArguments()` +- **Still defers (7)**: `name()`, `className()`, `uuid()`, `humanName()`, `parameters()`, `parametersVersion()`, `clone()` +- **Notes**: Template Method pattern — `preflight()` delegates to `preflightImpl()`, `execute()` to `executeImpl()` + +#### 30. `IParameter` *(promoted to Pure Interface in Phase 10)* +- **File**: `src/simplnx/Filter/IParameter.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (14)**: `uuid()`, `name()`, `humanName()`, `helpText()`, `defaultValue()`, `type()`, `acceptedTypes()`, `getVersion()`, `clone()`, `toJson()`, `fromJson()`, `construct()` +- **Concrete methods**: 0 +- **Notes**: Promoted to pure interface in Phase 10. `toJson()`, `fromJson()`, `construct()` moved to `AbstractParameter`. Template-method hooks `toJsonImpl()`/`fromJsonImpl()` moved to `AbstractParameter` as protected pure virtuals. + +#### 31. `AbstractParameter` +- **File**: `src/simplnx/Filter/AbstractParameter.hpp` +- **Inherits from**: `IParameter` +- **Implements (final) (3)**: `name()`, `humanName()`, `helpText()` +- **Implements (override) (3)**: `toJson()`, `fromJson()`, `construct()` +- **Own protected pure virtuals (2)**: `toJsonImpl()`, `fromJsonImpl()` (template-method hooks, moved from IParameter in Phase 10) +- **Data members**: 3 + +#### 32. `ValueParameter` +- **File**: `src/simplnx/Filter/ValueParameter.hpp` +- **Inherits from**: `AbstractParameter` +- **Implements (final) (1)**: `type()` +- **Adds pure virtual (1)**: `validate()` + +#### 33. `DataParameter` +- **File**: `src/simplnx/Filter/DataParameter.hpp` +- **Inherits from**: `AbstractParameter` +- **Implements (final) (1)**: `type()` +- **Adds pure virtuals (2)**: `mutability()`, `validate(DataStructure&, ...)` + +#### 34. `MutableDataParameter` +- **File**: `src/simplnx/Filter/MutableDataParameter.hpp` +- **Inherits from**: `DataParameter` +- **Implements (final) (1)**: `mutability()` +- **Adds pure virtual (1)**: `resolve(DataStructure&, ...)` + +#### 35. `ConstDataParameter` +- **File**: `src/simplnx/Filter/ConstDataParameter.hpp` +- **Inherits from**: `DataParameter` +- **Implements (final) (1)**: `mutability()` +- **Adds pure virtual (1)**: `resolve(const DataStructure&, ...)` + +### Data Action Hierarchy + +#### 36. `IDataAction` +- **File**: `src/simplnx/Filter/Output.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (2)**: `apply()`, `clone()` +- **Notes**: Pure interface with protected constructor pattern. + +#### 37. `AbstractDataCreationAction` *(renamed from IDataCreationAction in Phase 15)* +- **File**: `src/simplnx/Filter/Output.hpp` +- **Inherits from**: `IDataAction` +- **Adds pure virtual (1)**: `getAllCreatedPaths()` +- **Concrete (1)**: `getCreatedPath()` +- **Data members**: 1 + +### Plugin Hierarchy (Refactored in Phase 5) + +#### 38. `AbstractPlugin` +- **File**: `src/simplnx/Plugin/AbstractPlugin.hpp` +- **Inherits from**: `IPlugin` +- **Still pure virtual (1)**: `getSimplToSimplnxMap()` (override = 0) +- **Concrete overrides (10)**: All other IPlugin methods +- **Data members**: 7 + +### Pipeline Hierarchy (Refactored in Phase 4) + +#### 39. `AbstractPipelineNode` +- **File**: `src/simplnx/Pipeline/AbstractPipelineNode.hpp` +- **Inherits from**: `IPipelineNode` +- **Re-declares as pure (6)**: `getType()`, `getName()`, `preflight()` (x2), `execute()`, `deepCopy()` +- **Own pure virtual (1)**: `toJsonImpl()` (protected) +- **Concrete overrides (18)**: All other IPipelineNode methods +- **Data members**: 11+ + +#### 40. `AbstractPipelineFilter` +- **File**: `src/simplnx/Pipeline/AbstractPipelineFilter.hpp` +- **Inherits from**: `AbstractPipelineNode` +- **Implements (1)**: `getType()` -> returns `NodeType::Filter` +- **Adds pure virtual (1)**: `getFilterType()` + +### Data Store Hierarchy + +#### 41. `AbstractDataStore` (template) +- **File**: `src/simplnx/DataStructure/AbstractDataStore.hpp` +- **Inherits from**: `IDataStore` +- **Own pure virtual methods (20)**: Element access, arithmetic ops, chunk ops, HDF5 I/O +- **Concrete methods**: ~18 (iterators, `operator[]`, `fill()`, `copy()`, type queries) +- **Concrete subclasses**: `DataStore`, `EmptyDataStore` + +#### 42. `AbstractListStore` (template) +- **File**: `src/simplnx/DataStructure/AbstractListStore.hpp` +- **Inherits from**: `IListStore` +- **Own pure virtual methods (14)**: List access, modification, data setting +- **Concrete methods**: 6 (iterators) +- **Concrete subclass**: `ListStore` + +#### 43. `IStringStore` *(renamed from AbstractStringStore in Phase 15)* +- **File**: `src/simplnx/DataStructure/IStringStore.hpp` +- **Inherits from**: Nothing (standalone) +- **Pure virtual methods (12)**: `deepCopy()`, `size()`, `empty()`, tuple operations, element access +- **Concrete methods**: 8 (iterators, comparison operators — trivial delegation to pure virtual `operator[]` and `size()`) +- **Concrete subclass**: `StringStore` +- **Notes**: Renamed to `IStringStore` in Phase 15 — has no data members and all concrete methods are trivial delegations, qualifying it as a pure interface by project convention. + +### Montage Hierarchy + +#### 44. `AbstractMontage` +- **File**: `src/simplnx/DataStructure/Montage/AbstractMontage.hpp` +- **Inherits from**: `BaseGroup` +- **Own pure virtual methods (5)**: `getTooltipGenerator()`, `getGeometry()` (x2), `getTileIndex()`, `setGeometry()` +- **Concrete subclass**: `GridMontage` + +#### 45. `AbstractTileIndex` +- **File**: `src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp` +- **Inherits from**: Nothing +- **Pure virtual methods (3)**: `getGeometry()`, `isValid()`, `getToolTipGenerator()` +- **Concrete subclass**: `GridTileIndex` + +### Messaging Hierarchy + +#### 46. `AbstractDataStructureMessage` +- **File**: `src/simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp` +- **Pure virtual methods (1)**: `getMsgType()` +- **Concrete subclasses**: `DataAddedMessage`, `DataRemovedMessage`, `DataRenamedMessage`, `DataReparentedMessage` + +#### 47. `AbstractPipelineMessage` +- **File**: `src/simplnx/Pipeline/Messaging/AbstractPipelineMessage.hpp` +- **Pure virtual methods (1)**: `toString()` +- **9 concrete subclasses** + +#### 48. `PipelineNodeObserver` +- **File**: `src/simplnx/Pipeline/Messaging/PipelineNodeObserver.hpp` +- **Pure virtual methods (1, protected)**: `onNotify()` +- **Concrete subclass**: `Pipeline` (protected inheritance) + +### IO Hierarchy + +#### 49. `AbstractDataIOManager` *(renamed from IDataIOManager in Phase 12)* +- **File**: `src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp` +- **Pure virtual methods (1)**: `formatName()` +- **Concrete methods**: ~9 (factory management) +- **Data members**: 3 +- **Notes**: Renamed from `IDataIOManager` in Phase 12. Not a pure interface — has data members and concrete methods. + +#### 50. `HDF5::AbstractDataIO` *(renamed from HDF5::IDataIO in Phase 15)* +- **File**: `src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp` +- **Inherits from**: `IDataFactory` +- **Own pure virtual methods (3)**: `readData()`, `writeDataObject()`, `getTypeName()` +- **Notes**: Renamed along with 6 other HDF5 IO base classes (`IGeometryIO` → `AbstractGeometryIO`, `IGridGeometryIO` → `AbstractGridGeometryIO`, `INodeGeom0dIO` → `AbstractNodeGeom0dIO`, `INodeGeom1dIO` → `AbstractNodeGeom1dIO`, `INodeGeom2dIO` → `AbstractNodeGeom2dIO`, `INodeGeom3dIO` → `AbstractNodeGeom3dIO`) + +#### 51. `HDF5::ObjectIO` +- **File**: `src/simplnx/Utilities/Parsing/HDF5/IO/ObjectIO.hpp` +- **Pure virtual methods (2, protected)**: `open()`, `close()` +- **Concrete methods**: ~23 +- **Concrete subclasses**: `GroupIO` -> `FileIO`, `DatasetIO` + +### Utilities Hierarchy + +#### 52. `AbstractSegmentFeatures` +- **File**: `src/simplnx/Utilities/AbstractSegmentFeatures.hpp` +- **Inherits from**: `ISegmentFeatures` +- **Renamed from**: `SegmentFeatures` (Phase 2) +- **Overrides all 5 ISegmentFeatures methods** with default implementations +- **Data members**: 6 + +#### 53. `AlignSections` +- **File**: `src/simplnx/Utilities/AlignSections.hpp` +- **Pure virtual methods (1, protected)**: `findShifts()` +- **Notes**: Template Method pattern. No corresponding `IAlignSections` interface. + +#### 54. `SampleSurfaceMesh` +- **File**: `src/simplnx/Utilities/SampleSurfaceMesh.hpp` +- **Pure virtual methods (1, protected)**: `generatePoints()` +- **Notes**: Template Method pattern. No corresponding `ISampleSurfaceMesh` interface. + +#### 55. `AbstractArrayThreshold` *(renamed from IArrayThreshold in Phase 11)* +- **File**: `src/simplnx/Utilities/ArrayThreshold.hpp` +- **Inherits from**: `IArrayThreshold` (new pure interface) +- **Concrete overrides (5)**: `isInverted()`, `setInverted()`, `getUnionOperator()`, `setUnionOperator()`, `toJson()` +- **Data members**: 2 +- **Notes**: Renamed from `IArrayThreshold` in Phase 11. Pure interface `IArrayThreshold` extracted to `src/simplnx/Utilities/IArrayThreshold.hpp`. + +#### 56. `AbstractJsonPipelineParser` *(renamed from IJsonPipelineParser in Phase 11)* +- **File**: `src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp` +- **Inherits from**: `IJsonPipelineParser` (now pure interface) +- **Concrete methods**: 1 (`getFilterList()`) +- **Data members**: 1 (`m_FilterList`) +- **Notes**: Renamed from `IJsonPipelineParser` in Phase 11. `IJsonPipelineParser` made pure interface. + +#### 57. `CSV::AbstractDataParser` +- **File**: `src/simplnx/Utilities/FileUtilities.hpp` +- **Pure virtual methods (1)**: `parse()` +- **Concrete methods**: 3 +- **Concrete subclass**: `CSVDataParser` + +--- + +## Concrete Base Class + +#### 58. `ParallelAlgorithm` +- **File**: `src/simplnx/Utilities/ParallelAlgorithm.hpp` +- **Renamed from**: `IParallelAlgorithm` (Phase 2) +- **Pure virtual methods**: None +- **Notes**: Protected constructor prevents direct instantiation. No virtual methods at all. +- **Concrete subclasses**: `ParallelDataAlgorithm`, `ParallelData2DAlgorithm`, `ParallelData3DAlgorithm`, `ParallelTaskAlgorithm` + +--- + +## Full Inheritance Hierarchy Tree + +``` +[PURE INTERFACES - Extracted During Phases 2-7] + +IFilter [Pure Interface, Phase 3] + +-- AbstractFilter [Abstract Base] + +-- Hundreds of filter classes [Concrete, in Plugins/] + +IPlugin [Pure Interface, Phase 5] + +-- AbstractPlugin [Abstract Base] + +-- Concrete plugin classes [Concrete, in Plugins/] + +IPipelineNode [Pure Interface, Phase 4] + +-- AbstractPipelineNode [Abstract Base] + +-- Pipeline [Concrete] + +-- AbstractPipelineFilter [Abstract Base] + +-- PipelineFilter [Concrete] + +-- PlaceholderFilter [Concrete] + +IDataStructure [Pure Interface, Phase 7] + +-- DataStructure [Concrete] + +ISegmentFeatures [Pure Interface, Phase 2] + +-- AbstractSegmentFeatures [Abstract Base] + +-- Subclasses in Plugins/ [Concrete] + + +[PURE INTERFACES - Pre-existing] + +IDataFactory [Pure Interface] + +-- HDF5::AbstractDataIO [Abstract Base, renamed Phase 15] + +-- All HDF5 IO classes [Concrete] + +IPluginLoader [Pure Interface] + +-- InMemoryPluginLoader [Concrete] + +-- PluginLoader [Concrete] + +IJsonFilterParser [Pure Interface] + +-- JsonFilterParserV6 [Concrete] + +-- JsonFilterParserV7 [Concrete] + +IMaskCompare [Pure Interface] + +-- BoolMaskCompare [Concrete] + +-- UInt8MaskCompare [Concrete] + + +[GEOMETRY HIERARCHY - Dual Inheritance Pattern (Phase 6)] + +IGeometry (pure interface) IGridGeometry (pure interface) + | | + v v +AbstractGeometry (ABC) ----+---- AbstractGridGeometry (ABC) + | | + | [ImageGeom, RectGridGeom] + | + +-- INodeGeometry0D (pure interface) + | | + | v + +-- AbstractNodeGeometry0D (ABC) + | + +-- INodeGeometry1D (pure interface) + | | + | v + +-- AbstractNodeGeometry1D (ABC) + | + +-- INodeGeometry2D (pure interface) + | | + | v + +-- AbstractNodeGeometry2D (ABC) + | + +-- INodeGeometry3D (pure interface) + | | + | v + +-- AbstractNodeGeometry3D (ABC) + | + [TetrahedralGeom, HexahedralGeom] + + +[PURE INTERFACES -> ABSTRACT BASES -> CONCRETE (Phase 9)] + +IDataStore [Pure Interface (Phase 9)] + +-- AbstractDataStore [Abstract Base, template] + +-- DataStore [Concrete] + +-- EmptyDataStore [Concrete] + +IListStore [Pure Interface (Phase 9)] + +-- AbstractListStore [Abstract Base, template] + +-- ListStore [Concrete] + +IStringStore [Pure Interface, promoted Phase 15] + +-- StringStore [Concrete] + + +[DATA OBJECT HIERARCHY] + +IDataObject [Pure Interface, Phase 14] + +-- AbstractDataObject [Abstract Base, renamed from DataObject Phase 14] + | + +-- BaseGroup [Abstract Base] + | +-- DataGroup [Concrete] + | +-- AttributeMatrix [Concrete] + | +-- AbstractGeometry [Abstract Base] (+ IGeometry) + | | (see Geometry Hierarchy above) + | +-- AbstractMontage [Abstract Base] + | +-- GridMontage [Concrete] + | + +-- AbstractArray [Abstract Base, renamed from IArray Phase 11] + | +-- AbstractDataArray [Abstract Base, renamed from IDataArray Phase 11] + | | +-- DataArray [Concrete] + | +-- AbstractNeighborList [Abstract Base, renamed from INeighborList Phase 11] + | | +-- NeighborList [Concrete] + | +-- StringArray [Concrete] + | + +-- ScalarData [Concrete] + +-- DynamicListArray [Concrete] + + +[PARAMETER HIERARCHY] + +IParameter [Pure Interface, Phase 10] + +-- AbstractParameter [Abstract Base] + +-- ValueParameter [Abstract Base] + | +-- 17 concrete parameters [Concrete] + | +-- VectorParameterBase [Abstract Base] + | +-- VectorParameter [Concrete] + +-- DataParameter [Abstract Base] + +-- MutableDataParameter [Abstract Base] + | +-- 12 concrete params [Concrete] + +-- ConstDataParameter [Abstract Base] + + +[DATA ACTION HIERARCHY] + +IDataAction [Pure Interface] + +-- AbstractDataCreationAction [Abstract Base, renamed Phase 15] + | +-- 16 concrete actions [Concrete] + +-- 5 concrete actions [Concrete] + + +[PIPELINE MESSAGING] + +AbstractPipelineMessage [Abstract Base] + +-- 9 concrete message classes [Concrete] + +PipelineNodeObserver [Abstract Base] + +-- Pipeline [Concrete, protected inheritance] + +AbstractDataStructureMessage [Abstract Base] + +-- 4 concrete message classes [Concrete] + + +[IO HIERARCHY] + +AbstractDataIOManager [Abstract Base, renamed from IDataIOManager Phase 12] + +-- CoreDataIOManager, etc. [Concrete] + +HDF5::ObjectIO [Abstract Base] + +-- GroupIO [Concrete] + | +-- FileIO [Concrete] + +-- DatasetIO [Concrete] + + +[UTILITIES] + +AlignSections [Abstract Base, Template Method] + +-- Subclasses in Plugins/ [Concrete] + +SampleSurfaceMesh [Abstract Base, Template Method] + +-- Subclasses in Plugins/ [Concrete] + +IArrayThreshold [Pure Interface, Phase 11] + +-- AbstractArrayThreshold [Abstract Base] + +-- ArrayThreshold [Concrete] + +-- ArrayThresholdSet [Concrete] + +CSV::AbstractDataParser [Abstract Base] + +-- CSVDataParser [Concrete] + +IJsonPipelineParser [Pure Interface, Phase 11] + +-- AbstractJsonPipelineParser [Abstract Base] + +-- JsonPipelineParserV6 [Concrete] + +-- JsonPipelineParserV7 [Concrete] + +AbstractTileIndex [Abstract Base] + +-- GridTileIndex [Concrete] + +ParallelAlgorithm [Concrete Base - protected ctor] + +-- ParallelDataAlgorithm [Concrete] + +-- ParallelData2DAlgorithm [Concrete] + +-- ParallelData3DAlgorithm [Concrete] + +-- ParallelTaskAlgorithm [Concrete] + + +[STANDALONE - NO INTERFACE] + +DataMap +DataPath +LinkedPath +Metadata +Application +Preferences +Arguments +FilterHandle +FilterList +Parameters (class) +All Common/ classes +``` + +--- + +## Key Findings + +### 1. Dramatic Increase in Pure Interfaces + +The refactoring increased the number of true pure interfaces from **4 to 14**: + +| Phase | Interfaces Extracted | +|-------|---------------------| +| Pre-existing | `IDataFactory`, `IPluginLoader`, `IJsonFilterParser`, `IMaskCompare` | +| Phase 2 | `ISegmentFeatures` | +| Phase 3 | `IFilter` | +| Phase 4 | `IPipelineNode` | +| Phase 5 | `IPlugin` | +| Phase 6 | `IGeometry`, `IGridGeometry`, `INodeGeometry0D`, `INodeGeometry1D`, `INodeGeometry2D`, `INodeGeometry3D` | +| Phase 7 | `IDataStructure` | + +### 2. Naming Convention Now Fully Consistent + +The "I" prefix is now **correctly** used for pure interfaces throughout the codebase. All former misnomers have been fixed in Phases 11-15: + +| Old Name | New Name | Change | +|----------|----------|--------| +| `IArrayThreshold` (ABC) | `AbstractArrayThreshold` + `IArrayThreshold` (pure interface) | Extracted pure interface, renamed ABC | +| `IJsonPipelineParser` (ABC) | `AbstractJsonPipelineParser` + `IJsonPipelineParser` (pure interface) | Extracted pure interface, renamed ABC | +| `IArray` | `AbstractArray` | Renamed (no interface extraction — tightly coupled to DataObject hierarchy) | +| `IDataArray` | `AbstractDataArray` | Renamed (no interface extraction) | +| `INeighborList` | `AbstractNeighborList` | Renamed (no interface extraction) | +| `IDataCreationAction` (ABC) | `AbstractDataCreationAction` | Renamed — has data member and concrete method (Phase 15) | +| `IDataIO` + 6 HDF5 IO classes | `AbstractDataIO` etc. | Renamed — all have data members/concrete methods (Phase 15) | +| `AbstractStringStore` | `IStringStore` | Promoted — no data members, all concrete methods are trivial delegations (Phase 15) | + +### 3. Design Patterns Successfully Applied + +| Pattern | Where Applied | +|---------|---------------| +| **COM-style Interface/Implementation separation** | All major hierarchies now have pure `I`-prefixed interfaces at the root | +| **Template Method** | `AbstractFilter` (`preflight`/`execute` -> `preflightImpl`/`executeImpl`), `AlignSections`, `SampleSurfaceMesh` | +| **Multiple Inheritance (Interface + ABC)** | Geometry hierarchy — each Abstract class inherits from both its parent Abstract and a standalone I-interface | +| **Protected constructor pattern** | All interfaces use protected defaulted constructors to prevent standalone instantiation | +| **`final` keyword** | `AbstractParameter` hierarchy uses `final` to lock down method implementations | + +### 4. Serialization Compatibility Maintained + +All renamed geometry classes preserve their original `k_TypeName` string values (e.g., `AbstractGeometry::k_TypeName = "IGeometry"`) to maintain backward compatibility with existing `.dream3d` file serialization. + +### 5. Remaining Classes Without Extracted Interfaces + +The following abstract base classes do **not** yet have corresponding pure interfaces extracted. These could be candidates for future refactoring phases if further COM-style consistency is desired: + +| Class | Current Pure Virtuals | Complexity | +|-------|----------------------|------------| +| `AlignSections` | 1 | Low | +| `SampleSurfaceMesh` | 1 | Low | +| `AbstractDataStructureMessage` | 1 | Low | +| `AbstractPipelineMessage` | 1 | Low | +| `PipelineNodeObserver` | 1 | Low | +| `HDF5::ObjectIO` | 2 | Medium | +| `AbstractDataIOManager` | 1 | Low | +| `AbstractTileIndex` | 3 | Low | +| `AbstractMontage` | 5 | Medium | + +### 6. Quality of Extracted Interfaces + +All newly extracted interfaces follow consistent design principles: +- Virtual destructor defaulted +- No data members +- Protected default/copy/move constructors (allows derived class copy) +- All public methods pure virtual +- Standalone (no inheritance between interfaces — avoids diamond inheritance) +- Constants and type aliases placed on interfaces where they belong semantically diff --git a/scripts/simplnx_filter.hpp.in b/scripts/simplnx_filter.hpp.in index 04535ce513..b0694b9877 100644 --- a/scripts/simplnx_filter.hpp.in +++ b/scripts/simplnx_filter.hpp.in @@ -3,7 +3,7 @@ #include "@PLUGIN_NAME@/@PLUGIN_NAME@_export.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class @FILTER_NAME@ * @brief This filter will .... */ -class @PLUGIN_NAME_UPPER@_EXPORT @FILTER_NAME@ : public IFilter +class @PLUGIN_NAME_UPPER@_EXPORT @FILTER_NAME@ : public AbstractFilter { public: @FILTER_NAME@() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.cpp index d43ef391f3..9aa548d770 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.cpp @@ -53,7 +53,7 @@ bool ITK::DoDimensionsMatch(const IDataStore& dataStore, const ImageGeom& imageG Result<> ITK::CheckImageType(const std::vector& types, const DataStructure& dataStructure, const DataPath& path) { - const auto& dataArray = dataStructure.getDataRefAs(path); + const auto& dataArray = dataStructure.getDataRefAs(path); DataType dataType = dataArray.getDataType(); auto iter = std::find(types.cbegin(), types.cend(), dataType); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp index f97be4ef9e..9335442444 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp @@ -489,9 +489,9 @@ struct ConvertImageToDatastoreFunctor template struct ArrayComponentOptions { - static inline constexpr bool UsingScalar = UseScalarV; - static inline constexpr bool UsingVector = UseVectorV; - static inline constexpr bool UsingRgbRgba = UseRgbRgbaV; + static constexpr bool UsingScalar = UseScalarV; + static constexpr bool UsingVector = UseVectorV; + static constexpr bool UsingRgbRgba = UseRgbRgbaV; /* * The original implementation seemed to short circuit to vector if both were activated, but it's @@ -503,16 +503,16 @@ struct ArrayComponentOptions template struct ArrayTypeOptions { - static inline constexpr bool UsingInt8 = UseInt8V; - static inline constexpr bool UsingUInt8 = UseUInt8V; - static inline constexpr bool UsingInt16 = UseInt16V; - static inline constexpr bool UsingUInt16 = UseUInt16V; - static inline constexpr bool UsingInt32 = UseInt32V; - static inline constexpr bool UsingUInt32 = UseUInt32V; - static inline constexpr bool UsingInt64 = UseInt64V; - static inline constexpr bool UsingUInt64 = UseUInt64V; - static inline constexpr bool UsingFloat32 = UseFloat32V; - static inline constexpr bool UsingFloat64 = UseFloat64V; + static constexpr bool UsingInt8 = UseInt8V; + static constexpr bool UsingUInt8 = UseUInt8V; + static constexpr bool UsingInt16 = UseInt16V; + static constexpr bool UsingUInt16 = UseUInt16V; + static constexpr bool UsingInt32 = UseInt32V; + static constexpr bool UsingUInt32 = UseUInt32V; + static constexpr bool UsingInt64 = UseInt64V; + static constexpr bool UsingUInt64 = UseUInt64V; + static constexpr bool UsingFloat32 = UseFloat32V; + static constexpr bool UsingFloat64 = UseFloat64V; }; template @@ -930,7 +930,7 @@ template class OutputT = detail::DefaultO Result DataCheck(const DataStructure& dataStructure, const DataPath& inputArrayPath, const DataPath& imageGeomPath, const DataPath& outputArrayPath) { const auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - const auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); + const auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); const auto& inputDataStore = inputArray.getIDataStoreRef(); return ArraySwitchFunc(inputDataStore, imageGeom, -1, dataStructure, inputArrayPath, imageGeomPath, outputArrayPath); @@ -942,8 +942,8 @@ Result> Execute(DataStr const itk::ProgressObserver::Pointer progressObserver = nullptr) { auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); - auto& outputArray = dataStructure.getDataRefAs(outputArrayPath); + auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); + auto& outputArray = dataStructure.getDataRefAs(outputArrayPath); auto& inputDataStore = inputArray.getIDataStoreRef(); auto& outputDataStore = outputArray.getIDataStoreRef(); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ProjectionUtils.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ProjectionUtils.hpp index 8995b1771a..9b4acc39f7 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ProjectionUtils.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ProjectionUtils.hpp @@ -151,7 +151,7 @@ IFilter::PreflightResult RunITKProjectionDataCheck(const DataStructure& dataStru return MakeErrorResult(-76590, fmt::format("Input {} type is not currently supported. Please reach out to devs if you have a use case.", DataTypeToString(dataType))); }; - DataType type = dataStructure.getDataRefAs(selectedInputArray).getDataType(); + DataType type = dataStructure.getDataRefAs(selectedInputArray).getDataType(); Result helperOutputActions = RunTemplateFunctor(RunITKProjectionDataCheckFunctor{}, fallbackFunc, type, dataStructure, selectedInputArray, imageGeomPath, outputArrayPath); @@ -182,7 +182,7 @@ Result<> RunITKProjectionExecute(DataStructure& dataStructure, const DataPath& s outputArrayPath = finalImageGeomPath.createChildPath(originalGeometry.getCellDataPath().getTargetName()).createChildPath(outputArrayName); } - DataType type = dataStructure.getDataRefAs(selectedInputArray).getDataType(); + DataType type = dataStructure.getDataRefAs(selectedInputArray).getDataType(); auto fallbackFunc = [](DataType dataType) { return MakeErrorResult(-76591, fmt::format("Input {} type is not currently supported. Please reach out to devs if you have a use case.", DataTypeToString(dataType))); @@ -197,7 +197,7 @@ Result<> RunITKProjectionExecute(DataStructure& dataStructure, const DataPath& s } auto& imageGeom = dataStructure.getDataRefAs(finalImageGeomPath); - auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); + auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); // Update the Image Geometry with the new dimensions imageGeom.setDimensions({iArrayTupleShape[2], iArrayTupleShape[1], iArrayTupleShape[0]}); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp index ccfec212cf..1dd66c2011 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp @@ -5,9 +5,9 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" #include "simplnx/Parameters/VectorParameter.hpp" #include "simplnx/Utilities/StringUtilities.hpp" @@ -199,7 +199,7 @@ class IOHandler } // Ensure that we are dealing with in-core memory ONLY - // const IDataArray* inputArrayPtr = m_DataStructure.getDataAs(imageDataPath); + // const AbstractDataArray* inputArrayPtr = m_DataStructure.getDataAs(imageDataPath); // if(inputArrayPtr->getDataFormat() != "") //{ // return MakeErrorResult(-9999, fmt::format("Input Array '{}' utilizes out-of-core data. This is not supported within ITK filters.", imageDataPath.toString())); @@ -249,7 +249,7 @@ class IOHandler continue; } - if(m_DataStructure.getDataRefAs(imageDataPath).getDataType() != DataType::uint8) + if(m_DataStructure.getDataRefAs(imageDataPath).getDataType() != DataType::uint8) { outputResult.warnings().emplace_back( Warning{-74320, fmt::format("The array ({}) is not a UIntArray, so it will not be converted to grayscale. Continuing...", imageDataPath.getTargetName())}); @@ -271,16 +271,16 @@ class IOHandler } // deletion of non-grayscale array - DataObject::IdType id; + AbstractDataObject::IdType id; { // scoped for safety since this reference will be nonexistent in a moment - auto& oldArray = m_DataStructure.getDataRefAs(imageDataPath); + auto& oldArray = m_DataStructure.getDataRefAs(imageDataPath); id = oldArray.getId(); } m_DataStructure.removeData(id); // rename grayscale array to reflect original { - auto& gray = m_DataStructure.getDataRefAs(imageDataPath.replaceName("gray" + imageDataPath.getTargetName())); + auto& gray = m_DataStructure.getDataRefAs(imageDataPath.replaceName("gray" + imageDataPath.getTargetName())); if(gray.canRename(imageDataPath.getTargetName()) == false) { return MakeErrorResult(-18543, fmt::format("Unable to rename the grayscale array to {}", imageDataPath.getTargetName())); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.hpp index 9bb63d8491..3527493859 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.hpp @@ -3,7 +3,7 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/Filter/FilterTraits.hpp" #include "simplnx/Filter/IFilter.hpp" @@ -21,7 +21,7 @@ struct ITKIMAGEPROCESSING_EXPORT ITKImportFijiMontageInputValues bool changeDataType = false; DataType destType = DataType::uint8; fs::path inputFilePath = {}; - IGeometry::LengthUnit lengthUnit = IGeometry::LengthUnit::Micrometer; + AbstractGeometry::LengthUnit lengthUnit = AbstractGeometry::LengthUnit::Micrometer; std::vector origin = {}; std::vector colorWeights = {}; std::string DataGroupName = ""; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAbsImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAbsImageFilter.hpp index e6bffd76b8..7d3f9be622 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAbsImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAbsImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKAbsImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKAbsImageFilter : public AbstractFilter { public: ITKAbsImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAcosImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAcosImageFilter.hpp index ba40445708..e010aa3b68 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAcosImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAcosImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -35,7 +35,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKAcosImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKAcosImageFilter : public AbstractFilter { public: ITKAcosImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAdaptiveHistogramEqualizationImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAdaptiveHistogramEqualizationImageFilter.hpp index 336cc97d6e..2ce8ef3020 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAdaptiveHistogramEqualizationImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAdaptiveHistogramEqualizationImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKAdaptiveHistogramEqualizationImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKAdaptiveHistogramEqualizationImageFilter : public AbstractFilter { public: ITKAdaptiveHistogramEqualizationImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKApproximateSignedDistanceMapImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKApproximateSignedDistanceMapImageFilter.hpp index d35a14a911..d7863c2a09 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKApproximateSignedDistanceMapImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKApproximateSignedDistanceMapImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -49,7 +49,7 @@ namespace nx::core * ITK Module: ITKDistanceMap * ITK Group: DistanceMap */ -class ITKIMAGEPROCESSING_EXPORT ITKApproximateSignedDistanceMapImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKApproximateSignedDistanceMapImageFilter : public AbstractFilter { public: ITKApproximateSignedDistanceMapImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAsinImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAsinImageFilter.hpp index c5b5cb1ce0..db3ef83a83 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAsinImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAsinImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -35,7 +35,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKAsinImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKAsinImageFilter : public AbstractFilter { public: ITKAsinImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAtanImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAtanImageFilter.hpp index 670522b9d1..8986e52135 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAtanImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKAtanImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKAtanImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKAtanImageFilter : public AbstractFilter { public: ITKAtanImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryContourImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryContourImageFilter.hpp index 27e9bc1dc1..cd4300e647 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryContourImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryContourImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKImageLabel * ITK Group: ImageLabel */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryContourImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryContourImageFilter : public AbstractFilter { public: ITKBinaryContourImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryDilateImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryDilateImageFilter.hpp index 577406fd62..a5a057f730 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryDilateImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryDilateImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -35,7 +35,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryDilateImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryDilateImageFilter : public AbstractFilter { public: ITKBinaryDilateImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryErodeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryErodeImageFilter.hpp index 1c20ab5bc3..f06d0e08d4 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryErodeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryErodeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -35,7 +35,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryErodeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryErodeImageFilter : public AbstractFilter { public: ITKBinaryErodeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalClosingImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalClosingImageFilter.hpp index e7a2a36e81..063c64a783 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalClosingImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalClosingImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryMorphologicalClosingImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryMorphologicalClosingImageFilter : public AbstractFilter { public: ITKBinaryMorphologicalClosingImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalOpeningImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalOpeningImageFilter.hpp index 84140c5ae4..d34e58ba99 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalOpeningImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryMorphologicalOpeningImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryMorphologicalOpeningImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryMorphologicalOpeningImageFilter : public AbstractFilter { public: ITKBinaryMorphologicalOpeningImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryOpeningByReconstructionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryOpeningByReconstructionImageFilter.hpp index cabcbbf903..b53b3080ed 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryOpeningByReconstructionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryOpeningByReconstructionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -25,7 +25,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryOpeningByReconstructionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryOpeningByReconstructionImageFilter : public AbstractFilter { public: ITKBinaryOpeningByReconstructionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.cpp index e8bfebb368..2d99e626ee 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.cpp @@ -186,7 +186,7 @@ Result<> ITKBinaryProjectionImageFilter::executeImpl(DataStructure& dataStructur } auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); + auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); // Update the Image Geometry with the new dimensions imageGeom.setDimensions({iArrayTupleShape[2], iArrayTupleShape[1], iArrayTupleShape[0]}); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.hpp index f3632d9992..9d79cab1d7 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -42,7 +42,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryProjectionImageFilter : public AbstractFilter { public: ITKBinaryProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThinningImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThinningImageFilter.hpp index 83b10588d4..f750b1b24c 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThinningImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThinningImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -28,7 +28,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryThinningImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryThinningImageFilter : public AbstractFilter { public: ITKBinaryThinningImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThresholdImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThresholdImageFilter.hpp index afe6b3c94e..9624e901ab 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThresholdImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBinaryThresholdImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKThresholding * ITK Group: Thresholding */ -class ITKIMAGEPROCESSING_EXPORT ITKBinaryThresholdImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBinaryThresholdImageFilter : public AbstractFilter { public: ITKBinaryThresholdImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBlackTopHatImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBlackTopHatImageFilter.hpp index 0569033cdb..d8f6b60a26 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBlackTopHatImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBlackTopHatImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -21,7 +21,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKBlackTopHatImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBlackTopHatImageFilter : public AbstractFilter { public: ITKBlackTopHatImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBoundedReciprocalImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBoundedReciprocalImageFilter.hpp index 54f9acc893..23aca151a4 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBoundedReciprocalImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKBoundedReciprocalImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKBoundedReciprocalImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKBoundedReciprocalImageFilter : public AbstractFilter { public: ITKBoundedReciprocalImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKClosingByReconstructionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKClosingByReconstructionImageFilter.hpp index 9334612084..b945a44074 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKClosingByReconstructionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKClosingByReconstructionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -30,7 +30,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKClosingByReconstructionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKClosingByReconstructionImageFilter : public AbstractFilter { public: ITKClosingByReconstructionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKConnectedComponentImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKConnectedComponentImageFilter.hpp index fe0a4324d8..d06394757a 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKConnectedComponentImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKConnectedComponentImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -24,7 +24,7 @@ namespace nx::core * ITK Module: ITKConnectedComponents * ITK Group: ConnectedComponents */ -class ITKIMAGEPROCESSING_EXPORT ITKConnectedComponentImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKConnectedComponentImageFilter : public AbstractFilter { public: ITKConnectedComponentImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCosImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCosImageFilter.hpp index 2bf09d39d7..b66cc5b5dd 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCosImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCosImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -35,7 +35,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKCosImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKCosImageFilter : public AbstractFilter { public: ITKCosImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureAnisotropicDiffusionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureAnisotropicDiffusionImageFilter.hpp index 05b2493589..0a5cbd4b1e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureAnisotropicDiffusionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureAnisotropicDiffusionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -36,7 +36,7 @@ namespace nx::core * ITK Module: ITKAnisotropicSmoothing * ITK Group: AnisotropicSmoothing */ -class ITKIMAGEPROCESSING_EXPORT ITKCurvatureAnisotropicDiffusionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKCurvatureAnisotropicDiffusionImageFilter : public AbstractFilter { public: ITKCurvatureAnisotropicDiffusionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureFlowImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureFlowImageFilter.hpp index ba4549045e..a64226e86f 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureFlowImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKCurvatureFlowImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -52,7 +52,7 @@ namespace nx::core * ITK Module: ITKCurvatureFlow * ITK Group: CurvatureFlow */ -class ITKIMAGEPROCESSING_EXPORT ITKCurvatureFlowImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKCurvatureFlowImageFilter : public AbstractFilter { public: ITKCurvatureFlowImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDanielssonDistanceMapImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDanielssonDistanceMapImageFilter.hpp index 124e6511d0..e308e894d4 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDanielssonDistanceMapImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDanielssonDistanceMapImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -53,7 +53,7 @@ namespace nx::core * ITK Module: ITKDistanceMap * ITK Group: DistanceMap */ -class ITKIMAGEPROCESSING_EXPORT ITKDanielssonDistanceMapImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKDanielssonDistanceMapImageFilter : public AbstractFilter { public: ITKDanielssonDistanceMapImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDilateObjectMorphologyImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDilateObjectMorphologyImageFilter.hpp index 7376ffa883..1ad31f0958 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDilateObjectMorphologyImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDilateObjectMorphologyImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -25,7 +25,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKDilateObjectMorphologyImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKDilateObjectMorphologyImageFilter : public AbstractFilter { public: ITKDilateObjectMorphologyImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDiscreteGaussianImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDiscreteGaussianImageFilter.hpp index a8b2ad4a1a..8deb5c8d12 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDiscreteGaussianImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDiscreteGaussianImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -36,7 +36,7 @@ namespace nx::core * ITK Module: ITKSmoothing * ITK Group: Smoothing */ -class ITKIMAGEPROCESSING_EXPORT ITKDiscreteGaussianImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKDiscreteGaussianImageFilter : public AbstractFilter { public: ITKDiscreteGaussianImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDoubleThresholdImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDoubleThresholdImageFilter.hpp index ab1bfc94d9..36e1c381b2 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDoubleThresholdImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKDoubleThresholdImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -28,7 +28,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKDoubleThresholdImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKDoubleThresholdImageFilter : public AbstractFilter { public: ITKDoubleThresholdImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKErodeObjectMorphologyImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKErodeObjectMorphologyImageFilter.hpp index 95e8ad6952..be418b6325 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKErodeObjectMorphologyImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKErodeObjectMorphologyImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -25,7 +25,7 @@ namespace nx::core * ITK Module: ITKBinaryMathematicalMorphology * ITK Group: BinaryMathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKErodeObjectMorphologyImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKErodeObjectMorphologyImageFilter : public AbstractFilter { public: ITKErodeObjectMorphologyImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpImageFilter.hpp index 4408fae9b6..9433685345 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKExpImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKExpImageFilter : public AbstractFilter { public: ITKExpImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpNegativeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpNegativeImageFilter.hpp index 4a15426e73..ff398eb380 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpNegativeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKExpNegativeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKExpNegativeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKExpNegativeImageFilter : public AbstractFilter { public: ITKExpNegativeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientAnisotropicDiffusionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientAnisotropicDiffusionImageFilter.hpp index 66d8d7ffe8..fb64cd9e81 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientAnisotropicDiffusionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientAnisotropicDiffusionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -32,7 +32,7 @@ namespace nx::core * ITK Module: ITKAnisotropicSmoothing * ITK Group: AnisotropicSmoothing */ -class ITKIMAGEPROCESSING_EXPORT ITKGradientAnisotropicDiffusionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGradientAnisotropicDiffusionImageFilter : public AbstractFilter { public: ITKGradientAnisotropicDiffusionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeImageFilter.hpp index da3f33be5e..4b8355df2b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -25,7 +25,7 @@ namespace nx::core * ITK Module: ITKImageGradient * ITK Group: ImageGradient */ -class ITKIMAGEPROCESSING_EXPORT ITKGradientMagnitudeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGradientMagnitudeImageFilter : public AbstractFilter { public: ITKGradientMagnitudeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeRecursiveGaussianImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeRecursiveGaussianImageFilter.hpp index cf4891ee83..20712c6bae 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeRecursiveGaussianImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGradientMagnitudeRecursiveGaussianImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageGradient * ITK Group: ImageGradient */ -class ITKIMAGEPROCESSING_EXPORT ITKGradientMagnitudeRecursiveGaussianImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGradientMagnitudeRecursiveGaussianImageFilter : public AbstractFilter { public: ITKGradientMagnitudeRecursiveGaussianImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleDilateImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleDilateImageFilter.hpp index 1538886b28..1eec30e0ec 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleDilateImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleDilateImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -20,7 +20,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleDilateImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleDilateImageFilter : public AbstractFilter { public: ITKGrayscaleDilateImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleErodeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleErodeImageFilter.hpp index c72149b737..5b45a0613e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleErodeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleErodeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -20,7 +20,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleErodeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleErodeImageFilter : public AbstractFilter { public: ITKGrayscaleErodeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleFillholeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleFillholeImageFilter.hpp index 358ba18c64..67415306e3 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleFillholeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleFillholeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleFillholeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleFillholeImageFilter : public AbstractFilter { public: ITKGrayscaleFillholeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleGrindPeakImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleGrindPeakImageFilter.hpp index 15b75f744e..d06d26fda0 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleGrindPeakImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleGrindPeakImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -33,7 +33,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleGrindPeakImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleGrindPeakImageFilter : public AbstractFilter { public: ITKGrayscaleGrindPeakImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalClosingImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalClosingImageFilter.hpp index 0b51efb3d4..69a8e9cc68 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalClosingImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalClosingImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -20,7 +20,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleMorphologicalClosingImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleMorphologicalClosingImageFilter : public AbstractFilter { public: ITKGrayscaleMorphologicalClosingImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalOpeningImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalOpeningImageFilter.hpp index db39ad8815..14bcfcda8a 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalOpeningImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKGrayscaleMorphologicalOpeningImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -20,7 +20,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleMorphologicalOpeningImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKGrayscaleMorphologicalOpeningImageFilter : public AbstractFilter { public: ITKGrayscaleMorphologicalOpeningImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHConvexImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHConvexImageFilter.hpp index 056b57eccd..a0b85cf548 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHConvexImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHConvexImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -27,7 +27,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKHConvexImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKHConvexImageFilter : public AbstractFilter { public: ITKHConvexImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMaximaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMaximaImageFilter.hpp index f85ad88976..9c33ee1850 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMaximaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMaximaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -33,7 +33,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKHMaximaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKHMaximaImageFilter : public AbstractFilter { public: ITKHMaximaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMinimaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMinimaImageFilter.hpp index eb85aec474..34bfd0f450 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMinimaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKHMinimaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -30,7 +30,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKHMinimaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKHMinimaImageFilter : public AbstractFilter { public: ITKHMinimaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.cpp index 5cf1a4dd67..002804b731 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.cpp @@ -76,7 +76,7 @@ Parameters ITKImageReaderFilter::parameters() const FileSystemPathParameter::PathType::InputFile, false)); params.insert(std::make_unique(k_LengthUnit_Key, "Length Unit", "The length unit that will be set into the created image geometry", - to_underlying(IGeometry::LengthUnit::Micrometer), IGeometry::GetAllLengthUnitStrings())); + to_underlying(AbstractGeometry::LengthUnit::Micrometer), AbstractGeometry::GetAllLengthUnitStrings())); params.insertLinkableParameter(std::make_unique(k_ChangeDataType_Key, "Set Image Data Type", "Set the final created image data type.", false)); params.insert(std::make_unique(k_ImageDataType_Key, "Output Data Type", "Numeric Type of data to create", 0ULL, @@ -188,7 +188,7 @@ Result<> ITKImageReaderFilter::executeImpl(DataStructure& dataStructure, const A DataPath imageDataArrayPath = imageGeometryPath.createChildPath(cellDataName).createChildPath(imageDataArrayName); - // const IDataArray* inputArrayPtr = dataStructure.getDataAs(imageDataArrayPath); + // const AbstractDataArray* inputArrayPtr = dataStructure.getDataAs(imageDataArrayPath); // if(!inputArrayPtr->getDataFormat().empty()) //{ // return MakeErrorResult(-9999, fmt::format("Input Array '{}' utilizes out-of-core data. This is not supported within ITK filters.", imageDataArrayPath.toString())); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.hpp index a2a0376286..62a83aaa53 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReaderFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ITKImageReaderFilter * @brief This filter will .... */ -class ITKIMAGEPROCESSING_EXPORT ITKImageReaderFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKImageReaderFilter : public AbstractFilter { public: ITKImageReaderFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.cpp index 2bffb12065..db06a85810 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.cpp @@ -343,7 +343,7 @@ IFilter::PreflightResult ITKImageWriterFilter::preflightImpl(const DataStructure // Stored fastest to slowest i.e. X Y Z const auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); // Stored slowest to fastest i.e. Z Y X - const auto& imageArray = dataStructure.getDataRefAs(imageArrayPath); + const auto& imageArray = dataStructure.getDataRefAs(imageArrayPath); const IDataStore& imageArrayStore = imageArray.getIDataStoreRef(); @@ -398,13 +398,13 @@ Result<> ITKImageWriterFilter::executeImpl(DataStructure& dataStructure, const A auto totalDigits = filterArgs.value(k_TotalIndexDigits_Key); auto fillChar = filterArgs.value(k_LeadingDigitCharacter_Key); - const IDataArray* inputArray = dataStructure.getDataAs(imageArrayPath); + const AbstractDataArray* inputArray = dataStructure.getDataAs(imageArrayPath); const auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); // Stored fastest to slowest i.e. X Y Z SizeVec3 dims = imageGeom.getDimensions(); - const auto& imageArray = dataStructure.getDataRefAs(imageArrayPath); + const auto& imageArray = dataStructure.getDataRefAs(imageArrayPath); usize nComp = imageArray.getNumberOfComponents(); const IDataStore& currentData = imageArray.getIDataStoreRef(); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.hpp index 763201b748..029651211e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageWriterFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ITKImageWriterFilter * @brief This filter will .... */ -class ITKIMAGEPROCESSING_EXPORT ITKImageWriterFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKImageWriterFilter : public AbstractFilter { public: ITKImageWriterFilter() = default; @@ -38,9 +38,9 @@ class ITKIMAGEPROCESSING_EXPORT ITKImageWriterFilter : public IFilter */ static Result FromSIMPLJson(const nlohmann::json& json); - static inline constexpr usize k_XYPlane = 0; - static inline constexpr usize k_XZPlane = 1; - static inline constexpr usize k_YZPlane = 2; + static constexpr usize k_XYPlane = 0; + static constexpr usize k_XZPlane = 1; + static constexpr usize k_YZPlane = 2; /** * @brief Returns the name of the filter. diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp index 0444c13c87..6e7a340675 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp @@ -78,7 +78,7 @@ Parameters ITKImportFijiMontageFilter::parameters() const params.insert(std::make_unique(k_InputFile_Key, "Fiji Configuration File", "This is the configuration file in the same directory as all of the identified geometries", fs::path(""), FileSystemPathParameter::ExtensionsType{}, FileSystemPathParameter::PathType::InputFile)); params.insert(std::make_unique(k_LengthUnit_Key, "Length Unit", "The length unit that will be set into the created image geometry", - to_underlying(IGeometry::LengthUnit::Micrometer), IGeometry::GetAllLengthUnitStrings())); + to_underlying(AbstractGeometry::LengthUnit::Micrometer), AbstractGeometry::GetAllLengthUnitStrings())); params.insertLinkableParameter(std::make_unique(k_ChangeOrigin_Key, "Change Origin", "Set the origin of the mosaic to a user defined value", false)); params.insert(std::make_unique(k_Origin_Key, "Origin", "The new origin of the mosaic", std::vector(3), std::vector(3))); params.insertLinkableParameter( @@ -240,7 +240,7 @@ Result<> ITKImportFijiMontageFilter::executeImpl(DataStructure& dataStructure, c inputValues.convertToGrayScale = filterArgs.value(k_ConvertToGrayScale_Key); inputValues.parentDataGroup = filterArgs.value(k_ParentDataGroup_Key); inputValues.inputFilePath = filterArgs.value(k_InputFile_Key); - inputValues.lengthUnit = static_cast(filterArgs.value(k_LengthUnit_Key)); + inputValues.lengthUnit = static_cast(filterArgs.value(k_LengthUnit_Key)); inputValues.origin = filterArgs.value(k_Origin_Key); inputValues.colorWeights = filterArgs.value(k_ColorWeights_Key); inputValues.DataGroupName = filterArgs.value(k_DataGroupName_Key); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.hpp index 6e089b41a7..93c890e9d0 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.hpp @@ -3,9 +3,9 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include namespace fs = std::filesystem; @@ -16,7 +16,7 @@ namespace nx::core * @class ITKImportImageStack * @brief This filter will .... */ -class ITKIMAGEPROCESSING_EXPORT ITKImportFijiMontageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKImportFijiMontageFilter : public AbstractFilter { public: ITKImportFijiMontageFilter(); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.cpp index 792984b973..49b3006258 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.cpp @@ -259,7 +259,7 @@ Result<> ReadImageStack(DataStructure& dataStructure, const DataPath& imageGeomP // ======================= Convert to GrayScale Section =================== DataPath srcImageDataPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageArrayName); - bool validInputForGrayScaleConversion = importedDataStructure.getDataRefAs(srcImageDataPath).getDataType() == DataType::uint8; + bool validInputForGrayScaleConversion = importedDataStructure.getDataRefAs(srcImageDataPath).getDataType() == DataType::uint8; if(convertToGrayscale && validInputForGrayScaleConversion && nullptr != grayScaleFilter.get()) { // This same filter was used to preflight so as long as nothing changes on disk this really should work.... @@ -277,16 +277,16 @@ Result<> ReadImageStack(DataStructure& dataStructure, const DataPath& imageGeomP } // deletion of non-grayscale array - DataObject::IdType id; + AbstractDataObject::IdType id; { // scoped for safety since this reference will be nonexistent in a moment - auto& oldArray = importedDataStructure.getDataRefAs(srcImageDataPath); + auto& oldArray = importedDataStructure.getDataRefAs(srcImageDataPath); id = oldArray.getId(); } importedDataStructure.removeData(id); // rename grayscale array to reflect original { - auto& gray = importedDataStructure.getDataRefAs(srcImageDataPath.replaceName("gray" + srcImageDataPath.getTargetName())); + auto& gray = importedDataStructure.getDataRefAs(srcImageDataPath.replaceName("gray" + srcImageDataPath.getTargetName())); if(!gray.canRename(srcImageDataPath.getTargetName())) { return MakeErrorResult(-64543, fmt::format("Unable to rename the internal grayscale array to {}", srcImageDataPath.getTargetName())); @@ -520,7 +520,7 @@ IFilter::PreflightResult ITKImportImageStackFilter::preflightImpl(const DataStru std::vector outputDims; std::vector outputSpacing; std::vector outputOrigin; - IGeometry::LengthUnit outputUnits; + AbstractGeometry::LengthUnit outputUnits; // Create a sub-filter to read each image, although for preflight we are going to read the first image in the // list and hope the rest are correct. @@ -726,7 +726,7 @@ IFilter::PreflightResult ITKImportImageStackFilter::preflightImpl(const DataStru } const DataPath imageDataPath = currentImageGeomPath.createChildPath(cellDataName).createChildPath(pImageDataArrayNameValue); - auto& imageData = tmpDs.getDataRefAs(imageDataPath); + auto& imageData = tmpDs.getDataRefAs(imageDataPath); if(pConvertToGrayScaleValue) { if(imageData.getDataType() != DataType::uint8) diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.hpp index 448d8656cc..fc8273dff8 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStackFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ITKImportImageStackFilter * @brief This filter will .... */ -class ITKIMAGEPROCESSING_EXPORT ITKImportImageStackFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKImportImageStackFilter : public AbstractFilter { public: ITKImportImageStackFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIntensityWindowingImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIntensityWindowingImageFilter.hpp index a21a16a461..f09fedc191 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIntensityWindowingImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIntensityWindowingImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -23,7 +23,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKIntensityWindowingImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKIntensityWindowingImageFilter : public AbstractFilter { public: ITKIntensityWindowingImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKInvertIntensityImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKInvertIntensityImageFilter.hpp index fbe21d9eb5..bfebff7709 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKInvertIntensityImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKInvertIntensityImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -22,7 +22,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKInvertIntensityImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKInvertIntensityImageFilter : public AbstractFilter { public: ITKInvertIntensityImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIsoContourDistanceImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIsoContourDistanceImageFilter.hpp index 11c3fb1d4d..969712f53c 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIsoContourDistanceImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKIsoContourDistanceImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -22,7 +22,7 @@ namespace nx::core * ITK Module: ITKDistanceMap * ITK Group: DistanceMap */ -class ITKIMAGEPROCESSING_EXPORT ITKIsoContourDistanceImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKIsoContourDistanceImageFilter : public AbstractFilter { public: ITKIsoContourDistanceImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLabelContourImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLabelContourImageFilter.hpp index 52c6e3b20c..65e88bf932 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLabelContourImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLabelContourImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKImageLabel * ITK Group: ImageLabel */ -class ITKIMAGEPROCESSING_EXPORT ITKLabelContourImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKLabelContourImageFilter : public AbstractFilter { public: ITKLabelContourImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLaplacianRecursiveGaussianImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLaplacianRecursiveGaussianImageFilter.hpp index 8e3e26d2fe..5bbe0eae3e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLaplacianRecursiveGaussianImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLaplacianRecursiveGaussianImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageFeature * ITK Group: ImageFeature */ -class ITKIMAGEPROCESSING_EXPORT ITKLaplacianRecursiveGaussianImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKLaplacianRecursiveGaussianImageFilter : public AbstractFilter { public: ITKLaplacianRecursiveGaussianImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLog10ImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLog10ImageFilter.hpp index 19399d7458..7b1fc3019f 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLog10ImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLog10ImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKLog10ImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKLog10ImageFilter : public AbstractFilter { public: ITKLog10ImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLogImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLogImageFilter.hpp index 52aec4a707..88fee9baf7 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLogImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKLogImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKLogImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKLogImageFilter : public AbstractFilter { public: ITKLogImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.cpp index 45a2ce7db8..ba483c341b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.cpp @@ -211,7 +211,7 @@ Result<> ITKMaskImageFilter::executeImpl(DataStructure& dataStructure, const Arg auto maskArrayPath = filterArgs.value(k_MaskImageDataPath_Key); ImageGeom& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - IDataArray& maskArray = dataStructure.getDataRefAs(maskArrayPath); + AbstractDataArray& maskArray = dataStructure.getDataRefAs(maskArrayPath); IDataStore& maskStore = maskArray.getIDataStoreRef(); cxITKMaskImageFilter::ITKMaskImageFilterFunctor itkFunctor = {outsideValue, imageGeom, maskStore}; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.hpp index 60484e8f62..49a15d711b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaskImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -39,7 +39,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKMaskImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMaskImageFilter : public AbstractFilter { public: ITKMaskImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.cpp index 6cfa0fd6f5..869b7625bd 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.cpp @@ -1,7 +1,7 @@ #include "ITKMaximumProjectionImageFilter.hpp" #include "simplnx/Common/TypesUtility.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" #include "simplnx/Parameters/DataObjectNameParameter.hpp" diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.hpp index 363ba39a5f..898b6637f6 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMaximumProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -39,7 +39,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKMaximumProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMaximumProjectionImageFilter : public AbstractFilter { public: ITKMaximumProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.cpp index e937945413..ff6ae2e62e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.cpp @@ -172,7 +172,7 @@ Result<> ITKMeanProjectionImageFilter::executeImpl(DataStructure& dataStructure, } auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); + auto iArrayTupleShape = dataStructure.getDataAs(outputArrayPath)->getTupleShape(); // Update the Image Geometry with the new dimensions imageGeom.setDimensions({iArrayTupleShape[2], iArrayTupleShape[1], iArrayTupleShape[0]}); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.hpp index a5335a4afc..98020f7776 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMeanProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -39,7 +39,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKMeanProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMeanProjectionImageFilter : public AbstractFilter { public: ITKMeanProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianImageFilter.hpp index 4c4495ffa1..8cc0d4268e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * ITK Module: ITKSmoothing * ITK Group: Smoothing */ -class ITKIMAGEPROCESSING_EXPORT ITKMedianImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMedianImageFilter : public AbstractFilter { public: ITKMedianImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.cpp index 1e0ada6a34..4feb5ddbc1 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.cpp @@ -1,7 +1,7 @@ #include "ITKMedianProjectionImageFilter.hpp" #include "simplnx/Common/TypesUtility.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" #include "simplnx/Parameters/DataObjectNameParameter.hpp" diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.hpp index d318c35446..4d6047ebd6 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMedianProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -39,7 +39,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKMedianProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMedianProjectionImageFilter : public AbstractFilter { public: ITKMedianProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.cpp index 2c64cf9b63..afb5cf4e9b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.cpp @@ -440,8 +440,8 @@ Result<> ITKMhaFileReaderFilter::executeImpl(DataStructure& dataStructure, const return executeResult.result; } - const auto& srcDataArray = importedDataStructure.getDataRefAs(imageDataArrayPath); - const auto& destDataArray = dataStructure.getDataRefAs(imageDataArrayPath); + const auto& srcDataArray = importedDataStructure.getDataRefAs(imageDataArrayPath); + const auto& destDataArray = dataStructure.getDataRefAs(imageDataArrayPath); messageHandler(fmt::format("Copying image data to destination array '{}'...", destDataArray.getName())); Result<> copyResult = ExecuteDataFunction(CopyImageDataFunctor{}, srcDataArray.getDataType(), importedDataStructure, dataStructure, imageDataArrayPath, fileNamePath); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.hpp index 60d344a5f4..dba9f0c08c 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReaderFilter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "ITKImageProcessing/ITKImageProcessing_export.hpp" namespace nx::core { -class ITKIMAGEPROCESSING_EXPORT ITKMhaFileReaderFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMhaFileReaderFilter : public AbstractFilter { public: ITKMhaFileReaderFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinMaxCurvatureFlowImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinMaxCurvatureFlowImageFilter.hpp index 82e39a702f..781cce1942 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinMaxCurvatureFlowImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinMaxCurvatureFlowImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -44,7 +44,7 @@ namespace nx::core * ITK Module: ITKCurvatureFlow * ITK Group: CurvatureFlow */ -class ITKIMAGEPROCESSING_EXPORT ITKMinMaxCurvatureFlowImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMinMaxCurvatureFlowImageFilter : public AbstractFilter { public: ITKMinMaxCurvatureFlowImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.cpp index f2054e6edb..96eb82ccb4 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.cpp @@ -1,7 +1,7 @@ #include "ITKMinimumProjectionImageFilter.hpp" #include "simplnx/Common/TypesUtility.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" #include "simplnx/Parameters/DataObjectNameParameter.hpp" diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.hpp index 028faa0659..c6194b7744 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMinimumProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -39,7 +39,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKMinimumProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMinimumProjectionImageFilter : public AbstractFilter { public: ITKMinimumProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalGradientImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalGradientImageFilter.hpp index 6628359b56..f2b6f5e557 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalGradientImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalGradientImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -18,7 +18,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalGradientImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalGradientImageFilter : public AbstractFilter { public: ITKMorphologicalGradientImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedFromMarkersImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedFromMarkersImageFilter.hpp index 871936d8c8..466e7d285c 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedFromMarkersImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedFromMarkersImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -43,7 +43,7 @@ namespace nx::core * ITK Module: ITKWatersheds * ITK Group: Watersheds */ -class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalWatershedFromMarkersImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalWatershedFromMarkersImageFilter : public AbstractFilter { public: ITKMorphologicalWatershedFromMarkersImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedImageFilter.hpp index 80cc42c2b5..38a80088e8 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -28,7 +28,7 @@ namespace nx::core * ITK Module: ITKWatersheds * ITK Group: Watersheds */ -class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalWatershedImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKMorphologicalWatershedImageFilter : public AbstractFilter { public: ITKMorphologicalWatershedImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeImageFilter.hpp index 83921b797e..3e7942564f 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -22,7 +22,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKNormalizeImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKNormalizeImageFilter : public AbstractFilter { public: ITKNormalizeImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeToConstantImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeToConstantImageFilter.hpp index 19be09c9f2..7fcf239137 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeToConstantImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNormalizeToConstantImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -32,7 +32,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKNormalizeToConstantImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKNormalizeToConstantImageFilter : public AbstractFilter { public: ITKNormalizeToConstantImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNotImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNotImageFilter.hpp index 7a3f00a366..d674affb68 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNotImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKNotImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -37,7 +37,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKNotImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKNotImageFilter : public AbstractFilter { public: ITKNotImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOpeningByReconstructionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOpeningByReconstructionImageFilter.hpp index cbc8aab688..af795316f3 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOpeningByReconstructionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOpeningByReconstructionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -30,7 +30,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKOpeningByReconstructionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKOpeningByReconstructionImageFilter : public AbstractFilter { public: ITKOpeningByReconstructionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOtsuMultipleThresholdsImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOtsuMultipleThresholdsImageFilter.hpp index 33cde7b5c8..8bdf347f68 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOtsuMultipleThresholdsImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKOtsuMultipleThresholdsImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -30,7 +30,7 @@ namespace nx::core * ITK Module: ITKThresholding * ITK Group: Thresholding */ -class ITKIMAGEPROCESSING_EXPORT ITKOtsuMultipleThresholdsImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKOtsuMultipleThresholdsImageFilter : public AbstractFilter { public: ITKOtsuMultipleThresholdsImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMaximaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMaximaImageFilter.hpp index a00a81d329..a1a130106d 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMaximaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMaximaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -32,7 +32,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKRegionalMaximaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKRegionalMaximaImageFilter : public AbstractFilter { public: ITKRegionalMaximaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMinimaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMinimaImageFilter.hpp index fc3c5de7ad..3bd67fbf2b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMinimaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRegionalMinimaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -30,7 +30,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKRegionalMinimaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKRegionalMinimaImageFilter : public AbstractFilter { public: ITKRegionalMinimaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRelabelComponentImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRelabelComponentImageFilter.hpp index 0daa84d11f..483ae7abd3 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRelabelComponentImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRelabelComponentImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -34,7 +34,7 @@ namespace nx::core * ITK Module: ITKConnectedComponents * ITK Group: ConnectedComponents */ -class ITKIMAGEPROCESSING_EXPORT ITKRelabelComponentImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKRelabelComponentImageFilter : public AbstractFilter { public: ITKRelabelComponentImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRescaleIntensityImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRescaleIntensityImageFilter.hpp index 3074b4f0db..94ce9c27eb 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRescaleIntensityImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKRescaleIntensityImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKRescaleIntensityImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKRescaleIntensityImageFilter : public AbstractFilter { public: ITKRescaleIntensityImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSigmoidImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSigmoidImageFilter.hpp index 6ddec394ab..9bbdc88ac0 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSigmoidImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSigmoidImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -20,7 +20,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKSigmoidImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSigmoidImageFilter : public AbstractFilter { public: ITKSigmoidImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedDanielssonDistanceMapImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedDanielssonDistanceMapImageFilter.hpp index 340eb2326d..f769951be9 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedDanielssonDistanceMapImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedDanielssonDistanceMapImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -38,7 +38,7 @@ namespace nx::core * ITK Module: ITKDistanceMap * ITK Group: DistanceMap */ -class ITKIMAGEPROCESSING_EXPORT ITKSignedDanielssonDistanceMapImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSignedDanielssonDistanceMapImageFilter : public AbstractFilter { public: ITKSignedDanielssonDistanceMapImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedMaurerDistanceMapImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedMaurerDistanceMapImageFilter.hpp index 4c9f2e8400..98f2fb8f7d 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedMaurerDistanceMapImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSignedMaurerDistanceMapImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -32,7 +32,7 @@ namespace nx::core * ITK Module: ITKDistanceMap * ITK Group: DistanceMap */ -class ITKIMAGEPROCESSING_EXPORT ITKSignedMaurerDistanceMapImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSignedMaurerDistanceMapImageFilter : public AbstractFilter { public: ITKSignedMaurerDistanceMapImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSinImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSinImageFilter.hpp index 62a0a7c455..3f37897bff 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSinImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSinImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKSinImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSinImageFilter : public AbstractFilter { public: ITKSinImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSmoothingRecursiveGaussianImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSmoothingRecursiveGaussianImageFilter.hpp index acb31779b5..e0b8be68fc 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSmoothingRecursiveGaussianImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSmoothingRecursiveGaussianImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -18,7 +18,7 @@ namespace nx::core * ITK Module: ITKSmoothing * ITK Group: Smoothing */ -class ITKIMAGEPROCESSING_EXPORT ITKSmoothingRecursiveGaussianImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSmoothingRecursiveGaussianImageFilter : public AbstractFilter { public: ITKSmoothingRecursiveGaussianImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSqrtImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSqrtImageFilter.hpp index 3010278117..83de99d30e 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSqrtImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSqrtImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKSqrtImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSqrtImageFilter : public AbstractFilter { public: ITKSqrtImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSquareImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSquareImageFilter.hpp index 08a22445dd..4fc9a2aebf 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSquareImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSquareImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKSquareImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSquareImageFilter : public AbstractFilter { public: ITKSquareImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKStandardDeviationProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKStandardDeviationProjectionImageFilter.hpp index c44073fc3a..74e971cbb7 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKStandardDeviationProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKStandardDeviationProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -42,7 +42,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKStandardDeviationProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKStandardDeviationProjectionImageFilter : public AbstractFilter { public: ITKStandardDeviationProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSumProjectionImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSumProjectionImageFilter.hpp index 429e4a7321..5b40a6f6b9 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSumProjectionImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKSumProjectionImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -42,7 +42,7 @@ namespace nx::core * ITK Module: ITKImageStatistics * ITK Group: ImageStatistics */ -class ITKIMAGEPROCESSING_EXPORT ITKSumProjectionImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKSumProjectionImageFilter : public AbstractFilter { public: ITKSumProjectionImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKTanImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKTanImageFilter.hpp index 727059211f..1040db65f8 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKTanImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKTanImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ITKImageIntensity * ITK Group: ImageIntensity */ -class ITKIMAGEPROCESSING_EXPORT ITKTanImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKTanImageFilter : public AbstractFilter { public: ITKTanImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdImageFilter.hpp index b82d25f3f0..10a9328b36 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -28,7 +28,7 @@ namespace nx::core * ITK Module: ITKThresholding * ITK Group: Thresholding */ -class ITKIMAGEPROCESSING_EXPORT ITKThresholdImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKThresholdImageFilter : public AbstractFilter { public: ITKThresholdImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdMaximumConnectedComponentsImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdMaximumConnectedComponentsImageFilter.hpp index 0d81c5e554..846e2b7d88 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdMaximumConnectedComponentsImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKThresholdMaximumConnectedComponentsImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -41,7 +41,7 @@ namespace nx::core * ITK Module: ITKConnectedComponents * ITK Group: ConnectedComponents */ -class ITKIMAGEPROCESSING_EXPORT ITKThresholdMaximumConnectedComponentsImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKThresholdMaximumConnectedComponentsImageFilter : public AbstractFilter { public: ITKThresholdMaximumConnectedComponentsImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMaximaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMaximaImageFilter.hpp index 7388b9f335..a0408604b9 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMaximaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMaximaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -29,7 +29,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKValuedRegionalMaximaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKValuedRegionalMaximaImageFilter : public AbstractFilter { public: ITKValuedRegionalMaximaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMinimaImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMinimaImageFilter.hpp index 90a87b5336..2f3a2104d3 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMinimaImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKValuedRegionalMinimaImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKValuedRegionalMinimaImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKValuedRegionalMinimaImageFilter : public AbstractFilter { public: ITKValuedRegionalMinimaImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKWhiteTopHatImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKWhiteTopHatImageFilter.hpp index 6d39a2df81..825c48477f 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKWhiteTopHatImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKWhiteTopHatImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -18,7 +18,7 @@ namespace nx::core * ITK Module: ITKMathematicalMorphology * ITK Group: MathematicalMorphology */ -class ITKIMAGEPROCESSING_EXPORT ITKWhiteTopHatImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKWhiteTopHatImageFilter : public AbstractFilter { public: ITKWhiteTopHatImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKZeroCrossingImageFilter.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKZeroCrossingImageFilter.hpp index 632845bf49..6099011df6 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKZeroCrossingImageFilter.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKZeroCrossingImageFilter.hpp @@ -2,8 +2,8 @@ #include "ITKImageProcessing/ITKImageProcessing_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -43,7 +43,7 @@ namespace nx::core * ITK Module: ITKImageFeature * ITK Group: ImageFeature */ -class ITKIMAGEPROCESSING_EXPORT ITKZeroCrossingImageFilter : public IFilter +class ITKIMAGEPROCESSING_EXPORT ITKZeroCrossingImageFilter : public AbstractFilter { public: ITKZeroCrossingImageFilter() = default; diff --git a/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp index 5024be291b..5d1fb22550 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp @@ -55,10 +55,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Read_Basic", "[ITKImageProc DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Read_Basic", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -101,10 +101,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Override_Origin", "[ITKImag DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Override_Origin", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -145,10 +145,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Centering_Origin", "[ITKIma DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Centering_Origin", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -221,10 +221,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Cropping", "[ITKImageProces DataPath generatedDataPath = DataPath({computedGeomName, Constants::k_Cell_Data, k_ImageDataName}); DataPath exemplarDataPath = DataPath({sectionName, Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); } @@ -268,10 +268,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Override_Spacing", "[ITKIma DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Override_Spacing", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -326,10 +326,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: OriginSpacing_Preprocessed" DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"OriginSpacing_Preprocessed", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -385,10 +385,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: OriginSpacing_Postprocessed DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"OriginSpacing_Postprocessed", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -432,10 +432,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: DataType_Conversion", "[ITK DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"DataType_Conversion", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -488,10 +488,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Interaction_Crop_DataType", DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Interaction_Crop_DataType", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -542,10 +542,10 @@ TEST_CASE("ITKImageProcessing::ITKImageReaderFilter: Interaction_All", "[ITKImag UnitTest::CompareImageGeometry(&exemplarGeom, &generatedGeom); DataPath generatedDataPath = inputGeometryPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); DataPath exemplarDataPath = DataPath({"Interaction_Crop_OriginSpacing_Preprocessed_DataType", Constants::k_Cell_Data, k_ImageDataName}); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); - const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); - REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); - const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(generatedDataPath)); + const auto& generatedArray = dataStructure.getDataRefAs(generatedDataPath); + REQUIRE_NOTHROW(exemplarDS.getDataRefAs(exemplarDataPath)); + const auto& exemplarArray = exemplarDS.getDataRefAs(exemplarDataPath); UnitTest::CompareDataArrays(exemplarArray, generatedArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/ITKImageProcessing/test/ITKImportFijiMontageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKImportFijiMontageTest.cpp index 6d54dcc7ca..cda1015194 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKImportFijiMontageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKImportFijiMontageTest.cpp @@ -44,7 +44,7 @@ TEST_CASE("ITKImageProcessing::ITKImportFijiMontage: Basic 2x2 Grid Montage", "[ args.insertOrAssign(ITKImportFijiMontageFilter::k_InputFile_Key, std::make_any(smallInputFile)); args.insertOrAssign(ITKImportFijiMontageFilter::k_DataGroupName_Key, std::make_any(k_DataGroupName)); - args.insertOrAssign(ITKImportFijiMontageFilter::k_LengthUnit_Key, std::make_any(to_underlying(IGeometry::LengthUnit::Micrometer))); + args.insertOrAssign(ITKImportFijiMontageFilter::k_LengthUnit_Key, std::make_any(to_underlying(AbstractGeometry::LengthUnit::Micrometer))); args.insertOrAssign(ITKImportFijiMontageFilter::k_ChangeOrigin_Key, std::make_any(false)); args.insertOrAssign(ITKImportFijiMontageFilter::k_ConvertToGrayScale_Key, std::make_any(false)); args.insertOrAssign(ITKImportFijiMontageFilter::k_ParentDataGroup_Key, std::make_any(true)); @@ -61,8 +61,8 @@ TEST_CASE("ITKImageProcessing::ITKImportFijiMontage: Basic 2x2 Grid Montage", "[ auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); - std::vector generatedGroup = GetAllChildDataPaths(dataStructure, k_DataGroupPath, DataObject::Type::ImageGeom).value(); - std::vector exemplarGroup = GetAllChildDataPaths(exemplarDataStructure, k_DataGroupPath, DataObject::Type::ImageGeom).value(); + std::vector generatedGroup = GetAllChildDataPaths(dataStructure, k_DataGroupPath, IDataObject::Type::ImageGeom).value(); + std::vector exemplarGroup = GetAllChildDataPaths(exemplarDataStructure, k_DataGroupPath, IDataObject::Type::ImageGeom).value(); REQUIRE(generatedGroup.size() == exemplarGroup.size()); for(usize i = 0; i < generatedGroup.size(); i++) { diff --git a/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp index 412009b7b3..dd8a6c2dbf 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp @@ -879,7 +879,7 @@ TEST_CASE("ITKImportImageStack::Grayscale_Conversion", "[ITKImageProcessing][ITK // Verify grayscale array was created DataPath grayscalePath = geomPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); - REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); + REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); // Compare against exemplar DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); @@ -1155,7 +1155,7 @@ TEST_CASE("ITKImportImageStack::Interaction_Crop_Grayscale", "[ITKImageProcessin // Verify grayscale array exists DataPath grayscalePath = geomPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); - REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); + REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); // Compare against exemplar DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); @@ -1188,7 +1188,7 @@ TEST_CASE("ITKImportImageStack::Interaction_Resample_Grayscale", "[ITKImageProce // Verify grayscale array exists DataPath grayscalePath = geomPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); - REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); + REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); // Compare against exemplar DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); @@ -1220,7 +1220,7 @@ TEST_CASE("ITKImportImageStack::Interaction_Grayscale_Flip", "[ITKImageProcessin // Verify grayscale array exists DataPath grayscalePath = geomPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); - REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); + REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); // Compare against exemplar DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); @@ -1254,7 +1254,7 @@ TEST_CASE("ITKImportImageStack::Interaction_FullPipeline", "[ITKImageProcessing] // Verify grayscale array exists DataPath grayscalePath = geomPath.createChildPath(Constants::k_Cell_Data).createChildPath(k_ImageDataName); - REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); + REQUIRE_NOTHROW(ds.getDataRefAs(grayscalePath)); // Compare against exemplar DataStructure exemplarDS = UnitTest::LoadDataStructure(k_ExemplarFile); diff --git a/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp b/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp index 9e9a7f47e9..7079c653d8 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp @@ -23,7 +23,7 @@ using namespace nx::core; namespace { template -std::string ComputeMD5HashTyped(const IDataArray& outputDataArray) +std::string ComputeMD5HashTyped(const AbstractDataArray& outputDataArray) { const auto& dataArray = dynamic_cast&>(outputDataArray); usize arraySize = dataArray.getSize(); @@ -84,7 +84,7 @@ float64 ComputeDiff(PixelType p1, PixelType p2) } template -Result<> CompareImagesImpl(const ImageGeom& inputImageGeom, const IDataArray& outputDataArray, const ImageGeom& baselineImageGeom, const IDataArray& baselineDataArray, float64 tolerance) +Result<> CompareImagesImpl(const ImageGeom& inputImageGeom, const AbstractDataArray& outputDataArray, const ImageGeom& baselineImageGeom, const AbstractDataArray& baselineDataArray, float64 tolerance) { using DataArrayType = DataArray; @@ -110,7 +110,8 @@ Result<> CompareImagesImpl(const ImageGeom& inputImageGeom, const IDataArray& ou } template -Result<> CompareImagesTyped(const ImageGeom& inputImageGeom, const IDataArray& outputDataArray, const ImageGeom& baselineImageGeom, const IDataArray& baselineDataArray, float64 tolerance) +Result<> CompareImagesTyped(const ImageGeom& inputImageGeom, const AbstractDataArray& outputDataArray, const ImageGeom& baselineImageGeom, const AbstractDataArray& baselineDataArray, + float64 tolerance) { SizeVec3 inputDims = inputImageGeom.getDimensions(); if(inputDims[2] == 1) @@ -133,7 +134,7 @@ namespace ITKTestBase //------------------------------------------------------------------------------ bool IsArrayInMemory(DataStructure& dataStructure, const DataPath& outputDataPath) { - const auto& outputDataArray = dataStructure.getDataRefAs(outputDataPath); + const auto& outputDataArray = dataStructure.getDataRefAs(outputDataPath); DataType outputDataType = outputDataArray.getDataType(); switch(outputDataType) @@ -179,7 +180,7 @@ bool IsArrayInMemory(DataStructure& dataStructure, const DataPath& outputDataPat //------------------------------------------------------------------------------ std::string ComputeMd5Hash(DataStructure& dataStructure, const DataPath& outputDataPath) { - const auto& outputDataArray = dataStructure.getDataRefAs(outputDataPath); + const auto& outputDataArray = dataStructure.getDataRefAs(outputDataPath); DataType outputDataType = outputDataArray.getDataType(); // if(!outputDataArray.getDataFormat().empty()) //{ @@ -270,7 +271,7 @@ Result<> CompareImages(DataStructure& dataStructure, const DataPath& baselineGeo } SizeVec3 baselineDims = baselineImageGeom->getDimensions(); - const auto* baselineDataArray = dataStructure.getDataAs(baselineDataPath); + const auto* baselineDataArray = dataStructure.getDataAs(baselineDataPath); if(baselineDataArray == nullptr) { return MakeErrorResult(-11, fmt::format("Could not get DataArray for Baseline")); @@ -284,7 +285,7 @@ Result<> CompareImages(DataStructure& dataStructure, const DataPath& baselineGeo } SizeVec3 outputDims = inputImageGeom->getDimensions(); - const auto* outputDataArray = dataStructure.getDataAs(outputDataPath); + const auto* outputDataArray = dataStructure.getDataAs(outputDataPath); if(outputDataArray == nullptr) { return MakeErrorResult(-13, fmt::format("Could not get DataArray for Output")); diff --git a/src/Plugins/ITKImageProcessing/tools/filter.hpp.in b/src/Plugins/ITKImageProcessing/tools/filter.hpp.in index 385bd291d3..ee48c6a4dc 100644 --- a/src/Plugins/ITKImageProcessing/tools/filter.hpp.in +++ b/src/Plugins/ITKImageProcessing/tools/filter.hpp.in @@ -3,7 +3,7 @@ #include "${PLUGIN_NAME}/${PLUGIN_NAME}_export.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * ITK Module: ${ITK_MODULE} * ITK Group: ${ITK_GROUP} */ -class ${PLUGIN_NAME_UPPER}_EXPORT ${FILTER_NAME}Filter : public IFilter +class ${PLUGIN_NAME_UPPER}_EXPORT ${FILTER_NAME}Filter : public AbstractFilter { public: ${FILTER_NAME}Filter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMisorientation.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMisorientation.cpp index 83a59b2db1..61cfdb2612 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMisorientation.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMisorientation.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Numbers.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" @@ -33,7 +33,7 @@ Result<> AlignSectionsMisorientation::operator()() { return {}; } - const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); + const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); return execute(gridGeom.getDimensions(), m_InputValues->ImageGeometryPath); } @@ -41,7 +41,7 @@ Result<> AlignSectionsMisorientation::operator()() // ----------------------------------------------------------------------------- Result<> AlignSectionsMisorientation::findShifts(std::vector& xShifts, std::vector& yShifts) { - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; if(m_InputValues->UseMask) { try @@ -56,7 +56,7 @@ Result<> AlignSectionsMisorientation::findShifts(std::vector& xShifts, } } - auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); + auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); const auto& cellPhases = m_DataStructure.getDataRefAs(m_InputValues->cellPhasesArrayPath); const auto& quats = m_DataStructure.getDataRefAs(m_InputValues->quatsArrayPath); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.cpp index 2df4c1ac5d..1d85ff6a8f 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.cpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Constants.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/StringUtilities.hpp" @@ -35,7 +35,7 @@ Result<> AlignSectionsMutualInformation::operator()() { return {}; } - const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); + const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); return execute(gridGeom.getDimensions(), m_InputValues->ImageGeometryPath); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.hpp index 224d254b4f..8767094008 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/AlignSectionsMutualInformation.hpp @@ -59,7 +59,7 @@ class ORIENTATIONANALYSIS_EXPORT AlignSectionsMutualInformation : public AlignSe const std::atomic_bool& m_ShouldCancel; const IFilter::MessageHandler& m_MessageHandler; - std::unique_ptr m_MaskCompare = nullptr; + std::unique_ptr m_MaskCompare = nullptr; }; } // namespace nx::core diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/BadDataNeighborOrientationCheck.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/BadDataNeighborOrientationCheck.cpp index 2937ac640c..1d2b3342b5 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/BadDataNeighborOrientationCheck.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/BadDataNeighborOrientationCheck.cpp @@ -42,7 +42,7 @@ Result<> BadDataNeighborOrientationCheck::operator()() const auto& crystalStructures = m_DataStructure.getDataRefAs(m_InputValues->CrystalStructuresArrayPath); const usize totalPoints = quats.getNumberOfTuples(); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.cpp index f9223f1cca..4d1bd2ee81 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.cpp @@ -19,7 +19,7 @@ using namespace nx::core::OrientationUtilities; // ----------------------------------------------------------------------------- CAxisSegmentFeatures::CAxisSegmentFeatures(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, CAxisSegmentFeaturesInputValues* inputValues) -: SegmentFeatures(dataStructure, shouldCancel, mesgHandler) +: AbstractSegmentFeatures(dataStructure, shouldCancel, mesgHandler) , m_InputValues(inputValues) { } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.hpp index b1d0fe9d88..bc5dd6629d 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/CAxisSegmentFeatures.hpp @@ -5,8 +5,8 @@ #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/Filter/IFilter.hpp" +#include "simplnx/Utilities/AbstractSegmentFeatures.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" -#include "simplnx/Utilities/SegmentFeatures.hpp" namespace nx::core { @@ -16,7 +16,7 @@ struct ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeaturesInputValues float32 MisorientationTolerance; bool UseMask; bool RandomizeFeatureIds; - SegmentFeatures::NeighborScheme NeighborScheme; + ISegmentFeatures::NeighborScheme NeighborScheme; DataPath ImageGeometryPath; DataPath QuatsArrayPath; DataPath CellPhasesArrayPath; @@ -32,7 +32,7 @@ struct ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeaturesInputValues * @brief This filter segments the Features by grouping neighboring Cells that satisfy the C-axis misalignment tolerance, i.e., have misalignment angle less than the value set by the user. */ -class ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeatures : public SegmentFeatures +class ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeatures : public AbstractSegmentFeatures { public: CAxisSegmentFeatures(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, CAxisSegmentFeaturesInputValues* inputValues); @@ -54,7 +54,7 @@ class ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeatures : public SegmentFeatures Float32Array* m_QuatsArray = nullptr; Int32Array* m_CellPhases = nullptr; - std::unique_ptr m_GoodVoxelsArray = nullptr; + std::unique_ptr m_GoodVoxelsArray = nullptr; Int32Array* m_FeatureIdsArray = nullptr; }; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeAvgOrientations.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeAvgOrientations.hpp index e7b58b36d6..7453b3d525 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeAvgOrientations.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeAvgOrientations.hpp @@ -2,10 +2,10 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" #include diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFZQuaternions.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFZQuaternions.cpp index ed21b8aef6..69e1ee7d6b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFZQuaternions.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFZQuaternions.cpp @@ -122,13 +122,13 @@ Result<> ComputeFZQuaternions::operator()() Int32Array& phaseArray = m_DataStructure.getDataRefAs(m_InputValues->CellPhasesArrayPath); Float32Array& quatArray = m_DataStructure.getDataRefAs(m_InputValues->InputQuatsArrayPath); UInt32Array& xtalArray = m_DataStructure.getDataRefAs(m_InputValues->CrystalStructuresArrayPath); - IDataArray* maskArray = m_DataStructure.getDataAs(m_InputValues->MaskArrayPath); + AbstractDataArray* maskArray = m_DataStructure.getDataAs(m_InputValues->MaskArrayPath); Float32Array& fzQuatArray = m_DataStructure.getDataRefAs(m_InputValues->InputQuatsArrayPath.replaceName(m_InputValues->OutputFzQuatsArrayName)); std::atomic_int32_t warningCount = 0; int32_t numPhases = static_cast(xtalArray.getNumberOfTuples()); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&phaseArray); algArrays.push_back(&quatArray); algArrays.push_back(&xtalArray); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.cpp index 4256a8f34d..484bef14d8 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeFaceIPFColoring.cpp @@ -176,7 +176,7 @@ Result<> ComputeFaceIPFColoring::operator()() auto& secondIpfColors = m_DataStructure.getDataRefAs(secondIpfColorsArrayPath); int64 numTriangles = faceLabels.getNumberOfTuples(); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&faceLabels); algArrays.push_back(&faceNormals); algArrays.push_back(&eulerAngles); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp index a5af726df7..d61dd09457 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.cpp @@ -64,7 +64,7 @@ struct TriAreaAndNormals class TrianglesSelector { public: - TrianglesSelector(bool excludeTripleLines, const IGeometry::SharedFaceList& triangles, const Int8Array& nodeTypes, + TrianglesSelector(bool excludeTripleLines, const AbstractGeometry::SharedFaceList& triangles, const Int8Array& nodeTypes, #ifdef SIMPLNX_ENABLE_MULTICORE tbb::concurrent_vector& selectedTriangles, #else @@ -211,7 +211,7 @@ class TrianglesSelector private: bool m_ExcludeTripleLines; - const IGeometry::SharedFaceList& m_Triangles; + const AbstractGeometry::SharedFaceList& m_Triangles; const Int8Array& m_NodeTypes; #ifdef SIMPLNX_ENABLE_MULTICORE @@ -397,7 +397,7 @@ Result<> ComputeGBCDMetricBased::operator()() auto& nodeTypes = m_DataStructure.getDataRefAs(m_InputValues->NodeTypesArrayPath); auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometryPath); - const IGeometry::SharedFaceList& triangles = triangleGeom.getFacesRef(); + const AbstractGeometry::SharedFaceList& triangles = triangleGeom.getFacesRef(); // ------------------- before computing the distribution, we must find normalization factors ----- float64 ballVolume = k_BallVolumesM3M[m_InputValues->ChosenLimitDists]; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.hpp index 7d0183f3c3..9a5a2fb78b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDMetricBased.hpp @@ -53,9 +53,9 @@ class ORIENTATIONANALYSIS_EXPORT ComputeGBCDMetricBased const std::atomic_bool& getCancel(); - static inline constexpr int k_NumberResolutionChoices = 7; - static inline constexpr float k_ResolutionChoices[k_NumberResolutionChoices][2] = {{3.0f, 7.0f}, {5.0f, 5.0f}, {5.0f, 7.0f}, {5.0f, 8.0f}, - {6.0f, 7.0f}, {7.0f, 7.0f}, {8.0f, 8.0f}}; // { for misorient., for planes } + static constexpr int k_NumberResolutionChoices = 7; + static constexpr float k_ResolutionChoices[k_NumberResolutionChoices][2] = {{3.0f, 7.0f}, {5.0f, 5.0f}, {5.0f, 7.0f}, {5.0f, 8.0f}, + {6.0f, 7.0f}, {7.0f, 7.0f}, {8.0f, 8.0f}}; // { for misorient., for planes } private: DataStructure& m_DataStructure; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDPoleFigure.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDPoleFigure.cpp index 3d8abe423d..cee7907a69 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDPoleFigure.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBCDPoleFigure.cpp @@ -321,7 +321,7 @@ Result<> ComputeGBCDPoleFigure::operator()() m_MessageHandler({IFilter::Message::Type::Info, fmt::format("Generating Intensity Plot for phase {}", m_InputValues->PhaseOfInterest)}); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&poleFigure); algArrays.push_back(&gbcd); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp index 1a90161959..3dcb7b81dc 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeGBPDMetricBased.cpp @@ -65,7 +65,7 @@ class TriAreaAndNormals class TrianglesSelector { public: - TrianglesSelector(bool excludeTripleLines, const IGeometry::SharedFaceList& triangles, const Int8Array& nodeTypes, + TrianglesSelector(bool excludeTripleLines, const AbstractGeometry::SharedFaceList& triangles, const Int8Array& nodeTypes, #ifdef SIMPLNX_ENABLE_MULTICORE tbb::concurrent_vector& selectedTriangles, #else @@ -151,7 +151,7 @@ class TrianglesSelector private: // corresponding to Phase of Interest bool m_ExcludeTripleLines; - const IGeometry::SharedFaceList& m_Triangles; + const AbstractGeometry::SharedFaceList& m_Triangles; const Int8Array& m_NodeTypes; #ifdef SIMPLNX_ENABLE_MULTICORE tbb::concurrent_vector& m_SelectedTriangles; @@ -313,7 +313,7 @@ Result<> ComputeGBPDMetricBased::operator()() auto& nodeTypes = m_DataStructure.getDataRefAs(m_InputValues->NodeTypesArrayPath); auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometryPath); - const IGeometry::SharedFaceList& triangles = triangleGeom.getFacesRef(); + const AbstractGeometry::SharedFaceList& triangles = triangleGeom.getFacesRef(); const float64 limitDist = m_InputValues->LimitDist * Constants::k_PiOver180D; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.cpp index 1a3934c07c..708c7847b5 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.cpp @@ -24,7 +24,7 @@ class ComputeIPFColorsImpl { public: ComputeIPFColorsImpl(ComputeIPFColors* filter, FloatVec3Type referenceDir, nx::core::Float32Array& eulers, nx::core::Int32Array& phases, nx::core::UInt32Array& crystalStructures, int32_t numPhases, - const nx::core::IDataArray* goodVoxels, nx::core::UInt8Array& colors) + const nx::core::AbstractDataArray* goodVoxels, nx::core::UInt8Array& colors) : m_Filter(filter) , m_ReferenceDir(referenceDir) , m_CellEulerAngles(eulers.getDataStoreRef()) @@ -123,7 +123,7 @@ class ComputeIPFColorsImpl nx::core::Int32AbstractDataStore& m_CellPhases; nx::core::UInt32AbstractDataStore& m_CrystalStructures; int32_t m_NumPhases = 0; - const nx::core::IDataArray* m_GoodVoxels = nullptr; + const nx::core::AbstractDataArray* m_GoodVoxels = nullptr; nx::core::UInt8AbstractDataStore& m_CellIPFColors; }; } // namespace @@ -163,16 +163,16 @@ Result<> ComputeIPFColors::operator()() MatrixMath::Normalize3x1(normRefDir[0], normRefDir[1], normRefDir[2]); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&eulers); algArrays.push_back(&phases); algArrays.push_back(&crystalStructures); algArrays.push_back(&ipfColors); - nx::core::IDataArray* goodVoxelsArray = nullptr; + nx::core::AbstractDataArray* goodVoxelsArray = nullptr; if(m_InputValues->useGoodVoxels) { - goodVoxelsArray = m_DataStructure.getDataAs(m_InputValues->goodVoxelsArrayPath); + goodVoxelsArray = m_DataStructure.getDataAs(m_InputValues->goodVoxelsArrayPath); algArrays.push_back(goodVoxelsArray); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.hpp index 7087c2b300..6725e2ea17 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeIPFColors.hpp @@ -2,10 +2,10 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" #include diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeKernelAvgMisorientations.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeKernelAvgMisorientations.cpp index ab80ebb2de..9349a343f7 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeKernelAvgMisorientations.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeKernelAvgMisorientations.cpp @@ -184,12 +184,12 @@ Result<> ComputeKernelAvgMisorientations::operator()() progressMessageHelper.setMaxProgresss(udims[2] * udims[1] * udims[0]); progressMessageHelper.setProgressMessageTemplate("Finding Kernel Average Misorientations || {:.2f}%"); - typename IParallelAlgorithm::AlgorithmArrays algArrays; - algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->CellPhasesArrayPath)); - algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->CrystalStructuresArrayPath)); - algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)); - algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->KernelAverageMisorientationsArrayName)); - algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->QuatsArrayPath)); + typename ParallelAlgorithm::AlgorithmArrays algArrays; + algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->CellPhasesArrayPath)); + algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->CrystalStructuresArrayPath)); + algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)); + algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->KernelAverageMisorientationsArrayName)); + algArrays.push_back(m_DataStructure.getDataAs(m_InputValues->QuatsArrayPath)); ParallelData3DAlgorithm parallelAlgorithm; parallelAlgorithm.setRange(Range3D(0, udims[0], 0, udims[1], 0, udims[2])); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeShapesTriangleGeom.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeShapesTriangleGeom.cpp index 0068b1f301..94c27701bd 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeShapesTriangleGeom.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeShapesTriangleGeom.cpp @@ -1,7 +1,7 @@ #include "ComputeShapesTriangleGeom.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Utilities/GeometryHelpers.hpp" #include "simplnx/Utilities/IntersectionUtilities.hpp" @@ -18,8 +18,8 @@ using namespace nx::core; namespace { -using TriStore = AbstractDataStore; -using VertsStore = AbstractDataStore; +using TriStore = AbstractDataStore; +using VertsStore = AbstractDataStore; // usize FindEulerCharacteristic(usize numVertices, usize numFaces, usize numRegions) // { @@ -37,16 +37,16 @@ using VertsStore = AbstractDataStore +template AxialLengths FindIntersections(const Eigen::Matrix& orientationMatrix, const AbstractDataStore& faceLabelsStore, - const AbstractDataStore& triStore, const AbstractDataStore& vertexStore, - const AbstractDataStore& centroidsStore, IGeometry::MeshIndexType featureId, const std::atomic_bool& shouldCancel) + const AbstractDataStore& triStore, const AbstractDataStore& vertexStore, + const AbstractDataStore& centroidsStore, AbstractGeometry::MeshIndexType featureId, const std::atomic_bool& shouldCancel) { constexpr T epsilon = std::numeric_limits::epsilon(); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeTwinBoundaries.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeTwinBoundaries.cpp index 73f9647ac4..f3bfc36ae7 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeTwinBoundaries.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeTwinBoundaries.cpp @@ -163,7 +163,7 @@ class CalculateTwinBoundaryWithIncoherenceImpl public: CalculateTwinBoundaryWithIncoherenceImpl(float32 angtol, float32 axistol, const Int32AbstractDataStore& faceLabels, const Float64AbstractDataStore& faceNormals, const Float32AbstractDataStore& avgQuats, const Int32AbstractDataStore& featurePhases, const UInt32AbstractDataStore& crystalStructures, - std::unique_ptr& twinBoundaries, Float32AbstractDataStore& twinBoundaryIncoherence, const std::atomic_bool& shouldCancel, + std::unique_ptr& twinBoundaries, Float32AbstractDataStore& twinBoundaryIncoherence, const std::atomic_bool& shouldCancel, std::atomic_bool& hasNaN) : m_AxisTol(axistol) , m_AngTol(angtol) @@ -237,7 +237,7 @@ class CalculateTwinBoundaryWithIncoherenceImpl const Float32AbstractDataStore& m_AvgQuats; const Int32AbstractDataStore& m_FeaturePhases; const UInt32AbstractDataStore& m_CrystalStructures; - std::unique_ptr& m_TwinBoundaries; + std::unique_ptr& m_TwinBoundaries; Float32AbstractDataStore& m_TwinBoundaryIncoherence; const std::atomic_bool& m_ShouldCancel; std::atomic_bool& m_HasNaN; @@ -252,7 +252,7 @@ class CalculateTwinBoundaryImpl { public: CalculateTwinBoundaryImpl(float32 angtol, float32 axistol, const Int32AbstractDataStore& faceLabels, const Float32AbstractDataStore& avgQuats, const Int32AbstractDataStore& featurePhases, - const UInt32AbstractDataStore& crystalStructures, std::unique_ptr& twinBoundaries, const std::atomic_bool& shouldCancel) + const UInt32AbstractDataStore& crystalStructures, std::unique_ptr& twinBoundaries, const std::atomic_bool& shouldCancel) : m_AxisTol(axistol) , m_AngTol(angtol) , m_FaceLabels(faceLabels) @@ -304,7 +304,7 @@ class CalculateTwinBoundaryImpl const Float32AbstractDataStore& m_AvgQuats; const Int32AbstractDataStore& m_FeaturePhases; const UInt32AbstractDataStore& m_CrystalStructures; - std::unique_ptr& m_TwinBoundaries; + std::unique_ptr& m_TwinBoundaries; const std::atomic_bool& m_ShouldCancel; std::vector m_OrientationOps; }; @@ -359,7 +359,7 @@ Result<> ComputeTwinBoundaries::operator()() const auto& avgQuats = m_DataStructure.getDataAs(m_InputValues->AvgQuatsArrayPath)->getDataStoreRef(); const auto& featurePhases = m_DataStructure.getDataAs(m_InputValues->FeaturePhasesArrayPath)->getDataStoreRef(); - std::unique_ptr twinBoundaries; + std::unique_ptr twinBoundaries; try { twinBoundaries = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->TwinBoundariesArrayPath); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertOrientationsToVertexGeometry.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertOrientationsToVertexGeometry.cpp index bbd8cd9226..9654854041 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertOrientationsToVertexGeometry.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertOrientationsToVertexGeometry.cpp @@ -4,8 +4,8 @@ #include +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Utilities/DataArrayUtilities.hpp" #include diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp index 177c08c49e..738e84f128 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ConvertQuaternion.cpp @@ -94,7 +94,7 @@ const std::atomic_bool& ConvertQuaternion::getCancel() // ----------------------------------------------------------------------------- Result<> ConvertQuaternion::operator()() { - const auto& iDataArray = m_DataStructure.getDataRefAs(m_InputValues->QuaternionDataArrayPath); + const auto& iDataArray = m_DataStructure.getDataRefAs(m_InputValues->QuaternionDataArrayPath); ParallelDataAlgorithm dataAlg; dataAlg.setRange(0, iDataArray.getNumberOfTuples()); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.cpp index 000b1e28b3..85ca209c55 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.cpp @@ -1,13 +1,13 @@ #include "EBSDSegmentFeatures.hpp" #include "simplnx/DataStructure/DataStore.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" using namespace nx::core; // ----------------------------------------------------------------------------- EBSDSegmentFeatures::EBSDSegmentFeatures(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, EBSDSegmentFeaturesInputValues* inputValues) -: SegmentFeatures(dataStructure, shouldCancel, mesgHandler) +: AbstractSegmentFeatures(dataStructure, shouldCancel, mesgHandler) , m_InputValues(inputValues) { m_OrientationOps = ebsdlib::LaueOps::GetAllOrientationOps(); @@ -21,7 +21,7 @@ EBSDSegmentFeatures::~EBSDSegmentFeatures() noexcept = default; Result<> EBSDSegmentFeatures::operator()() { this->m_NeighborScheme = m_InputValues->NeighborScheme; - auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); + auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); m_QuatsArray = m_DataStructure.getDataAs(m_InputValues->QuatsArrayPath); m_CellPhases = m_DataStructure.getDataAs(m_InputValues->CellPhasesArrayPath); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.hpp index d1db6caada..76318fc4b2 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/EBSDSegmentFeatures.hpp @@ -2,13 +2,13 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" +#include "simplnx/Utilities/AbstractSegmentFeatures.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" -#include "simplnx/Utilities/SegmentFeatures.hpp" #include @@ -25,7 +25,7 @@ struct ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeaturesInputValues float32 MisorientationTolerance; bool UseMask; bool RandomizeFeatureIds; - SegmentFeatures::NeighborScheme NeighborScheme; + ISegmentFeatures::NeighborScheme NeighborScheme; DataPath ImageGeometryPath; DataPath QuatsArrayPath; DataPath CellPhasesArrayPath; @@ -40,7 +40,7 @@ struct ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeaturesInputValues /** * @brief */ -class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeatures : public SegmentFeatures +class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeatures : public AbstractSegmentFeatures { public: using FeatureIdsArrayType = Int32Array; @@ -81,7 +81,7 @@ class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeatures : public SegmentFeatures const EBSDSegmentFeaturesInputValues* m_InputValues = nullptr; Float32Array* m_QuatsArray = nullptr; FeatureIdsArrayType* m_CellPhases = nullptr; - std::unique_ptr m_GoodVoxelsArray = nullptr; + std::unique_ptr m_GoodVoxelsArray = nullptr; DataArray* m_CrystalStructures = nullptr; FeatureIdsArrayType* m_FeatureIdsArray = nullptr; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/NeighborOrientationCorrelation.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/NeighborOrientationCorrelation.cpp index c2a49646e4..44083fc9e7 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/NeighborOrientationCorrelation.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/NeighborOrientationCorrelation.cpp @@ -25,7 +25,7 @@ class NeighborOrientationCorrelationTransferDataImpl NeighborOrientationCorrelationTransferDataImpl() = delete; NeighborOrientationCorrelationTransferDataImpl(const NeighborOrientationCorrelationTransferDataImpl&) = default; - NeighborOrientationCorrelationTransferDataImpl(MessageHelper& messageHelper, size_t totalPoints, const std::vector& bestNeighbor, std::shared_ptr dataArrayPtr) + NeighborOrientationCorrelationTransferDataImpl(MessageHelper& messageHelper, size_t totalPoints, const std::vector& bestNeighbor, std::shared_ptr dataArrayPtr) : m_MessageHelper(messageHelper) , m_TotalPoints(totalPoints) , m_BestNeighbor(bestNeighbor) @@ -57,7 +57,7 @@ class NeighborOrientationCorrelationTransferDataImpl MessageHelper& m_MessageHelper; size_t m_TotalPoints = 0; std::vector m_BestNeighbor; - std::shared_ptr m_DataArrayPtr; + std::shared_ptr m_DataArrayPtr; }; // ----------------------------------------------------------------------------- @@ -208,7 +208,7 @@ Result<> NeighborOrientationCorrelation::operator()() } // Build up a list of the DataArrays that we are going to operate on. - std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->ConfidenceIndexArrayPath, m_InputValues->IgnoredDataArrayPaths); + std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->ConfidenceIndexArrayPath, m_InputValues->IgnoredDataArrayPaths); // The idea for this parallel section is to parallelize over each Data Array that // will need it's data adjusted. This should go faster than before by about 2x. // Better speed up could be achieved if we had better data locality. diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadAngData.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadAngData.hpp index c49f43e06e..10f9665530 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadAngData.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadAngData.hpp @@ -2,10 +2,10 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" #include diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadChannel5Data.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadChannel5Data.hpp index 8c05dc7582..8727391a60 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadChannel5Data.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadChannel5Data.hpp @@ -2,10 +2,10 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/FileSystemPathParameter.hpp" diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp index 7db1fe0e44..55e2e5459a 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp @@ -115,7 +115,7 @@ class ComputeIntensityStereographicProjection using RTreeType = RTree; // filter->notifyStatusMessage(QString("Starting Interpolation....")); - nx::core::IGeometry::SharedFaceList& delTriangles = delaunayGeom->getFacesRef(); + nx::core::AbstractGeometry::SharedFaceList& delTriangles = delaunayGeom->getFacesRef(); size_t numTriangles = delaunayGeom->getNumberOfFaces(); // int percent = 0; int counter = xPositionsPtr.size() / 100; @@ -274,13 +274,13 @@ class ComputeIntensityStereographicProjection using DimensionType = std::vector; DimensionType faceTupleShape = {0}; - Result result = ArrayCreationUtilities::CreateArray(dataStructure, faceTupleShape, {3ULL}, sharedFaceListPath, IDataAction::Mode::Execute); + Result result = ArrayCreationUtilities::CreateArray(dataStructure, faceTupleShape, {3ULL}, sharedFaceListPath, IDataAction::Mode::Execute); if(result.invalid()) { return -1; // return MergeResults(result, MakeErrorResult(-5509, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedTriList '{}'", prefix, trianglesPath.toString()))); } - auto& sharedFaceListRef = dataStructure.getDataRefAs(sharedFaceListPath); + auto& sharedFaceListRef = dataStructure.getDataRefAs(sharedFaceListPath); triangleGeom.setFaceList(sharedFaceListRef); // Create the Vertex Array with a component size of 3 @@ -680,7 +680,7 @@ Result<> WritePoleFigure::operator()() auto& crystalStructures = m_DataStructure.getDataRefAs(m_InputValues->CrystalStructuresArrayPath); auto& materialNames = m_DataStructure.getDataRefAs(m_InputValues->MaterialNameArrayPath); - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; if(m_InputValues->UseMask) { try diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.cpp index 021f537479..b500f5f15e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.cpp @@ -47,7 +47,7 @@ Result<> WriteStatsGenOdfAngleFile::operator()() } const auto& cellPhases = m_DataStructure.getDataRefAs(m_InputValues->CellPhasesArrayPath); - std::unique_ptr maskPtr = nullptr; + std::unique_ptr maskPtr = nullptr; if(m_InputValues->UseMask) { maskPtr = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); @@ -100,7 +100,7 @@ Result<> WriteStatsGenOdfAngleFile::operator()() } // ----------------------------------------------------------------------------- -int WriteStatsGenOdfAngleFile::determineOutputLineCount(const Int32Array& cellPhases, const std::unique_ptr& mask, usize totalPoints, int32 phase) const +int WriteStatsGenOdfAngleFile::determineOutputLineCount(const Int32Array& cellPhases, const std::unique_ptr& mask, usize totalPoints, int32 phase) const { int32 lineCount = 0; for(usize i = 0; i < totalPoints; i++) @@ -118,7 +118,7 @@ int WriteStatsGenOdfAngleFile::determineOutputLineCount(const Int32Array& cellPh } // ----------------------------------------------------------------------------- -Result<> WriteStatsGenOdfAngleFile::writeOutputFile(std::ofstream& out, const Int32Array& cellPhases, const std::unique_ptr& mask, int32 lineCount, +Result<> WriteStatsGenOdfAngleFile::writeOutputFile(std::ofstream& out, const Int32Array& cellPhases, const std::unique_ptr& mask, int32 lineCount, usize totalPoints, int32 phase) const { const auto& eulerAngles = m_DataStructure.getDataRefAs(m_InputValues->CellEulerAnglesArrayPath); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.hpp index 08c67f013d..c0d50a7a51 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WriteStatsGenOdfAngleFile.hpp @@ -46,8 +46,8 @@ class ORIENTATIONANALYSIS_EXPORT WriteStatsGenOdfAngleFile const std::atomic_bool& getCancel(); - int determineOutputLineCount(const Int32Array& cellPhases, const std::unique_ptr& mask, usize totalPoints, int32 phase) const; - Result<> writeOutputFile(std::ofstream& out, const Int32Array& cellPhases, const std::unique_ptr& mask, int32 lineCount, usize totalPoints, int32 phase) const; + int determineOutputLineCount(const Int32Array& cellPhases, const std::unique_ptr& mask, usize totalPoints, int32 phase) const; + Result<> writeOutputFile(std::ofstream& out, const Int32Array& cellPhases, const std::unique_ptr& mask, int32 lineCount, usize totalPoints, int32 phase) const; private: DataStructure& m_DataStructure; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMisorientationFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMisorientationFilter.hpp index 50ec160fa0..e262e80dc8 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMisorientationFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMisorientationFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class AlignSectionsMisorientationFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT AlignSectionsMisorientationFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT AlignSectionsMisorientationFilter : public AbstractFilter { public: AlignSectionsMisorientationFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMutualInformationFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMutualInformationFilter.hpp index 78f2862dc0..3b6bf2b438 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMutualInformationFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/AlignSectionsMutualInformationFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will segment each 2D slice, creating Feature Ids that are used when determining the mutual information between neighboring slices. The slices are shifted relative to one another * until the position of maximum mutual information is determined for each section. */ -class ORIENTATIONANALYSIS_EXPORT AlignSectionsMutualInformationFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT AlignSectionsMutualInformationFilter : public AbstractFilter { public: AlignSectionsMutualInformationFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.hpp index d3b27f8ef0..205cc9bc31 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/BadDataNeighborOrientationCheckFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class BadDataNeighborOrientationCheckFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT BadDataNeighborOrientationCheckFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT BadDataNeighborOrientationCheckFilter : public AbstractFilter { public: BadDataNeighborOrientationCheckFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.cpp index e698b93e0f..d8accd6d9d 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.cpp @@ -126,7 +126,7 @@ IFilter::PreflightResult CAxisSegmentFeaturesFilter::preflightImpl(const DataStr // Validate the Grid Geometry auto gridGeomPath = filterArgs.value(k_SelectedImageGeometryPath_Key); - const auto* inputGridGeom = dataStructure.getDataAs(gridGeomPath); + const auto* inputGridGeom = dataStructure.getDataAs(gridGeomPath); DataPath inputCellDataPath = inputGridGeom->getCellDataPath(); auto featureIdsPath = inputCellDataPath.createChildPath(filterArgs.value(k_FeatureIdsArrayName_Key)); auto pCellFeatureAttributeMatrixNameValue = gridGeomPath.createChildPath(filterArgs.value(k_CellFeatureAttributeMatrixName_Key)); @@ -185,7 +185,7 @@ Result<> CAxisSegmentFeaturesFilter::executeImpl(DataStructure& dataStructure, c inputValues.FeatureIdsArrayPath = inputValues.QuatsArrayPath.replaceName(filterArgs.value(k_FeatureIdsArrayName_Key)); inputValues.CellFeatureAttributeMatrixPath = inputValues.ImageGeometryPath.createChildPath(filterArgs.value(k_CellFeatureAttributeMatrixName_Key)); inputValues.ActiveArrayPath = inputValues.CellFeatureAttributeMatrixPath.createChildPath(filterArgs.value(k_ActiveArrayName_Key)); - inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); + inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); return CAxisSegmentFeatures(dataStructure, messageHandler, shouldCancel, &inputValues)(); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.hpp index 54ba4877c9..22c4aec92a 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CAxisSegmentFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CAxisSegmentFeaturesFilter * @brief This filter segments the Features by grouping neighboring Cells that satisfy the C-axis misalignment tolerance, i.e., have misalignment angle less than the value set by the user. */ -class ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeaturesFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT CAxisSegmentFeaturesFilter : public AbstractFilter { public: CAxisSegmentFeaturesFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgCAxesFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgCAxesFilter.hpp index ba05080462..11c1d25ff0 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgCAxesFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgCAxesFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeAvgCAxesFilter * @brief This filter determines the average C-axis location of each Feature */ -class ORIENTATIONANALYSIS_EXPORT ComputeAvgCAxesFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeAvgCAxesFilter : public AbstractFilter { public: ComputeAvgCAxesFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgOrientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgOrientationsFilter.hpp index 509d2eec12..1cffe93c50 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgOrientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeAvgOrientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeAvgOrientationsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeAvgOrientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeAvgOrientationsFilter : public AbstractFilter { public: ComputeAvgOrientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeBoundaryStrengthsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeBoundaryStrengthsFilter.hpp index 738abb345f..172ac21e5f 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeBoundaryStrengthsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeBoundaryStrengthsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeBoundaryStrengthsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeBoundaryStrengthsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeBoundaryStrengthsFilter : public AbstractFilter { public: ComputeBoundaryStrengthsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisLocationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisLocationsFilter.hpp index 2106f7c563..cd1310ac7b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisLocationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeCAxisLocationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter determines the direction of the C-axis for each Element by applying the quaternion of the Element to the <001> direction, which is the C-axis for Hexagonal materials. This will * tell where the C-axis of the Element sits in the sample reference frame. */ -class ORIENTATIONANALYSIS_EXPORT ComputeCAxisLocationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeCAxisLocationsFilter : public AbstractFilter { public: ComputeCAxisLocationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.cpp index 20d3be405c..de040dc278 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.cpp @@ -29,7 +29,7 @@ class GenerateMaskedFZQuatsImpl { public: GenerateMaskedFZQuatsImpl(const Float32AbstractDataStore& quats, const Int32AbstractDataStore& phases, const UInt32AbstractDataStore& crystalStructures, const int32 numPhases, - std::unique_ptr& goodVoxels, Float32AbstractDataStore& fzQuats, const std::atomic_bool& shouldCancel, std::atomic_int32_t& warningCount) + std::unique_ptr& goodVoxels, Float32AbstractDataStore& fzQuats, const std::atomic_bool& shouldCancel, std::atomic_int32_t& warningCount) : m_Quats(quats) , m_CellPhases(phases) , m_CrystalStructures(crystalStructures) @@ -93,7 +93,7 @@ class GenerateMaskedFZQuatsImpl const Int32AbstractDataStore& m_CellPhases; const UInt32AbstractDataStore& m_CrystalStructures; const int32 m_NumPhases = 0; - std::unique_ptr& m_GoodVoxels; + std::unique_ptr& m_GoodVoxels; Float32AbstractDataStore& m_FZQuats; const std::atomic_bool& m_ShouldCancel; std::atomic_int32_t& m_WarningCount; @@ -267,7 +267,7 @@ IFilter::PreflightResult ComputeFZQuaternionsFilter::preflightImpl(const DataStr if(pUseGoodVoxelsValue) { - const auto& maskArray = dataStructure.getDataRefAs(pGoodVoxelsArrayPathValue); + const auto& maskArray = dataStructure.getDataRefAs(pGoodVoxelsArrayPathValue); if(maskArray.getNumberOfTuples() != quatArray.getNumberOfTuples()) { return {MakeErrorResult(-49002, @@ -299,13 +299,13 @@ Result<> ComputeFZQuaternionsFilter::executeImpl(DataStructure& dataStructure, c auto& phaseArray = dataStructure.getDataRefAs(pCellPhasesArrayPathValue); auto& quatArray = dataStructure.getDataRefAs(pQuatsArrayPathValue); auto& xtalArray = dataStructure.getDataRefAs(pCrystalStructuresArrayPathValue); - auto* maskArray = dataStructure.getDataAs(pGoodVoxelsArrayPathValue); + auto* maskArray = dataStructure.getDataAs(pGoodVoxelsArrayPathValue); auto& fzQuatArray = dataStructure.getDataRefAs(pFZQuatsArrayPathValue); std::atomic_int32_t warningCount = 0; auto numPhases = static_cast(xtalArray.getNumberOfTuples()); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&phaseArray); algArrays.push_back(&quatArray); algArrays.push_back(&xtalArray); @@ -325,7 +325,7 @@ Result<> ComputeFZQuaternionsFilter::executeImpl(DataStructure& dataStructure, c if(pUseGoodVoxelsValue) { - std::unique_ptr maskArrayPtr = nullptr; + std::unique_ptr maskArrayPtr = nullptr; try { maskArrayPtr = MaskCompareUtilities::InstantiateMaskCompare(dataStructure, pGoodVoxelsArrayPathValue); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.hpp index 352707354e..dd1aa59b66 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFZQuaternionsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFZQuaternions * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeFZQuaternionsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFZQuaternionsFilter : public AbstractFilter { public: ComputeFZQuaternionsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFaceIPFColoringFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFaceIPFColoringFilter.hpp index 4687bf8f3a..9d893281a2 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFaceIPFColoringFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFaceIPFColoringFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFaceIPFColoringFilter * @brief This filter will generate a pair of colors for each Triangle in a Triangle Geometry based on the inverse pole figure (IPF) color scheme for the present crystal structure. */ -class ORIENTATIONANALYSIS_EXPORT ComputeFaceIPFColoringFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFaceIPFColoringFilter : public AbstractFilter { public: ComputeFaceIPFColoringFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureFaceMisorientationFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureFaceMisorientationFilter.hpp index 1c76dc9df6..d131133055 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureFaceMisorientationFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureFaceMisorientationFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will generate a 3 component vector for each Triangle in a Triangle Geometry that is the axis-angle of the misorientation associated with the Features that lie on either side of * the Triangle. The axis is normalized, so if the magnitude of the vector is viewed, it will be the misorientation angle in degrees. */ -class ORIENTATIONANALYSIS_EXPORT ComputeFeatureFaceMisorientationFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFeatureFaceMisorientationFilter : public AbstractFilter { public: ComputeFeatureFaceMisorientationFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborCAxisMisalignmentsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborCAxisMisalignmentsFilter.hpp index 8de0601dbe..0ef5366897 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborCAxisMisalignmentsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborCAxisMisalignmentsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureNeighborCAxisMisalignmentsFilter * @brief This filter determines, for each Feature, the C-axis mis alignments with the Features that are in contact with it. */ -class ORIENTATIONANALYSIS_EXPORT ComputeFeatureNeighborCAxisMisalignmentsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFeatureNeighborCAxisMisalignmentsFilter : public AbstractFilter { public: ComputeFeatureNeighborCAxisMisalignmentsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborMisorientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborMisorientationsFilter.hpp index 9dd5b39222..17c2efab5b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborMisorientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureNeighborMisorientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureNeighborMisorientationsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeFeatureNeighborMisorientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFeatureNeighborMisorientationsFilter : public AbstractFilter { public: ComputeFeatureNeighborMisorientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceCAxisMisorientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceCAxisMisorientationsFilter.hpp index 12b3740468..a0a81c4e40 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceCAxisMisorientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceCAxisMisorientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureReferenceCAxisMisorientationsFilter * @brief This filter calculates the misorientation angle between the C-axis of each Cell within a Feature and the average C-axis for that Feature and stores that value for each Cell. */ -class ORIENTATIONANALYSIS_EXPORT ComputeFeatureReferenceCAxisMisorientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFeatureReferenceCAxisMisorientationsFilter : public AbstractFilter { public: ComputeFeatureReferenceCAxisMisorientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceMisorientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceMisorientationsFilter.hpp index 9cb8fe615f..d0dcd382f9 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceMisorientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeFeatureReferenceMisorientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureReferenceMisorientationsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeFeatureReferenceMisorientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeFeatureReferenceMisorientationsFilter : public AbstractFilter { public: ComputeFeatureReferenceMisorientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDFilter.hpp index a2a0d38eee..b1ed53b825 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeGBCDFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeGBCDFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeGBCDFilter : public AbstractFilter { public: ComputeGBCDFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDMetricBasedFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDMetricBasedFilter.hpp index 8b91d9d94c..e7dd406040 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDMetricBasedFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDMetricBasedFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeGBCDMetricBasedFilter * @brief This filter computes a section through the five-dimensional grain boundary distribution for a fixed mis orientation. */ -class ORIENTATIONANALYSIS_EXPORT ComputeGBCDMetricBasedFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeGBCDMetricBasedFilter : public AbstractFilter { public: ComputeGBCDMetricBasedFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDPoleFigureFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDPoleFigureFilter.hpp index 6ae5c2848a..761994b894 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDPoleFigureFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBCDPoleFigureFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeGBCDPoleFigureFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeGBCDPoleFigureFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeGBCDPoleFigureFilter : public AbstractFilter { public: ComputeGBCDPoleFigureFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBPDMetricBasedFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBPDMetricBasedFilter.hpp index ca7e0fc0ed..4c722d4771 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBPDMetricBasedFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeGBPDMetricBasedFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeGBPDMetricBasedFilter * @brief This filter computes the grain boundary plane distribution (GBPD) */ -class ORIENTATIONANALYSIS_EXPORT ComputeGBPDMetricBasedFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeGBPDMetricBasedFilter : public AbstractFilter { public: ComputeGBPDMetricBasedFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeIPFColorsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeIPFColorsFilter.hpp index 951327361f..d5501896ab 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeIPFColorsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeIPFColorsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeIPFColorsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeIPFColorsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeIPFColorsFilter : public AbstractFilter { public: ComputeIPFColorsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeKernelAvgMisorientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeKernelAvgMisorientationsFilter.hpp index e6cbd0b51e..d8b563b498 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeKernelAvgMisorientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeKernelAvgMisorientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeKernelAvgMisorientationsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeKernelAvgMisorientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeKernelAvgMisorientationsFilter : public AbstractFilter { public: ComputeKernelAvgMisorientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeMisorientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeMisorientationsFilter.hpp index a2e350afda..c69033ab03 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeMisorientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeMisorientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeMisorientationsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeMisorientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeMisorientationsFilter : public AbstractFilter { public: ComputeMisorientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeQuaternionConjugateFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeQuaternionConjugateFilter.hpp index 393b8bb33e..3df5b728cb 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeQuaternionConjugateFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeQuaternionConjugateFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeQuaternionConjugateFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeQuaternionConjugateFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeQuaternionConjugateFilter : public AbstractFilter { public: ComputeQuaternionConjugateFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSchmidsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSchmidsFilter.hpp index 409af03719..2a373f3cfc 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSchmidsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSchmidsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeSchmidsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeSchmidsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeSchmidsFilter : public AbstractFilter { public: ComputeSchmidsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesFilter.hpp index 07fb3aa790..092907f0f4 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeShapesFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeShapesFilter : public AbstractFilter { public: ComputeShapesFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesTriangleGeomFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesTriangleGeomFilter.hpp index 5a2f9b7224..7b25876777 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesTriangleGeomFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeShapesTriangleGeomFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeShapesTriangleGeomFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeShapesTriangleGeomFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeShapesTriangleGeomFilter : public AbstractFilter { public: ComputeShapesTriangleGeomFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSlipTransmissionMetricsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSlipTransmissionMetricsFilter.hpp index bbb5b3cf83..5df641ccab 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSlipTransmissionMetricsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeSlipTransmissionMetricsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeSlipTransmissionMetricsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeSlipTransmissionMetricsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeSlipTransmissionMetricsFilter : public AbstractFilter { public: ComputeSlipTransmissionMetricsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.cpp index 2c4134a012..6713742944 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.cpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/Filters/Algorithms/ComputeTwinBoundaries.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -117,7 +117,7 @@ IFilter::PreflightResult ComputeTwinBoundariesFilter::preflightImpl(const DataSt nx::core::Result resultOutputActions; - const auto* faceLabels = dataStructure.getDataAs(pFaceLabelsArrayPath); + const auto* faceLabels = dataStructure.getDataAs(pFaceLabelsArrayPath); if(faceLabels == nullptr) { return MakePreflightErrorResult(-94730, "Input Face Labels Array must be valid."); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.hpp index 1ac7549324..690ef640b4 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ComputeTwinBoundariesFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ComputeTwinBoundariesFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ComputeTwinBoundariesFilter : public AbstractFilter { public: ComputeTwinBoundariesFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.hpp index 3dabfe187e..28f6471519 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConvertHexGridToSquareGridFilter * @brief This filter will... */ -class ORIENTATIONANALYSIS_EXPORT ConvertHexGridToSquareGridFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ConvertHexGridToSquareGridFilter : public AbstractFilter { public: ConvertHexGridToSquareGridFilter(); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.cpp index dc14fcf385..08d973dac3 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.cpp @@ -99,7 +99,7 @@ IFilter::PreflightResult ConvertOrientationsFilter::preflightImpl(const DataStru } auto pInputArrayPath = filterArgs.value(k_InputOrientationArrayPath_Key); - const auto* inputArray = dataStructure.getDataAs(pInputArrayPath); + const auto* inputArray = dataStructure.getDataAs(pInputArrayPath); std::vector inputCompShape = inputArray->getIDataStore()->getComponentShape(); if(inputCompShape.size() > 1) diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.hpp index 26575c1938..1d365edae7 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -22,7 +22,7 @@ namespace nx::core * "Stereographic" = 7 * */ -class ORIENTATIONANALYSIS_EXPORT ConvertOrientationsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ConvertOrientationsFilter : public AbstractFilter { public: ConvertOrientationsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.cpp index 58a40d3f5a..60dfa67358 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.cpp @@ -67,7 +67,7 @@ Parameters ConvertOrientationsToVertexGeometryFilter::parameters() const params.insert(std::make_unique(k_CopyVertexPaths_Key, "Copy Vertex Arrays", "Paths to vertex-related DataArrays that should be copied to the output rodrigues vertex geometry", std::vector{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); params.insertLinkableParameter(std::make_unique(k_ConvertToFundamentalZone_Key, "Convert To Fundamental Zone", "Convert the orientations to the fundamental zone.", false)); @@ -151,7 +151,7 @@ IFilter::PreflightResult ConvertOrientationsToVertexGeometryFilter::preflightImp DataPath vertexAttrMatrixPath = outputVertexGeometryPath.createChildPath(outputVertexAttrMatrixName); for(const auto& vertexPathToCopy : vertexPathsToCopy) { - auto& vertexDataArray = dataStructure.getDataRefAs(vertexPathToCopy); + auto& vertexDataArray = dataStructure.getDataRefAs(vertexPathToCopy); DataType type = vertexDataArray.getDataType(); DataPath copyPath = vertexAttrMatrixPath.createChildPath(vertexDataArray.getName()); auto numTuples = vertexDataArray.getNumberOfTuples(); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.hpp index 50ed0f6f8e..07214fa5c8 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertOrientationsToVertexGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConvertOrientationsToVertexGeometryFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ConvertOrientationsToVertexGeometryFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ConvertOrientationsToVertexGeometryFilter : public AbstractFilter { public: ConvertOrientationsToVertexGeometryFilter() = default; @@ -24,15 +24,15 @@ class ORIENTATIONANALYSIS_EXPORT ConvertOrientationsToVertexGeometryFilter : pub ConvertOrientationsToVertexGeometryFilter& operator=(ConvertOrientationsToVertexGeometryFilter&&) noexcept = delete; // Parameter Keys - static inline constexpr StringLiteral k_InputType_Key = "input_representation_index"; - static inline constexpr StringLiteral k_InputOrientationArrayPath_Key = "input_orientation_array_path"; - static inline constexpr StringLiteral k_CopyVertexPaths_Key = "copy_vertex_array_paths"; - static inline constexpr StringLiteral k_ConvertToFundamentalZone_Key = "convert_to_fundamental_zone"; - static inline constexpr StringLiteral k_CellPhasesArrayPath_Key = "cell_phases_array_path"; - static inline constexpr StringLiteral k_CrystalStructuresArrayPath_Key = "crystal_structures_array_path"; - static inline constexpr StringLiteral k_VertexGeometryPath_Key = "output_vertex_geometry_path"; - static inline constexpr StringLiteral k_VertexAttrMatrixName_Key = "output_vertex_attr_matrix_name"; - static inline constexpr StringLiteral k_SharedVertexListName_Key = "output_shared_vertex_list_name"; + static constexpr StringLiteral k_InputType_Key = "input_representation_index"; + static constexpr StringLiteral k_InputOrientationArrayPath_Key = "input_orientation_array_path"; + static constexpr StringLiteral k_CopyVertexPaths_Key = "copy_vertex_array_paths"; + static constexpr StringLiteral k_ConvertToFundamentalZone_Key = "convert_to_fundamental_zone"; + static constexpr StringLiteral k_CellPhasesArrayPath_Key = "cell_phases_array_path"; + static constexpr StringLiteral k_CrystalStructuresArrayPath_Key = "crystal_structures_array_path"; + static constexpr StringLiteral k_VertexGeometryPath_Key = "output_vertex_geometry_path"; + static constexpr StringLiteral k_VertexAttrMatrixName_Key = "output_vertex_attr_matrix_name"; + static constexpr StringLiteral k_SharedVertexListName_Key = "output_shared_vertex_list_name"; /** * @brief Reads SIMPL json and converts it simplnx Arguments. diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.cpp index aa4aa136a4..99e4803306 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.cpp @@ -95,7 +95,7 @@ IFilter::PreflightResult ConvertQuaternionFilter::preflightImpl(const DataStruct nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& quats = dataStructure.getDataRefAs(pQuaternionDataArrayPathValue); + const auto& quats = dataStructure.getDataRefAs(pQuaternionDataArrayPathValue); { auto createConvertedQuatAction = std::make_unique(quats.getDataType(), quats.getTupleShape(), std::vector{4}, pOutputDataArrayPathValue); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.hpp index af4d193068..ab99a51d9a 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertQuaternionFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConvertQuaternionFilter * @brief This filter will covert Quaternions between a 'Scalar-Vector' and 'Vector-Scalar' representation */ -class ORIENTATIONANALYSIS_EXPORT ConvertQuaternionFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ConvertQuaternionFilter : public AbstractFilter { public: ConvertQuaternionFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CreateEnsembleInfoFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CreateEnsembleInfoFilter.hpp index 439b23014d..d5544795dc 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CreateEnsembleInfoFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/CreateEnsembleInfoFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreateEnsembleInfoFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT CreateEnsembleInfoFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT CreateEnsembleInfoFilter : public AbstractFilter { public: CreateEnsembleInfoFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.cpp index 8712016a6e..0e30551168 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.cpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Constants.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" @@ -125,7 +125,7 @@ IFilter::PreflightResult EBSDSegmentFeaturesFilter::preflightImpl(const DataStru // Validate the Grid Geometry auto gridGeomPath = filterArgs.value(k_SelectedImageGeometryPath_Key); - const auto* inputGridGeom = dataStructure.getDataAs(gridGeomPath); + const auto* inputGridGeom = dataStructure.getDataAs(gridGeomPath); DataPath inputCellDataPath = inputGridGeom->getCellDataPath(); auto featureIdsPath = inputCellDataPath.createChildPath(filterArgs.value(k_FeatureIdsArrayName_Key)); auto pCellFeatureAttributeMatrixNameValue = gridGeomPath.createChildPath(filterArgs.value(k_CellFeatureAttributeMatrixName_Key)); @@ -185,7 +185,7 @@ Result<> EBSDSegmentFeaturesFilter::executeImpl(DataStructure& dataStructure, co inputValues.CellFeatureAttributeMatrixPath = inputValues.ImageGeometryPath.createChildPath(filterArgs.value(k_CellFeatureAttributeMatrixName_Key)); inputValues.ActiveArrayPath = inputValues.CellFeatureAttributeMatrixPath.createChildPath(filterArgs.value(k_ActiveArrayName_Key)); inputValues.IsPeriodic = filterArgs.value(k_IsPeriodic_Key); - inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); + inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); return EBSDSegmentFeatures(dataStructure, messageHandler, shouldCancel, &inputValues)(); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.hpp index 8823c3b88b..b88233086f 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EBSDSegmentFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class EBSDSegmentFeaturesFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeaturesFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeaturesFilter : public AbstractFilter { public: EBSDSegmentFeaturesFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EbsdToH5EbsdFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EbsdToH5EbsdFilter.hpp index ab698f1d0d..e35dbf1d33 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EbsdToH5EbsdFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/EbsdToH5EbsdFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class EbsdToH5EbsdFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT EbsdToH5EbsdFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT EbsdToH5EbsdFilter : public AbstractFilter { public: EbsdToH5EbsdFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeTwinsFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeTwinsFilter.hpp index ba2d4072bb..aa5a61d9bd 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeTwinsFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/MergeTwinsFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class MergeTwinsFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT MergeTwinsFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT MergeTwinsFilter : public AbstractFilter { public: MergeTwinsFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.cpp index 3e8796fc47..d66539c739 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.cpp @@ -76,7 +76,7 @@ Parameters NeighborOrientationCorrelationFilter::parameters() const DataPath({"Ensemble Data", "CrystalStructures"}), ArraySelectionParameter::AllowedTypes{DataType::uint32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_IgnoredDataArrayPaths_Key, "Attribute Arrays to Ignore", "The list of arrays to ignore", MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); return params; } @@ -122,7 +122,7 @@ IFilter::PreflightResult NeighborOrientationCorrelationFilter::preflightImpl(con // collect the rest of the geometry's arrays that aren't ignored to check the tuple count DataPath parentPath = pConfidenceIndexArrayPathValue.getParent(); const auto& parent = dataStructure.getDataRefAs(parentPath); - auto childArrays = parent.findAllChildrenOfType(); + auto childArrays = parent.findAllChildrenOfType(); for(const auto& childArray : childArrays) { bool ignore = false; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.hpp index 22a64b688f..0cf9ba30e6 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/NeighborOrientationCorrelationFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class NeighborOrientationCorrelationFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT NeighborOrientationCorrelationFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT NeighborOrientationCorrelationFilter : public AbstractFilter { public: NeighborOrientationCorrelationFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.cpp index 62da778895..64a11c6c72 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.cpp @@ -123,7 +123,7 @@ IFilter::PreflightResult ReadAngDataFilter::preflightImpl(const DataStructure& d // Define a custom class that generates the changes to the DataStructure. auto createImageGeometryAction = std::make_unique(pImageGeometryPath, CreateImageGeometryAction::DimensionType({imageGeomDims[0], imageGeomDims[1], imageGeomDims[2]}), - origin, spacing, pCellAttributeMatrixNameValue, IGeometry::LengthUnit::Micrometer); + origin, spacing, pCellAttributeMatrixNameValue, AbstractGeometry::LengthUnit::Micrometer); // Assign the createImageGeometryAction to the Result::actions vector via a push_back nx::core::Result resultOutputActions; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.hpp index d935aaaf88..0ed64f579b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadAngDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include @@ -17,7 +17,7 @@ class ReadAngDataPrivate; * @brief This filter will read a single .ang file into a new Image Geometry, allowing the immediate use of Filters on the data instead of having to generate the intermediate * .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadAngDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadAngDataFilter : public AbstractFilter { public: ReadAngDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.cpp index ed936035b4..dadc3578d6 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.cpp @@ -148,7 +148,7 @@ IFilter::PreflightResult ReadChannel5DataFilter::preflightImpl(const DataStructu // Define an Action that makes changes to the DataStructure auto createImageGeometryAction = std::make_unique(pImageGeometryPath, CreateImageGeometryAction::DimensionType({imageGeomDims[0], imageGeomDims[1], imageGeomDims[2]}), - origin, spacing, pCellAttributeMatrixNameValue, IGeometry::LengthUnit::Micrometer); + origin, spacing, pCellAttributeMatrixNameValue, AbstractGeometry::LengthUnit::Micrometer); // Assign the createImageGeometryAction to the Result::actions vector via an appendAction nx::core::Result resultOutputActions; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.hpp index 7851f9eef9..1ffb684e9f 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadChannel5DataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will read a single .ctf file into a new Image Geometry, allowing the immediate use of Filters on the data instead of having to generate the * intermediate .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadChannel5DataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadChannel5DataFilter : public AbstractFilter { public: ReadChannel5DataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.cpp index 512edc92dd..a0dd2b4afa 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.cpp @@ -130,7 +130,7 @@ IFilter::PreflightResult ReadCtfDataFilter::preflightImpl(const DataStructure& d // Define a custom class that generates the changes to the DataStructure. auto createImageGeometryAction = std::make_unique(pImageGeometryPath, CreateImageGeometryAction::DimensionType({imageGeomDims[0], imageGeomDims[1], imageGeomDims[2]}), - origin, spacing, pCellAttributeMatrixNameValue, IGeometry::LengthUnit::Micrometer); + origin, spacing, pCellAttributeMatrixNameValue, AbstractGeometry::LengthUnit::Micrometer); // Assign the createImageGeometryAction to the Result::actions vector via a push_back nx::core::Result resultOutputActions; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.hpp index 1efde67b39..31ff0fc69f 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadCtfDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will read a single .ctf file into a new Image Geometry, allowing the immediate use of Filters on the data instead of having to generate the * intermediate .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadCtfDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadCtfDataFilter : public AbstractFilter { public: ReadCtfDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadEnsembleInfoFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadEnsembleInfoFilter.hpp index 048e5cefee..4a18b14e0e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadEnsembleInfoFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadEnsembleInfoFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadEnsembleInfoFilter * @brief This filter reads in information about the crystal structure and phase types of all the Features that are contained in a Cell based volume. */ -class ORIENTATIONANALYSIS_EXPORT ReadEnsembleInfoFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadEnsembleInfoFilter : public AbstractFilter { public: ReadEnsembleInfoFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.cpp index 1b92485a10..369092bfd9 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.cpp @@ -161,7 +161,8 @@ IFilter::PreflightResult ReadGrainMapper3DFilter::preflightImpl(const DataStruct CreateImageGeometryAction::SpacingType spacing = reader.getLabDCTSpacing(); std::vector origin = reader.getLabDCTOrigin(); - auto createDataGroupAction = std::make_unique(pLabDCTImageGeometryPath, dims, origin, spacing, pLabDCTCellAttributeMatrixNameValue, IGeometry::LengthUnit::Millimeter); + auto createDataGroupAction = + std::make_unique(pLabDCTImageGeometryPath, dims, origin, spacing, pLabDCTCellAttributeMatrixNameValue, AbstractGeometry::LengthUnit::Millimeter); resultOutputActions.value().appendAction(std::move(createDataGroupAction)); } @@ -246,7 +247,7 @@ IFilter::PreflightResult ReadGrainMapper3DFilter::preflightImpl(const DataStruct std::vector origin = reader.getAbsorptionCTOrigin(); auto createDataGroupAction = - std::make_unique(pAbsorptionCTImageGeometryPath, dims, origin, spacing, pAbsorptionCTCellAttributeMatrixNameValue, IGeometry::LengthUnit::Millimeter); + std::make_unique(pAbsorptionCTImageGeometryPath, dims, origin, spacing, pAbsorptionCTCellAttributeMatrixNameValue, AbstractGeometry::LengthUnit::Millimeter); resultOutputActions.value().appendAction(std::move(createDataGroupAction)); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.hpp index a45b88b25d..643204c5fa 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadGrainMapper3DFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadGrainMapper3DFilter * @brief This filter determines the average C-axis location of each Feature */ -class ORIENTATIONANALYSIS_EXPORT ReadGrainMapper3DFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadGrainMapper3DFilter : public AbstractFilter { public: ReadGrainMapper3DFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EbsdFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EbsdFilter.hpp index 48ae2be8b0..dcabbf8d71 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EbsdFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EbsdFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadH5EbsdFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT ReadH5EbsdFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadH5EbsdFilter : public AbstractFilter { public: ReadH5EbsdFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EspritDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EspritDataFilter.hpp index f530673fce..476c80634e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EspritDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5EspritDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadH5EspritDataFilter * @brief This filter will read a single .h5 file into a new Image Geometry, allowing the immediate use of Filters on the data instead of having to generate the intermediate .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadH5EspritDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadH5EspritDataFilter : public AbstractFilter { public: ReadH5EspritDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OimDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OimDataFilter.hpp index 7cb4a5aac7..7d96face42 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OimDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OimDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will read a single .h5 file into a new Image Geometry, allowing the immediate use of Filters on the data instead of having to generate the * intermediate .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadH5OimDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadH5OimDataFilter : public AbstractFilter { public: ReadH5OimDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp index 103700b0f0..0171dff536 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadH5OinaDataFilter * @brief This filter will read a single .h5oina file into a new Image Geometry, allowing the immediate use of Filters on the data. */ -class ORIENTATIONANALYSIS_EXPORT ReadH5OinaDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT ReadH5OinaDataFilter : public AbstractFilter { public: ReadH5OinaDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RodriguesConvertorFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RodriguesConvertorFilter.hpp index ee1f9693bd..5c3fccd06c 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RodriguesConvertorFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RodriguesConvertorFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RodriguesConvertorFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT RodriguesConvertorFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT RodriguesConvertorFilter : public AbstractFilter { public: RodriguesConvertorFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.hpp index 300ebc7e69..528db558e4 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/RotateEulerRefFrameFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RotateEulerRefFrameFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT RotateEulerRefFrameFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT RotateEulerRefFrameFilter : public AbstractFilter { public: RotateEulerRefFrameFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDGMTFileFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDGMTFileFilter.hpp index ccdf28208e..3faa31aac4 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDGMTFileFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDGMTFileFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteGBCDGMTFileFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT WriteGBCDGMTFileFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT WriteGBCDGMTFileFilter : public AbstractFilter { public: WriteGBCDGMTFileFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDTriangleDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDTriangleDataFilter.hpp index eb5764002e..2ec8813879 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDTriangleDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteGBCDTriangleDataFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteGBCDTriangleDataFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT WriteGBCDTriangleDataFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT WriteGBCDTriangleDataFilter : public AbstractFilter { public: WriteGBCDTriangleDataFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.cpp index c4b34af8d0..58a6cb90ec 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.cpp @@ -104,8 +104,8 @@ IFilter::PreflightResult WriteINLFileFilter::preflightImpl(const DataStructure& nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - IArray::ArrayType arrayType = dataStructure.getDataAs(pMaterialNameArrayPathValue)->getArrayType(); - if(arrayType != IArray::ArrayType::StringArray) + AbstractArray::ArrayType arrayType = dataStructure.getDataAs(pMaterialNameArrayPathValue)->getArrayType(); + if(arrayType != AbstractArray::ArrayType::StringArray) { return MakePreflightErrorResult(-78430, fmt::format("Array [{}] type is incorrect, must be of type StringArray.", pMaterialNameArrayPathValue.toString())); } diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.hpp index 25ca1bdade..f6f39c21b4 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteINLFileFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteINLFileFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT WriteINLFileFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT WriteINLFileFilter : public AbstractFilter { public: WriteINLFileFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WritePoleFigureFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WritePoleFigureFilter.hpp index d6f2e7c0ac..dfc72dfb31 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WritePoleFigureFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WritePoleFigureFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WritePoleFigureFilter * @brief This filter will .... */ -class ORIENTATIONANALYSIS_EXPORT WritePoleFigureFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT WritePoleFigureFilter : public AbstractFilter { public: WritePoleFigureFilter() = default; diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteStatsGenOdfAngleFileFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteStatsGenOdfAngleFileFilter.hpp index 2eccd87daf..12c9b2af09 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteStatsGenOdfAngleFileFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/WriteStatsGenOdfAngleFileFilter.hpp @@ -2,8 +2,8 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteStatsGenOdfAngleFileFilter * @brief This filter will generate a synthetic microstructure with an ODF that matches (as closely as possible) an existing experimental data set or other data set that is being mimicked. */ -class ORIENTATIONANALYSIS_EXPORT WriteStatsGenOdfAngleFileFilter : public IFilter +class ORIENTATIONANALYSIS_EXPORT WriteStatsGenOdfAngleFileFilter : public AbstractFilter { public: WriteStatsGenOdfAngleFileFilter() = default; @@ -41,11 +41,11 @@ class ORIENTATIONANALYSIS_EXPORT WriteStatsGenOdfAngleFileFilter : public IFilte */ static Result FromSIMPLJson(const nlohmann::json& json); - static inline constexpr uint64 k_CommaDelimiter = 0; - static inline constexpr uint64 k_SemiColonDelimiter = 1; - static inline constexpr uint64 k_SpaceDelimiter = 2; - static inline constexpr uint64 k_ColonDelimiter = 3; - static inline constexpr uint64 k_TabDelimiter = 4; + static constexpr uint64 k_CommaDelimiter = 0; + static constexpr uint64 k_SemiColonDelimiter = 1; + static constexpr uint64 k_SpaceDelimiter = 2; + static constexpr uint64 k_ColonDelimiter = 3; + static constexpr uint64 k_TabDelimiter = 4; /** * @brief Returns the name of the filter. diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/IEbsdOemReader.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/IEbsdOemReader.hpp index ec02dbbf69..421e56f969 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/IEbsdOemReader.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/IEbsdOemReader.hpp @@ -55,7 +55,7 @@ class ORIENTATIONANALYSIS_EXPORT IEbsdOemReader Result<> execute() { auto& imageGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); - imageGeom.setUnits(IGeometry::LengthUnit::Micrometer); + imageGeom.setUnits(AbstractGeometry::LengthUnit::Micrometer); int index = 0; for(const auto& currentScanName : m_InputValues->SelectedScanNames.scanNames) diff --git a/src/Plugins/OrientationAnalysis/test/AlignSectionsMisorientationTest.cpp b/src/Plugins/OrientationAnalysis/test/AlignSectionsMisorientationTest.cpp index 52cc00e757..50e7699b21 100644 --- a/src/Plugins/OrientationAnalysis/test/AlignSectionsMisorientationTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/AlignSectionsMisorientationTest.cpp @@ -145,13 +145,13 @@ TEST_CASE("OrientationAnalysis::AlignSectionsMisorientationFilter: output test", const DataPath alignmentAMPath = Constants::k_DataContainerPath.createChildPath(Constants::k_AlignmentAMName); const DataPath slicesPath = alignmentAMPath.createChildPath(Constants::k_SlicesArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); const DataPath relativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_RelativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); const DataPath cumulativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_CumulativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); // Write out the .dream3d file now #ifdef SIMPLNX_WRITE_TEST_OUTPUT diff --git a/src/Plugins/OrientationAnalysis/test/AlignSectionsMutualInformationTest.cpp b/src/Plugins/OrientationAnalysis/test/AlignSectionsMutualInformationTest.cpp index e8e8f1580e..eb0796ae7f 100644 --- a/src/Plugins/OrientationAnalysis/test/AlignSectionsMutualInformationTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/AlignSectionsMutualInformationTest.cpp @@ -143,13 +143,13 @@ TEST_CASE("OrientationAnalysis::AlignSectionsMutualInformationFilter: output tes const DataPath alignmentAMPath = Constants::k_DataContainerPath.createChildPath(Constants::k_AlignmentAMName); const DataPath slicesPath = alignmentAMPath.createChildPath(Constants::k_SlicesArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); const DataPath relativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_RelativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); const DataPath cumulativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_CumulativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); // Write out the .dream3d file now #ifdef SIMPLNX_WRITE_TEST_OUTPUT diff --git a/src/Plugins/OrientationAnalysis/test/ComputeSchmidsTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeSchmidsTest.cpp index 08116580ef..08a3bd5069 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeSchmidsTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeSchmidsTest.cpp @@ -78,8 +78,8 @@ TEST_CASE("OrientationAnalysis::ComputeSchmidsFilter", "[OrientationAnalysis][Co { const DataPath exemplarPath({k_DataContainer, k_CellFeatureData, comparisonName}); const DataPath calculatedPath({k_DataContainer, k_CellFeatureData, k_CalculatedArrayPrefix + comparisonName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData, 1); } @@ -88,8 +88,8 @@ TEST_CASE("OrientationAnalysis::ComputeSchmidsFilter", "[OrientationAnalysis][Co { const DataPath exemplarPath({k_DataContainer, k_CellFeatureData, comparisonName}); const DataPath calculatedPath({k_DataContainer, k_CellFeatureData, k_CalculatedArrayPrefix + comparisonName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData, 1); } } diff --git a/src/Plugins/OrientationAnalysis/test/ComputeShapesFilterTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeShapesFilterTest.cpp index fad314de53..398562449e 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeShapesFilterTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeShapesFilterTest.cpp @@ -75,8 +75,8 @@ TEST_CASE("OrientationAnalysis::ComputeShapesFilter", "[SimplnxCore][ComputeShap { const DataPath exemplarPath({k_DataContainer, k_CellFeatureData, comparisonName}); const DataPath calculatedPath({k_DataContainer, k_CellFeatureData, comparisonName + "NX"}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } } diff --git a/src/Plugins/OrientationAnalysis/test/ComputeTriangleGeomShapesTest.cpp b/src/Plugins/OrientationAnalysis/test/ComputeTriangleGeomShapesTest.cpp index 6d1ba5a1f2..8b288d8b6f 100644 --- a/src/Plugins/OrientationAnalysis/test/ComputeTriangleGeomShapesTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ComputeTriangleGeomShapesTest.cpp @@ -78,8 +78,8 @@ TEST_CASE("OrientationAnalysis::ComputeTriangleGeomShapes", "[OrientationAnalysi const DataPath kExemplarArrayPath = k_FaceFeatureAttributeMatrixPath.createChildPath(exemplarArrayNames[i]); const DataPath kNxArrayPath = k_FaceFeatureAttributeMatrixPath.createChildPath(outputArrayNames[i]); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); UnitTest::CompareDataArrays(kExemplarsArray, kNxArray); } diff --git a/src/Plugins/OrientationAnalysis/test/NeighborOrientationCorrelationTest.cpp b/src/Plugins/OrientationAnalysis/test/NeighborOrientationCorrelationTest.cpp index 6ddbce09ea..8a67f510c3 100644 --- a/src/Plugins/OrientationAnalysis/test/NeighborOrientationCorrelationTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/NeighborOrientationCorrelationTest.cpp @@ -110,7 +110,7 @@ TEST_CASE("OrientationAnalysis::NeighborOrientationCorrelationFilter: Small IN10 for(const auto& cellArrayPath : selectedCellArrays) { - const auto& generatedDataArray = dataStructure.getDataRefAs(cellArrayPath); + const auto& generatedDataArray = dataStructure.getDataRefAs(cellArrayPath); DataType type = generatedDataArray.getDataType(); // Now generate the path to the exemplar data set in the exemplar data structure. @@ -119,12 +119,12 @@ TEST_CASE("OrientationAnalysis::NeighborOrientationCorrelationFilter: Small IN10 DataPath exemplarDataArrayPath(generatedPathVector); // Check to see if there is something to compare against in the exemplar file. - if(nullptr == exemplarDataStructure.getDataAs(exemplarDataArrayPath)) + if(nullptr == exemplarDataStructure.getDataAs(exemplarDataArrayPath)) { continue; } - auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath); + auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath); DataType exemplarType = exemplarDataArray.getDataType(); if(type != exemplarType) diff --git a/src/Plugins/OrientationAnalysis/test/OrientationAnalysisTestUtils.hpp b/src/Plugins/OrientationAnalysis/test/OrientationAnalysisTestUtils.hpp index ce2f51e66c..31fcaa0b6b 100644 --- a/src/Plugins/OrientationAnalysis/test/OrientationAnalysisTestUtils.hpp +++ b/src/Plugins/OrientationAnalysis/test/OrientationAnalysisTestUtils.hpp @@ -25,23 +25,23 @@ namespace fs = std::filesystem; namespace AlignSectionsFeatureCentroidFilter { // Parameter Keys -static inline constexpr StringLiteral k_UseReferenceSlice_Key = "use_reference_slice"; -static inline constexpr StringLiteral k_ReferenceSlice_Key = "reference_slice"; -static inline constexpr StringLiteral k_MaskArrayPath_Key = "mask_array_path"; -static inline constexpr StringLiteral k_SelectedImageGeometryPath_Key = "input_image_geometry_path"; +static constexpr StringLiteral k_UseReferenceSlice_Key = "use_reference_slice"; +static constexpr StringLiteral k_ReferenceSlice_Key = "reference_slice"; +static constexpr StringLiteral k_MaskArrayPath_Key = "mask_array_path"; +static constexpr StringLiteral k_SelectedImageGeometryPath_Key = "input_image_geometry_path"; } // namespace AlignSectionsFeatureCentroidFilter namespace ReadTextDataArrayFilter { -static inline constexpr StringLiteral k_InputFile_Key = "input_file"; -static inline constexpr StringLiteral k_ScalarType_Key = "scalar_type_index"; -static inline constexpr StringLiteral k_NTuples_Key = "number_tuples"; -static inline constexpr StringLiteral k_NComp_Key = "number_comp"; -static inline constexpr StringLiteral k_NSkipLines_Key = "skip_line_count"; -static inline constexpr StringLiteral k_DelimiterChoice_Key = "delimiter_index"; -static inline constexpr StringLiteral k_DataArrayPath_Key = "output_data_array_path"; -static inline constexpr StringLiteral k_DataFormat_Key = "data_format"; -static inline constexpr StringLiteral k_AdvancedOptions_Key = "set_tuple_dimensions"; +static constexpr StringLiteral k_InputFile_Key = "input_file"; +static constexpr StringLiteral k_ScalarType_Key = "scalar_type_index"; +static constexpr StringLiteral k_NTuples_Key = "number_tuples"; +static constexpr StringLiteral k_NComp_Key = "number_comp"; +static constexpr StringLiteral k_NSkipLines_Key = "skip_line_count"; +static constexpr StringLiteral k_DelimiterChoice_Key = "delimiter_index"; +static constexpr StringLiteral k_DataArrayPath_Key = "output_data_array_path"; +static constexpr StringLiteral k_DataFormat_Key = "data_format"; +static constexpr StringLiteral k_AdvancedOptions_Key = "set_tuple_dimensions"; } // namespace ReadTextDataArrayFilter namespace nx::core diff --git a/src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp b/src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp index 3ec241dc2a..4032140e79 100644 --- a/src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ReadH5EbsdTest.cpp @@ -84,9 +84,9 @@ TEST_CASE("OrientationAnalysis::ReadH5Ebsd: Valid filter execution", "[Orientati { continue; } - const auto& generatedDataArray = dataStructure.getDataRefAs(arrayPath); + const auto& generatedDataArray = dataStructure.getDataRefAs(arrayPath); DataType type = generatedDataArray.getDataType(); - auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(arrayPath); + auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(arrayPath); DataType exemplarType = exemplarDataArray.getDataType(); if(type != exemplarType) diff --git a/src/Plugins/OrientationAnalysis/test/ReadH5EspritDataTest.cpp b/src/Plugins/OrientationAnalysis/test/ReadH5EspritDataTest.cpp index 2f5997f643..7910b1b07c 100644 --- a/src/Plugins/OrientationAnalysis/test/ReadH5EspritDataTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ReadH5EspritDataTest.cpp @@ -69,7 +69,7 @@ TEST_CASE("OrientationAnalysis::ReadH5EspritDataFilter: Single Scan", "[Orientat REQUIRE(imageGeom.getDimensions() == exemplarImageGeom.getDimensions()); REQUIRE(imageGeom.getSpacing() == exemplarImageGeom.getSpacing()); REQUIRE(imageGeom.getOrigin() == exemplarImageGeom.getOrigin()); - REQUIRE(imageGeom.getUnits() == IGeometry::LengthUnit::Micrometer); + REQUIRE(imageGeom.getUnits() == AbstractGeometry::LengthUnit::Micrometer); UnitTest::CompareExemplarToGeneratedData(dataStructure, dataStructure, exemplarImageGeomPath.createChildPath(k_Cell_Data), exemplarImageGeomPath.getTargetName()); @@ -122,7 +122,7 @@ TEST_CASE("OrientationAnalysis::ReadH5EspritDataFilter: Multi Scan", "[Orientati REQUIRE(imageGeom.getDimensions() == exemplarImageGeom.getDimensions()); REQUIRE(imageGeom.getSpacing() == exemplarImageGeom.getSpacing()); REQUIRE(imageGeom.getOrigin() == exemplarImageGeom.getOrigin()); - REQUIRE(imageGeom.getUnits() == IGeometry::LengthUnit::Micrometer); + REQUIRE(imageGeom.getUnits() == AbstractGeometry::LengthUnit::Micrometer); UnitTest::CompareExemplarToGeneratedData(dataStructure, dataStructure, exemplarImageGeomPath.createChildPath(k_Cell_Data), exemplarImageGeomPath.getTargetName()); diff --git a/src/Plugins/OrientationAnalysis/test/ReadH5OimDataTest.cpp b/src/Plugins/OrientationAnalysis/test/ReadH5OimDataTest.cpp index 83348964ef..f7c0f61baf 100644 --- a/src/Plugins/OrientationAnalysis/test/ReadH5OimDataTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ReadH5OimDataTest.cpp @@ -68,7 +68,7 @@ TEST_CASE("OrientationAnalysis::ReadH5OimDataFilter: Single Scan", "[Orientation REQUIRE(imageGeom.getDimensions() == exemplarImageGeom.getDimensions()); REQUIRE(imageGeom.getSpacing() == exemplarImageGeom.getSpacing()); REQUIRE(imageGeom.getOrigin() == exemplarImageGeom.getOrigin()); - REQUIRE(imageGeom.getUnits() == IGeometry::LengthUnit::Micrometer); + REQUIRE(imageGeom.getUnits() == AbstractGeometry::LengthUnit::Micrometer); UnitTest::CompareExemplarToGeneratedData(dataStructure, dataStructure, exemplarImageGeomPath.createChildPath(k_Cell_Data), exemplarImageGeomPath.getTargetName()); @@ -120,7 +120,7 @@ TEST_CASE("OrientationAnalysis::ReadH5OimDataFilter: Multi Scan", "[OrientationA REQUIRE(imageGeom.getDimensions() == exemplarImageGeom.getDimensions()); REQUIRE(imageGeom.getSpacing() == exemplarImageGeom.getSpacing()); REQUIRE(imageGeom.getOrigin() == exemplarImageGeom.getOrigin()); - REQUIRE(imageGeom.getUnits() == IGeometry::LengthUnit::Micrometer); + REQUIRE(imageGeom.getUnits() == AbstractGeometry::LengthUnit::Micrometer); UnitTest::CompareExemplarToGeneratedData(dataStructure, dataStructure, exemplarImageGeomPath.createChildPath(k_Cell_Data), exemplarImageGeomPath.getTargetName()); diff --git a/src/Plugins/OrientationAnalysis/test/ReadH5OinaDataTest.cpp b/src/Plugins/OrientationAnalysis/test/ReadH5OinaDataTest.cpp index 1ccd5c77da..8a5ec49b0b 100644 --- a/src/Plugins/OrientationAnalysis/test/ReadH5OinaDataTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/ReadH5OinaDataTest.cpp @@ -63,7 +63,7 @@ TEST_CASE("OrientationAnalysis::ReadH5OinaDataFilter: Valid Filter Execution", " REQUIRE(imageGeom.getDimensions() == exemplarImageGeom.getDimensions()); REQUIRE(imageGeom.getSpacing() == exemplarImageGeom.getSpacing()); REQUIRE(imageGeom.getOrigin() == exemplarImageGeom.getOrigin()); - REQUIRE(imageGeom.getUnits() == IGeometry::LengthUnit::Micrometer); + REQUIRE(imageGeom.getUnits() == AbstractGeometry::LengthUnit::Micrometer); UnitTest::CompareExemplarToGeneratedData(dataStructure, exemplarDataStructure, DataPath({ImageGeom::k_TypeName, k_CellData}), k_ExemplarDataContainer); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AddBadDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AddBadDataFilter.hpp index e0cdb2359d..d1708bc0d1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AddBadDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AddBadDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class AddBadDataFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT AddBadDataFilter : public IFilter +class SIMPLNXCORE_EXPORT AddBadDataFilter : public AbstractFilter { public: AddBadDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AddBadData.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AddBadData.cpp index 0c183f01ab..8345aae37e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AddBadData.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AddBadData.cpp @@ -62,7 +62,7 @@ Result<> AddBadData::operator()() { for(const auto& voxelArrayPath : voxelArrayPaths) { - ExecuteDataFunction(InitializeTupleToZeroFunctor{}, m_DataStructure.getDataAsUnsafe(voxelArrayPath)->getDataType(), m_DataStructure, voxelArrayPath, i); + ExecuteDataFunction(InitializeTupleToZeroFunctor{}, m_DataStructure.getDataAsUnsafe(voxelArrayPath)->getDataType(), m_DataStructure, voxelArrayPath, i); } } } @@ -73,7 +73,7 @@ Result<> AddBadData::operator()() { for(const auto& voxelArrayPath : voxelArrayPaths) { - ExecuteDataFunction(InitializeTupleToZeroFunctor{}, m_DataStructure.getDataAs(voxelArrayPath)->getDataType(), m_DataStructure, voxelArrayPath, i); + ExecuteDataFunction(InitializeTupleToZeroFunctor{}, m_DataStructure.getDataAs(voxelArrayPath)->getDataType(), m_DataStructure, voxelArrayPath, i); } } } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignGeometries.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignGeometries.cpp index 4393e1643b..b01df8b6d9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignGeometries.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignGeometries.cpp @@ -2,9 +2,9 @@ #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/RectGridGeom.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" @@ -13,7 +13,7 @@ using namespace nx::core; namespace { -FloatVec3 extractOrigin(const IGeometry& geometry) +FloatVec3 extractOrigin(const AbstractGeometry& geometry) { auto geomType = geometry.getGeomType(); switch(geomType) @@ -89,7 +89,7 @@ FloatVec3 extractOrigin(const IGeometry& geometry) case IGeometry::Type::Triangle: [[fallthrough]]; case IGeometry::Type::Quad: { - const auto& geometry2d = dynamic_cast(geometry); + const auto& geometry2d = dynamic_cast(geometry); const auto& vertices = geometry2d.getVertices()->getDataStoreRef(); FloatVec3 origin(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); @@ -109,7 +109,7 @@ FloatVec3 extractOrigin(const IGeometry& geometry) case IGeometry::Type::Hexahedral: [[fallthrough]]; case IGeometry::Type::Tetrahedral: { - const auto& geometry3d = dynamic_cast(geometry); + const auto& geometry3d = dynamic_cast(geometry); const auto& vertices = geometry3d.getVertices()->getDataStoreRef(); FloatVec3 origin(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); @@ -133,7 +133,7 @@ FloatVec3 extractOrigin(const IGeometry& geometry) return origin; } -FloatVec3 extractCentroid(const IGeometry& geometry) +FloatVec3 extractCentroid(const AbstractGeometry& geometry) { FloatVec3 centroid(0.0f, 0.0f, 0.0f); switch(geometry.getGeomType()) @@ -232,7 +232,7 @@ FloatVec3 extractCentroid(const IGeometry& geometry) case IGeometry::Type::Triangle: [[fallthrough]]; case IGeometry::Type::Quad: { - auto& geometry2d = dynamic_cast(geometry); + auto& geometry2d = dynamic_cast(geometry); const auto& vertices = geometry2d.getVertices()->getDataStoreRef(); centroid[0] = 0.0f; centroid[1] = 0.0f; @@ -252,7 +252,7 @@ FloatVec3 extractCentroid(const IGeometry& geometry) case IGeometry::Type::Hexahedral: [[fallthrough]]; case IGeometry::Type::Tetrahedral: { - const auto& geometry3d = dynamic_cast(geometry); + const auto& geometry3d = dynamic_cast(geometry); const auto& vertices = geometry3d.getVertices()->getDataStoreRef(); centroid[0] = 0.0f; centroid[1] = 0.0f; @@ -273,7 +273,7 @@ FloatVec3 extractCentroid(const IGeometry& geometry) return centroid; } -void translateGeometry(IGeometry& geometry, const FloatVec3& translation) +void translateGeometry(AbstractGeometry& geometry, const FloatVec3& translation) { switch(geometry.getGeomType()) { @@ -331,7 +331,7 @@ void translateGeometry(IGeometry& geometry, const FloatVec3& translation) case IGeometry::Type::Quad: [[fallthrough]]; case IGeometry::Type::Triangle: { - auto& geometry2d = dynamic_cast(geometry); + auto& geometry2d = dynamic_cast(geometry); auto& vertices = geometry2d.getVertices()->getDataStoreRef(); for(size_t i = 0; i < geometry2d.getNumberOfVertices(); i++) { @@ -345,7 +345,7 @@ void translateGeometry(IGeometry& geometry, const FloatVec3& translation) case IGeometry::Type::Hexahedral: [[fallthrough]]; case IGeometry::Type::Tetrahedral: { - auto& geometry3d = dynamic_cast(geometry); + auto& geometry3d = dynamic_cast(geometry); auto& vertices = geometry3d.getVertices()->getDataStoreRef(); for(size_t i = 0; i < geometry3d.getNumberOfVertices(); i++) { @@ -380,8 +380,8 @@ Result<> AlignGeometries::operator()() auto targetGeometryPath = m_InputValues->InputTargetGeometryPath; auto alignmentType = m_InputValues->AlignmentTypeIndex; - auto& moving = m_DataStructure.getDataRefAs(movingGeometryPath); - auto& target = m_DataStructure.getDataRefAs(targetGeometryPath); + auto& moving = m_DataStructure.getDataRefAs(movingGeometryPath); + auto& target = m_DataStructure.getDataRefAs(targetGeometryPath); if(alignmentType == 0) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignSectionsFeatureCentroid.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignSectionsFeatureCentroid.cpp index e6adcc7ba8..bba723fab3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignSectionsFeatureCentroid.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AlignSectionsFeatureCentroid.cpp @@ -1,7 +1,7 @@ #include "AlignSectionsFeatureCentroid.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" @@ -31,7 +31,7 @@ Result<> AlignSectionsFeatureCentroid::operator()() { return {}; } - const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); + const auto& gridGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); return execute(gridGeom.getDimensions(), m_InputValues->ImageGeometryPath); } @@ -39,7 +39,7 @@ Result<> AlignSectionsFeatureCentroid::operator()() // ----------------------------------------------------------------------------- Result<> AlignSectionsFeatureCentroid::findShifts(std::vector& xShifts, std::vector& yShifts) { - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AppendImageGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AppendImageGeometry.cpp index a3b344da03..2d6fbef337 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AppendImageGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/AppendImageGeometry.cpp @@ -1,7 +1,7 @@ #include "AppendImageGeometry.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/IArray.hpp" #include "simplnx/Utilities/DataArrayUtilities.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/ParallelTaskAlgorithm.hpp" @@ -73,8 +73,8 @@ Result<> AppendImageGeometry::operator()() auto newDataArrayPath = newCellDataPath.createChildPath(name); auto destDataArrayPath = destCellDataPath.createChildPath(name); - auto* newDataArray = m_DataStructure.getDataAs(newDataArrayPath); - auto* destDataArray = m_DataStructure.getDataAs(destDataArrayPath); + auto* newDataArray = m_DataStructure.getDataAs(newDataArrayPath); + auto* destDataArray = m_DataStructure.getDataAs(destDataArrayPath); // if(destDataArray == nullptr && newDataArray == nullptr) // { // // One of these has to be valid, something has gone horribly wrong @@ -100,7 +100,7 @@ Result<> AppendImageGeometry::operator()() destDataArray = result.value(); } - std::vector inputDataArrays; + std::vector inputDataArrays; std::vector> inputTupleShapes; if(m_InputValues->SaveAsNewGeometry) { @@ -138,7 +138,7 @@ Result<> AppendImageGeometry::operator()() } else { - auto* inputDataArray = m_DataStructure.getDataAs(inputCellDataPath.createChildPath(name)); + auto* inputDataArray = m_DataStructure.getDataAs(inputCellDataPath.createChildPath(name)); if(inputDataArray == nullptr) { continue; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp index a71770e880..f811d0cdb8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp @@ -1,7 +1,7 @@ #include "ApplyTransformationToGeometry.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" #include "simplnx/Utilities/DataGroupUtilities.hpp" #include "simplnx/Utilities/ParallelAlgorithmUtilities.hpp" #include "simplnx/Utilities/ParallelDataAlgorithm.hpp" @@ -97,8 +97,8 @@ Result<> ApplyTransformationToGeometry::applyImageGeometryTransformation() return {}; } - const auto* srcDataArrayPtr = m_DataStructure.getDataAs(srcCelLDataAMPath.createChildPath(srcDataObject->getName())); - auto* destDataArrayPtr = m_DataStructure.getDataAs(destCellDataAMPath.createChildPath(srcDataObject->getName())); + const auto* srcDataArrayPtr = m_DataStructure.getDataAs(srcCelLDataAMPath.createChildPath(srcDataObject->getName())); + auto* destDataArrayPtr = m_DataStructure.getDataAs(destCellDataAMPath.createChildPath(srcDataObject->getName())); if(m_InputValues->InterpolationSelection == detail::k_NearestNeighborInterpolationIdx) { @@ -129,9 +129,9 @@ Result<> ApplyTransformationToGeometry::applyImageGeometryTransformation() // ----------------------------------------------------------------------------- Result<> ApplyTransformationToGeometry::applyNodeGeometryTransformation() { - auto& nodeGeometry0D = m_DataStructure.getDataRefAs(m_InputValues->SelectedGeometryPath); + auto& nodeGeometry0D = m_DataStructure.getDataRefAs(m_InputValues->SelectedGeometryPath); - IGeometry::SharedVertexList& vertexList = nodeGeometry0D.getVerticesRef(); + AbstractGeometry::SharedVertexList& vertexList = nodeGeometry0D.getVerticesRef(); ImageRotationUtilities::FilterProgressCallback filterProgressCallback(m_MessageHandler, m_ShouldCancel); @@ -187,7 +187,7 @@ Result<> ApplyTransformationToGeometry::operator()() // Apply geometry transformation auto* imageGeometryPtr = m_DataStructure.getDataAs(m_InputValues->SelectedGeometryPath); - auto* nodeGeometry0D = m_DataStructure.getDataAs(m_InputValues->SelectedGeometryPath); + auto* nodeGeometry0D = m_DataStructure.getDataAs(m_InputValues->SelectedGeometryPath); if(m_InputValues->TranslateGeometryToGlobalOrigin) { auto boundingBox = (imageGeometryPtr != nullptr) ? imageGeometryPtr->getBoundingBoxf() : nodeGeometry0D->getBoundingBox(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.hpp index f1366c4f5e..e5b1b1b2fd 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.hpp @@ -20,29 +20,29 @@ namespace nx::core { namespace detail { -static inline constexpr StringLiteral k_NoTransform = "No Transform"; -static inline constexpr StringLiteral k_PrecomputedTransformationMatrix = "Pre-Computed Transformation Matrix (4x4)"; -static inline constexpr StringLiteral k_ManualTransformationMatrix = "Manual Transformation Matrix"; -static inline constexpr StringLiteral k_Rotation = "Rotation"; -static inline constexpr StringLiteral k_Translation = "Translation"; -static inline constexpr StringLiteral k_Scale = "Scale"; +static constexpr StringLiteral k_NoTransform = "No Transform"; +static constexpr StringLiteral k_PrecomputedTransformationMatrix = "Pre-Computed Transformation Matrix (4x4)"; +static constexpr StringLiteral k_ManualTransformationMatrix = "Manual Transformation Matrix"; +static constexpr StringLiteral k_Rotation = "Rotation"; +static constexpr StringLiteral k_Translation = "Translation"; +static constexpr StringLiteral k_Scale = "Scale"; static inline const ChoicesParameter::Choices k_TransformationChoices = {k_NoTransform, k_PrecomputedTransformationMatrix, k_ManualTransformationMatrix, k_Rotation, k_Translation, k_Scale}; -static inline constexpr ChoicesParameter::ValueType k_NoTransformIdx = 0ULL; -static inline constexpr ChoicesParameter::ValueType k_PrecomputedTransformationMatrixIdx = 1ULL; -static inline constexpr ChoicesParameter::ValueType k_ManualTransformationMatrixIdx = 2ULL; -static inline constexpr ChoicesParameter::ValueType k_RotationIdx = 3ULL; -static inline constexpr ChoicesParameter::ValueType k_TranslationIdx = 4ULL; -static inline constexpr ChoicesParameter::ValueType k_ScaleIdx = 5ULL; +static constexpr ChoicesParameter::ValueType k_NoTransformIdx = 0ULL; +static constexpr ChoicesParameter::ValueType k_PrecomputedTransformationMatrixIdx = 1ULL; +static constexpr ChoicesParameter::ValueType k_ManualTransformationMatrixIdx = 2ULL; +static constexpr ChoicesParameter::ValueType k_RotationIdx = 3ULL; +static constexpr ChoicesParameter::ValueType k_TranslationIdx = 4ULL; +static constexpr ChoicesParameter::ValueType k_ScaleIdx = 5ULL; -static inline constexpr StringLiteral k_NearestNeighborInterpolation = "Nearest Neighbor Resampling"; -static inline constexpr StringLiteral k_LinearInterpolation = "Linear Interpolation"; -static inline constexpr StringLiteral k_NoInterpolation = "No Interpolation"; +static constexpr StringLiteral k_NearestNeighborInterpolation = "Nearest Neighbor Resampling"; +static constexpr StringLiteral k_LinearInterpolation = "Linear Interpolation"; +static constexpr StringLiteral k_NoInterpolation = "No Interpolation"; static inline const ChoicesParameter::Choices k_InterpolationChoices = {k_NearestNeighborInterpolation, k_LinearInterpolation, k_NoInterpolation}; -static inline constexpr ChoicesParameter::ValueType k_NearestNeighborInterpolationIdx = 0ULL; -static inline constexpr ChoicesParameter::ValueType k_LinearInterpolationIdx = 1ULL; -static inline constexpr ChoicesParameter::ValueType k_NoInterpolationIdx = 2ULL; +static constexpr ChoicesParameter::ValueType k_NearestNeighborInterpolationIdx = 0ULL; +static constexpr ChoicesParameter::ValueType k_LinearInterpolationIdx = 1ULL; +static constexpr ChoicesParameter::ValueType k_NoInterpolationIdx = 2ULL; } // namespace detail struct SIMPLNXCORE_EXPORT ApplyTransformationToGeometryInputValues diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ArrayCalculator.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ArrayCalculator.cpp index 621911e38c..7a849aae86 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ArrayCalculator.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ArrayCalculator.cpp @@ -44,7 +44,7 @@ namespace struct CreateCalculatorArrayFunctor { template - CalculatorItem::Pointer operator()(DataStructure& dataStructure, bool allocate, const IDataArray* iDataArrayPtr) + CalculatorItem::Pointer operator()(DataStructure& dataStructure, bool allocate, const AbstractDataArray* iDataArrayPtr) { const auto* inputDataArray = dynamic_cast*>(iDataArrayPtr); CalculatorItem::Pointer itemPtr = CalculatorArray::New(dataStructure, inputDataArray, ICalculatorArray::Array, allocate); @@ -510,7 +510,7 @@ Result<> ArrayCalculatorParser::parseArray(std::string token, std::vector(tokenArrayPath); + const auto* dataArray = m_DataStructure.getDataAs(tokenArrayPath); if(firstArray_NumTuples < 0 && firstArray_Name.empty()) { firstArray_NumTuples = dataArray->getNumberOfTuples(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineAttributeArrays.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineAttributeArrays.cpp index a550a044ac..3e621f4926 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineAttributeArrays.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineAttributeArrays.cpp @@ -16,7 +16,7 @@ struct CombineAttributeArraysImpl { template - Result<> operator()(bool normalize, std::vector& inputArraysVec, DataObject* outputArrayPtr) + Result<> operator()(bool normalize, std::vector& inputArraysVec, AbstractDataObject* outputArrayPtr) { using OutputArrayType = DataArray; using InputArrayType = DataArray; @@ -151,13 +151,13 @@ Result<> CombineAttributeArrays::operator()() { return {}; } - std::vector inputArrays; + std::vector inputArrays; for(const auto& dataPath : m_InputValues->SelectedDataArrayPaths) { inputArrays.push_back(m_DataStructure.getData(dataPath)); } - auto& outputArray = m_DataStructure.getDataRefAs(m_InputValues->StackedDataArrayPath); + auto& outputArray = m_DataStructure.getDataRefAs(m_InputValues->StackedDataArrayPath); return ExecuteDataFunction(CombineAttributeArraysImpl{}, outputArray.getDataType(), m_InputValues->NormalizeData, inputArrays, m_DataStructure.getData(m_InputValues->StackedDataArrayPath)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineNodeBasedGeometries.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineNodeBasedGeometries.cpp index f58d7050b4..2979ffd815 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineNodeBasedGeometries.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineNodeBasedGeometries.cpp @@ -140,37 +140,38 @@ Result<> CombineGeometryElements(DataStructure& ds, NodeGeomType* outputGeomPtr, Result<> CombineVertexElements(DataStructure& ds, const DataPath& outputGeomPath, const std::vector& inputGeometryPaths, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel) { - auto getVerticesArrayFunc = [](INodeGeometry0D * ptr) -> auto + auto getVerticesArrayFunc = [](AbstractNodeGeometry0D * ptr) -> auto { return ptr->getVertices(); }; - auto getVertexAttrMatrixFunc = [](INodeGeometry0D * ptr) -> auto + auto getVertexAttrMatrixFunc = [](AbstractNodeGeometry0D * ptr) -> auto { return ptr->getVertexAttributeMatrix(); }; - auto* outputGeom0d = ds.getDataAs(outputGeomPath); + auto* outputGeom0d = ds.getDataAs(outputGeomPath); // Combine the data msgHandler({IFilter::Message::Type::Info, fmt::format("Combining vertex data...")}); - std::vector inputGeoms(inputGeometryPaths.size()); - std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); - return CombineGeometryElements(ds, outputGeom0d, inputGeoms, getVerticesArrayFunc, INodeGeometry0D::k_SharedVertexListName, getVertexAttrMatrixFunc, msgHandler, shouldCancel); + std::vector inputGeoms(inputGeometryPaths.size()); + std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); + return CombineGeometryElements(ds, outputGeom0d, inputGeoms, getVerticesArrayFunc, AbstractNodeGeometry0D::k_SharedVertexListName, getVertexAttrMatrixFunc, msgHandler, + shouldCancel); } Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, const std::vector& inputGeometryPaths, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel) { - auto getEdgesArrayFunc = [](INodeGeometry1D * ptr) -> auto + auto getEdgesArrayFunc = [](AbstractNodeGeometry1D * ptr) -> auto { return ptr->getEdges(); }; - auto getEdgeAttrMatrixFunc = [](INodeGeometry1D * ptr) -> auto + auto getEdgeAttrMatrixFunc = [](AbstractNodeGeometry1D * ptr) -> auto { return ptr->getEdgeAttributeMatrix(); }; - auto* outputGeom1d = ds.getDataAs(outputGeomPath); + auto* outputGeom1d = ds.getDataAs(outputGeomPath); if(outputGeom1d == nullptr) { // This geometry is not at least a 1D geometry, so just return @@ -180,7 +181,7 @@ Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputEdgesArray = getEdgesArrayFunc(outputGeom1d); if(outputEdgesArray == nullptr) { - auto* edgesArray = ds.getDataAs>(outputGeomPath.createChildPath(INodeGeometry1D::k_SharedEdgeListName)); + auto* edgesArray = ds.getDataAs>(outputGeomPath.createChildPath(AbstractNodeGeometry1D::k_SharedEdgeListName)); if(edgesArray == nullptr) { // There are no edges, so just return @@ -194,7 +195,7 @@ Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputEdgeAttrMatrix = getEdgeAttrMatrixFunc(outputGeom1d); if(outputEdgeAttrMatrix == nullptr) { - auto* edgeAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(INodeGeometry1D::k_EdgeAttributeMatrixName)); + auto* edgeAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(AbstractNodeGeometry1D::k_EdgeAttributeMatrixName)); if(edgeAttrMatrix != nullptr) { // Set the edge attribute matrix into the geometry (it may have been created via an action in preflight) @@ -202,12 +203,13 @@ Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, } } - std::vector inputGeoms(inputGeometryPaths.size()); - std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); + std::vector inputGeoms(inputGeometryPaths.size()); + std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); // Combine the data msgHandler({IFilter::Message::Type::Info, fmt::format("Combining edge data...")}); - auto result = CombineGeometryElements(ds, outputGeom1d, inputGeoms, getEdgesArrayFunc, INodeGeometry1D::k_SharedEdgeListName, getEdgeAttrMatrixFunc, msgHandler, shouldCancel); + auto result = + CombineGeometryElements(ds, outputGeom1d, inputGeoms, getEdgesArrayFunc, AbstractNodeGeometry1D::k_SharedEdgeListName, getEdgeAttrMatrixFunc, msgHandler, shouldCancel); if(result.invalid()) { return result; @@ -216,7 +218,7 @@ Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, // Update the edges array values. For example, an edge geometry will need its edges // array updated since all the vertex indices will be different after concatenation msgHandler({IFilter::Message::Type::Info, fmt::format("Updating edge values to use new vertex indices...")}); - auto getVerticesArrayFunc = [](INodeGeometry1D * ptr) -> auto + auto getVerticesArrayFunc = [](AbstractNodeGeometry1D * ptr) -> auto { return ptr->getVertices(); }; @@ -227,16 +229,16 @@ Result<> CombineEdgeElements(DataStructure& ds, const DataPath& outputGeomPath, Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, const std::vector& inputGeometryPaths, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel) { - auto getFacesArrayFunc = [](INodeGeometry2D * ptr) -> auto + auto getFacesArrayFunc = [](AbstractNodeGeometry2D * ptr) -> auto { return ptr->getFaces(); }; - auto getFaceAttrMatrixFunc = [](INodeGeometry2D * ptr) -> auto + auto getFaceAttrMatrixFunc = [](AbstractNodeGeometry2D * ptr) -> auto { return ptr->getFaceAttributeMatrix(); }; - auto* outputGeom2d = ds.getDataAs(outputGeomPath); + auto* outputGeom2d = ds.getDataAs(outputGeomPath); if(outputGeom2d == nullptr) { // This geometry is not at least a 2D geometry, so just return @@ -246,7 +248,7 @@ Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputFacesArray = getFacesArrayFunc(outputGeom2d); if(outputFacesArray == nullptr) { - auto* facesArray = ds.getDataAs>(outputGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName)); + auto* facesArray = ds.getDataAs>(outputGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName)); if(facesArray == nullptr) { // There are no faces, so just return @@ -260,7 +262,7 @@ Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputFacesAttrMatrix = getFaceAttrMatrixFunc(outputGeom2d); if(outputFacesAttrMatrix == nullptr) { - auto* facesAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(INodeGeometry2D::k_FaceAttributeMatrixName)); + auto* facesAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); if(facesAttrMatrix != nullptr) { // Set the face attribute matrix into the geometry (it may have been created via an action in preflight) @@ -270,9 +272,10 @@ Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, // Combine the data msgHandler({IFilter::Message::Type::Info, fmt::format("Combining face data...")}); - std::vector inputGeoms(inputGeometryPaths.size()); - std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); - auto result = CombineGeometryElements(ds, outputGeom2d, inputGeoms, getFacesArrayFunc, INodeGeometry2D::k_SharedFacesListName, getFaceAttrMatrixFunc, msgHandler, shouldCancel); + std::vector inputGeoms(inputGeometryPaths.size()); + std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); + auto result = + CombineGeometryElements(ds, outputGeom2d, inputGeoms, getFacesArrayFunc, AbstractNodeGeometry2D::k_SharedFacesListName, getFaceAttrMatrixFunc, msgHandler, shouldCancel); if(result.invalid()) { return result; @@ -281,7 +284,7 @@ Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, // Update the faces array values. For example, a triangle geometry will need its faces // array updated since all the vertex indices will be different after concatenation msgHandler({IFilter::Message::Type::Info, fmt::format("Updating face values to use new vertex indices...")}); - auto getVerticesArrayFunc = [](INodeGeometry2D * ptr) -> auto + auto getVerticesArrayFunc = [](AbstractNodeGeometry2D * ptr) -> auto { return ptr->getVertices(); }; @@ -292,16 +295,16 @@ Result<> CombineFaceElements(DataStructure& ds, const DataPath& outputGeomPath, Result<> CombinePolyElements(DataStructure& ds, const DataPath& outputGeomPath, const std::vector& inputGeometryPaths, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel) { - auto getPolyArrayFunc = [](INodeGeometry3D * ptr) -> auto + auto getPolyArrayFunc = [](AbstractNodeGeometry3D * ptr) -> auto { return ptr->getPolyhedra(); }; - auto getPolyAttrMatrixFunc = [](INodeGeometry3D * ptr) -> auto + auto getPolyAttrMatrixFunc = [](AbstractNodeGeometry3D * ptr) -> auto { return ptr->getPolyhedraAttributeMatrix(); }; - auto* outputGeom3d = ds.getDataAs(outputGeomPath); + auto* outputGeom3d = ds.getDataAs(outputGeomPath); if(outputGeom3d == nullptr) { // This geometry is not at least a 3D geometry, so just return @@ -311,7 +314,7 @@ Result<> CombinePolyElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputPolyhedraArray = getPolyArrayFunc(outputGeom3d); if(outputPolyhedraArray == nullptr) { - auto* polyArray = ds.getDataAs>(outputGeomPath.createChildPath(INodeGeometry3D::k_SharedPolyhedronListName)); + auto* polyArray = ds.getDataAs>(outputGeomPath.createChildPath(AbstractNodeGeometry3D::k_SharedPolyhedronListName)); if(polyArray == nullptr) { // There are no polyhedra, so just return @@ -325,7 +328,7 @@ Result<> CombinePolyElements(DataStructure& ds, const DataPath& outputGeomPath, auto* outputPolyAttrMatrix = getPolyAttrMatrixFunc(outputGeom3d); if(outputPolyAttrMatrix == nullptr) { - auto* polyAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(INodeGeometry3D::k_PolyhedronDataName)); + auto* polyAttrMatrix = ds.getDataAs(outputGeomPath.createChildPath(AbstractNodeGeometry3D::k_PolyhedronDataName)); if(polyAttrMatrix != nullptr) { // Set the polyhedra attribute matrix into the geometry (it may have been created via an action in preflight) @@ -335,9 +338,10 @@ Result<> CombinePolyElements(DataStructure& ds, const DataPath& outputGeomPath, // Combine the data msgHandler({IFilter::Message::Type::Info, fmt::format("Combining polyhedron data...")}); - std::vector inputGeoms(inputGeometryPaths.size()); - std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); - auto result = CombineGeometryElements(ds, outputGeom3d, inputGeoms, getPolyArrayFunc, INodeGeometry3D::k_SharedPolyhedronListName, getPolyAttrMatrixFunc, msgHandler, shouldCancel); + std::vector inputGeoms(inputGeometryPaths.size()); + std::transform(inputGeometryPaths.begin(), inputGeometryPaths.end(), inputGeoms.begin(), [&ds](const DataPath& path) { return ds.getDataAs(path); }); + auto result = CombineGeometryElements(ds, outputGeom3d, inputGeoms, getPolyArrayFunc, AbstractNodeGeometry3D::k_SharedPolyhedronListName, getPolyAttrMatrixFunc, msgHandler, + shouldCancel); if(result.invalid()) { return result; @@ -346,7 +350,7 @@ Result<> CombinePolyElements(DataStructure& ds, const DataPath& outputGeomPath, // Update the polyhedra array values. For example, a tetrahedral geometry will need its // polyhedra array updated since all the vertex indices will be different after concatenation msgHandler({IFilter::Message::Type::Info, fmt::format("Updating polyhedron values to use new vertex indices...")}); - auto getVerticesArrayFunc = [](INodeGeometry3D * ptr) -> auto + auto getVerticesArrayFunc = [](AbstractNodeGeometry3D * ptr) -> auto { return ptr->getVertices(); }; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineStlFiles.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineStlFiles.cpp index 4e693f2525..90c471ad65 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineStlFiles.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineStlFiles.cpp @@ -164,8 +164,8 @@ Result<> CombineStlFiles::operator()() usize vertexOffset = 0; usize triCounter = 0; usize faceNormalsOffset = 0; - INodeGeometry2D::SharedFaceList& triangles = combinedGeom.getFacesRef(); - INodeGeometry0D::SharedVertexList& vertices = combinedGeom.getVerticesRef(); + AbstractNodeGeometry2D::SharedFaceList& triangles = combinedGeom.getFacesRef(); + AbstractNodeGeometry0D::SharedVertexList& vertices = combinedGeom.getVerticesRef(); ParallelTaskAlgorithm taskRunner; int32 fileIndex = 1; usize faceLabelOffset = 0; @@ -181,7 +181,7 @@ Result<> CombineStlFiles::operator()() return {}; } - INodeGeometry2D::SharedFaceList& currentSharedFaceList = currentGeometry->getFacesRef(); + AbstractNodeGeometry2D::SharedFaceList& currentSharedFaceList = currentGeometry->getFacesRef(); usize currentGeomNumTriangles = currentGeometry->getNumberOfFaces(); usize currentGeomNumVertices = currentGeometry->getNumberOfVertices(); { @@ -212,7 +212,7 @@ Result<> CombineStlFiles::operator()() } vertexLabelOffset += currentGeomNumVertices; - INodeGeometry0D::SharedVertexList& curVertices = currentGeometry->getVerticesRef(); + AbstractNodeGeometry0D::SharedVertexList& curVertices = currentGeometry->getVerticesRef(); auto& curFaceNormals = tempDataStructure.getDataRefAs(currentGeometry->getFaceAttributeMatrixDataPath().createChildPath("Face Normals")); taskRunner.execute(CombineStlImpl{triangles, vertices, combinedFaceNormals, currentSharedFaceList, curVertices, curFaceNormals, triOffset, vertexOffset, faceNormalsOffset}); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineTransformationMatrices.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineTransformationMatrices.cpp index f33fa8c29e..700b276a28 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineTransformationMatrices.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CombineTransformationMatrices.cpp @@ -25,7 +25,7 @@ Eigen::Matrix CreateEigenMatrix(const AbstractDataStor struct MatrixOperationFunctor { template - Result<> operator()(const IDataArray& array1, const IDataArray& array2, IDataArray& outputArray) + Result<> operator()(const AbstractDataArray& array1, const AbstractDataArray& array2, AbstractDataArray& outputArray) { using MatrixType = Eigen::Matrix; using StoreType = AbstractDataStore; @@ -82,11 +82,11 @@ const std::atomic_bool& CombineTransformationMatrices::getCancel() // ----------------------------------------------------------------------------- Result<> CombineTransformationMatrices::operator()() { - auto& outputArray = m_DataStructure.getDataRefAs(m_InputValues->OutputPath); + auto& outputArray = m_DataStructure.getDataRefAs(m_InputValues->OutputPath); auto pathsIter = m_InputValues->SelectedPaths.begin(); - const auto& array1 = m_DataStructure.getDataRefAs(*pathsIter++); - const auto& array2 = m_DataStructure.getDataRefAs(*pathsIter++); + const auto& array1 = m_DataStructure.getDataRefAs(*pathsIter++); + const auto& array2 = m_DataStructure.getDataRefAs(*pathsIter++); if(array1.getDataType() != array2.getDataType()) { return MakeErrorResult(-89750, "DataType mismatch"); @@ -96,7 +96,7 @@ Result<> CombineTransformationMatrices::operator()() for(; pathsIter != m_InputValues->SelectedPaths.end(); ++pathsIter) { - const auto& arrayRef = m_DataStructure.getDataRefAs(*pathsIter); + const auto& arrayRef = m_DataStructure.getDataRefAs(*pathsIter); ExecuteDataFunction(MatrixOperationFunctor{}, outputArray.getDataType(), arrayRef, outputArray, outputArray); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogram.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogram.cpp index b416d85969..6bf6ab4c9b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogram.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogram.cpp @@ -8,7 +8,7 @@ #include "simplnx/Utilities/ParallelAlgorithmUtilities.hpp" #include "simplnx/Utilities/ParallelTaskAlgorithm.hpp" -#include +#include #include using namespace nx::core; @@ -48,7 +48,7 @@ Result<> ComputeArrayHistogram::operator()() std::atomic overflow = 0; - std::unique_ptr mask = nullptr; + std::unique_ptr mask = nullptr; if(m_InputValues->MaskPath.has_value()) { mask = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskPath.value()); @@ -61,8 +61,8 @@ Result<> ComputeArrayHistogram::operator()() return {}; } - const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); - auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); + const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); + auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); auto& counts = m_DataStructure.getDataAs>(m_InputValues->CreatedHistogramCountsDataPaths.at(i))->getDataStoreRef(); auto& mostPopulated = m_DataStructure.getDataAs>(m_InputValues->CreatedBinMostPopulatedDataPaths.at(i))->getDataStoreRef(); @@ -93,13 +93,13 @@ Result<> ComputeArrayHistogram::operator()() return {}; } - const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); - auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); - INeighborList* modalBinRanges = nullptr; + const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); + auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); + AbstractNeighborList* modalBinRanges = nullptr; if(m_InputValues->CreatedBinModalRangesDataPaths.has_value()) { auto modalBinRangesPaths = m_InputValues->CreatedBinModalRangesDataPaths.value(); - modalBinRanges = m_DataStructure.getDataAs(modalBinRangesPaths.at(i)); + modalBinRanges = m_DataStructure.getDataAs(modalBinRangesPaths.at(i)); ExecuteParallelFunctor( HistogramUtilities::concurrent::CalculateModalBinRangesImplFunctor{}, inputData->getDataType(), taskRunner, inputData, binRanges, modalBinRanges, mask, m_ShouldCancel); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogramByFeature.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogramByFeature.cpp index 1f4acc0f57..f77711b891 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogramByFeature.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayHistogramByFeature.cpp @@ -1,9 +1,9 @@ #include "ComputeArrayHistogramByFeature.hpp" #include "SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Utilities/HistogramUtilities.hpp" #include "simplnx/Utilities/MessageHelper.hpp" #include "simplnx/Utilities/ParallelAlgorithmUtilities.hpp" @@ -37,7 +37,7 @@ class GenerateFeatureHistogramImpl */ GenerateFeatureHistogramImpl(const AbstractDataStore& inputStore, AbstractDataStore& binRangesStore, NeighborList* modalBinRangesList, const AbstractDataStore& featureIdsStore, float64 histMin, float64 histMax, bool histFullRange, const std::atomic_bool& shouldCancel, const int32 numBins, - AbstractDataStore& histogramStore, AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, + AbstractDataStore& histogramStore, AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, std::atomic& overflow, ProgressMessageHelper& progressMessageHelper) : m_InputStore(inputStore) , m_ShouldCancel(shouldCancel) @@ -58,7 +58,7 @@ class GenerateFeatureHistogramImpl GenerateFeatureHistogramImpl(const AbstractDataStore& inputStore, AbstractDataStore& binRangesStore, const AbstractDataStore& featureIdsStore, float64 histMin, float64 histMax, bool histFullRange, const std::atomic_bool& shouldCancel, const int32 numBins, AbstractDataStore& histogramStore, - AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, std::atomic& overflow, + AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, std::atomic& overflow, ProgressMessageHelper& progressMessageHelper) : m_InputStore(inputStore) , m_ShouldCancel(shouldCancel) @@ -229,7 +229,7 @@ class GenerateFeatureHistogramImpl float64 m_HistMax; bool m_HistFullRange; int32 m_NumBins; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; const AbstractDataStore& m_InputStore; const AbstractDataStore& m_FeatureIdsStore; AbstractDataStore& m_HistogramStore; @@ -248,13 +248,13 @@ class GenerateFeatureHistogramImpl struct InstantiateHistogramByFeatureImplFunctor { template - auto operator()(INeighborList* modalBinRangesNL, const IDataArray* inputArray, IDataArray* binRangesArray, ArgsT&&... args) + auto operator()(AbstractNeighborList* modalBinRangesNL, const AbstractDataArray* inputArray, AbstractDataArray* binRangesArray, ArgsT&&... args) { return GenerateFeatureHistogramImpl(inputArray->template getIDataStoreRefAs>(), binRangesArray->template getIDataStoreRefAs>(), dynamic_cast*>(modalBinRangesNL), std::forward(args)...); } template - auto operator()(const IDataArray* inputArray, IDataArray* binRangesArray, ArgsT&&... args) + auto operator()(const AbstractDataArray* inputArray, AbstractDataArray* binRangesArray, ArgsT&&... args) { return GenerateFeatureHistogramImpl(inputArray->template getIDataStoreRefAs>(), binRangesArray->template getIDataStoreRefAs>(), std::forward(args)...); @@ -295,8 +295,8 @@ Result<> ComputeArrayHistogramByFeature::operator()() return {}; } - const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); - auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); + const auto* inputData = m_DataStructure.getDataAs(selectedArrayPaths[i]); + auto* binRanges = m_DataStructure.getDataAs(m_InputValues->CreatedBinRangeDataPaths.at(i)); auto& counts = m_DataStructure.getDataAs>(m_InputValues->CreatedHistogramCountsDataPaths.at(i))->getDataStoreRef(); auto& mostPopulated = m_DataStructure.getDataAs>(m_InputValues->CreatedBinMostPopulatedDataPaths.at(i))->getDataStoreRef(); @@ -304,7 +304,7 @@ Result<> ComputeArrayHistogramByFeature::operator()() counts.resizeTuples({numFeatures}); mostPopulated.resizeTuples({numFeatures}); - std::unique_ptr mask = nullptr; + std::unique_ptr mask = nullptr; if(m_InputValues->UseMask) { mask = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); @@ -321,7 +321,7 @@ Result<> ComputeArrayHistogramByFeature::operator()() if(m_InputValues->CreatedBinModalRangesDataPaths.has_value()) { std::vector modalBinRangesPaths = m_InputValues->CreatedBinModalRangesDataPaths.value(); - auto* modalBinRanges = m_DataStructure.getDataAs(modalBinRangesPaths.at(i)); + auto* modalBinRanges = m_DataStructure.getDataAs(modalBinRangesPaths.at(i)); modalBinRanges->resizeTuples({numFeatures}); ExecuteParallelFunctor(InstantiateHistogramByFeatureImplFunctor{}, inputData->getDataType(), dataAlg, modalBinRanges, inputData, binRanges, featureIdsStore, m_InputValues->MinRange, m_InputValues->MaxRange, histFullRange, m_ShouldCancel, diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp index 91ee62cce7..4dbe551266 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeArrayStatistics.cpp @@ -17,7 +17,7 @@ using namespace nx::core; namespace { // ----------------------------------------------------------------------------- -bool CheckArraysInMemory(const nx::core::IParallelAlgorithm::AlgorithmArrays& arrays) +bool CheckArraysInMemory(const nx::core::ParallelAlgorithm::AlgorithmArrays& arrays) { if(arrays.empty()) { @@ -44,7 +44,7 @@ template class StatisticsByFeatureImpl { public: - StatisticsByFeatureImpl(bool length, bool min, bool max, bool mean, bool mode, bool stdDeviation, bool summation, const std::unique_ptr& mask, + StatisticsByFeatureImpl(bool length, bool min, bool max, bool mean, bool mode, bool stdDeviation, bool summation, const std::unique_ptr& mask, const Int32AbstractDataStore& featureIds, const AbstractDataStore& source, BoolArray* featureHasDataArray, UInt64Array* lengthArray, DataArray* minArray, DataArray* maxArray, Float32Array* meanArray, NeighborList* modeArray, Float32Array* stdDevArray, Float32Array* summationArray, const std::atomic_bool& shouldCancel, MessageHelper& messageHelper) @@ -234,7 +234,7 @@ class StatisticsByFeatureImpl bool m_Mode; bool m_StdDeviation; bool m_Summation; - const std::unique_ptr& m_Mask = nullptr; + const std::unique_ptr& m_Mask = nullptr; const Int32AbstractDataStore& m_FeatureIds; const AbstractDataStore& m_Source; BoolArray* m_FeatureHasDataArray = nullptr; @@ -433,8 +433,8 @@ template class MedianByFeatureImpl { public: - MedianByFeatureImpl(const std::unique_ptr& mask, const Int32AbstractDataStore& featureIds, const AbstractDataStore& source, bool findMedian, bool findNumUnique, - Float32Array* medianArray, Int32Array* numUniqueValuesArray, DataArray* lengthArray, MessageHelper& messageHelper) + MedianByFeatureImpl(const std::unique_ptr& mask, const Int32AbstractDataStore& featureIds, const AbstractDataStore& source, bool findMedian, + bool findNumUnique, Float32Array* medianArray, Int32Array* numUniqueValuesArray, DataArray* lengthArray, MessageHelper& messageHelper) : m_FindMedian(findMedian) , m_FindNumUniqueValues(findNumUnique) , m_MedianArray(medianArray) @@ -501,7 +501,7 @@ class MedianByFeatureImpl bool m_FindNumUniqueValues; Float32Array* m_MedianArray; Int32Array* m_NumUniqueValuesArray; - const std::unique_ptr& m_Mask = nullptr; + const std::unique_ptr& m_Mask = nullptr; const Int32AbstractDataStore& m_FeatureIds; const AbstractDataStore& m_Source; const DataArray* m_LengthArray = nullptr; @@ -599,7 +599,7 @@ class MedianByFeatureRangeImpl // ----------------------------------------------------------------------------- template -void FindStatisticsImpl(const ContainerType& data, std::vector& arrays, const ComputeArrayStatisticsInputValues* inputValues) +void FindStatisticsImpl(const ContainerType& data, std::vector& arrays, const ComputeArrayStatisticsInputValues* inputValues) { if(inputValues->FindLength) { @@ -803,9 +803,9 @@ Result<> InitializeArrays(DataStructure& dataStructure, const ComputeArrayStatis struct ComputeArrayStatisticsFunctor { template - Result<> operator()(DataStructure& dataStructure, const IDataArray& inputIDataArray, std::vector& arrays, const ComputeArrayStatisticsInputValues* inputValues) + Result<> operator()(DataStructure& dataStructure, const AbstractDataArray& inputIDataArray, std::vector& arrays, const ComputeArrayStatisticsInputValues* inputValues) { - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; if(inputValues->UseMask) { try @@ -878,10 +878,10 @@ struct ComputeArrayStatisticsFunctor struct ComputeArrayStatisticsByFeatureFunctor { template - Result<> operator()(DataStructure& dataStructure, const IDataArray* inputIDataArray, std::vector& arrays, usize numFeatures, const ComputeArrayStatisticsInputValues* inputValues, - const std::atomic_bool& shouldCancel, MessageHelper& messageHelper) + Result<> operator()(DataStructure& dataStructure, const AbstractDataArray* inputIDataArray, std::vector& arrays, usize numFeatures, + const ComputeArrayStatisticsInputValues* inputValues, const std::atomic_bool& shouldCancel, MessageHelper& messageHelper) { - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; if(inputValues->UseMask) { try @@ -915,7 +915,7 @@ struct ComputeArrayStatisticsByFeatureFunctor auto* featureHasDataPtr = dynamic_cast(arrays[9]); - IParallelAlgorithm::AlgorithmArrays indexAlgArrays; + ParallelAlgorithm::AlgorithmArrays indexAlgArrays; indexAlgArrays.push_back(inputArrayPtr); indexAlgArrays.push_back(featureHasDataPtr); indexAlgArrays.push_back(lengthArrayPtr); @@ -955,7 +955,7 @@ struct ComputeArrayStatisticsByFeatureFunctor ParallelDataAlgorithm medianDataAlg; { // Scoped to prevent alg use of ptr array - IParallelAlgorithm::AlgorithmArrays medianAlgArrays; + ParallelAlgorithm::AlgorithmArrays medianAlgArrays; medianAlgArrays.push_back(featureIdsPtr); medianAlgArrays.push_back(inputArrayPtr); medianAlgArrays.push_back(medianArrayPtr); @@ -989,7 +989,7 @@ struct ComputeArrayStatisticsByFeatureFunctor } template - Result<> operator()(DataStructure& dataStructure, const IDataArray* inputIDataArray, std::vector& arrays, const std::pair& range, + Result<> operator()(DataStructure& dataStructure, const AbstractDataArray* inputIDataArray, std::vector& arrays, const std::pair& range, const ComputeArrayStatisticsInputValues* inputValues, const std::atomic_bool& shouldCancel, MessageHelper& messageHelper) { Result<> initializationResult = InitializeArrays(dataStructure, inputValues); @@ -1013,7 +1013,7 @@ struct ComputeArrayStatisticsByFeatureFunctor auto* featureHasDataPtr = dynamic_cast(arrays[9]); - IParallelAlgorithm::AlgorithmArrays indexAlgArrays; + ParallelAlgorithm::AlgorithmArrays indexAlgArrays; indexAlgArrays.push_back(tempMaskPtr); indexAlgArrays.push_back(featureIdsMapPtr); indexAlgArrays.push_back(featureIdsPtr); @@ -1058,7 +1058,7 @@ struct ComputeArrayStatisticsByFeatureFunctor ParallelDataAlgorithm medianDataAlg; { // Scoped to prevent alg use of ptr array - IParallelAlgorithm::AlgorithmArrays medianAlgArrays; + ParallelAlgorithm::AlgorithmArrays medianAlgArrays; medianAlgArrays.push_back(featureIdsPtr); medianAlgArrays.push_back(inputArrayPtr); medianAlgArrays.push_back(medianArrayPtr); @@ -1115,57 +1115,57 @@ Result<> ComputeArrayStatistics::operator()() return {}; } - std::vector arrays(9, nullptr); + std::vector arrays(9, nullptr); if(m_InputValues->FindLength) { - arrays[0] = m_DataStructure.getDataAs(m_InputValues->LengthArrayName); + arrays[0] = m_DataStructure.getDataAs(m_InputValues->LengthArrayName); } if(m_InputValues->FindMin) { - arrays[1] = m_DataStructure.getDataAs(m_InputValues->MinimumArrayName); + arrays[1] = m_DataStructure.getDataAs(m_InputValues->MinimumArrayName); } if(m_InputValues->FindMax) { - arrays[2] = m_DataStructure.getDataAs(m_InputValues->MaximumArrayName); + arrays[2] = m_DataStructure.getDataAs(m_InputValues->MaximumArrayName); } if(m_InputValues->FindMean) { - arrays[3] = m_DataStructure.getDataAs(m_InputValues->MeanArrayName); + arrays[3] = m_DataStructure.getDataAs(m_InputValues->MeanArrayName); } if(m_InputValues->FindMedian) { - arrays[4] = m_DataStructure.getDataAs(m_InputValues->MedianArrayName); + arrays[4] = m_DataStructure.getDataAs(m_InputValues->MedianArrayName); } if(m_InputValues->FindMode) { - arrays[5] = m_DataStructure.getDataAs(m_InputValues->ModeArrayName); + arrays[5] = m_DataStructure.getDataAs(m_InputValues->ModeArrayName); } if(m_InputValues->FindStdDeviation) { - arrays[6] = m_DataStructure.getDataAs(m_InputValues->StdDeviationArrayName); + arrays[6] = m_DataStructure.getDataAs(m_InputValues->StdDeviationArrayName); } if(m_InputValues->FindSummation) { - arrays[7] = m_DataStructure.getDataAs(m_InputValues->SummationArrayName); + arrays[7] = m_DataStructure.getDataAs(m_InputValues->SummationArrayName); } if(m_InputValues->FindNumUniqueValues) { - arrays[8] = m_DataStructure.getDataAs(m_InputValues->NumUniqueValuesName); + arrays[8] = m_DataStructure.getDataAs(m_InputValues->NumUniqueValuesName); } MessageHelper messageHelper(m_MessageHandler); if(!m_InputValues->ComputeByIndex) { - const auto& inputArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedArrayPath); + const auto& inputArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedArrayPath); // We must use ExecuteNeighborFunction because the Mode array is a NeighborList return ExecuteNeighborFunction(ComputeArrayStatisticsFunctor{}, inputArray.getDataType(), m_DataStructure, inputArray, arrays, m_InputValues); } arrays.resize(10); - arrays[9] = m_DataStructure.getDataAs(m_InputValues->FeatureHasDataArrayName); + arrays[9] = m_DataStructure.getDataAs(m_InputValues->FeatureHasDataArrayName); const auto& featureIds = m_DataStructure.getDataRefAs(m_InputValues->FeatureIdsArrayPath); // Get max and min feature ids @@ -1207,7 +1207,7 @@ Result<> ComputeArrayStatistics::operator()() case FeatureIdRangeControls::None: { auto* destAttrMatPtr = m_DataStructure.getDataAs(m_InputValues->DestinationAttributeMatrix); destAttrMatPtr->resizeTuples({numFeatures}); - const auto* inputArray = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath); + const auto* inputArray = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath); // We must use ExecuteNeighborFunction because the Mode array is a NeighborList return ExecuteNeighborFunction(ComputeArrayStatisticsByFeatureFunctor{}, inputArray->getDataType(), m_DataStructure, inputArray, arrays, numFeatures, m_InputValues, m_ShouldCancel, messageHelper); @@ -1228,7 +1228,7 @@ Result<> ComputeArrayStatistics::operator()() tempMask.fill(false); if(m_InputValues->UseMask) { - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); @@ -1280,7 +1280,7 @@ Result<> ComputeArrayStatistics::operator()() auto* destAttrMatPtr = m_DataStructure.getDataAs(m_InputValues->DestinationAttributeMatrix); destAttrMatPtr->resizeTuples({numFeatures}); - const auto* inputArray = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath); + const auto* inputArray = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath); // We must use ExecuteNeighborFunction because the Mode array is a NeighborList return ExecuteNeighborFunction(ComputeArrayStatisticsByFeatureFunctor{}, inputArray->getDataType(), m_DataStructure, inputArray, arrays, std::make_pair(trueMin, trueMax), m_InputValues, diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBiasedFeatures.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBiasedFeatures.cpp index 52ff67d499..1da4bb3a2f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBiasedFeatures.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBiasedFeatures.cpp @@ -55,7 +55,7 @@ Result<> ComputeBiasedFeatures::findBoundingBoxFeatures() auto& biasedFeaturesStore = m_DataStructure.getDataAsUnsafe(m_InputValues->BiasedFeaturesArrayName)->getDataStoreRef(); biasedFeaturesStore.fill(false); - std::unique_ptr surfaceFeatures = nullptr; + std::unique_ptr surfaceFeatures = nullptr; try { surfaceFeatures = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->SurfaceFeaturesArrayPath); @@ -196,7 +196,7 @@ Result<> ComputeBiasedFeatures::findBoundingBoxFeatures2D() auto& biasedFeaturesStore = m_DataStructure.getDataAs(m_InputValues->BiasedFeaturesArrayName)->getDataStoreRef(); biasedFeaturesStore.fill(false); - std::unique_ptr maskCompare = nullptr; + std::unique_ptr maskCompare = nullptr; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->SurfaceFeaturesArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBoundingBoxStats.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBoundingBoxStats.cpp index bbffb321f3..5c6891fd1f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBoundingBoxStats.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBoundingBoxStats.cpp @@ -658,7 +658,7 @@ struct ExecuteBoundsStatsCalculations { template Result<> operator()(DataStructure& dataStructure, const ComputeBoundingBoxStatsInputValues* inputValues, const ImageGeom& imageGeom, const Float32AbstractDataStore& unifiedBounds, - const IDataArray& inputIDataArray) + const AbstractDataArray& inputIDataArray) { usize numTuples = unifiedBounds.getNumberOfTuples(); @@ -732,7 +732,7 @@ Result<> ComputeBoundingBoxStats::operator()() { const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->GeometryPath); auto& unifiedArray = m_DataStructure.getDataRefAs(m_InputValues->UnifiedPath).getDataStoreRef(); - auto& inputArray = m_DataStructure.getDataRefAs(m_InputValues->InputPath); + auto& inputArray = m_DataStructure.getDataRefAs(m_InputValues->InputPath); if(inputArray.getDataType() == DataType::boolean) { return MakeErrorResult(-98500, "Boolean arrays cannot be used as inputs to this filter."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeCoordinateThreshold.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeCoordinateThreshold.cpp index e459ecb152..8537464735 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeCoordinateThreshold.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeCoordinateThreshold.cpp @@ -2,11 +2,11 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" @@ -19,7 +19,7 @@ using namespace nx::core; namespace { template -concept GeometryType = std::is_base_of_v; +concept GeometryType = std::is_base_of_v; template class ComputeMaskImpl @@ -37,7 +37,8 @@ class ComputeMaskImpl // ----------------------------------------------------------------------------- void compute(usize start, usize end) const { - static_assert(std::is_same_v || std::is_base_of_v || std::is_base_of_v || std::is_base_of_v); + static_assert(std::is_same_v || std::is_base_of_v || std::is_base_of_v || + std::is_base_of_v); uint8 trueValue = (m_Invert) ? 0 : 1; uint8 falseValue = (m_Invert) ? 1 : 0; @@ -93,7 +94,7 @@ class ComputeMaskImpl } if constexpr(std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); for(usize i = start; i < end; i++) { float32 xVal = verts[(i * 3) + 0]; @@ -112,15 +113,15 @@ class ComputeMaskImpl } if constexpr(std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); - const IGeometry::SharedEdgeList::store_type& edges = m_Geom.getEdgesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedEdgeList::store_type& edges = m_Geom.getEdgesRef().getDataStoreRef(); usize numComp = edges.getNumberOfComponents(); for(usize i = start; i < end; i++) { uint8 hits = 0; for(usize comp = 0; comp < numComp; comp++) { - const IGeometry::SharedFaceList::value_type activeVertIndex = edges.getValue((i * numComp) + comp); + const AbstractGeometry::SharedFaceList::value_type activeVertIndex = edges.getValue((i * numComp) + comp); float32 xVal = verts.getValue((activeVertIndex * 3) + 0); float32 yVal = verts.getValue((activeVertIndex * 3) + 1); float32 zVal = verts.getValue((activeVertIndex * 3) + 2); @@ -139,15 +140,15 @@ class ComputeMaskImpl } if constexpr(std::is_same_v || std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); - const IGeometry::SharedFaceList::store_type& faces = m_Geom.getFacesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = m_Geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedFaceList::store_type& faces = m_Geom.getFacesRef().getDataStoreRef(); usize numComp = faces.getNumberOfComponents(); for(usize i = start; i < end; i++) { uint8 hits = 0; for(usize comp = 0; comp < numComp; comp++) { - const IGeometry::SharedFaceList::value_type activeVertIndex = faces.getValue((i * numComp) + comp); + const AbstractGeometry::SharedFaceList::value_type activeVertIndex = faces.getValue((i * numComp) + comp); float32 xVal = verts.getValue((activeVertIndex * 3) + 0); float32 yVal = verts.getValue((activeVertIndex * 3) + 1); float32 zVal = verts.getValue((activeVertIndex * 3) + 2); @@ -179,7 +180,7 @@ class ComputeMaskImpl const std::function& m_IsInBoundsFunct; }; -Result<> ExecuteComputeMask(const IGeometry& geom, UInt8AbstractDataStore& mask, bool shouldInvert, const std::function& isInBoundsFunct) +Result<> ExecuteComputeMask(const AbstractGeometry& geom, UInt8AbstractDataStore& mask, bool shouldInvert, const std::function& isInBoundsFunct) { ParallelDataAlgorithm dataAlg; dataAlg.setParallelizationEnabled(false); @@ -218,14 +219,14 @@ Result<> ExecuteComputeMask(const IGeometry& geom, UInt8AbstractDataStore& mask, return {}; } -bool PrecheckRuntimeGeom(const IGeometry& geom, const ComputeCoordinateThresholdInputValues* inputValues) +bool PrecheckRuntimeGeom(const AbstractGeometry& geom, const ComputeCoordinateThresholdInputValues* inputValues) { if(geom.getGeomType() == IGeometry::Type::Image) { return true; } - const auto& iNodeGeom = dynamic_cast(geom); + const auto& iNodeGeom = dynamic_cast(geom); BoundingBox3Df bounds = iNodeGeom.getBoundingBox(); std::array minPoint = bounds.getMinPoint().toArray(); @@ -321,7 +322,7 @@ Result<> ComputeCoordinateThreshold::operator()() } } - const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->GeometryPath); + const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->GeometryPath); auto& mask = m_DataStructure.getDataRefAs(m_InputValues->MaskArrayPath).getDataStoreRef(); if(!PrecheckRuntimeGeom(geom, m_InputValues)) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeDifferencesMap.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeDifferencesMap.cpp index 348c62f573..361a1360ee 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeDifferencesMap.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeDifferencesMap.cpp @@ -9,7 +9,7 @@ namespace struct ExecuteFindDifferenceMapFunctor { template - void operator()(IDataArray* firstArrayPtr, IDataArray* secondArrayPtr, IDataArray* differenceMapPtr) + void operator()(AbstractDataArray* firstArrayPtr, AbstractDataArray* secondArrayPtr, AbstractDataArray* differenceMapPtr) { using store_type = AbstractDataStore; @@ -51,9 +51,9 @@ ComputeDifferencesMap::~ComputeDifferencesMap() noexcept = default; Result<> ComputeDifferencesMap::operator()() { - auto* firstInputArray = m_DataStructure.getDataAs(m_InputValues->FirstInputArrayPath); - auto* secondInputArray = m_DataStructure.getDataAs(m_InputValues->SecondInputArrayPath); - auto* differenceMapArray = m_DataStructure.getDataAs(m_InputValues->DifferenceMapArrayPath); + auto* firstInputArray = m_DataStructure.getDataAs(m_InputValues->FirstInputArrayPath); + auto* secondInputArray = m_DataStructure.getDataAs(m_InputValues->SecondInputArrayPath); + auto* differenceMapArray = m_DataStructure.getDataAs(m_InputValues->DifferenceMapArrayPath); ExecuteDataFunction(ExecuteFindDifferenceMapFunctor{}, firstInputArray->getDataType(), firstInputArray, secondInputArray, differenceMapArray); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureBounds.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureBounds.cpp index ed51e70d33..abe2a75a28 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureBounds.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureBounds.cpp @@ -3,11 +3,11 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" @@ -19,12 +19,13 @@ using namespace nx::core; namespace { template -concept GeometryType = std::is_base_of_v; +concept GeometryType = std::is_base_of_v; template std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataStore& featureIds, usize numFeatures) { - static_assert(std::is_same_v || std::is_base_of_v || std::is_base_of_v || std::is_base_of_v); + static_assert(std::is_same_v || std::is_base_of_v || std::is_base_of_v || + std::is_base_of_v); std::vector bounds(numFeatures * 6, std::numeric_limits::quiet_NaN()); if constexpr(std::is_same_v) @@ -72,7 +73,7 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto } if constexpr(std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); for(usize i = 0; i < verts.getNumberOfTuples(); i++) { @@ -98,8 +99,8 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto } if constexpr(std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); - const IGeometry::SharedEdgeList::store_type& edges = geom.getEdgesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedEdgeList::store_type& edges = geom.getEdgesRef().getDataStoreRef(); usize numComp = edges.getNumberOfComponents(); for(usize i = 0; i < edges.getNumberOfTuples(); i++) @@ -112,7 +113,7 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto for(usize comp = 0; comp < numComp; comp++) { - const IGeometry::SharedFaceList::value_type activeVertIndex = edges[(i * numComp) + comp]; + const AbstractGeometry::SharedFaceList::value_type activeVertIndex = edges[(i * numComp) + comp]; float32 xVal = verts[(activeVertIndex * 3) + 0]; float32 yVal = verts[(activeVertIndex * 3) + 1]; float32 zVal = verts[(activeVertIndex * 3) + 2]; @@ -130,8 +131,8 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto } if constexpr(std::is_same_v || std::is_same_v) { - const IGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); - const IGeometry::SharedFaceList::store_type& faces = geom.getFacesRef().getDataStoreRef(); + const AbstractGeometry::SharedVertexList::store_type& verts = geom.getVerticesRef().getDataStoreRef(); + const AbstractGeometry::SharedFaceList::store_type& faces = geom.getFacesRef().getDataStoreRef(); usize numComp = faces.getNumberOfComponents(); for(usize i = 0; i < faces.getNumberOfTuples(); i++) @@ -144,7 +145,7 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto for(usize comp = 0; comp < numComp; comp++) { - const IGeometry::SharedFaceList::value_type activeVertIndex = faces[(i * numComp) + comp]; + const AbstractGeometry::SharedFaceList::value_type activeVertIndex = faces[(i * numComp) + comp]; float32 xVal = verts[(activeVertIndex * 3) + 0]; float32 yVal = verts[(activeVertIndex * 3) + 1]; float32 zVal = verts[(activeVertIndex * 3) + 2]; @@ -165,7 +166,7 @@ std::vector ComputeBounds(const GeomT& geom, const Int32AbstractDataSto } template -std::vector ExecuteComputeBounds(const IGeometry& geom, ArgsT&&... args) +std::vector ExecuteComputeBounds(const AbstractGeometry& geom, ArgsT&&... args) { switch(geom.getGeomType()) { @@ -216,7 +217,7 @@ Result<> ComputeFeatureBounds::operator()() featureAM.getNumberOfTuples(), numFeatures, m_InputValues->FeatureIdsArrayPath.getTargetName())); } - const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->GeometryPath); + const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->GeometryPath); std::vector bounds = ExecuteComputeBounds(geom, featureIds, numFeatures); if(bounds.empty()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureClustering.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureClustering.cpp index b1fba0726f..b2fba5c5f5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureClustering.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureClustering.cpp @@ -137,7 +137,7 @@ Result<> ComputeFeatureClustering::operator()() auto& clusteringList = m_DataStructure.getDataRefAs>(m_InputValues->ClusteringListArrayName); auto& rdfStore = m_DataStructure.getDataAs(m_InputValues->RDFArrayName)->getDataStoreRef(); auto& minMaxDistancesStore = m_DataStructure.getDataAs(m_InputValues->MaxMinArrayName)->getDataStoreRef(); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; if(m_InputValues->RemoveBiasedFeatures) { try diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizes.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizes.cpp index e160410194..602e504392 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizes.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizes.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Numbers.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/RectGridGeom.hpp" #include "simplnx/Utilities/DataArrayUtilities.hpp" @@ -304,7 +304,7 @@ Result<> ComputeFeatureSizes::operator()() } const DataPath geomPath = m_InputValues->InputImageGeometryPath; - auto& geom = m_DataStructure.getDataRefAs(geomPath); + auto& geom = m_DataStructure.getDataRefAs(geomPath); const auto& featureIds = featureIdsArrayPtr->getDataStoreRef(); const DataPath featureAttributeMatrixPath = m_InputValues->FeatureAttributeMatrixPath; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMeans.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMeans.cpp index c39457655b..7e45d2455a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMeans.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMeans.cpp @@ -15,7 +15,7 @@ template class ComputeKMeansTemplate { public: - ComputeKMeansTemplate(ComputeKMeans* filter, const IDataArray* inputIDataArray, IDataArray* meansIDataArray, const std::unique_ptr& maskDataArray, + ComputeKMeansTemplate(ComputeKMeans* filter, const AbstractDataArray* inputIDataArray, AbstractDataArray* meansIDataArray, const std::unique_ptr& maskDataArray, usize numClusters, Int32AbstractDataStore& fIds, ClusterUtilities::DistanceMetric distMetric, std::mt19937_64::result_type seed) : m_Filter(filter) , m_InputArray(inputIDataArray->template getIDataStoreRefAs()) @@ -104,7 +104,7 @@ class ComputeKMeansTemplate ComputeKMeans* m_Filter; const AbstractDataStoreT& m_InputArray; AbstractDataStoreT& m_Means; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; usize m_NumClusters; Int32AbstractDataStore& m_FeatureIds; ClusterUtilities::DistanceMetric m_DistMetric; @@ -207,9 +207,9 @@ const std::atomic_bool& ComputeKMeans::getCancel() // ----------------------------------------------------------------------------- Result<> ComputeKMeans::operator()() { - auto* clusteringArray = m_DataStructure.getDataAs(m_InputValues->ClusteringArrayPath); + auto* clusteringArray = m_DataStructure.getDataAs(m_InputValues->ClusteringArrayPath); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); @@ -221,7 +221,7 @@ Result<> ComputeKMeans::operator()() return MakeErrorResult(-54060, message); } - RunTemplateClass(clusteringArray->getDataType(), this, clusteringArray, m_DataStructure.getDataAs(m_InputValues->MeansArrayPath), + RunTemplateClass(clusteringArray->getDataType(), this, clusteringArray, m_DataStructure.getDataAs(m_InputValues->MeansArrayPath), maskCompare, m_InputValues->InitClusters, m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->getDataStoreRef(), m_InputValues->DistanceMetric, m_InputValues->Seed); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMedoids.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMedoids.cpp index 62c870f18b..cc5f2e2f3a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMedoids.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeKMedoids.cpp @@ -15,7 +15,7 @@ template class KMedoidsTemplate { public: - KMedoidsTemplate(ComputeKMedoids* filter, const IDataArray* inputIDataArray, IDataArray* medoidsIDataArray, const std::unique_ptr& maskDataArray, + KMedoidsTemplate(ComputeKMedoids* filter, const AbstractDataArray* inputIDataArray, AbstractDataArray* medoidsIDataArray, const std::unique_ptr& maskDataArray, usize numClusters, Int32AbstractDataStore& fIds, ClusterUtilities::DistanceMetric distMetric, std::mt19937_64::result_type seed) : m_Filter(filter) , m_InputArray(inputIDataArray->template getIDataStoreRefAs>()) @@ -93,7 +93,7 @@ class KMedoidsTemplate ComputeKMedoids* m_Filter; const AbstractDataStoreT& m_InputArray; AbstractDataStoreT& m_Medoids; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; usize m_NumClusters; Int32AbstractDataStore& m_FeatureIds; ClusterUtilities::DistanceMetric m_DistMetric; @@ -208,8 +208,8 @@ const std::atomic_bool& ComputeKMedoids::getCancel() // ----------------------------------------------------------------------------- Result<> ComputeKMedoids::operator()() { - auto* clusteringArray = m_DataStructure.getDataAs(m_InputValues->ClusteringArrayPath); - std::unique_ptr maskCompare; + auto* clusteringArray = m_DataStructure.getDataAs(m_InputValues->ClusteringArrayPath); + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); @@ -220,8 +220,8 @@ Result<> ComputeKMedoids::operator()() std::string message = fmt::format("Mask Array DataPath does not exist or is not of the correct type (Bool | UInt8) {}", m_InputValues->MaskArrayPath.toString()); return MakeErrorResult(-54070, message); } - RunTemplateClass(clusteringArray->getDataType(), this, clusteringArray, m_DataStructure.getDataAs(m_InputValues->MedoidsArrayPath), maskCompare, - m_InputValues->InitClusters, m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->getDataStoreRef(), + RunTemplateClass(clusteringArray->getDataType(), this, clusteringArray, m_DataStructure.getDataAs(m_InputValues->MedoidsArrayPath), + maskCompare, m_InputValues->InitClusters, m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->getDataStoreRef(), m_InputValues->DistanceMetric, m_InputValues->Seed); return {}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeNeighborListStatistics.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeNeighborListStatistics.cpp index 1842305800..240be9f1ec 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeNeighborListStatistics.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeNeighborListStatistics.cpp @@ -21,8 +21,8 @@ class ComputeNeighborListStatisticsImpl using DataArrayType = DataArray; using StoreType = AbstractDataStore; - ComputeNeighborListStatisticsImpl(ComputeNeighborListStatistics* filter, const INeighborList& source, bool length, bool min, bool max, bool mean, bool median, bool stdDeviation, bool summation, - std::vector& arrays, const std::atomic_bool& shouldCancel, ProgressMessageHelper& progressMessageHelper) + ComputeNeighborListStatisticsImpl(ComputeNeighborListStatistics* filter, const AbstractNeighborList& source, bool length, bool min, bool max, bool mean, bool median, bool stdDeviation, + bool summation, std::vector& arrays, const std::atomic_bool& shouldCancel, ProgressMessageHelper& progressMessageHelper) : m_Filter(filter) , m_ShouldCancel(shouldCancel) , m_Source(source) @@ -139,7 +139,7 @@ class ComputeNeighborListStatisticsImpl ComputeNeighborListStatistics* m_Filter = nullptr; const std::atomic_bool& m_ShouldCancel; - const INeighborList& m_Source; + const AbstractNeighborList& m_Source; bool m_Length = false; bool m_Min = false; bool m_Max = false; @@ -148,7 +148,7 @@ class ComputeNeighborListStatisticsImpl bool m_StdDeviation = false; bool m_Summation = false; - std::vector& m_Arrays; + std::vector& m_Arrays; ProgressMessageHelper& m_ProgressMessageHelper; }; } // namespace @@ -169,7 +169,7 @@ ComputeNeighborListStatistics::~ComputeNeighborListStatistics() noexcept = defau // ----------------------------------------------------------------------------- Result<> ComputeNeighborListStatistics::operator()() { - const auto& inputINeighborList = m_DataStructure.getDataRefAs(m_InputValues->TargetNeighborListPath); + const auto& inputINeighborList = m_DataStructure.getDataRefAs(m_InputValues->TargetNeighborListPath); DataType type = inputINeighborList.getDataType(); if(type == DataType::boolean) @@ -183,35 +183,35 @@ Result<> ComputeNeighborListStatistics::operator()() return MakeErrorResult(k_EmptyNeighborList, fmt::format("ComputeNeighborListStatisticsFilter::NeighborList {} was empty", inputINeighborList.getName())); } - std::vector arrays(7, nullptr); + std::vector arrays(7, nullptr); if(m_InputValues->FindLength) { - arrays[0] = m_DataStructure.getDataAs(m_InputValues->LengthPath); + arrays[0] = m_DataStructure.getDataAs(m_InputValues->LengthPath); } if(m_InputValues->FindMin) { - arrays[1] = m_DataStructure.getDataAs(m_InputValues->MinPath); + arrays[1] = m_DataStructure.getDataAs(m_InputValues->MinPath); } if(m_InputValues->FindMax) { - arrays[2] = m_DataStructure.getDataAs(m_InputValues->MaxPath); + arrays[2] = m_DataStructure.getDataAs(m_InputValues->MaxPath); } if(m_InputValues->FindMean) { - arrays[3] = m_DataStructure.getDataAs(m_InputValues->MeanPath); + arrays[3] = m_DataStructure.getDataAs(m_InputValues->MeanPath); } if(m_InputValues->FindMedian) { - arrays[4] = m_DataStructure.getDataAs(m_InputValues->MedianPath); + arrays[4] = m_DataStructure.getDataAs(m_InputValues->MedianPath); } if(m_InputValues->FindStdDeviation) { - arrays[5] = m_DataStructure.getDataAs(m_InputValues->StdDeviationPath); + arrays[5] = m_DataStructure.getDataAs(m_InputValues->StdDeviationPath); } if(m_InputValues->FindSummation) { - arrays[6] = m_DataStructure.getDataAs(m_InputValues->SummationPath); + arrays[6] = m_DataStructure.getDataAs(m_InputValues->SummationPath); } MessageHelper messageHelper(m_MessageHandler); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomCentroids.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomCentroids.cpp index ec08855a0d..9207fed9da 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomCentroids.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomCentroids.cpp @@ -2,7 +2,7 @@ #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Utilities/GeometryHelpers.hpp" @@ -30,14 +30,14 @@ const std::atomic_bool& ComputeTriangleGeomCentroids::getCancel() // ----------------------------------------------------------------------------- Result<> ComputeTriangleGeomCentroids::operator()() { - using MeshIndexType = IGeometry::MeshIndexType; - using SharedVertexListType = AbstractDataStore; - using SharedFaceListType = AbstractDataStore; + using MeshIndexType = AbstractGeometry::MeshIndexType; + using SharedVertexListType = AbstractDataStore; + using SharedFaceListType = AbstractDataStore; const auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometryPath); const SharedVertexListType& vertexCoords = triangleGeom.getVertices()->getDataStoreRef(); const SharedFaceListType& triangles = triangleGeom.getFaces()->getDataStoreRef(); - IGeometry::MeshIndexType numTriangles = triangleGeom.getNumberOfFaces(); + AbstractGeometry::MeshIndexType numTriangles = triangleGeom.getNumberOfFaces(); const BoundingBox3Df boundingBox = triangleGeom.getBoundingBox(); // Get the faceLabels array and then get the min and max values diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomVolumes.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomVolumes.cpp index 8348f5684d..2e13963daf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomVolumes.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeTriangleGeomVolumes.cpp @@ -1,7 +1,7 @@ #include "ComputeTriangleGeomVolumes.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Utilities/DataArrayUtilities.hpp" #include "simplnx/Utilities/Meshing/TriangleUtilities.hpp" @@ -30,11 +30,11 @@ const std::atomic_bool& ComputeTriangleGeomVolumes::getCancel() // ----------------------------------------------------------------------------- Result<> ComputeTriangleGeomVolumes::operator()() { - using MeshIndexType = IGeometry::MeshIndexType; - using SharedVertexListType = AbstractDataStore; + using MeshIndexType = AbstractGeometry::MeshIndexType; + using SharedVertexListType = AbstractDataStore; const auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometryPath); - IGeometry::MeshIndexType numTriangles = triangleGeom.getNumberOfFaces(); + AbstractGeometry::MeshIndexType numTriangles = triangleGeom.getNumberOfFaces(); const SharedVertexListType& vertexCoords = triangleGeom.getVertices()->getDataStoreRef(); const auto& faceLabels = m_DataStructure.getDataAs(m_InputValues->FaceLabelsArrayPath)->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVectorColors.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVectorColors.cpp index 6ac7d6c380..981715f5b4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVectorColors.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVectorColors.cpp @@ -37,7 +37,7 @@ const std::atomic_bool& ComputeVectorColors::getCancel() // ----------------------------------------------------------------------------- Result<> ComputeVectorColors::operator()() { - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVertexToTriangleDistances.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVertexToTriangleDistances.cpp index 5801167021..4456da691b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVertexToTriangleDistances.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeVertexToTriangleDistances.cpp @@ -13,8 +13,8 @@ using namespace nx::core; namespace { using RTreeType = RTree; -using SharedTriListT = AbstractDataStore; -using SharedVertexListT = AbstractDataStore; +using SharedTriListT = AbstractDataStore; +using SharedVertexListT = AbstractDataStore; /** * @brief 3x1 Matrix as a row. diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.cpp index 59d4d8f37f..8409b16b17 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.cpp @@ -1,6 +1,6 @@ #include "ConcatenateDataArrays.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" using namespace nx::core; @@ -26,20 +26,20 @@ const std::atomic_bool& ConcatenateDataArrays::getCancel() // ----------------------------------------------------------------------------- Result<> ConcatenateDataArrays::operator()() { - const auto& outputDataArray = m_DataStructure.getDataRefAs(m_InputValues->OutputArrayPath); + const auto& outputDataArray = m_DataStructure.getDataRefAs(m_InputValues->OutputArrayPath); std::string arrayTypeName = outputDataArray.getTypeName(); switch(outputDataArray.getArrayType()) { - case IArray::ArrayType::DataArray: { + case AbstractArray::ArrayType::DataArray: { return ConcatenateArrays(m_DataStructure, m_InputValues->InputArrayPaths, m_InputValues->OutputArrayPath, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { return ConcatenateArraysImpl(m_DataStructure, m_InputValues->InputArrayPaths, m_InputValues->OutputArrayPath, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::NeighborListArray: { + case AbstractArray::ArrayType::NeighborListArray: { return ConcatenateNeighborLists(m_DataStructure, m_InputValues->InputArrayPaths, m_InputValues->OutputArrayPath, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakeErrorResult(to_underlying(ConcatenateDataArrays::ErrorCodes::InputArraysEqualAny), "Every array in the input arrays list has array type 'Any'. This SHOULD NOT be possible, so please contact the developers."); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.hpp index 421e2f4272..a73f33dee1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConcatenateDataArrays.hpp @@ -144,7 +144,7 @@ class SIMPLNXCORE_EXPORT ConcatenateDataArrays static Result<> ConcatenateArrays(DataStructure& dataStructure, const std::vector& inputArrayPaths, const DataPath& outputArrayPath, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { - const auto& outputDataArray = dataStructure.getDataRefAs(outputArrayPath); + const auto& outputDataArray = dataStructure.getDataRefAs(outputArrayPath); Result<> result; ExecuteDataFunction(ConcatenateDataArraysTemplateImpl{}, outputDataArray.getDataType(), dataStructure, inputArrayPaths, outputArrayPath, messageHandler, shouldCancel, result); return result; @@ -153,7 +153,7 @@ class SIMPLNXCORE_EXPORT ConcatenateDataArrays static Result<> ConcatenateNeighborLists(DataStructure& dataStructure, const std::vector& inputArrayPaths, const DataPath& outputArrayPath, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { - const auto& outputNeighborList = dataStructure.getDataRefAs(outputArrayPath); + const auto& outputNeighborList = dataStructure.getDataRefAs(outputArrayPath); Result<> result; ExecuteNeighborFunction(ConcatenateNeighborListsTemplateImpl{}, outputNeighborList.getDataType(), dataStructure, inputArrayPaths, outputArrayPath, messageHandler, shouldCancel, result); return result; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConditionalSetValue.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConditionalSetValue.cpp index 9a67608222..41bc791709 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConditionalSetValue.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConditionalSetValue.cpp @@ -12,7 +12,7 @@ namespace struct ReplaceValueInArrayFunctor { template - void operator()(IDataArray& workingArray, const std::string& removeValue, const std::string& replaceValue) + void operator()(AbstractDataArray& workingArray, const std::string& removeValue, const std::string& replaceValue) { auto& dataStore = workingArray.template getIDataStoreRefAs>(); @@ -49,9 +49,9 @@ Result<> ConditionalSetValue::operator()() { if(m_InputValues->UseConditional) { - DataObject& inputDataObject = m_DataStructure.getDataRef(m_InputValues->SelectedArrayPath); + AbstractDataObject& inputDataObject = m_DataStructure.getDataRef(m_InputValues->SelectedArrayPath); - const IDataArray& conditionalArray = m_DataStructure.getDataRefAs(m_InputValues->ConditionalArrayPath); + const AbstractDataArray& conditionalArray = m_DataStructure.getDataRefAs(m_InputValues->ConditionalArrayPath); Result<> result = ConditionalReplaceValueInArray(m_InputValues->ReplaceValue, inputDataObject, conditionalArray, m_InputValues->InvertMask); @@ -59,7 +59,7 @@ Result<> ConditionalSetValue::operator()() } else { - auto& inputDataArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedArrayPath); + auto& inputDataArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedArrayPath); ExecuteDataFunction(ReplaceValueInArrayFunctor{}, inputDataArray.getDataType(), inputDataArray, m_InputValues->RemoveValue, m_InputValues->ReplaceValue); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertColorToGrayScale.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertColorToGrayScale.cpp index 8a4e9f4267..0c47950d17 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertColorToGrayScale.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertColorToGrayScale.cpp @@ -151,7 +151,7 @@ class ParallelWrapper ParallelWrapper& operator=(ParallelWrapper&&) = delete; // Move Assignment Not Implemented template - static void Run(T impl, size_t totalPoints, const typename IParallelAlgorithm::AlgorithmStores& algStores) + static void Run(T impl, size_t totalPoints, const typename ParallelAlgorithm::AlgorithmStores& algStores) { ParallelDataAlgorithm dataAlg; dataAlg.setRange(0, totalPoints); @@ -205,7 +205,7 @@ Result<> ConvertColorToGrayScale::operator()() size_t comp = inputColorData.getNumberOfComponents(); size_t totalPoints = inputColorData.getNumberOfTuples(); - typename IParallelAlgorithm::AlgorithmStores algStores; + typename ParallelAlgorithm::AlgorithmStores algStores; algStores.push_back(&inputColorData); algStores.push_back(&outputGrayData); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertData.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertData.cpp index d3899c002f..0789266de4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertData.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ConvertData.cpp @@ -71,9 +71,9 @@ Result<> ConvertData(DataStructure& dataStructure, const ConvertDataInputValues* DataArray& inputArray = dataStructure.getDataRefAs>(inputValues->SelectedArrayPath); AbstractDataStore& inputStore = inputArray.getDataStoreRef(); - typename IParallelAlgorithm::AlgorithmArrays algArrays; + typename ParallelAlgorithm::AlgorithmArrays algArrays; algArrays.push_back(&inputArray); - algArrays.push_back(dataStructure.getDataAs(inputValues->OutputArrayName)); + algArrays.push_back(dataStructure.getDataAs(inputValues->OutputArrayName)); ParallelDataAlgorithm dataAlg; dataAlg.setRange(0, inputArray.size()); @@ -155,7 +155,7 @@ const std::atomic_bool& ConvertData::getCancel() // ----------------------------------------------------------------------------- Result<> ConvertData::operator()() { - DataType inputArrayType = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath)->getDataType(); + DataType inputArrayType = m_DataStructure.getDataAs(m_InputValues->SelectedArrayPath)->getDataType(); switch(inputArrayType) { case DataType::int8: { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateAMScanPaths.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateAMScanPaths.cpp index d940dc6da1..8c0b4f0b49 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateAMScanPaths.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateAMScanPaths.cpp @@ -228,7 +228,7 @@ std::vector fillPolygonWithParallelLines(const std::vector& } // ---------------------------------------------------------------------------- -void extractRegion(INodeGeometry0D::SharedVertexList& vertices, INodeGeometry1D::SharedEdgeList& edges, AbstractDataStore& regionIds, AbstractDataStore& sliceIds, +void extractRegion(AbstractNodeGeometry0D::SharedVertexList& vertices, AbstractNodeGeometry1D::SharedEdgeList& edges, AbstractDataStore& regionIds, AbstractDataStore& sliceIds, int32_t regionIdToExtract, int32_t sliceIdToExtract, std::vector& outVertices, std::vector& outEdges) { outVertices.clear(); @@ -342,8 +342,8 @@ Result<> CreateAMScanPaths::operator()() { // Get References to all the INPUT Data Objects auto& CADLayers = m_DataStructure.getDataRefAs(m_InputValues->CADSliceDataContainerName); - INodeGeometry1D::SharedEdgeList& outlineEdges = CADLayers.getEdgesRef(); - INodeGeometry0D::SharedVertexList& outlineVertices = CADLayers.getVerticesRef(); + AbstractNodeGeometry1D::SharedEdgeList& outlineEdges = CADLayers.getEdgesRef(); + AbstractNodeGeometry0D::SharedVertexList& outlineVertices = CADLayers.getVerticesRef(); auto& cadSliceIds = m_DataStructure.getDataAs(m_InputValues->CADSliceIdsArrayPath)->getDataStoreRef(); auto& cadRegionIds = m_DataStructure.getDataAs(m_InputValues->CADRegionIdsArrayPath)->getDataStoreRef(); usize numCADLayerEdges = CADLayers.getNumberOfEdges(); @@ -353,8 +353,8 @@ Result<> CreateAMScanPaths::operator()() hatchesEdgeGeom.resizeEdgeList(0ULL); hatchesEdgeGeom.resizeVertexList(0ULL); - AbstractDataStore& hatchVertsDataStore = hatchesEdgeGeom.getVertices()->getDataStoreRef(); - AbstractDataStore& hatchesDataStore = hatchesEdgeGeom.getEdges()->getDataStoreRef(); + AbstractDataStore& hatchVertsDataStore = hatchesEdgeGeom.getVertices()->getDataStoreRef(); + AbstractDataStore& hatchesDataStore = hatchesEdgeGeom.getEdges()->getDataStoreRef(); const DataPath hatchAttributeMatrixPath = m_InputValues->HatchDataContainerName.createChildPath(m_InputValues->HatchAttributeMatrixName); auto& hatchSliceIdsDataStore = m_DataStructure.getDataAs(hatchAttributeMatrixPath.createChildPath(m_InputValues->CADSliceIdsArrayPath.getTargetName()))->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp index ea914280fd..983dda710c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp @@ -41,7 +41,7 @@ class CreateColorMapImpl { public: CreateColorMapImpl(const AbstractDataStore& arrayStore, const std::vector& binPoints, const std::vector& controlPoints, int numControlColors, UInt8AbstractDataStore& colorStore, - const nx::core::IDataArray* goodVoxels, const std::vector& invalidColor) + const nx::core::AbstractDataArray* goodVoxels, const std::vector& invalidColor) : m_ArrayStore(arrayStore) , m_BinPoints(binPoints) , m_ArrayMin(arrayStore[0]) @@ -160,7 +160,7 @@ class CreateColorMapImpl int m_NumControlColors; const std::vector& m_ControlPoints; UInt8AbstractDataStore& m_ColorStore; - const nx::core::IDataArray* m_GoodVoxels = nullptr; + const nx::core::AbstractDataArray* m_GoodVoxels = nullptr; const std::vector& m_InvalidColor; }; @@ -190,10 +190,10 @@ struct GenerateColorArrayFunctor auto& colorArray = dataStructure.getDataAs(inputValues->RgbArrayPath)->getDataStoreRef(); - nx::core::IDataArray* goodVoxelsArray = nullptr; + nx::core::AbstractDataArray* goodVoxelsArray = nullptr; if(inputValues->UseMask) { - goodVoxelsArray = dataStructure.getDataAs(inputValues->MaskArrayPath); + goodVoxelsArray = dataStructure.getDataAs(inputValues->MaskArrayPath); } const AbstractDataStore& arrayRef = dataStructure.getDataAs>(inputValues->SelectedDataArrayPath)->getDataStoreRef(); @@ -231,7 +231,7 @@ const std::atomic_bool& CreateColorMap::getCancel() // ----------------------------------------------------------------------------- Result<> CreateColorMap::operator()() { - const IDataArray& selectedIDataArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedDataArrayPath); + const AbstractDataArray& selectedIDataArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedDataArrayPath); auto controlPointsResult = ColorTableUtilities::ExtractControlPoints(m_InputValues->PresetName); if(controlPointsResult.invalid()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CropEdgeGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CropEdgeGeometry.cpp index 7c0388ba3b..6f44ea0726 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CropEdgeGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CropEdgeGeometry.cpp @@ -19,7 +19,8 @@ template class CropEdgeGeomArray { public: - CropEdgeGeomArray(const IDataArray& oldCellArray, IDataArray& newCellArray, const AttributeMatrix& srcAttrMatrix, const std::vector& tupleMask, const std::atomic_bool& shouldCancel) + CropEdgeGeomArray(const AbstractDataArray& oldCellArray, AbstractDataArray& newCellArray, const AttributeMatrix& srcAttrMatrix, const std::vector& tupleMask, + const std::atomic_bool& shouldCancel) : m_OldCellStore(oldCellArray.template getIDataStoreRefAs>()) , m_NewCellStore(newCellArray.template getIDataStoreRefAs>()) , m_SrcAttrMatrix(srcAttrMatrix) @@ -349,10 +350,10 @@ Result<> CropEdgeGeometry::operator()() return {}; } - const auto& oldDataArray = dynamic_cast(*oldDataObject); + const auto& oldDataArray = dynamic_cast(*oldDataObject); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destVertexAttrMatrix.at(srcName)); + auto& newDataArray = dynamic_cast(destVertexAttrMatrix.at(srcName)); m_MessageHandler(fmt::format("Cropping Volume || Copying Vertex Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, oldDataArray, newDataArray, srcVertexAttrMatrix, vertexReferenced, m_ShouldCancel); @@ -391,10 +392,10 @@ Result<> CropEdgeGeometry::operator()() return {}; } - const auto& oldDataArray = dynamic_cast(*oldDataObject); + const auto& oldDataArray = dynamic_cast(*oldDataObject); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destEdgesAttrMatrix.at(srcName)); + auto& newDataArray = dynamic_cast(destEdgesAttrMatrix.at(srcName)); m_MessageHandler(fmt::format("Cropping Volume || Copying Edge Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, oldDataArray, newDataArray, srcEdgesAttrMatrix, edgesMask, m_ShouldCancel); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/DBSCAN.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/DBSCAN.cpp index e766a1e36c..76fd3d8f1e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/DBSCAN.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/DBSCAN.cpp @@ -107,7 +107,7 @@ class HyperGridBitMap3D : public HyperGridBitMap template HyperGridBitMap3D(const std::atomic_bool& shouldCancel, MessageHelper& messageHelper, const AbstractDataStore& inputArray, float32 epsilon, - const std::unique_ptr& mask) + const std::unique_ptr& mask) : HyperGridBitMap() { ThrottledMessenger throttledMessenger = messageHelper.createThrottledMessenger(); @@ -319,7 +319,7 @@ class HyperGridBitMap2D : public HyperGridBitMap template HyperGridBitMap2D(const std::atomic_bool& shouldCancel, MessageHelper& messageHelper, const AbstractDataStore& inputArray, float32 epsilon, - const std::unique_ptr& mask) + const std::unique_ptr& mask) : HyperGridBitMap() { ThrottledMessenger throttledMessenger = messageHelper.createThrottledMessenger(); @@ -705,7 +705,7 @@ class GDCF { public: GDCF() = delete; - GDCF(const std::atomic_bool& shouldCancel, MessageHelper& messageHelper, const AbstractDataStore& inputArray, float32 epsilon, const std::unique_ptr& mask, + GDCF(const std::atomic_bool& shouldCancel, MessageHelper& messageHelper, const AbstractDataStore& inputArray, float32 epsilon, const std::unique_ptr& mask, ClusterUtilities::DistanceMetric distMetric) : hyperGridBitMap(HGBPT(shouldCancel, messageHelper, inputArray, epsilon, mask)) , m_Epsilon(epsilon) @@ -1034,7 +1034,7 @@ class GDCF }; template -Result<> RunAlgorithm(const DBSCANInputValues* inputValues, const AbstractDataStore& inputArray, const std::unique_ptr& mask, Int32Array& featureIds, +Result<> RunAlgorithm(const DBSCANInputValues* inputValues, const AbstractDataStore& inputArray, const std::unique_ptr& mask, Int32Array& featureIds, MessageHelper& messageHelper, const std::atomic_bool& shouldCancel) { messageHelper.sendMessage("Partitioning Input Data:"); @@ -1066,7 +1066,7 @@ Result<> RunAlgorithm(const DBSCANInputValues* inputValues, const AbstractDataSt struct DBSCANFunctor { template - Result<> operator()(const DBSCANInputValues* inputValues, const IDataArray& clusterArray, const std::unique_ptr& mask, Int32Array& featureIds, + Result<> operator()(const DBSCANInputValues* inputValues, const AbstractDataArray& clusterArray, const std::unique_ptr& mask, Int32Array& featureIds, MessageHelper& messageHelper, const std::atomic_bool& shouldCancel) { const auto& inputArray = dynamic_cast&>(clusterArray).getDataStoreRef(); @@ -1105,10 +1105,10 @@ Result<> DBSCAN::operator()() { MessageHelper messageHelper(m_MessageHandler); - auto& clusteringArray = m_DataStructure.getDataRefAs(m_InputValues->ClusteringArrayPath); + auto& clusteringArray = m_DataStructure.getDataRefAs(m_InputValues->ClusteringArrayPath); auto& featureIds = m_DataStructure.getDataRefAs(m_InputValues->FeatureIdsArrayPath); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.cpp index 045546d49e..ee19f378bc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.cpp @@ -18,7 +18,7 @@ class ErodeDilateBadDataTransferDataImpl ErodeDilateBadDataTransferDataImpl(const ErodeDilateBadDataTransferDataImpl&) = default; ErodeDilateBadDataTransferDataImpl(ErodeDilateBadData* filterAlg, usize totalPoints, ChoicesParameter::ValueType operation, const Int32AbstractDataStore& featureIds, - const std::vector& neighbors, const std::shared_ptr& dataArrayPtr, MessageHelper& messageHelper) + const std::vector& neighbors, const std::shared_ptr& dataArrayPtr, MessageHelper& messageHelper) : m_FilterAlg(filterAlg) , m_TotalPoints(totalPoints) , m_Operation(operation) @@ -59,7 +59,7 @@ class ErodeDilateBadDataTransferDataImpl usize m_TotalPoints = 0; ChoicesParameter::ValueType m_Operation = 0; std::vector m_Neighbors; - const std::shared_ptr m_DataArrayPtr; + const std::shared_ptr m_DataArrayPtr; const Int32AbstractDataStore& m_FeatureIds; MessageHelper& m_MessageHelper; }; @@ -179,7 +179,7 @@ Result<> ErodeDilateBadData::operator()() } // Build up a list of the DataArrays that we are going to operate on. - const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); + const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); MessageHelper messageHelper(m_MessageHandler); @@ -199,7 +199,7 @@ Result<> ErodeDilateBadData::operator()() taskRunner.wait(); // This will spill over if the number of DataArrays to process does not divide evenly by the number of threads. // Now update the feature Ids - auto featureIDataArray = m_DataStructure.getSharedDataAs(m_InputValues->FeatureIdsArrayPath); + auto featureIDataArray = m_DataStructure.getSharedDataAs(m_InputValues->FeatureIdsArrayPath); taskRunner.setParallelizationEnabled(false); // Do this to make the next call synchronous taskRunner.execute(ErodeDilateBadDataTransferDataImpl(this, totalPoints, m_InputValues->Operation, featureIds, neighbors, featureIDataArray, messageHelper)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.hpp index 5eb5a734b4..2bc69e4e1c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateBadData.hpp @@ -12,12 +12,12 @@ namespace nx::core { namespace detail { -static inline constexpr StringLiteral k_DilateString = "Dilate"; -static inline constexpr StringLiteral k_ErodeString = "Erode"; +static constexpr StringLiteral k_DilateString = "Dilate"; +static constexpr StringLiteral k_ErodeString = "Erode"; static inline const ChoicesParameter::Choices k_OperationChoices = {k_DilateString, k_ErodeString}; -static inline constexpr ChoicesParameter::ValueType k_DilateIndex = 0ULL; -static inline constexpr ChoicesParameter::ValueType k_ErodeIndex = 1ULL; +static constexpr ChoicesParameter::ValueType k_DilateIndex = 0ULL; +static constexpr ChoicesParameter::ValueType k_ErodeIndex = 1ULL; } // namespace detail struct SIMPLNXCORE_EXPORT ErodeDilateBadDataInputValues diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateCoordinationNumber.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateCoordinationNumber.cpp index ffb9123d1d..1a76e00baf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateCoordinationNumber.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateCoordinationNumber.cpp @@ -12,7 +12,7 @@ namespace struct DataArrayCopyTupleFunctor { template - void operator()(IDataArray& outputIDataArray, size_t sourceIndex, size_t targetIndex) + void operator()(AbstractDataArray& outputIDataArray, size_t sourceIndex, size_t targetIndex) { using DataArrayType = DataArray; DataArrayType outputArray = dynamic_cast(outputIDataArray); @@ -74,7 +74,7 @@ Result<> ErodeDilateCoordinationNumber::operator()() std::array faceNeighborInternalIdx = initializeFaceNeighborInternalIdx(); const std::string attrMatName = m_InputValues->FeatureIdsArrayPath.getTargetName(); - const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); + const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); std::vector featureCount(numFeatures + 1, 0); std::vector coordinationNumber(totalPoints, 0); @@ -129,11 +129,11 @@ Result<> ErodeDilateCoordinationNumber::operator()() const int64 neighbor = neighbors[voxelIndex]; if(coordinationNumber[voxelIndex] >= m_InputValues->CoordinationNumber && coordinationNumber[voxelIndex] > 0) { - // TODO: update to use IDataArray->copyTuple() function + // TODO: update to use AbstractDataArray->copyTuple() function /****************************************************************** * If this section is slow it is because we are having to use the * ExecuteDataFunction() in order to call "copyTuple()" because - * "copyTuple()" isn't in the IArray API set. Oh well. + * "copyTuple()" isn't in the AbstractArray API set. Oh well. */ for(const auto& voxelArray : voxelArrays) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateMask.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateMask.hpp index c0dc2a5273..1ded6aa377 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateMask.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ErodeDilateMask.hpp @@ -14,12 +14,12 @@ namespace nx::core { namespace detail { -static inline constexpr StringLiteral k_DilateString = "Dilate"; -static inline constexpr StringLiteral k_ErodeString = "Erode"; +static constexpr StringLiteral k_DilateString = "Dilate"; +static constexpr StringLiteral k_ErodeString = "Erode"; static inline const ChoicesParameter::Choices k_OperationChoices = {k_DilateString, k_ErodeString}; -static inline constexpr ChoicesParameter::ValueType k_DilateIndex = 0ULL; -static inline constexpr ChoicesParameter::ValueType k_ErodeIndex = 1ULL; +static constexpr ChoicesParameter::ValueType k_DilateIndex = 0ULL; +static constexpr ChoicesParameter::ValueType k_ErodeIndex = 1ULL; } // namespace detail struct SIMPLNXCORE_EXPORT ErodeDilateMaskInputValues diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractComponentAsArray.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractComponentAsArray.cpp index 977acdafa3..5c6afa5273 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractComponentAsArray.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractComponentAsArray.cpp @@ -10,7 +10,7 @@ namespace struct RemoveComponentsFunctor { template - void operator()(IDataArray* originalArray, IDataArray* resizedArray, usize componentIndexToRemove) // Due to logic structure originalArray cannot be const + void operator()(AbstractDataArray* originalArray, AbstractDataArray* resizedArray, usize componentIndexToRemove) // Due to logic structure originalArray cannot be const { const auto& originalStoreRef = originalArray->template getIDataStoreRefAs>(); auto& resizedStoreRef = resizedArray->template getIDataStoreRefAs>(); @@ -40,7 +40,7 @@ struct RemoveComponentsFunctor struct ExtractComponentsFunctor { template - void operator()(IDataArray* inputArray, IDataArray* extractedCompArray, usize componentIndexToExtract) // Due to logic structure inputArray cannot be const + void operator()(AbstractDataArray* inputArray, AbstractDataArray* extractedCompArray, usize componentIndexToExtract) // Due to logic structure inputArray cannot be const { const auto& inputStoreRef = inputArray->template getIDataStoreRefAs>(); auto& extractedStoreRef = extractedCompArray->template getIDataStoreRefAs>(); @@ -90,21 +90,21 @@ Result<> ExtractComponentAsArray::operator()() const bool removeComponentsFromArrayBool = m_InputValues->RemoveComponentsFromArray; const auto compToRemoveNum = static_cast(abs(m_InputValues->CompNumber)); // this will be the original array if components are not being removed, else it is resized array - auto* baseArrayPtr = m_DataStructure.getDataAs(m_InputValues->BaseArrayPath); + auto* baseArrayPtr = m_DataStructure.getDataAs(m_InputValues->BaseArrayPath); m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Extracting Component")); if((!removeComponentsFromArrayBool) && moveComponentsToNewArrayBool) { - ExecuteDataFunction(ExtractComponentsFunctor{}, baseArrayPtr->getDataType(), baseArrayPtr, m_DataStructure.getDataAs(m_InputValues->NewArrayPath), compToRemoveNum); + ExecuteDataFunction(ExtractComponentsFunctor{}, baseArrayPtr->getDataType(), baseArrayPtr, m_DataStructure.getDataAs(m_InputValues->NewArrayPath), compToRemoveNum); return {}; } // will not exist if remove components is not occurring, hence the early bailout ^ - auto* tempArrayPtr = m_DataStructure.getDataAs(m_InputValues->TempArrayPath); // will not exist if remove components is not true, hence the early bailout ^ + auto* tempArrayPtr = m_DataStructure.getDataAs(m_InputValues->TempArrayPath); // will not exist if remove components is not true, hence the early bailout ^ if(moveComponentsToNewArrayBool) { m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Moving Component")); - auto* extractedCompArrayPtr = m_DataStructure.getDataAs(m_InputValues->NewArrayPath); + auto* extractedCompArrayPtr = m_DataStructure.getDataAs(m_InputValues->NewArrayPath); ExecuteDataFunction(ExtractComponentsFunctor{}, tempArrayPtr->getDataType(), tempArrayPtr, extractedCompArrayPtr, compToRemoveNum); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractFeatureBoundaries2D.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractFeatureBoundaries2D.cpp index 40b1456a02..69fc436f0e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractFeatureBoundaries2D.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractFeatureBoundaries2D.cpp @@ -96,7 +96,8 @@ void CountEdges(const AbstractDataStore& featureIds, usize dimX, usize dimY, */ template void PopulateVerticalEdges(const AbstractDataStore& featureIds, usize dimX, usize dimY, float32 originX, float32 originY, float32 originZ, float32 spacingX, float32 spacingY, - INodeGeometry0D::SharedVertexList& vertices, INodeGeometry1D::SharedEdgeList& edges, usize& currentEdge, const std::atomic_bool& shouldCancel, const Range& range) + AbstractNodeGeometry0D::SharedVertexList& vertices, AbstractNodeGeometry1D::SharedEdgeList& edges, usize& currentEdge, const std::atomic_bool& shouldCancel, + const Range& range) { for(usize y = range.min(); y < range.max(); y++) { @@ -151,7 +152,8 @@ void PopulateVerticalEdges(const AbstractDataStore& featureIds, usize dimX, u */ template void PopulateHorizontalEdgesImpl(const AbstractDataStore& featureIds, usize dimX, usize dimY, float32 originX, float32 originY, float32 originZ, float32 spacingX, float32 spacingY, - INodeGeometry0D::SharedVertexList& vertices, INodeGeometry1D::SharedEdgeList& edges, usize& currentEdge, const std::atomic_bool& shouldCancel, const Range& range) + AbstractNodeGeometry0D::SharedVertexList& vertices, AbstractNodeGeometry1D::SharedEdgeList& edges, usize& currentEdge, const std::atomic_bool& shouldCancel, + const Range& range) { for(usize y = range.min(); y < range.max(); y++) { @@ -313,8 +315,8 @@ struct ExtractFeatureBoundariesFunctor edgeGeom.resizeVertexList(numVertices); edgeGeom.resizeEdgeList(totalEdgeCount); - INodeGeometry0D::SharedVertexList& verticesRef = edgeGeom.getVerticesRef(); - INodeGeometry1D::SharedEdgeList& edgesRef = edgeGeom.getEdgesRef(); + AbstractNodeGeometry0D::SharedVertexList& verticesRef = edgeGeom.getVerticesRef(); + AbstractNodeGeometry1D::SharedEdgeList& edgesRef = edgeGeom.getEdgesRef(); // ========================================================================= // PASS 2 - POPULATE: Create vertices and edge connectivity @@ -499,7 +501,7 @@ Result<> ExtractFeatureBoundaries2D::operator()() // Get references to the input/output geometries and feature IDs array const auto& imageGeom = m_DataStructure.getDataRefAs(m_InputValues->InputImageGeometryPath); auto& edgeGeom = m_DataStructure.getDataRefAs(m_InputValues->OutputEdgeGeometryPath); - const auto& featureIdsArray = m_DataStructure.getDataRefAs(m_InputValues->FeatureIdsArrayPath); + const auto& featureIdsArray = m_DataStructure.getDataRefAs(m_InputValues->FeatureIdsArrayPath); // Get the data type to dispatch to the correct template instantiation const DataType dataType = featureIdsArray.getDataType(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractInternalSurfacesFromTriangleGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractInternalSurfacesFromTriangleGeometry.cpp index 6f6c81d508..434bdf83f9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractInternalSurfacesFromTriangleGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractInternalSurfacesFromTriangleGeometry.cpp @@ -16,16 +16,16 @@ struct RemoveFlaggedVerticesFunctor { // copy data to masked geometry template - void operator()(IDataArray* inputDataPtr, IDataArray* outputDataArray, const std::vector& indexMapping) const + void operator()(AbstractDataArray* inputDataPtr, AbstractDataArray* outputDataArray, const std::vector& indexMapping) const { auto& inputData = inputDataPtr->template getIDataStoreRefAs>(); auto& outputData = outputDataArray->template getIDataStoreRefAs>(); usize nComps = inputData.getNumberOfComponents(); - IGeometry::MeshIndexType notSeen = std::numeric_limits::max(); + AbstractGeometry::MeshIndexType notSeen = std::numeric_limits::max(); for(usize i = 0; i < indexMapping.size(); i++) { - IGeometry::MeshIndexType newIndex = indexMapping[i]; + AbstractGeometry::MeshIndexType newIndex = indexMapping[i]; if(newIndex != notSeen) { for(usize compIdx = 0; compIdx < nComps; compIdx++) @@ -85,7 +85,7 @@ Result<> ExtractInternalSurfacesFromTriangleGeometry::operator()() // int64 prog = 1; // int64 progressInt = 0; // int64 counter = 0; - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; const MeshIndexType notSeen = std::numeric_limits::max(); @@ -137,8 +137,8 @@ Result<> ExtractInternalSurfacesFromTriangleGeometry::operator()() internalTriangleGeom.getVertexAttributeMatrix()->resizeTuples({currentNewVertIndex}); internalTriangleGeom.getFaceAttributeMatrix()->resizeTuples({currentNewTriIndex}); - IGeometry::SharedVertexList* internalVerts = internalTriangleGeom.getVertices(); - IGeometry::SharedFaceList* internalTriangles = internalTriangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* internalVerts = internalTriangleGeom.getVertices(); + AbstractGeometry::SharedFaceList* internalTriangles = internalTriangleGeom.getFaces(); // Transfer the data from the old SharedVertexList to the new VertexList for(MeshIndexType vertIndex = 0; vertIndex < numVerts; vertIndex++) @@ -182,8 +182,8 @@ Result<> ExtractInternalSurfacesFromTriangleGeometry::operator()() for(const auto& targetArrayPath : m_InputValues->CopyVertexArrayPaths) { DataPath destinationPath = internalTrianglesPath.createChildPath(m_InputValues->VertexAttributeMatrixName).createChildPath(targetArrayPath.getTargetName()); - auto* src = m_DataStructure.getDataAs(targetArrayPath); - auto* dest = m_DataStructure.getDataAs(destinationPath); + auto* src = m_DataStructure.getDataAs(targetArrayPath); + auto* dest = m_DataStructure.getDataAs(destinationPath); ExecuteDataFunction(RemoveFlaggedVerticesFunctor{}, src->getDataType(), src, dest, vertNewIndex); } @@ -191,8 +191,8 @@ Result<> ExtractInternalSurfacesFromTriangleGeometry::operator()() for(const auto& targetArrayPath : m_InputValues->CopyTriangleArrayPaths) { DataPath destinationPath = internalTrianglesPath.createChildPath(m_InputValues->TriangleAttributeMatrixName).createChildPath(targetArrayPath.getTargetName()); - auto* src = m_DataStructure.getDataAs(targetArrayPath); - auto* dest = m_DataStructure.getDataAs(destinationPath); + auto* src = m_DataStructure.getDataAs(targetArrayPath); + auto* dest = m_DataStructure.getDataAs(destinationPath); dest->resizeTuples({currentNewTriIndex}); ExecuteDataFunction(RemoveFlaggedVerticesFunctor{}, src->getDataType(), src, dest, triNewIndex); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp index 080acc9091..8bcdb5cdb3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp @@ -1,7 +1,7 @@ #include "ExtractVertexGeometry.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" @@ -23,7 +23,7 @@ struct CopyDataFunctor } template - void operator()(const IDataArray* srcIArray, IDataArray* destIArray, const std::vector& maskArray) + void operator()(const AbstractDataArray* srcIArray, AbstractDataArray* destIArray, const std::vector& maskArray) { const auto& srcArray = srcIArray->template getIDataStoreRefAs>(); auto& destArray = destIArray->template getIDataStoreRefAs>(); @@ -69,7 +69,7 @@ const std::atomic_bool& ExtractVertexGeometry::getCancel() // ----------------------------------------------------------------------------- Result<> ExtractVertexGeometry::operator()() { - const auto& inputGeometry = m_DataStructure.getDataRefAs(m_InputValues->InputGeometryPath); + const auto& inputGeometry = m_DataStructure.getDataRefAs(m_InputValues->InputGeometryPath); auto& vertexGeometry = m_DataStructure.getDataRefAs(m_InputValues->VertexGeometryPath); SizeVec3 dims = inputGeometry.getDimensions(); @@ -101,7 +101,7 @@ Result<> ExtractVertexGeometry::operator()() std::vector maskedPoints; if(m_InputValues->UseMask) { - std::unique_ptr maskArrayPtr = nullptr; + std::unique_ptr maskArrayPtr = nullptr; try { maskArrayPtr = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, maskArrayPath); @@ -129,7 +129,7 @@ Result<> ExtractVertexGeometry::operator()() // of each cell and then set that into the new VertexGeometry m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Generating vertex geometry")); - IGeometry::SharedVertexList& vertices = vertexGeometry.getVerticesRef(); + AbstractGeometry::SharedVertexList& vertices = vertexGeometry.getVerticesRef(); auto& verticesDataStore = vertices.getDataStoreRef(); usize vertIdx = 0; for(usize idx = 0; idx < totalCells; idx++) @@ -158,9 +158,9 @@ Result<> ExtractVertexGeometry::operator()() vertexAttrMatrix.resizeTuples({vertexCount}); for(const auto& dataArrayPath : m_InputValues->IncludedDataArrayPaths) { - const auto* srcIDataArray = m_DataStructure.getDataAs(dataArrayPath); + const auto* srcIDataArray = m_DataStructure.getDataAs(dataArrayPath); DataPath destDataArrayPath = vertexAttributeMatrixDataPath.createChildPath(srcIDataArray->getName()); - auto* destDataArray = m_DataStructure.getDataAs(destDataArrayPath); + auto* destDataArray = m_DataStructure.getDataAs(destDataArrayPath); ExecuteDataFunction(CopyDataFunctor{}, srcIDataArray->getDataType(), srcIDataArray, destDataArray, maskedPoints); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FillBadData.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FillBadData.cpp index 5cd59ae953..9ec35a0be4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FillBadData.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FillBadData.cpp @@ -91,7 +91,7 @@ void FillBadDataUpdateTuples(const Int32AbstractDataStore& featureIds, AbstractD struct FillBadDataUpdateTuplesFunctor { template - void operator()(const Int32AbstractDataStore& featureIds, IDataArray* outputIDataArray, const std::vector& neighbors) + void operator()(const Int32AbstractDataStore& featureIds, AbstractDataArray* outputIDataArray, const std::vector& neighbors) { auto& outputStore = outputIDataArray->template getIDataStoreRefAs>(); FillBadDataUpdateTuples(featureIds, outputStore, neighbors); @@ -565,7 +565,7 @@ void FillBadData::phaseFourIterativeFill(Int32AbstractDataStore& featureIdsStore // Get a list of all cell arrays that need to be updated during filling // Exclude arrays specified in ignoredDataArrayPaths - std::optional> allChildArrays = GetAllChildDataPaths(m_DataStructure, selectedImageGeom.getCellDataPath(), DataObject::Type::DataArray, m_InputValues->ignoredDataArrayPaths); + std::optional> allChildArrays = GetAllChildDataPaths(m_DataStructure, selectedImageGeom.getCellDataPath(), IDataObject::Type::DataArray, m_InputValues->ignoredDataArrayPaths); std::vector voxelArrayNames; if(allChildArrays.has_value()) { @@ -664,7 +664,7 @@ void FillBadData::phaseFourIterativeFill(Int32AbstractDataStore& featureIdsStore continue; } - auto* oldCellArray = m_DataStructure.getDataAs(cellArrayPath); + auto* oldCellArray = m_DataStructure.getDataAs(cellArrayPath); // Use the type-dispatched update function to handle all data types ExecuteDataFunction(FillBadDataUpdateTuplesFunctor{}, oldCellArray->getDataType(), featureIdsStore, oldCellArray, neighbors); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.cpp index 28a1b769f3..034485680d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.cpp @@ -37,7 +37,7 @@ Result<> FindNRingNeighbors::operator()(const IFilter::MessageHandler& mesgHandl { return result; } - const INodeGeometry1D::ElementDynamicList* node2TrianglePtr = triangleGeom->getElementsContainingVert(); + const AbstractNodeGeometry1D::ElementDynamicList* node2TrianglePtr = triangleGeom->getElementsContainingVert(); // Figure out these boolean values for a sanity check bool check0 = faceLabels[triangleId * 2] == m_InputValues->RegionId0 && faceLabels[triangleId * 2 + 1] == m_InputValues->RegionId1; @@ -68,12 +68,12 @@ Result<> FindNRingNeighbors::operator()(const IFilter::MessageHandler& mesgHandl { // Get all the triangles for this Node id uint16_t tCount = node2TrianglePtr->getNumberOfElements(triangles[triangleIdx * 3 + i]); - IGeometry::MeshIndexType* data = node2TrianglePtr->getElementListPointer(triangles[triangleIdx * 3 + i]); + AbstractGeometry::MeshIndexType* data = node2TrianglePtr->getElementListPointer(triangles[triangleIdx * 3 + i]); // Copy all the triangles into our "2Ring" set which will be the unique set of triangle ids for(uint16_t t = 0; t < tCount; ++t) { - IGeometry::MeshIndexType tid = data[t]; + AbstractGeometry::MeshIndexType tid = data[t]; check0 = faceLabels[tid * 2] == m_InputValues->RegionId0 && faceLabels[tid * 2 + 1] == m_InputValues->RegionId1; check1 = faceLabels[tid * 2 + 1] == m_InputValues->RegionId0 && faceLabels[tid * 2] == m_InputValues->RegionId1; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.hpp index 4bf2fd5cd0..c056e9b341 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FindNRingNeighbors.hpp @@ -5,7 +5,7 @@ #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/NeighborList.hpp" #include "simplnx/Filter/IFilter.hpp" @@ -30,7 +30,7 @@ struct SIMPLNXCORE_EXPORT FindNRingNeighborsInputValues class SIMPLNXCORE_EXPORT FindNRingNeighbors { public: - using UniqueFaceIds_t = std::set; + using UniqueFaceIds_t = std::set; FindNRingNeighbors(FindNRingNeighborsInputValues* inputValues); ~FindNRingNeighbors() noexcept; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FlyingEdges3D.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FlyingEdges3D.cpp index 309244b167..7030f65d64 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FlyingEdges3D.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/FlyingEdges3D.cpp @@ -10,7 +10,7 @@ namespace struct ExecuteFlyingEdgesFunctor { template - void operator()(const ImageGeom& image, const IDataArray* iDataArray, float64 isoVal, TriangleGeom& triangleGeom, Float32AbstractDataStore& normals, AttributeMatrix& normAM) + void operator()(const ImageGeom& image, const AbstractDataArray* iDataArray, float64 isoVal, TriangleGeom& triangleGeom, Float32AbstractDataStore& normals, AttributeMatrix& normAM) { FlyingEdgesAlgorithm flyingEdges = FlyingEdgesAlgorithm(image, iDataArray->template getIDataStoreRefAs>(), static_cast(isoVal), triangleGeom, normals); flyingEdges.pass1(); @@ -49,7 +49,7 @@ Result<> FlyingEdges3D::operator()() { const auto& image = m_DataStructure.getDataRefAs(m_InputValues->imageGeomPath); float64 isoVal = m_InputValues->isoVal; - const auto* iDataArray = m_DataStructure.getDataAs(m_InputValues->contouringArrayPath); + const auto* iDataArray = m_DataStructure.getDataAs(m_InputValues->contouringArrayPath); auto triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->triangleGeomPath); auto& normalsStore = m_DataStructure.getDataAs(m_InputValues->normalsArrayPath)->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifyDuplicateVertices.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifyDuplicateVertices.cpp index 1b3d72c0a4..13cc85c741 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifyDuplicateVertices.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifyDuplicateVertices.cpp @@ -29,11 +29,12 @@ const std::atomic_bool& IdentifyDuplicateVertices::getCancel() // ----------------------------------------------------------------------------- Result<> IdentifyDuplicateVertices::operator()() { - const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->TargetGeometryPath); - const INodeGeometry2D::SharedVertexList::store_type& verts = geom.getVertices()->getDataStoreRef(); + const auto& geom = m_DataStructure.getDataRefAs(m_InputValues->TargetGeometryPath); + const AbstractNodeGeometry2D::SharedVertexList::store_type& verts = geom.getVertices()->getDataStoreRef(); // Sort Vertices - MeshingUtilities::SortedVerticesList sortedVerticesList = MeshingUtilities::OrderSharedVertices(m_DataStructure.getDataRefAs(m_InputValues->TargetGeometryPath), m_ShouldCancel); + MeshingUtilities::SortedVerticesList sortedVerticesList = + MeshingUtilities::OrderSharedVertices(m_DataStructure.getDataRefAs(m_InputValues->TargetGeometryPath), m_ShouldCancel); if(!MeshingUtilities::HasDuplicateVertices(geom.getVertices()->getDataStoreRef(), sortedVerticesList)) { // no duplicates found @@ -41,7 +42,7 @@ Result<> IdentifyDuplicateVertices::operator()() } // Leverage ordering assumptions to speed up duplicate checks - std::array offset; + std::array offset; switch(sortedVerticesList.axis) { case MeshingUtilities::AxialAlignment::X: { @@ -60,11 +61,11 @@ Result<> IdentifyDuplicateVertices::operator()() auto& duplicatesMask = m_DataStructure.getDataAs(m_InputValues->DuplicatesMaskPath)->getDataStoreRef(); duplicatesMask.fill(0); - using VertT = INodeGeometry0D::SharedVertexList::value_type; + using VertT = AbstractNodeGeometry0D::SharedVertexList::value_type; for(usize i = 1; i < sortedVerticesList.ordering.size(); i++) { - const IGeometry::MeshIndexType prevIndex = sortedVerticesList.ordering[i - 1] * 3; - const IGeometry::MeshIndexType currentIndex = sortedVerticesList.ordering[i] * 3; + const AbstractGeometry::MeshIndexType prevIndex = sortedVerticesList.ordering[i - 1] * 3; + const AbstractGeometry::MeshIndexType currentIndex = sortedVerticesList.ordering[i] * 3; if(std::numeric_limits::epsilon() < std::fabs(verts[prevIndex + offset[0]] - verts[currentIndex + offset[0]])) { // value on first axis is different; proceed to next iteration diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifySample.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifySample.cpp index c96d0e33ff..e4ec352513 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifySample.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IdentifySample.cpp @@ -12,7 +12,7 @@ namespace struct IdentifySampleFunctor { template - void operator()(const ImageGeom* imageGeom, IDataArray* goodVoxelsPtr, bool fillHoles, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) + void operator()(const ImageGeom* imageGeom, AbstractDataArray* goodVoxelsPtr, bool fillHoles, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { ShapeType cDims = {1}; auto& goodVoxels = goodVoxelsPtr->template getIDataStoreRefAs>(); @@ -187,7 +187,7 @@ struct IdentifySampleSliceBySliceFunctor }; template - void operator()(const ImageGeom* imageGeom, IDataArray* goodVoxelsPtr, bool fillHoles, Plane plane, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) + void operator()(const ImageGeom* imageGeom, AbstractDataArray* goodVoxelsPtr, bool fillHoles, Plane plane, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { auto& goodVoxels = goodVoxelsPtr->template getIDataStoreRefAs>(); @@ -400,7 +400,7 @@ IdentifySample::~IdentifySample() noexcept = default; // ----------------------------------------------------------------------------- Result<> IdentifySample::operator()() { - auto* inputData = m_DataStructure.getDataAs(m_InputValues->MaskArrayPath); + auto* inputData = m_DataStructure.getDataAs(m_InputValues->MaskArrayPath); const auto* imageGeom = m_DataStructure.getDataAs(m_InputValues->InputImageGeometryPath); if(m_InputValues->SliceBySlice) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/InitializeData.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/InitializeData.cpp index 362514fca0..5f4c5dc23b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/InitializeData.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/InitializeData.cpp @@ -1,8 +1,8 @@ #include "InitializeData.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/AbstractDataStore.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" #include "simplnx/Utilities/StringInterpretationUtilities.hpp" @@ -251,7 +251,7 @@ std::vector standardizeMultiComponent(const usize numComps, const s struct FillArrayFunctor { template - void operator()(IDataArray& iDataArray, const InitializeDataInputValues& inputValues) + void operator()(AbstractDataArray& iDataArray, const InitializeDataInputValues& inputValues) { auto& dataStore = iDataArray.template getIDataStoreRefAs>(); usize numComp = dataStore.getNumberOfComponents(); // We checked that the values string is greater than max comps size so proceed check free @@ -526,7 +526,7 @@ const std::atomic_bool& InitializeData::getCancel() Result<> InitializeData::operator()() { - auto& iDataArray = m_DataStructure.getDataRefAs(m_InputValues->InputArrayPath); + auto& iDataArray = m_DataStructure.getDataRefAs(m_InputValues->InputArrayPath); ExecuteDataFunction(::FillArrayFunctor{}, iDataArray.getDataType(), iDataArray, *m_InputValues); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IterativeClosestPoint.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IterativeClosestPoint.cpp index f51aed5130..c80253364b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IterativeClosestPoint.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/IterativeClosestPoint.cpp @@ -18,7 +18,7 @@ template struct VertexGeomAdaptor { const Derived& obj; - AbstractDataStore* verts; + AbstractDataStore* verts; size_t m_NumComponents = 0; size_t m_NumTuples = 0; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/LaplacianSmoothing.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/LaplacianSmoothing.cpp index 06f7607a3e..6be5e06c92 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/LaplacianSmoothing.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/LaplacianSmoothing.cpp @@ -3,7 +3,7 @@ #include "LaplacianSmoothing.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" using namespace nx::core; @@ -24,7 +24,7 @@ Result<> LaplacianSmoothing::operator()() // At the end of the algorithm, the 2D Node Geometry will have edges that are not // needed. This will remove those from the DataStructure - if(auto* nodeGeom2DPtr = m_DataStructure.getDataAs(m_InputValues->pTriangleGeometryDataPath); nullptr != nodeGeom2DPtr) + if(auto* nodeGeom2DPtr = m_DataStructure.getDataAs(m_InputValues->pTriangleGeometryDataPath); nullptr != nodeGeom2DPtr) { auto edgeListId = nodeGeom2DPtr->getEdgeListId(); nodeGeom2DPtr->setEdgeListId(0); @@ -41,7 +41,7 @@ Result<> LaplacianSmoothing::operator()() // ----------------------------------------------------------------------------- Result<> LaplacianSmoothing::edgeBasedSmoothing() { - auto& nodeGeom1DRef = m_DataStructure.getDataRefAs(m_InputValues->pTriangleGeometryDataPath); + auto& nodeGeom1DRef = m_DataStructure.getDataRefAs(m_InputValues->pTriangleGeometryDataPath); if(nodeGeom1DRef.getVertices() == nullptr) { @@ -49,12 +49,12 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } Float32AbstractDataStore& vertDataStoreRef = nodeGeom1DRef.getVertices()->getDataStoreRef(); - IGeometry::MeshIndexType numberOfVertices = nodeGeom1DRef.getNumberOfVertices(); + AbstractGeometry::MeshIndexType numberOfVertices = nodeGeom1DRef.getNumberOfVertices(); // Generate the Lambda Array std::vector lambdas = generateLambdaArray(); - auto inode2DPtr = m_DataStructure.getDataAs(m_InputValues->pTriangleGeometryDataPath); + auto inode2DPtr = m_DataStructure.getDataAs(m_InputValues->pTriangleGeometryDataPath); if(nullptr != inode2DPtr) { // Generate the Unique Edges @@ -64,8 +64,8 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } } - AbstractDataStore& edges = nodeGeom1DRef.getEdges()->getDataStoreRef(); - IGeometry::MeshIndexType numEdges = edges.getNumberOfTuples(); + AbstractDataStore& edges = nodeGeom1DRef.getEdges()->getDataStoreRef(); + AbstractGeometry::MeshIndexType numEdges = edges.getNumberOfTuples(); std::vector numConnections(numberOfVertices, 0); @@ -80,12 +80,12 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Iteration {} of {}", q, m_InputValues->pIterationSteps)); // Compute the Deltas for each point - for(IGeometry::MeshIndexType i = 0; i < numEdges; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < numEdges; i++) { - IGeometry::MeshIndexType in1 = edges[2 * i]; // row of the first vertex - IGeometry::MeshIndexType in2 = edges[2 * i + 1]; // row the second vertex + AbstractGeometry::MeshIndexType in1 = edges[2 * i]; // row of the first vertex + AbstractGeometry::MeshIndexType in2 = edges[2 * i + 1]; // row the second vertex - for(IGeometry::MeshIndexType j = 0; j < 3; j++) + for(AbstractGeometry::MeshIndexType j = 0; j < 3; j++) { #if 0 Q_ASSERT(static_cast(3 * in1 + j) < static_cast(numberOfVertices * 3)); @@ -100,11 +100,11 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } // Move each point - for(IGeometry::MeshIndexType i = 0; i < numberOfVertices; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < numberOfVertices; i++) { - for(IGeometry::MeshIndexType j = 0; j < 3; j++) + for(AbstractGeometry::MeshIndexType j = 0; j < 3; j++) { - IGeometry::MeshIndexType in0 = 3 * i + j; + AbstractGeometry::MeshIndexType in0 = 3 * i + j; dlta = deltaArray[in0] / numConnections[i]; float ll = lambdas[i]; @@ -126,10 +126,10 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } m_MessageHandler(IFilter::Message::Type::Info, fmt::format("Iteration {} of {}", q, m_InputValues->pIterationSteps)); // Compute the Delta's - for(IGeometry::MeshIndexType i = 0; i < numEdges; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < numEdges; i++) { - IGeometry::MeshIndexType in1 = edges[2 * i]; // row of the first vertex - IGeometry::MeshIndexType in2 = edges[2 * i + 1]; // row the second vertex + AbstractGeometry::MeshIndexType in1 = edges[2 * i]; // row of the first vertex + AbstractGeometry::MeshIndexType in2 = edges[2 * i + 1]; // row the second vertex for(int32_t j = 0; j < 3; j++) { @@ -146,11 +146,11 @@ Result<> LaplacianSmoothing::edgeBasedSmoothing() } // Move the points - for(IGeometry::MeshIndexType i = 0; i < numberOfVertices; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < numberOfVertices; i++) { - for(IGeometry::MeshIndexType j = 0; j < 3; j++) + for(AbstractGeometry::MeshIndexType j = 0; j < 3; j++) { - IGeometry::MeshIndexType in0 = 3 * i + j; + AbstractGeometry::MeshIndexType in0 = 3 * i + j; dlta = deltaArray[in0] / numConnections[i]; float ll = lambdas[i] * m_InputValues->pMuFactor; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/MapPointCloudToRegularGrid.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/MapPointCloudToRegularGrid.cpp index 19b0554a3a..dcb39eabff 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/MapPointCloudToRegularGrid.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/MapPointCloudToRegularGrid.cpp @@ -38,7 +38,7 @@ using ErrorType = OutOfBoundsType; template Result<> ProcessVertices(const IFilter::MessageHandler& messageHandler, const VertexGeom& vertices, const ImageGeom& image, UInt64AbstractDataStore& voxelIndices, - const std::unique_ptr& maskCompare, uint64 outOfBoundsValue) + const std::unique_ptr& maskCompare, uint64 outOfBoundsValue) { // Out of Bounds Counter usize count = 0; @@ -132,7 +132,7 @@ Result<> MapPointCloudToRegularGrid::operator()() const auto& image = m_DataStructure.getDataRefAs(m_InputValues->ImageGeomPath); // Create the Mask - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/NearestPointFuseRegularGrids.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/NearestPointFuseRegularGrids.cpp index 40d811b8dd..8c9ca7073b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/NearestPointFuseRegularGrids.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/NearestPointFuseRegularGrids.cpp @@ -88,7 +88,8 @@ template class CopyFromIndicesListImpl { public: - CopyFromIndicesListImpl(const IArray& sourceArray, IArray& destArray, const ImageGeom& sampleImageGeom, const ImageGeom& refImageGeom, float64 fillValue, const std::atomic_bool& shouldCancel) + CopyFromIndicesListImpl(const AbstractArray& sourceArray, AbstractArray& destArray, const ImageGeom& sampleImageGeom, const ImageGeom& refImageGeom, float64 fillValue, + const std::atomic_bool& shouldCancel) : m_SourceArray(sourceArray) , m_DestArray(destArray) , m_ArrayType(destArray.getArrayType()) @@ -107,26 +108,26 @@ class CopyFromIndicesListImpl void operator()() const { - if(m_ArrayType == IArray::ArrayType::NeighborListArray) + if(m_ArrayType == AbstractArray::ArrayType::NeighborListArray) { return; } - else if(m_ArrayType == IArray::ArrayType::DataArray) + else if(m_ArrayType == AbstractArray::ArrayType::DataArray) { using DataArrayT = DataArray; auto destArray = dynamic_cast(m_DestArray); CopyData(dynamic_cast(m_SourceArray), destArray, m_SampleGeom, m_RefGeom, m_ShouldCancel, static_cast(m_FillValue)); } - else if(m_ArrayType == IArray::ArrayType::StringArray) + else if(m_ArrayType == AbstractArray::ArrayType::StringArray) { CopyData(dynamic_cast(m_SourceArray), dynamic_cast(m_DestArray), m_SampleGeom, m_RefGeom, m_ShouldCancel, ""); } } private: - const IArray& m_SourceArray; - IArray& m_DestArray; - IArray::ArrayType m_ArrayType = IArray::ArrayType::Any; + const AbstractArray& m_SourceArray; + AbstractArray& m_DestArray; + AbstractArray::ArrayType m_ArrayType = AbstractArray::ArrayType::Any; const ImageGeom& m_SampleGeom; const ImageGeom& m_RefGeom; float64 m_FillValue; @@ -172,17 +173,17 @@ Result<> NearestPointFuseRegularGrids::operator()() // Copy according to calculated values ParallelTaskAlgorithm taskRunner; - auto sampleVoxelArrays = sampleAM.findAllChildrenOfType(); + auto sampleVoxelArrays = sampleAM.findAllChildrenOfType(); for(const auto& array : sampleVoxelArrays) { // this path was created in preflight DataPath createdArrayPath = m_InputValues->ReferenceCellAttributeMatrixPath.createChildPath(array->getName()); - auto& refAMArray = m_DataStructure.getDataRefAs(createdArrayPath); + auto& refAMArray = m_DataStructure.getDataRefAs(createdArrayPath); DataType dataType = DataType::int32; - if(refAMArray.getArrayType() == IArray::ArrayType::DataArray) + if(refAMArray.getArrayType() == AbstractArray::ArrayType::DataArray) { - dataType = dynamic_cast(refAMArray).getDataType(); + dataType = dynamic_cast(refAMArray).getDataType(); } ExecuteParallelFunction(dataType, taskRunner, *array, refAMArray, sampleImageGeom, refImageGeom, m_InputValues->fillValue, getCancel()); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PadImageGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PadImageGeometry.cpp index e6dc4a4b3f..de49c7ccf1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PadImageGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PadImageGeometry.cpp @@ -14,7 +14,8 @@ template class PadImageGeomDataArray { public: - PadImageGeomDataArray(const IDataArray& oldCellArray, IDataArray& newCellArray, const ImageGeom& srcImageGeom, const PadImageGeometryInputValues* inputValues, const std::atomic_bool& shouldCancel) + PadImageGeomDataArray(const AbstractDataArray& oldCellArray, AbstractDataArray& newCellArray, const ImageGeom& srcImageGeom, const PadImageGeometryInputValues* inputValues, + const std::atomic_bool& shouldCancel) : m_OldCellStore(oldCellArray.template getIDataStoreRefAs>()) , m_NewCellStore(newCellArray.template getIDataStoreRefAs>()) , m_SrcImageGeom(srcImageGeom) @@ -147,10 +148,10 @@ Result<> PadImageGeometry::operator()() return {}; } - const auto& oldDataArray = dynamic_cast(*oldDataObject); + const auto& oldDataArray = dynamic_cast(*oldDataObject); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); + auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); m_MessageHandler(fmt::format("Padding Volume || Copying Data Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, oldDataArray, newDataArray, srcImageGeom, m_InputValues, m_ShouldCancel); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp index 2d75aabcea..4978188f48 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.cpp @@ -15,7 +15,7 @@ namespace class PartitionCellBasedGeometryImpl { public: - PartitionCellBasedGeometryImpl(const IGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int startingPartitionId, int outOfBoundsValue, + PartitionCellBasedGeometryImpl(const AbstractGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int startingPartitionId, int outOfBoundsValue, const std::atomic_bool& shouldCancel) : m_InputGeometry(inputGeometry) , m_PartitionIdsStore(partitionIdsStore) @@ -65,7 +65,7 @@ class PartitionCellBasedGeometryImpl } private: - const IGridGeometry& m_InputGeometry; + const AbstractGridGeometry& m_InputGeometry; Int32AbstractDataStore& m_PartitionIdsStore; const ImageGeom& m_PSImageGeom; int m_StartingPartitionId; @@ -183,7 +183,7 @@ Result<> PartitionGeometry::operator()() const DataPath partitionIdsPath = m_InputValues->InputGeomCellAMPath.createChildPath(m_InputValues->PartitionIdsArrayName); auto& partitionIdsStore = m_DataStructure.getDataAs(partitionIdsPath)->getDataStoreRef(); - const IGeometry& iGeomToPartition = m_DataStructure.getDataRefAs(m_InputValues->InputGeometryToPartition); + const AbstractGeometry& iGeomToPartition = m_DataStructure.getDataRefAs(m_InputValues->InputGeometryToPartition); Result<> result; switch(iGeomToPartition.getGeomType()) { @@ -203,8 +203,8 @@ Result<> PartitionGeometry::operator()() case IGeometry::Type::Quad: case IGeometry::Type::Tetrahedral: case IGeometry::Type::Hexahedral: { - const INodeGeometry0D& inputGeomToPartition = m_DataStructure.getDataRefAs({m_InputValues->InputGeometryToPartition}); - const AbstractDataStore& vertexListStore = inputGeomToPartition.getVertices()->getDataStoreRef(); + const AbstractNodeGeometry0D& inputGeomToPartition = m_DataStructure.getDataRefAs({m_InputValues->InputGeometryToPartition}); + const AbstractDataStore& vertexListStore = inputGeomToPartition.getVertices()->getDataStoreRef(); result = partitionNodeBasedGeometry(vertexListStore, partitionIdsStore, partitionGridGeom, m_InputValues->OutOfBoundsFeatureID, vertexMask); break; } @@ -224,11 +224,11 @@ Result<> PartitionGeometry::operator()() // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -Result<> PartitionGeometry::partitionCellBasedGeometry(const IGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int outOfBoundsValue) +Result<> PartitionGeometry::partitionCellBasedGeometry(const AbstractGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int outOfBoundsValue) { SizeVec3 dims = inputGeometry.getDimensions(); - IParallelAlgorithm::AlgorithmStores algStores; + ParallelAlgorithm::AlgorithmStores algStores; algStores.push_back(&partitionIdsStore); ParallelData3DAlgorithm dataAlg; @@ -245,11 +245,11 @@ Result<> PartitionGeometry::partitionCellBasedGeometry(const IGridGeometry& inpu Result<> PartitionGeometry::partitionNodeBasedGeometry(const VertexStore& vertexListStore, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int outOfBoundsValue, const std::optional& maskArrayOpt) { - IParallelAlgorithm::AlgorithmStores algStores; + ParallelAlgorithm::AlgorithmStores algStores; algStores.push_back(&vertexListStore); algStores.push_back(&partitionIdsStore); - IParallelAlgorithm::AlgorithmArrays algArrays; + ParallelAlgorithm::AlgorithmArrays algArrays; if(maskArrayOpt.has_value()) { algArrays.push_back(&(maskArrayOpt.value())); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.hpp index a11e20d9bf..6456d10c38 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PartitionGeometry.hpp @@ -4,7 +4,7 @@ #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" @@ -54,7 +54,7 @@ struct SIMPLNXCORE_EXPORT PartitionGeometryInputValues class SIMPLNXCORE_EXPORT PartitionGeometry { public: - using VertexStore = AbstractDataStore; + using VertexStore = AbstractDataStore; PartitionGeometry(DataStructure& dataStructure, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel, PartitionGeometryInputValues* inputValues); ~PartitionGeometry() noexcept; @@ -69,7 +69,7 @@ class SIMPLNXCORE_EXPORT PartitionGeometry USizeVec3 geometryDims; std::optional geometryOrigin; std::optional geometrySpacing; - IGeometry::LengthUnit geometryUnits; + AbstractGeometry::LengthUnit geometryUnits; }; Result<> operator()(); @@ -99,7 +99,7 @@ class SIMPLNXCORE_EXPORT PartitionGeometry * @return The result of the partitioning algorithm. Valid if successful, invalid * if there was an error. */ - Result<> partitionCellBasedGeometry(const IGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int outOfBoundsValue); + Result<> partitionCellBasedGeometry(const AbstractGridGeometry& inputGeometry, Int32AbstractDataStore& partitionIdsStore, const ImageGeom& psImageGeom, int outOfBoundsValue); /** * @brief Partitions a vertex list (typically from a node-based geometry) according to diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleEdgeGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleEdgeGeometry.cpp index af12bc6052..20637498f9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleEdgeGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleEdgeGeometry.cpp @@ -18,7 +18,7 @@ class CopyEdgeDataToVertexData public: using StoreType = AbstractDataStore; - CopyEdgeDataToVertexData(const IDataArray* selectedEdgeArray, IDataArray* createdVertexArray, const UInt64AbstractDataStore& vertexEdgeIds, const std::atomic_bool& shouldCancel) + CopyEdgeDataToVertexData(const AbstractDataArray* selectedEdgeArray, AbstractDataArray* createdVertexArray, const UInt64AbstractDataStore& vertexEdgeIds, const std::atomic_bool& shouldCancel) : m_SelectedEdgeDataStore(selectedEdgeArray->template getIDataStoreRefAs()) , m_CreatedVertexDataStore(createdVertexArray->template getIDataStoreRefAs()) , m_VertexEdgeDataStore(vertexEdgeIds) @@ -209,8 +209,8 @@ Result<> PointSampleEdgeGeometry::operator()() for(const auto& selectedArrayPath : m_InputValues->pSelectedDataArrayPaths) { DataPath createdArrayPath = vertexAttrMatPath.createChildPath(selectedArrayPath.getTargetName()); - const auto* selectedEdgeArray = m_DataStructure.getDataAs(selectedArrayPath); - auto* createdVertexArray = m_DataStructure.getDataAs(createdArrayPath); + const auto* selectedEdgeArray = m_DataStructure.getDataAs(selectedArrayPath); + auto* createdVertexArray = m_DataStructure.getDataAs(createdArrayPath); if(maxEdgeId >= selectedEdgeArray->getNumberOfTuples()) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.cpp index df402efe5b..9217ed16ab 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.cpp @@ -84,7 +84,7 @@ Result<> PointSampleTriangleGeometry::operator()() // We get the pointer to the Array instead of a reference because it might not have been set because // the bool "use_mask" might have been false, but we do NOT want to try to get the array // 'on demand' in the loop. That is a BAD idea as is it really slow to do that. (10x slower). - std::unique_ptr maskArray = nullptr; + std::unique_ptr maskArray = nullptr; if(m_Inputs->pUseMask) { try @@ -100,7 +100,7 @@ Result<> PointSampleTriangleGeometry::operator()() } // Get a reference to the Vertex List - AbstractDataStore& vertices = vertex.getVertices()->getDataStoreRef(); + AbstractDataStore& vertices = vertex.getVertices()->getDataStoreRef(); // Create a vector of TupleTransferFunctions for each of the Triangle Face to Vertex Data Arrays std::vector> tupleTransferFunctions; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.hpp index f573cc8089..f90cc4f8eb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/PointSampleTriangleGeometry.hpp @@ -41,7 +41,7 @@ #include "simplnx/Common/Result.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/IFilter.hpp" @@ -87,7 +87,7 @@ class SIMPLNXCORE_EXPORT PointSampleTriangleGeometry PointSampleTriangleGeometry& operator=(const PointSampleTriangleGeometry&) = delete; PointSampleTriangleGeometry& operator=(PointSampleTriangleGeometry&&) noexcept = delete; - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; Result<> operator()(); @@ -107,8 +107,8 @@ class SIMPLNXCORE_EXPORT PointSampleTriangleGeometry DataPath m_MaskArrayPath = {"", "", ""}; std::vector m_SelectedDataPaths = {}; - std::vector m_SelectedWeakPtrVector; - std::vector m_CreatedWeakPtrVector; + std::vector m_SelectedWeakPtrVector; + std::vector m_CreatedWeakPtrVector; int32_t m_NumSamples = 0; #endif diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp index e0016d3d54..87a2f4da4e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.cpp @@ -33,7 +33,7 @@ void hashCombine(size_t& seed, const T& obj) // ----------------------------------------------------------------------------- using VertexType = std::array; -using EdgeType = std::array; +using EdgeType = std::array; // ----------------------------------------------------------------------------- struct VertexHasher @@ -52,15 +52,15 @@ struct EdgeHasher { size_t operator()(const EdgeType& edge) const { - size_t hash = std::hash()(edge[0]); + size_t hash = std::hash()(edge[0]); hashCombine(hash, edge[1]); return hash; } }; // ----------------------------------------------------------------------------- -using VertexMap = std::unordered_map; -using EdgeMap = std::unordered_map; +using VertexMap = std::unordered_map; +using EdgeMap = std::unordered_map; // ----------------------------------------------------------------------------- struct GenerateTripleLinesImpl @@ -225,7 +225,7 @@ struct GenerateTripleLinesImpl }; // ----------------------------------------------------------------------------- -void GetGridCoordinates(const IGridGeometry* grid, size_t x, size_t y, size_t z, QuickSurfaceMesh::VertexStore& verts, IGeometry::MeshIndexType nodeIndex) +void GetGridCoordinates(const AbstractGridGeometry* grid, size_t x, size_t y, size_t z, QuickSurfaceMesh::VertexStore& verts, AbstractGeometry::MeshIndexType nodeIndex) { nx::core::Point3D tmpCoords = grid->getPlaneCoords(x, y, z); verts[nodeIndex] = static_cast(tmpCoords[0]); @@ -330,7 +330,7 @@ QuickSurfaceMesh::~QuickSurfaceMesh() noexcept = default; Result<> QuickSurfaceMesh::operator()() { // Get the ImageGeometry - auto& grid = m_DataStructure.getDataRefAs(m_InputValues->GridGeomDataPath); + auto& grid = m_DataStructure.getDataRefAs(m_InputValues->GridGeomDataPath); // Get the Created Triangle Geometry auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometryPath); @@ -395,7 +395,7 @@ Result<> QuickSurfaceMesh::operator()() { return MakeErrorResult(-56341, fmt::format("Unable to generate the connectivity list for {} geometry.", triangleGeom.getName())); } - const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); + const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); m_MessageHandler("Repairing Windings..."); windingResult = MeshingUtilities::RepairTriangleWinding(triangleGeom.getFaces()->getDataStoreRef(), connectivity, @@ -409,8 +409,8 @@ Result<> QuickSurfaceMesh::operator()() #ifdef QSM_CREATE_TRIPLE_LINES if(m_InputValues->pGenerateTripleLines) { - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); EdgeGeom* edgeGeom = EdgeGeom::Create(m_DataStructure, "[EdgeType Geometry]", parentGroupId); edgeGeom->setVertices(*vertices); @@ -442,8 +442,8 @@ Result<> QuickSurfaceMesh::operator()() std::string sharedEdgeListName = "SharedEdgeList"; size_t numEdges = edgeCount; size_t numEdgeComps = 2; - IGeometry::SharedEdgeList* edges = - IGeometry::SharedEdgeList::CreateWithStore>(m_DataStructure, sharedEdgeListName, {numEdges}, {numEdgeComps}, m_DataStructure.getId(edgeGeometryDataPath)); + AbstractGeometry::SharedEdgeList* edges = + AbstractGeometry::SharedEdgeList::CreateWithStore>(m_DataStructure, sharedEdgeListName, {numEdges}, {numEdgeComps}, m_DataStructure.getId(edgeGeometryDataPath)); edgeCount = 0; for(MeshIndexType i = 0; i < triangleCount; i++) @@ -484,7 +484,7 @@ void QuickSurfaceMesh::correctProblemVoxels() { m_MessageHandler(IFilter::Message::Type::Info, "Correcting Problem Voxels"); - auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); + auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); auto& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->getDataStoreRef(); SizeVec3 udims = grid->getDimensions(); @@ -655,7 +655,7 @@ void QuickSurfaceMesh::determineActiveNodes(std::vector& nodeIds, { m_MessageHandler(IFilter::Message::Type::Info, "Determining active Nodes"); - auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); + auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); Int32AbstractDataStore& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->getDataStoreRef(); SizeVec3 udims = grid->getDimensions(); @@ -975,7 +975,7 @@ void QuickSurfaceMesh::createNodesAndTriangles(std::vector& m_Nod } } - auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); + auto* grid = m_DataStructure.getDataAs(m_InputValues->GridGeomDataPath); SizeVec3 udims = grid->getDimensions(); @@ -1747,7 +1747,8 @@ void QuickSurfaceMesh::generateTripleLines() EdgeGeom* tripleLineEdge = EdgeGeom::Create(m_DataStructure, edgeGeometryName); size_t numVerts = vertexMap.size(); size_t numComps = 3; - IGeometry::SharedVertexList* vertices = Float32Array::CreateWithStore>(m_DataStructure, sharedVertListName, {numVerts}, {numComps}, m_DataStructure.getId(edgeGeometryDataPath)); + AbstractGeometry::SharedVertexList* vertices = + Float32Array::CreateWithStore>(m_DataStructure, sharedVertListName, {numVerts}, {numComps}, m_DataStructure.getId(edgeGeometryDataPath)); auto& verticesRef = vertices->getDataStoreRef(); for(const auto& vert : vertexMap) @@ -1766,8 +1767,8 @@ void QuickSurfaceMesh::generateTripleLines() std::string sharedEdgeListName = "SharedEdgeList"; size_t numEdges = edgeMap.size(); size_t numEdgeComps = 2; - IGeometry::SharedEdgeList* edges = - IGeometry::SharedEdgeList::CreateWithStore>(m_DataStructure, sharedEdgeListName, {numEdges}, {numEdgeComps}, m_DataStructure.getId(edgeGeometryDataPath)); + AbstractGeometry::SharedEdgeList* edges = + AbstractGeometry::SharedEdgeList::CreateWithStore>(m_DataStructure, sharedEdgeListName, {numEdges}, {numEdgeComps}, m_DataStructure.getId(edgeGeometryDataPath)); auto& edgesRef = edges->getDataStoreRef(); for(const auto& edge : edgeMap) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.hpp index 27bf7da0fa..9c6fbeedea 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/QuickSurfaceMesh.hpp @@ -4,7 +4,7 @@ #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/MultiArraySelectionParameter.hpp" @@ -35,9 +35,9 @@ struct SIMPLNXCORE_EXPORT QuickSurfaceMeshInputValues class SIMPLNXCORE_EXPORT QuickSurfaceMesh { public: - using VertexStore = AbstractDataStore; - using TriStore = AbstractDataStore; - using MeshIndexType = IGeometry::MeshIndexType; + using VertexStore = AbstractDataStore; + using TriStore = AbstractDataStore; + using MeshIndexType = AbstractGeometry::MeshIndexType; QuickSurfaceMesh(DataStructure& dataStructure, QuickSurfaceMeshInputValues* inputValues, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler); ~QuickSurfaceMesh() noexcept; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadBinaryCTNorthstar.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadBinaryCTNorthstar.cpp index 331757559d..01b80b3499 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadBinaryCTNorthstar.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadBinaryCTNorthstar.cpp @@ -30,7 +30,7 @@ Result<> SanityCheckFileSizeVersusAllocatedSize(size_t allocatedBytes, size_t fi Result<> ReadBinaryCTFiles(DataStructure& dataStructure, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel, const ReadBinaryCTNorthstarInputValues* inputValues) { auto& geom = dataStructure.getDataRefAs(inputValues->ImageGeometryPath); - geom.setUnits(static_cast(inputValues->LengthUnit)); + geom.setUnits(static_cast(inputValues->LengthUnit)); auto& density = dataStructure.getDataAs(inputValues->DensityArrayPath)->getDataStoreRef(); density.fill(0xABCDEF); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadDeformKeyFileV12.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadDeformKeyFileV12.cpp index 2efdc82501..8f76acdbf2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadDeformKeyFileV12.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadDeformKeyFileV12.cpp @@ -1,7 +1,7 @@ #include "ReadDeformKeyFileV12.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/Utilities/StringUtilities.hpp" @@ -519,7 +519,7 @@ class IOHandler return {}; } - Result<> readVertexCoordinates(AbstractDataStore& vertex, usize numVerts) + Result<> readVertexCoordinates(AbstractDataStore& vertex, usize numVerts) { std::string buf; std::vector tokens; /* vector to store the split data */ @@ -560,7 +560,7 @@ class IOHandler return {}; } - Result<> readQuadGeometry(AbstractDataStore& quads, usize numCells) + Result<> readQuadGeometry(AbstractDataStore& quads, usize numCells) { std::string buf; std::vector tokens; /* vector to store the split data */ @@ -678,7 +678,7 @@ class IOHandler if(m_Allocate) { // Grab vertex list from quad geom - AbstractDataStore& vertex = m_DataStructure.getDataAs(m_QuadGeomPath)->getVertices()->getDataStoreRef(); + AbstractDataStore& vertex = m_DataStructure.getDataAs(m_QuadGeomPath)->getVertices()->getDataStoreRef(); auto vertexResult = readVertexCoordinates(vertex, numVerts); if(vertexResult.invalid()) @@ -706,7 +706,7 @@ class IOHandler { auto& quadGeom = m_DataStructure.getDataRefAs(m_QuadGeomPath); quadGeom.setSpatialDimensionality(2); - AbstractDataStore& quads = quadGeom.getFaces()->getDataStoreRef(); + AbstractDataStore& quads = quadGeom.getFaces()->getDataStoreRef(); auto quadResult = readQuadGeometry(quads, numCells); if(quadResult.invalid()) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadRawBinary.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadRawBinary.cpp index b90d9916f2..1bd59562c0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadRawBinary.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadRawBinary.cpp @@ -66,7 +66,7 @@ int32 SanityCheckFileSizeVersusAllocatedSize(usize allocatedBytes, usize fileSiz // ----------------------------------------------------------------------------- template -Result<> ReadBinaryFile(IDataArray* dataArrayPtr, const std::string& filename, uint64 skipHeaderBytes, ChoicesParameter::ValueType endian) +Result<> ReadBinaryFile(AbstractDataArray* dataArrayPtr, const std::string& filename, uint64 skipHeaderBytes, ChoicesParameter::ValueType endian) { constexpr usize k_DefaultBlockSize = 1000000; @@ -120,7 +120,7 @@ Result<> ReadRawBinary::execute() { return {}; } - auto* binaryIDataArray = m_DataStructure.getDataAs(m_InputValues.createdAttributeArrayPathValue); + auto* binaryIDataArray = m_DataStructure.getDataAs(m_InputValues.createdAttributeArrayPathValue); if(binaryIDataArray->getNumberOfComponents() != static_cast(m_InputValues.numberOfComponentsValue)) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadStlFile.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadStlFile.cpp index bab5791a57..ccaf33384c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadStlFile.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadStlFile.cpp @@ -124,8 +124,8 @@ Result<> ReadStlFile::operator()() triangleGeom.resizeFaceList(triCount); triangleGeom.resizeVertexList(triCount * 3); - using SharedTriList = AbstractDataStore; - using SharedVertList = AbstractDataStore; + using SharedTriList = AbstractDataStore; + using SharedVertList = AbstractDataStore; SharedTriList& triangles = triangleGeom.getFaces()->getDataStoreRef(); SharedVertList& nodes = triangleGeom.getVertices()->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadZeissTxmFile.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadZeissTxmFile.hpp index dec4bd6f77..c5d2fe5ab6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadZeissTxmFile.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReadZeissTxmFile.hpp @@ -46,7 +46,7 @@ struct ZeissTxmHeaderMetadata CreateImageGeometryAction::DimensionType Dimensions = {0, 0, 0}; CreateImageGeometryAction::SpacingType Spacing = {0.0f, 0.0f, 0.0f}; CreateImageGeometryAction::OriginType Origin = {0.0f, 0.0f, 0.0f}; - IGeometry::LengthUnit Units = IGeometry::LengthUnit::Micrometer; + AbstractGeometry::LengthUnit Units = AbstractGeometry::LengthUnit::Micrometer; std::string DataFilePath = {}; ZeissTxmDataType DataType = ZeissTxmDataType::FLOAT_TYPE; void clear() @@ -54,7 +54,7 @@ struct ZeissTxmHeaderMetadata Dimensions = {0, 0, 0}; Spacing = {0.0f, 0.0f, 0.0f}; Origin = {0.0f, 0.0f, 0.0f}; - Units = IGeometry::LengthUnit::Micrometer; + Units = AbstractGeometry::LengthUnit::Micrometer; DataFilePath = {}; DataType = ZeissTxmDataType::FLOAT_TYPE; } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RegularGridSampleSurfaceMesh.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RegularGridSampleSurfaceMesh.cpp index d7816860b9..1b5cf26b7f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RegularGridSampleSurfaceMesh.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RegularGridSampleSurfaceMesh.cpp @@ -16,7 +16,7 @@ namespace // ---------------------------------------------------------------------------- // -inline std::array GetEdgeCoordinates(usize edgeId, const INodeGeometry0D::SharedVertexList& verts, const INodeGeometry1D::SharedEdgeList& edges) +inline std::array GetEdgeCoordinates(usize edgeId, const AbstractNodeGeometry0D::SharedVertexList& verts, const AbstractNodeGeometry1D::SharedEdgeList& edges) { usize v0Idx = edges[edgeId * 2]; usize v1Idx = edges[edgeId * 2 + 1]; @@ -25,8 +25,8 @@ inline std::array GetEdgeCoordinates(usize edgeId, const // ---------------------------------------------------------------------------- // Helper function to check if a point lies inside a polygon using ray-casting -bool pointInPolygon(const EdgeGeom& edgeGeom, const std::vector& edgeIndices, const Point3Df& point, const INodeGeometry0D::SharedVertexList& verts, - const INodeGeometry1D::SharedEdgeList& edges) +bool pointInPolygon(const EdgeGeom& edgeGeom, const std::vector& edgeIndices, const Point3Df& point, const AbstractNodeGeometry0D::SharedVertexList& verts, + const AbstractNodeGeometry1D::SharedEdgeList& edges) { size_t intersections = 0; size_t numEdges = edgeIndices.size(); @@ -94,8 +94,8 @@ class SampleSurfaceMeshSliceImpl edgeIndices.reserve(1024); // Reserve some space in the vector. This is just a guess. SizeVec3 dimensions = m_ImageGeom.getDimensions(); size_t cellsPerSlice = dimensions[0] * dimensions[1]; - const INodeGeometry0D::SharedVertexList& verts = m_EdgeGeom.getVerticesRef(); - const INodeGeometry1D::SharedEdgeList& edges = m_EdgeGeom.getEdgesRef(); + const AbstractNodeGeometry0D::SharedVertexList& verts = m_EdgeGeom.getVerticesRef(); + const AbstractNodeGeometry1D::SharedEdgeList& edges = m_EdgeGeom.getEdgesRef(); // Loop over all edges and find the edges that are just for the current Slice Id for(usize edgeIdx = 0; edgeIdx < numEdges; edgeIdx++) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp index 8038e32097..2338e4b20b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedEdges.cpp @@ -85,7 +85,7 @@ Result<> RemoveFlaggedEdges::operator()() { // Remove Edges from reduced according to removeEdgesIndex const auto& originalEdgeGeom = m_DataStructure.getDataRefAs(m_InputValues->EdgeGeometry); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp index 893b4f030b..0099c18806 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedFeatures.cpp @@ -110,7 +110,7 @@ bool IdentifyNeighbors(ImageGeom& imageGeom, Int32AbstractDataStore& featureIds, return shouldLoop; } -std::vector FlagFeatures(Int32AbstractDataStore& featureIds, std::unique_ptr& flaggedFeatures, const bool fillRemovedFeatures) +std::vector FlagFeatures(Int32AbstractDataStore& featureIds, std::unique_ptr& flaggedFeatures, const bool fillRemovedFeatures) { bool good = false; usize totalPoints = featureIds.getNumberOfTuples(); @@ -150,7 +150,7 @@ std::vector FlagFeatures(Int32AbstractDataStore& featureIds, std::unique_p return activeObjects; } -void FindVoxelArrays(const Int32AbstractDataStore& featureIds, const std::vector& neighbors, std::vector>& voxelArrays, const std::atomic_bool& shouldCancel) +void FindVoxelArrays(const Int32AbstractDataStore& featureIds, const std::vector& neighbors, std::vector>& voxelArrays, const std::atomic_bool& shouldCancel) { const usize totalPoints = featureIds.getNumberOfTuples(); @@ -262,7 +262,7 @@ Result<> RemoveFlaggedFeatures::operator()() auto& imageGeom = m_DataStructure.getDataRefAs(m_InputValues->ImageGeometryPath); auto function = static_cast(m_InputValues->ExtractFeatures); - std::unique_ptr flaggedFeatures = nullptr; + std::unique_ptr flaggedFeatures = nullptr; try { flaggedFeatures = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->FlaggedFeaturesArrayPath); @@ -390,7 +390,7 @@ Result<> RemoveFlaggedFeatures::operator()() } m_MessageHandler(IFilter::ProgressMessage{IFilter::Message::Type::Info, fmt::format("Filling bad voxels...")}); - std::vector> voxelArrays = GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); + std::vector> voxelArrays = GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsArrayPath, m_InputValues->IgnoredDataArrayPaths); FindVoxelArrays(featureIds, neighbors, voxelArrays, getCancel()); } while(shouldLoop); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedTriangles.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedTriangles.cpp index 12e1200b1d..0806311837 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedTriangles.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RemoveFlaggedTriangles.cpp @@ -84,7 +84,7 @@ Result<> RemoveFlaggedTriangles::operator()() { // Remove Triangles from reduced according to removeTrianglesIndex const auto& originalTriangle = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeometry); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReplaceElementAttributesWithNeighborValues.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReplaceElementAttributesWithNeighborValues.cpp index e7fb389196..f2a535e085 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReplaceElementAttributesWithNeighborValues.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReplaceElementAttributesWithNeighborValues.cpp @@ -93,7 +93,7 @@ struct ExecuteTemplate } template - void operator()(const ImageGeom& imageGeom, IDataArray* inputIDataArray, int32 comparisonAlgorithm, float thresholdValue, bool loopUntilDone, const std::atomic_bool& shouldCancel, + void operator()(const ImageGeom& imageGeom, AbstractDataArray* inputIDataArray, int32 comparisonAlgorithm, float thresholdValue, bool loopUntilDone, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& messageHandler) { const auto& inputStore = inputIDataArray->template getIDataStoreRefAs>(); @@ -212,7 +212,7 @@ struct ExecuteTemplate { for(const auto& [dataId, dataObject] : *attrMatrix) { - auto& dataArray = dynamic_cast(*dataObject); + auto& dataArray = dynamic_cast(*dataObject); dataArray.copyTuple(neighbor, voxelIndex); } } @@ -250,7 +250,7 @@ const std::atomic_bool& ReplaceElementAttributesWithNeighborValues::getCancel() Result<> ReplaceElementAttributesWithNeighborValues::operator()() { - auto* srcIDataArray = m_DataStructure.getDataAs(m_InputValues->InputArrayPath); + auto* srcIDataArray = m_DataStructure.getDataAs(m_InputValues->InputArrayPath); const auto& imageGeom = m_DataStructure.getDataRefAs(m_InputValues->SelectedImageGeometryPath); ExecuteDataFunction(ExecuteTemplate{}, srcIDataArray->getDataType(), imageGeom, srcIDataArray, m_InputValues->SelectedComparison, m_InputValues->MinConfidence, m_InputValues->Loop, m_ShouldCancel, diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinNumNeighbors.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinNumNeighbors.cpp index fe641fc999..05d51cd21e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinNumNeighbors.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinNumNeighbors.cpp @@ -14,7 +14,7 @@ namespace Result<> CopyTupleFromArray(DataStructure& dataStructure, const DataPath& dataArrayPath, const std::vector& badFeatureIdIndexes, const AbstractDataStore& featureIds, const std::vector& neighbors, const IFilter::MessageHandler& mesgHandler) { - auto* voxelArray = dataStructure.getDataAs(dataArrayPath); + auto* voxelArray = dataStructure.getDataAs(dataArrayPath); auto arraySize = voxelArray->getSize(); for(const auto& featureIdIndex : badFeatureIdIndexes) { @@ -70,7 +70,7 @@ Result<> RequireMinNumNeighbors::operator()() // The Cell Attribute Matrix is the parent of the "Feature Ids" array. Always. DataPath cellDataAttrMatrixPath = m_InputValues->FeatureIdsPath.getParent(); - std::optional> result = nx::core::GetAllChildDataPaths(m_DataStructure, cellDataAttrMatrixPath, DataObject::Type::DataArray, m_InputValues->IgnoredVoxelArrayPaths); + std::optional> result = nx::core::GetAllChildDataPaths(m_DataStructure, cellDataAttrMatrixPath, IDataObject::Type::DataArray, m_InputValues->IgnoredVoxelArrayPaths); if(!result.has_value()) { return MakeErrorResult(-5556, fmt::format("Error fetching all Data Arrays from Attribute Matrix '{}'", cellDataAttrMatrixPath.toString())); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinimumSizeFeatures.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinimumSizeFeatures.cpp index 5a0edad7ca..bc2132b67c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinimumSizeFeatures.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RequireMinimumSizeFeatures.cpp @@ -20,7 +20,7 @@ class RequireMinimumSizeFeaturesTransferDataImpl RequireMinimumSizeFeaturesTransferDataImpl(const RequireMinimumSizeFeaturesTransferDataImpl&) = default; RequireMinimumSizeFeaturesTransferDataImpl(RequireMinimumSizeFeatures* filterAlg, usize totalPoints, const Int32AbstractDataStore& featureIds, const std::vector& neighborVoxelIndex, - const std::shared_ptr& dataArrayPtr, MessageHelper& messageHelper, const std::atomic_bool& shouldCancel) + const std::shared_ptr& dataArrayPtr, MessageHelper& messageHelper, const std::atomic_bool& shouldCancel) : m_FilterAlg(filterAlg) , m_TotalPoints(totalPoints) , m_NeighborsVoxelIndex(neighborVoxelIndex) @@ -68,7 +68,7 @@ class RequireMinimumSizeFeaturesTransferDataImpl RequireMinimumSizeFeatures* m_FilterAlg = nullptr; usize m_TotalPoints = 0; std::vector m_NeighborsVoxelIndex; - const std::shared_ptr m_DataArrayPtr; + const std::shared_ptr m_DataArrayPtr; const Int32AbstractDataStore& m_FeatureIds; MessageHelper& m_MessageHelper; const std::atomic_bool& m_ShouldCancel; @@ -245,7 +245,7 @@ void RequireMinimumSizeFeatures::assignBadVoxels(SizeVec3 dimensions, const Int3 messageHelper.sendMessage(fmt::format("Remaining voxels: {} - Updating Data Arrays... ", counter)); // Build up a list of the DataArrays that we are going to operate on. - const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsPath, {}); + const std::vector> voxelArrays = nx::core::GenerateDataArrayList(m_DataStructure, m_InputValues->FeatureIdsPath, {}); ParallelTaskAlgorithm taskRunner; taskRunner.setParallelizationEnabled(true); @@ -262,7 +262,7 @@ void RequireMinimumSizeFeatures::assignBadVoxels(SizeVec3 dimensions, const Int3 } taskRunner.wait(); // This will spill over if the number of DataArrays to process does not divide evenly by the number of threads. // Now update the feature Ids - auto featureIDataArray = m_DataStructure.getSharedDataAs(m_InputValues->FeatureIdsPath); + auto featureIDataArray = m_DataStructure.getSharedDataAs(m_InputValues->FeatureIdsPath); taskRunner.setParallelizationEnabled(false); // Do this to make the next call synchronous taskRunner.execute(RequireMinimumSizeFeaturesTransferDataImpl(this, totalPoints, featureIds, neighborsVoxelIndex, featureIDataArray, messageHelper, m_ShouldCancel)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp index f651009a4e..24f4bfa272 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleImageGeom.cpp @@ -19,7 +19,7 @@ template class ResampleImageGeomArrayImpl { public: - ResampleImageGeomArrayImpl(ResampleImageGeom* algorithm, const IDataArray& srcArray, IDataArray& destArray, const ImageGeom& srcImageGeom, const ImageGeom& destImageGeom, + ResampleImageGeomArrayImpl(ResampleImageGeom* algorithm, const AbstractDataArray& srcArray, AbstractDataArray& destArray, const ImageGeom& srcImageGeom, const ImageGeom& destImageGeom, const std::atomic_bool& shouldCancel) : m_AlgorithmPtr(algorithm) , m_SrcArray(srcArray) @@ -78,8 +78,8 @@ class ResampleImageGeomArrayImpl private: ResampleImageGeom* m_AlgorithmPtr = nullptr; - const IDataArray& m_SrcArray; - IDataArray& m_DestArray; + const AbstractDataArray& m_SrcArray; + AbstractDataArray& m_DestArray; const ImageGeom& m_SrcImageGeom; const ImageGeom& m_DestImageGeom; const std::atomic_bool& m_ShouldCancel; @@ -131,10 +131,10 @@ Result<> ResampleImageGeom::operator()() } arrayIndex++; - const auto& oldDataArray = dynamic_cast(*oldDataObject); + const auto& oldDataArray = dynamic_cast(*oldDataObject); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); - m_MessageHandler(fmt::format("Resampling Data Array: '{}' ({}/{})", srcName, arrayIndex, totalArrays)); + auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); + m_MessageHandler(fmt::format("Resample Volume || Copying Data Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, this, oldDataArray, newDataArray, selectedImageGeom, destImageGeom, m_ShouldCancel); } @@ -183,16 +183,16 @@ Result<> ResampleImageGeom::operator()() // created, so we can use the convenience of the DataArray.deepCopy() function. for(size_t index = 0; index < sourceFeatureDataPaths.size(); index++) { - DataObject* dataObject = m_DataStructure.getData(sourceFeatureDataPaths[index]); - if(dataObject->getDataObjectType() == DataObject::Type::DataArray) + AbstractDataObject* dataObject = m_DataStructure.getData(sourceFeatureDataPaths[index]); + if(dataObject->getDataObjectType() == IDataObject::Type::DataArray) { - auto result = DeepCopy(m_DataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); + auto result = DeepCopy(m_DataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); if(result.invalid()) { return result; } } - else if(dataObject->getDataObjectType() == DataObject::Type::StringArray) + else if(dataObject->getDataObjectType() == IDataObject::Type::StringArray) { auto result = DeepCopy(m_DataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); if(result.invalid()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleRectGridToImageGeom.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleRectGridToImageGeom.cpp index 8343cbc891..11750f252e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleRectGridToImageGeom.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ResampleRectGridToImageGeom.cpp @@ -67,9 +67,9 @@ Result<> ResampleRectGridToImageGeom::operator()() return {}; } - const auto& srcArray = m_DataStructure.getDataRefAs(srcArrayPath); + const auto& srcArray = m_DataStructure.getDataRefAs(srcArrayPath); const std::string srcName = srcArray.getName(); - auto& destDataArray = dynamic_cast(destCellDataAM.at(srcName)); + auto& destDataArray = dynamic_cast(destCellDataAM.at(srcName)); m_MessageHandler(fmt::format("Resample Rect Grid To Image Geom || Copying Data Array {}", srcName)); CopyFromArray::RunParallelMapRectToImage(destDataArray, taskRunner, srcArray, origin, imageGeomDims, imageGeomSpacing, rectGridDims, xGridValues, yGridValues, zGridValues); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.cpp index 3c0afde002..bda1fea0f2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.cpp @@ -24,21 +24,21 @@ const std::atomic_bool& ReshapeDataArray::getCancel() Result<> ReshapeDataArray::operator()() { auto outputArrayPath = m_InputValues->InputArrayPath.getParent().createChildPath(fmt::format(".{}", m_InputValues->InputArrayPath.getTargetName())); - auto& outputArray = m_DataStructure.getDataRefAs(outputArrayPath); + auto& outputArray = m_DataStructure.getDataRefAs(outputArrayPath); std::string arrayTypeName = outputArray.getTypeName(); switch(outputArray.getArrayType()) { - case IArray::ArrayType::DataArray: { + case AbstractArray::ArrayType::DataArray: { return ReshapeArray(m_DataStructure, m_InputValues->InputArrayPath, outputArrayPath, m_MessageHandler); } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { return ReshapeArrayImpl(m_DataStructure, m_InputValues->InputArrayPath, outputArrayPath, m_MessageHandler); } - case IArray::ArrayType::NeighborListArray: { + case AbstractArray::ArrayType::NeighborListArray: { return ReshapeNeighborList(m_DataStructure, m_InputValues->InputArrayPath, outputArrayPath, m_MessageHandler); } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakeErrorResult(to_underlying(ReshapeDataArray::ErrorCodes::InputArrayEqualsAny), "Every array in the input arrays list has array type 'Any'. This SHOULD NOT be possible, so please contact the developers."); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.hpp index 01627a64bb..3b7fd24a9e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ReshapeDataArray.hpp @@ -135,13 +135,13 @@ class SIMPLNXCORE_EXPORT ReshapeDataArray static Result<> ReshapeArray(DataStructure& dataStructure, const DataPath& inputArrayPath, const DataPath& outputArrayPath, const IFilter::MessageHandler& messageHandler) { - const auto& outputDataArray = dataStructure.getDataRefAs(outputArrayPath); + const auto& outputDataArray = dataStructure.getDataRefAs(outputArrayPath); return ExecuteDataFunction(ReshapeDataArrayTemplateImpl{}, outputDataArray.getDataType(), dataStructure, inputArrayPath, outputArrayPath, messageHandler); } static Result<> ReshapeNeighborList(DataStructure& dataStructure, const DataPath& inputArrayPath, const DataPath& outputArrayPath, const IFilter::MessageHandler& messageHandler) { - const auto& outputNeighborList = dataStructure.getDataRefAs(outputArrayPath); + const auto& outputNeighborList = dataStructure.getDataRefAs(outputArrayPath); return ExecuteNeighborFunction(ReshapeNeighborListTemplateImpl{}, outputNeighborList.getDataType(), dataStructure, inputArrayPath, outputArrayPath, messageHandler); } }; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RotateSampleRefFrame.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RotateSampleRefFrame.cpp index f9816530e5..386716c8ad 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RotateSampleRefFrame.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/RotateSampleRefFrame.cpp @@ -88,8 +88,8 @@ Result<> RotateSampleRefFrame::operator()() return {}; } - const auto* srcDataArray = m_DataStructure.getDataAs(srcCelLDataAMPath.createChildPath(srcDataObject->getName())); - auto* destDataArray = m_DataStructure.getDataAs(destCellDataAMPath.createChildPath(srcDataObject->getName())); + const auto* srcDataArray = m_DataStructure.getDataAs(srcCelLDataAMPath.createChildPath(srcDataObject->getName())); + auto* destDataArray = m_DataStructure.getDataAs(destCellDataAMPath.createChildPath(srcDataObject->getName())); m_MessageHandler(fmt::format("Rotating Volume || Copying Data Array {}", srcDataObject->getName())); ExecuteParallelFunction(srcDataArray->getDataType(), taskRunner, srcDataArray, destDataArray, rotateArgs, rotationMatrix, diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.cpp index 51805d1765..da35daf043 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.cpp @@ -3,7 +3,7 @@ #include #include "simplnx/DataStructure/DataStore.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" using namespace nx::core; @@ -23,13 +23,13 @@ constexpr int64 k_MissingOrIncorrectGoodVoxelsArray = -602; /** * @brief The TSpecificCompareFunctorBool class extends @see CompareFunctor to compare boolean data */ -class TSpecificCompareFunctorBool : public SegmentFeatures::CompareFunctor +class TSpecificCompareFunctorBool : public ISegmentFeatures::CompareFunctor { public: using DataArrayType = BoolArray; CX_DEFAULT_CONSTRUCTORS(TSpecificCompareFunctorBool) - TSpecificCompareFunctorBool(IDataArray* data, int64 length, AbstractDataStore* featureIds) + TSpecificCompareFunctorBool(AbstractDataArray* data, int64 length, AbstractDataStore* featureIds) : m_Length(length) , m_FeatureIdsArray(featureIds) , m_Data(dynamic_cast(data)) @@ -64,7 +64,7 @@ class TSpecificCompareFunctorBool : public SegmentFeatures::CompareFunctor * @brief The TSpecificCompareFunctor class extens @see CompareFunctor to compare templated data */ template -class TSpecificCompareFunctor : public SegmentFeatures::CompareFunctor +class TSpecificCompareFunctor : public ISegmentFeatures::CompareFunctor { public: CX_DEFAULT_CONSTRUCTORS(TSpecificCompareFunctor) @@ -72,7 +72,7 @@ class TSpecificCompareFunctor : public SegmentFeatures::CompareFunctor using DataArrayType = DataArray; using DataStoreType = AbstractDataStore; - TSpecificCompareFunctor(IDataArray* data, int64 length, T tolerance, AbstractDataStore* featureIds) + TSpecificCompareFunctor(AbstractDataArray* data, int64 length, T tolerance, AbstractDataStore* featureIds) : m_Length(length) , m_Tolerance(tolerance) , m_FeatureIdsArray(featureIds) @@ -119,7 +119,7 @@ class TSpecificCompareFunctor : public SegmentFeatures::CompareFunctor ScalarSegmentFeatures::ScalarSegmentFeatures(DataStructure& dataStructure, ScalarSegmentFeaturesInputValues* inputValues, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler) -: SegmentFeatures(dataStructure, shouldCancel, mesgHandler) +: AbstractSegmentFeatures(dataStructure, shouldCancel, mesgHandler) , m_InputValues(inputValues) { m_IsPeriodic = inputValues->IsPeriodic; @@ -145,11 +145,11 @@ Result<> ScalarSegmentFeatures::operator()() } } - auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); + auto* gridGeom = m_DataStructure.getDataAs(m_InputValues->ImageGeometryPath); m_FeatureIdsArray = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath); - auto* inputDataArray = m_DataStructure.getDataAs(m_InputValues->InputDataPath); + auto* inputDataArray = m_DataStructure.getDataAs(m_InputValues->InputDataPath); size_t inDataPoints = inputDataArray->getNumberOfTuples(); nx::core::DataType dataType = inputDataArray->getDataType(); @@ -206,7 +206,7 @@ Result<> ScalarSegmentFeatures::operator()() } if(inputDataArray->getNumberOfComponents() != 1) { - m_CompareFunctor = std::make_shared(); // The default CompareFunctor which ALWAYS returns false for the comparison + m_CompareFunctor = std::make_shared(); // The default CompareFunctor which ALWAYS returns false for the comparison } // Run the segmentation algorithm diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.hpp index 6a1393eeae..1be177a220 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.hpp @@ -2,13 +2,13 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" +#include "simplnx/Utilities/AbstractSegmentFeatures.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" -#include "simplnx/Utilities/SegmentFeatures.hpp" #include #include @@ -22,7 +22,7 @@ struct SIMPLNXCORE_EXPORT ScalarSegmentFeaturesInputValues bool UseMask; bool RandomizeFeatureIds; bool IsPeriodic = false; - SegmentFeatures::NeighborScheme NeighborScheme; + ISegmentFeatures::NeighborScheme NeighborScheme; DataPath ImageGeometryPath; DataPath InputDataPath; DataPath MaskArrayPath; @@ -34,7 +34,7 @@ struct SIMPLNXCORE_EXPORT ScalarSegmentFeaturesInputValues /** * @brief The ScalarSegmentFeatures class */ -class SIMPLNXCORE_EXPORT ScalarSegmentFeatures : public SegmentFeatures +class SIMPLNXCORE_EXPORT ScalarSegmentFeatures : public AbstractSegmentFeatures { public: using FeatureIdsArrayType = Int32Array; @@ -76,7 +76,7 @@ class SIMPLNXCORE_EXPORT ScalarSegmentFeatures : public SegmentFeatures const ScalarSegmentFeaturesInputValues* m_InputValues = nullptr; FeatureIdsArrayType* m_FeatureIdsArray = nullptr; GoodVoxelsArrayType* m_GoodVoxelsArray = nullptr; - std::shared_ptr m_CompareFunctor; - std::unique_ptr m_GoodVoxels = nullptr; + std::shared_ptr m_CompareFunctor; + std::unique_ptr m_GoodVoxels = nullptr; }; } // namespace nx::core diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/Silhouette.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/Silhouette.cpp index 5b61ed32e3..97ba053dbc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/Silhouette.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/Silhouette.cpp @@ -26,7 +26,7 @@ class SilhouetteTemplate return Pointer(static_cast(nullptr)); } - SilhouetteTemplate(const IDataArray& inputIDataArray, Float64AbstractDataStore& outputDataArray, const std::unique_ptr& maskDataArray, usize numClusters, + SilhouetteTemplate(const AbstractDataArray& inputIDataArray, Float64AbstractDataStore& outputDataArray, const std::unique_ptr& maskDataArray, usize numClusters, const Int32AbstractDataStore& featureIds, ClusterUtilities::DistanceMetric distMetric) : m_InputData(inputIDataArray.template getIDataStoreRefAs()) , m_OutputData(outputDataArray) @@ -125,7 +125,7 @@ class SilhouetteTemplate const AbstractDataStoreT& m_InputData; Float64AbstractDataStore& m_OutputData; const Int32AbstractDataStore& m_FeatureIds; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; usize m_NumClusters; ClusterUtilities::DistanceMetric m_DistMetric; }; @@ -167,8 +167,8 @@ Result<> Silhouette::operator()() uniqueIds.insert(featureIds[i]); } - auto& clusteringArray = m_DataStructure.getDataRefAs(m_InputValues->ClusteringArrayPath); - std::unique_ptr maskCompare; + auto& clusteringArray = m_DataStructure.getDataRefAs(m_InputValues->ClusteringArrayPath); + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(m_DataStructure, m_InputValues->MaskArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.cpp index 94a51b5f73..e4ef448492 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.cpp @@ -67,8 +67,8 @@ Result<> SliceTriangleGeometry::operator()() auto& edgeGeom = m_DataStructure.getDataRefAs(m_InputValues->SliceDataContainerName); edgeGeom.resizeVertexList(numVerts); edgeGeom.resizeEdgeList(numEdges); - INodeGeometry0D::SharedVertexList& verts = edgeGeom.getVerticesRef(); - INodeGeometry1D::SharedEdgeList& edges = edgeGeom.getEdgesRef(); + AbstractNodeGeometry0D::SharedVertexList& verts = edgeGeom.getVerticesRef(); + AbstractNodeGeometry1D::SharedEdgeList& edges = edgeGeom.getEdgesRef(); edgeGeom.getVertexAttributeMatrix()->resizeTuples({numVerts}); edgeGeom.getEdgeAttributeMatrix()->resizeTuples({numEdges}); auto& sliceAM = m_DataStructure.getDataRefAs(m_InputValues->SliceDataContainerName.createChildPath(m_InputValues->SliceAttributeMatrixName)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.hpp index 80373134fc..b518f40c5e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SliceTriangleGeometry.hpp @@ -4,7 +4,7 @@ #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" #include "simplnx/Parameters/DataGroupCreationParameter.hpp" @@ -56,8 +56,8 @@ class SIMPLNXCORE_EXPORT SliceTriangleGeometry const std::atomic_bool& getCancel(); protected: - using TriStore = AbstractDataStore; - using VertsStore = AbstractDataStore; + using TriStore = AbstractDataStore; + using VertsStore = AbstractDataStore; private: DataStructure& m_DataStructure; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByComponent.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByComponent.cpp index 3a68cd98b3..408be20382 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByComponent.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByComponent.cpp @@ -11,7 +11,7 @@ namespace struct SplitArraysFunctor { template - void operator()(DataStructure& dataStructure, const IDataArray* inputIDataArray, const SplitDataArrayByComponentInputValues* inputValues) + void operator()(DataStructure& dataStructure, const AbstractDataArray* inputIDataArray, const SplitDataArrayByComponentInputValues* inputValues) { const auto& inputStore = inputIDataArray->template getIDataStoreRefAs>(); usize numTuples = inputStore.getNumberOfTuples(); @@ -53,7 +53,7 @@ const std::atomic_bool& SplitDataArrayByComponent::getCancel() // ----------------------------------------------------------------------------- Result<> SplitDataArrayByComponent::operator()() { - auto* inputArray = m_DataStructure.getDataAs(m_InputValues->InputArrayPath); + auto* inputArray = m_DataStructure.getDataAs(m_InputValues->InputArrayPath); ExecuteDataFunction(SplitArraysFunctor{}, inputArray->getDataType(), m_DataStructure, inputArray, m_InputValues); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByTuple.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByTuple.cpp index 58fa59fbeb..2f1caf7104 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByTuple.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SplitDataArrayByTuple.cpp @@ -183,7 +183,7 @@ struct SplitNeighborListsTemplateImpl Result<> SplitArraysByTuple(DataStructure& dataStructure, const DataPath& inputArrayPath, const std::vector& outputArrayPaths, usize splitDimension, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { - const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPath); + const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPath); Result<> result; ExecuteDataFunction(SplitDataArraysTemplateImpl{}, inputDataArray.getDataType(), dataStructure, inputArrayPath, outputArrayPaths, splitDimension, messageHandler, shouldCancel, result); return result; @@ -192,7 +192,7 @@ Result<> SplitArraysByTuple(DataStructure& dataStructure, const DataPath& inputA Result<> SplitNeighborLists(DataStructure& dataStructure, const DataPath& inputArrayPath, const std::vector& outputArrayPaths, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { - const auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPath); + const auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPath); Result<> result; ExecuteNeighborFunction(SplitNeighborListsTemplateImpl{}, inputNeighborList.getDataType(), dataStructure, inputArrayPath, outputArrayPaths, messageHandler, shouldCancel, result); return result; @@ -221,20 +221,20 @@ const std::atomic_bool& SplitDataArrayByTuple::getCancel() // ----------------------------------------------------------------------------- Result<> SplitDataArrayByTuple::operator()() { - const auto& inputDataArray = m_DataStructure.getDataRefAs(m_InputValues->InputArrayPath); + const auto& inputDataArray = m_DataStructure.getDataRefAs(m_InputValues->InputArrayPath); std::string arrayTypeName = inputDataArray.getTypeName(); switch(inputDataArray.getArrayType()) { - case IArray::ArrayType::DataArray: { + case AbstractArray::ArrayType::DataArray: { return SplitArraysByTuple(m_DataStructure, m_InputValues->InputArrayPath, m_InputValues->OutputArrayPaths, m_InputValues->SplitDimension, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { return SplitArraysByTupleImpl(m_DataStructure, m_InputValues->InputArrayPath, m_InputValues->OutputArrayPaths, m_InputValues->SplitDimension, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::NeighborListArray: { + case AbstractArray::ArrayType::NeighborListArray: { return SplitNeighborLists(m_DataStructure, m_InputValues->InputArrayPath, m_InputValues->OutputArrayPaths, m_MessageHandler, m_ShouldCancel); } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakeErrorResult(to_underlying(SplitDataArrayByTuple::ErrorCodes::AnyArrayType), fmt::format("The input array '{}' has array type 'Any'. This SHOULD NOT be possible, so please contact the developers.", m_InputValues->InputArrayPath.toString())); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SurfaceNets.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SurfaceNets.cpp index a0364a4aa7..3f770bca81 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SurfaceNets.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SurfaceNets.cpp @@ -435,7 +435,7 @@ Result<> SurfaceNets::operator()() { return MakeErrorResult(-56331, fmt::format("Unable to generate the connectivity list for {} geometry.", triangleGeom.getName())); } - const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); + const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); m_MessageHandler("Repairing Windings..."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TriangleCentroid.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TriangleCentroid.cpp index d738b941a9..726b90e9df 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TriangleCentroid.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TriangleCentroid.cpp @@ -1,7 +1,7 @@ #include "TriangleCentroid.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Utilities/Math/MatrixMath.hpp" #include "simplnx/Utilities/ParallelDataAlgorithm.hpp" diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp index 00930bf65f..97e85422da 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.cpp @@ -5,7 +5,7 @@ namespace nx::core void AddTupleTransferInstance(DataStructure& dataStructure, const DataPath& selectedDataPath, const DataPath& createdDataPath, std::vector>& tupleTransferFunctions) { - auto* inputDataArray = dataStructure.getDataAs(selectedDataPath); + auto* inputDataArray = dataStructure.getDataAs(selectedDataPath); switch(inputDataArray->getDataType()) { @@ -59,7 +59,7 @@ void AddTupleTransferInstance(DataStructure& dataStructure, const DataPath& sele void AddFeatureTupleTransferInstance(DataStructure& dataStructure, const DataPath& selectedDataPath, const DataPath& createdDataPath, const DataPath& featureIdsArrayPath, std::vector>& tupleTransferFunctions) { - auto* inputDataArray = dataStructure.getDataAs(selectedDataPath); + auto* inputDataArray = dataStructure.getDataAs(selectedDataPath); switch(inputDataArray->getDataType()) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.hpp index adb92820cb..b92192e575 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/TupleTransfer.hpp @@ -76,7 +76,7 @@ class TransferTuple : public AbstractTupleTransfer m_SourceDataPath = selectedDataPath; m_DestinationDataPath = createdArrayPath; - IDataArray* cellArrayPtr = dataStructure.template getDataAs(m_SourceDataPath); + AbstractDataArray* cellArrayPtr = dataStructure.template getDataAs(m_SourceDataPath); m_NumComps = cellArrayPtr->getNumberOfComponents(); } @@ -181,7 +181,7 @@ class TransferFeatureTuple : public AbstractTupleTransfer m_SourceDataPath = selectedDataPath; m_DestinationDataPath = createdArrayPath; - IDataArray* cellArrayPtr = dataStructure.template getDataAs(m_SourceDataPath); + AbstractDataArray* cellArrayPtr = dataStructure.template getDataAs(m_SourceDataPath); m_NumComps = cellArrayPtr->getNumberOfComponents(); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/VerifyTriangleWinding.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/VerifyTriangleWinding.cpp index 63f6207847..0fedaf5e56 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/VerifyTriangleWinding.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/VerifyTriangleWinding.cpp @@ -48,7 +48,7 @@ class ReverseWindingImpl } // Flip it - const IGeometry::MeshIndexType tempValue = m_Triangles[(i * 3) + 0]; + const AbstractGeometry::MeshIndexType tempValue = m_Triangles[(i * 3) + 0]; m_Triangles[(i * 3) + 0] = m_Triangles[(i * 3) + 2]; m_Triangles[(i * 3) + 2] = tempValue; break; @@ -74,7 +74,7 @@ class ReverseWindingImpl } // Flip it - const IGeometry::MeshIndexType tempValue = m_Triangles[(i * 3) + 0]; + const AbstractGeometry::MeshIndexType tempValue = m_Triangles[(i * 3) + 0]; m_Triangles[(i * 3) + 0] = m_Triangles[(i * 3) + 2]; m_Triangles[(i * 3) + 2] = tempValue; break; @@ -156,7 +156,7 @@ Result<> VerifyTriangleWinding::operator()() { return MakeErrorResult(-56321, fmt::format("Unable to generate the connectivity list for {} geometry.", triGeom.getName())); } - const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); + const auto& connectivity = m_DataStructure.getDataRefAs(optionalId.value()); m_MessageHandler("Repairing Windings..."); // This is reused since it may contain warnings @@ -179,7 +179,7 @@ Result<> VerifyTriangleWinding::operator()() maxFeature = std::max(idsStore[i], maxFeature); } - std::vector volumes(maxFeature + 1); + std::vector volumes(maxFeature + 1); auto volumeResult = MeshingUtilities::CalculateFeatureVolumes(triangles, triGeom.getVertices()->getDataStoreRef(), idsStore, volumes, m_ShouldCancel); if(volumeResult.invalid()) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoRectilinearCoordinate.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoRectilinearCoordinate.cpp index 9dd463ce38..782cf878ed 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoRectilinearCoordinate.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoRectilinearCoordinate.cpp @@ -84,7 +84,7 @@ Result<> WriteAvizoRectilinearCoordinate::writeData(FILE* outputFile) const fprintf(outputFile, "@1 # FeatureIds in z, y, x with X moving fastest, then Y, then Z\n"); - const auto& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs>(); + const auto& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs>(); const usize totalPoints = featureIds.getNumberOfTuples(); if(m_InputValues->WriteBinaryFile) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoUniformCoordinate.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoUniformCoordinate.cpp index 0ac3f5d4f1..0a4c278b64 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoUniformCoordinate.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAvizoUniformCoordinate.cpp @@ -87,7 +87,7 @@ Result<> WriteAvizoUniformCoordinate::writeData(FILE* outputFile) const { fprintf(outputFile, "@1\n"); - const auto& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs>(); + const auto& featureIds = m_DataStructure.getDataAs(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs>(); const usize totalPoints = featureIds.getNumberOfTuples(); if(m_InputValues->WriteBinaryFile) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteNodesAndElementsFiles.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteNodesAndElementsFiles.cpp index bd0988c34d..ba42f72379 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteNodesAndElementsFiles.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteNodesAndElementsFiles.cpp @@ -108,7 +108,7 @@ void WriteNodesAndElementsFiles::sendMessage(const std::string& message) // ----------------------------------------------------------------------------- Result<> WriteNodesAndElementsFiles::operator()() { - auto& iNodeGeometry = m_DataStructure.getDataRefAs(m_InputValues->SelectedGeometryPath); + auto& iNodeGeometry = m_DataStructure.getDataRefAs(m_InputValues->SelectedGeometryPath); auto geomType = iNodeGeometry.getGeomType(); UInt64Array* cellsArray = nullptr; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteStlFile.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteStlFile.cpp index ac43e70dde..3808581f20 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteStlFile.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteStlFile.cpp @@ -19,8 +19,8 @@ using namespace nx::core; namespace { -using TriStore = AbstractDataStore; -using VertexStore = AbstractDataStore; +using TriStore = AbstractDataStore; +using VertexStore = AbstractDataStore; struct LimitBoundAtomicFileFactory; @@ -72,8 +72,8 @@ struct LimitBoundAtomicFileFactory } }; -Result<> SingleWriteOutStl(WriteStlFile* filter, const fs::path& path, const IGeometry::MeshIndexType endValue, std::string header, const TriStore& triangles, const VertexStore& vertices, - const std::atomic_bool& shouldCancel, const IGeometry::MeshIndexType startValue = 0) +Result<> SingleWriteOutStl(WriteStlFile* filter, const fs::path& path, const AbstractGeometry::MeshIndexType endValue, std::string header, const TriStore& triangles, const VertexStore& vertices, + const std::atomic_bool& shouldCancel, const AbstractGeometry::MeshIndexType startValue = 0) { Result<> result; @@ -126,7 +126,7 @@ Result<> SingleWriteOutStl(WriteStlFile* filter, const fs::path& path, const IGe attrByteCountPtr[0] = 0; // Loop over all the triangles for this spin - for(IGeometry::MeshIndexType triangle = startValue; triangle < endValue; ++triangle) + for(AbstractGeometry::MeshIndexType triangle = startValue; triangle < endValue; ++triangle) { if(shouldCancel) { @@ -137,9 +137,9 @@ Result<> SingleWriteOutStl(WriteStlFile* filter, const fs::path& path, const IGe } // Get the true indices of the 3 nodes - IGeometry::MeshIndexType nId0 = triangles[triangle * 3]; - IGeometry::MeshIndexType nId1 = triangles[triangle * 3 + 1]; - IGeometry::MeshIndexType nId2 = triangles[triangle * 3 + 2]; + AbstractGeometry::MeshIndexType nId0 = triangles[triangle * 3]; + AbstractGeometry::MeshIndexType nId1 = triangles[triangle * 3 + 1]; + AbstractGeometry::MeshIndexType nId2 = triangles[triangle * 3 + 2]; vert1Ptr[0] = static_cast(vertices[nId0 * 3]); vert1Ptr[1] = static_cast(vertices[nId0 * 3 + 1]); @@ -185,8 +185,8 @@ Result<> SingleWriteOutStl(WriteStlFile* filter, const fs::path& path, const IGe class SingleOutWrapper { public: - SingleOutWrapper(WriteStlFile* filter, const fs::path& path, const IGeometry::MeshIndexType endValue, std::string header, const TriStore& triangles, const VertexStore& vertices, - const IGeometry::MeshIndexType startValue, const std::atomic_bool& shouldCancel) + SingleOutWrapper(WriteStlFile* filter, const fs::path& path, const AbstractGeometry::MeshIndexType endValue, std::string header, const TriStore& triangles, const VertexStore& vertices, + const AbstractGeometry::MeshIndexType startValue, const std::atomic_bool& shouldCancel) : m_Filter(filter) , m_Path(path) , m_EndValue(endValue) @@ -207,11 +207,11 @@ class SingleOutWrapper private: WriteStlFile* m_Filter = nullptr; const fs::path m_Path; - const IGeometry::MeshIndexType m_EndValue; + const AbstractGeometry::MeshIndexType m_EndValue; std::string m_Header; const TriStore& m_Triangles; const VertexStore& m_Vertices; - const IGeometry::MeshIndexType m_StartValue; + const AbstractGeometry::MeshIndexType m_StartValue; const std::atomic_bool& m_ShouldCancel; }; @@ -221,7 +221,7 @@ class SingleOutWrapper class MultiWriteStlFileImpl { public: - MultiWriteStlFileImpl(WriteStlFile* filter, LimitBoundAtomicFile& limitBoundAtomicFile, const IGeometry::MeshIndexType endValue, const std::string header, const TriStore& triangles, + MultiWriteStlFileImpl(WriteStlFile* filter, LimitBoundAtomicFile& limitBoundAtomicFile, const AbstractGeometry::MeshIndexType endValue, const std::string header, const TriStore& triangles, const VertexStore& vertices, const Int32AbstractDataStore& featureIds, const int32 featureId, const usize maxTriangles, const std::atomic_bool& shouldCancel) : m_Filter(filter) , m_LimitBoundAtomicFile(limitBoundAtomicFile) @@ -297,7 +297,7 @@ class MultiWriteStlFileImpl const usize numComps = m_FeatureIds.getNumberOfComponents(); // Loop over all the triangles for this spin - for(IGeometry::MeshIndexType triangle = startValue; triangle < m_EndValue; triangle++) + for(AbstractGeometry::MeshIndexType triangle = startValue; triangle < m_EndValue; triangle++) { if(m_ShouldCancel) { @@ -330,9 +330,9 @@ class MultiWriteStlFileImpl } // Get the true indices of the 3 nodes - IGeometry::MeshIndexType nId0 = m_Triangles[triangle * 3]; - IGeometry::MeshIndexType nId1 = m_Triangles[triangle * 3 + 1]; - IGeometry::MeshIndexType nId2 = m_Triangles[triangle * 3 + 2]; + AbstractGeometry::MeshIndexType nId0 = m_Triangles[triangle * 3]; + AbstractGeometry::MeshIndexType nId1 = m_Triangles[triangle * 3 + 1]; + AbstractGeometry::MeshIndexType nId2 = m_Triangles[triangle * 3 + 2]; if(m_FeatureIds[triangle * numComps] == m_FeatureId) { @@ -341,7 +341,7 @@ class MultiWriteStlFileImpl else if(numComps > 1 && m_FeatureIds[triangle * numComps + 1] == m_FeatureId) { // Switch the 2 node indices - IGeometry::MeshIndexType temp = nId1; + AbstractGeometry::MeshIndexType temp = nId1; nId1 = nId2; nId2 = temp; } @@ -393,7 +393,7 @@ class MultiWriteStlFileImpl private: WriteStlFile* m_Filter = nullptr; LimitBoundAtomicFile& m_LimitBoundAtomicFile; - const IGeometry::MeshIndexType m_EndValue; + const AbstractGeometry::MeshIndexType m_EndValue; const std::string m_Header; const TriStore& m_Triangles; const VertexStore& m_Vertices; @@ -403,7 +403,7 @@ class MultiWriteStlFileImpl const std::atomic_bool& m_ShouldCancel; }; -Result<> ExecuteSingleFileOverflow(WriteStlFile* filter, const IGeometry::MeshIndexType nTriangles, const std::string& header, const fs::path& firstFile, const TriStore& triangles, +Result<> ExecuteSingleFileOverflow(WriteStlFile* filter, const AbstractGeometry::MeshIndexType nTriangles, const std::string& header, const fs::path& firstFile, const TriStore& triangles, const VertexStore& vertices, const usize maxTriangles, const std::atomic_bool& shouldCancel) { const usize count = nTriangles / maxTriangles; @@ -484,7 +484,7 @@ Result<> WriteStlFile::operator()() const auto& triangleGeom = m_DataStructure.getDataRefAs(m_InputValues->TriangleGeomPath); const ::VertexStore& vertices = triangleGeom.getVertices()->getDataStoreRef(); const ::TriStore& triangles = triangleGeom.getFaces()->getDataStoreRef(); - const IGeometry::MeshIndexType nTriangles = triangleGeom.getNumberOfFaces(); + const AbstractGeometry::MeshIndexType nTriangles = triangleGeom.getNumberOfFaces(); auto groupingType = static_cast(m_InputValues->GroupingType); @@ -587,7 +587,7 @@ Result<> WriteStlFile::operator()() std::map uniqueGrainIdToPhase; const auto& featurePhases = m_DataStructure.getDataRefAs(m_InputValues->FeaturePhasesPath); - for(IGeometry::MeshIndexType i = 0; i < nTriangles; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < nTriangles; i++) { uniqueGrainIdToPhase.emplace(featureIds[i * 2], featurePhases[i * 2]); uniqueGrainIdToPhase.emplace(featureIds[i * 2 + 1], featurePhases[i * 2 + 1]); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.cpp index 5ccf4c518f..a288629aee 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.cpp @@ -69,7 +69,7 @@ Result<> WriteVtkRectilinearGrid::operator()() for(const DataPath& arrayPath : m_InputValues->SelectedDataArrayPaths) { - ExecuteDataFunction(WriteVtkDataArrayFunctor{}, m_DataStructure.getDataAs(arrayPath)->getDataType(), outputFile, m_InputValues->WriteBinaryFile, m_DataStructure, arrayPath, + ExecuteDataFunction(WriteVtkDataArrayFunctor{}, m_DataStructure.getDataAs(arrayPath)->getDataType(), outputFile, m_InputValues->WriteBinaryFile, m_DataStructure, arrayPath, m_MessageHandler); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.hpp index 2ac2a4f08a..a8a99762eb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkRectilinearGrid.hpp @@ -11,7 +11,7 @@ namespace nx::core { class ImageGeom; -class IDataArray; +class AbstractDataArray; struct SIMPLNXCORE_EXPORT WriteVtkRectilinearGridInputValues { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.cpp index cec378e608..e611e6fe8b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.cpp @@ -66,7 +66,7 @@ Result<> WriteVtkStructuredPoints::operator()() for(const auto& arrayPath : m_InputValues->SelectedDataArrayPaths) { m_MessageHandler({nx::core::IFilter::Message::Type::Info, fmt::format("Writing {}", arrayPath.toString())}); - auto& dataArray = m_DataStructure.getDataRefAs(arrayPath); + auto& dataArray = m_DataStructure.getDataRefAs(arrayPath); result = MergeResults(result, ExecuteNeighborFunction(WriteVtkDataFunctor{}, dataArray.getDataType(), outStrm, dataArray, m_InputValues->WriteBinaryFile, m_MessageHandler, m_ShouldCancel)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.hpp index f454794fc2..cea8756b3e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteVtkStructuredPoints.hpp @@ -11,7 +11,7 @@ namespace nx::core { class ImageGeom; -class IDataArray; +class AbstractDataArray; struct SIMPLNXCORE_EXPORT WriteVtkStructuredPointsInputValues { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.cpp index c7686c8bae..e06485afa1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.cpp @@ -49,7 +49,7 @@ std::vector AlignGeometriesFilter::defaultTags() const //------------------------------------------------------------------------------ Parameters AlignGeometriesFilter::parameters() const { - GeometrySelectionParameter::AllowedTypes geomTypes = IGeometry::GetAllGeomTypes(); + GeometrySelectionParameter::AllowedTypes geomTypes = AbstractGeometry::GetAllGeomTypes(); Parameters params; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.hpp index 4dbb4ecc58..22a990ec2a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignGeometriesFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT AlignGeometriesFilter : public IFilter +class SIMPLNXCORE_EXPORT AlignGeometriesFilter : public AbstractFilter { public: AlignGeometriesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsFeatureCentroidFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsFeatureCentroidFilter.hpp index 2a5ba3a1ce..b9f9abefee 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsFeatureCentroidFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsFeatureCentroidFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT AlignSectionsFeatureCentroidFilter : public IFilter +class SIMPLNXCORE_EXPORT AlignSectionsFeatureCentroidFilter : public AbstractFilter { public: AlignSectionsFeatureCentroidFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.cpp index abfd83ef6b..b877ef918b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.cpp @@ -117,7 +117,7 @@ IFilter::PreflightResult AlignSectionsListFilter::preflightImpl(const DataStruct if(!pUseFileValue) { - const auto* shiftsArray = dataStructure.getDataAs(pShiftsArrayPathValue); + const auto* shiftsArray = dataStructure.getDataAs(pShiftsArrayPathValue); if(shiftsArray == nullptr) { return MakePreflightErrorResult(-8942, "Shifts array is not valid."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.hpp index 45b5d396aa..3cc5561239 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AlignSectionsListFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class AlignSectionsListFilter * @brief This filter will apply the cell shifts from a user specified txt file to each section of the Image Geometry */ -class SIMPLNXCORE_EXPORT AlignSectionsListFilter : public IFilter +class SIMPLNXCORE_EXPORT AlignSectionsListFilter : public AbstractFilter { public: AlignSectionsListFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.cpp index a26106d072..7079b6bfbe 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.cpp @@ -153,12 +153,12 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru } } - IGeometry::LengthUnit inputUnits = inputGeometry.getUnits(); - IGeometry::LengthUnit destUnits = destGeometry.getUnits(); + AbstractGeometry::LengthUnit inputUnits = inputGeometry.getUnits(); + AbstractGeometry::LengthUnit destUnits = destGeometry.getUnits(); if(inputUnits != destUnits) { resultOutputActions.warnings().push_back( - Warning{-8310, fmt::format("Input units ({}) not equal to Destination units ({}).", IGeometry::LengthUnitToString(inputUnits), IGeometry::LengthUnitToString(destUnits))}); + Warning{-8310, fmt::format("Input units ({}) not equal to Destination units ({}).", AbstractGeometry::LengthUnitToString(inputUnits), AbstractGeometry::LengthUnitToString(destUnits))}); } switch(pDirection) @@ -224,29 +224,29 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru auto inputDataArrayPath = inputCellDataPath.createChildPath(name); auto destDataArrayPath = destCellDataPath.createChildPath(name); - auto inputDataArray = dataStructure.getDataAs(inputDataArrayPath); - auto destDataArray = dataStructure.getDataAs(destDataArrayPath); + auto inputDataArray = dataStructure.getDataAs(inputDataArrayPath); + auto destDataArray = dataStructure.getDataAs(destDataArrayPath); if(inputDataArray == nullptr && dataStructure.containsData(inputDataArrayPath)) { resultOutputActions.warnings().push_back( - {-8206, fmt::format("Cannot append data array {} in cell data attribute matrix at path '{}' because it is not of type IArray.", name, inputCellDataPath.toString())}); + {-8206, fmt::format("Cannot append data array {} in cell data attribute matrix at path '{}' because it is not of type AbstractArray.", name, inputCellDataPath.toString())}); continue; } if(destDataArray == nullptr && dataStructure.containsData(destDataArrayPath)) { resultOutputActions.warnings().push_back( - {-8207, fmt::format("Cannot append data array {} in cell data attribute matrix at path '{}' because it is not of type IArray.", name, destCellDataPath.toString())}); + {-8207, fmt::format("Cannot append data array {} in cell data attribute matrix at path '{}' because it is not of type AbstractArray.", name, destCellDataPath.toString())}); continue; } if(inputDataArray != nullptr && destDataArray != nullptr) { - const IArray::ArrayType arrayType = destDataArray->getArrayType(); + const AbstractArray::ArrayType arrayType = destDataArray->getArrayType(); if(arrayType != inputDataArray->getArrayType()) { - const std::string inputArrayStr = *IArray::StringListFromArrayType({inputDataArray->getArrayType()}).begin(); - const std::string destArrayStr = *IArray::StringListFromArrayType({arrayType}).begin(); + const std::string inputArrayStr = *AbstractArray::StringListFromArrayType({inputDataArray->getArrayType()}).begin(); + const std::string destArrayStr = *AbstractArray::StringListFromArrayType({arrayType}).begin(); resultOutputActions.warnings().push_back({-8208, fmt::format("Cannot append data from input data object of array type {} to destination data object of array type {} because " "the array types do not match.", inputArrayStr, destArrayStr)}); @@ -261,10 +261,10 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru continue; } - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - DataType dataType1 = dynamic_cast(inputDataArray)->getDataType(); - DataType dataType2 = dynamic_cast(destDataArray)->getDataType(); + DataType dataType1 = dynamic_cast(inputDataArray)->getDataType(); + DataType dataType2 = dynamic_cast(destDataArray)->getDataType(); if(dataType1 != dataType2) { resultOutputActions.warnings().push_back( @@ -274,10 +274,10 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru } } - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - DataType dataType1 = dynamic_cast(inputDataArray)->getDataType(); - DataType dataType2 = dynamic_cast(destDataArray)->getDataType(); + DataType dataType1 = dynamic_cast(inputDataArray)->getDataType(); + DataType dataType2 = dynamic_cast(destDataArray)->getDataType(); if(dataType1 != dataType2) { resultOutputActions.warnings().push_back( @@ -299,10 +299,10 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru auto arrayType = inputDataArray != nullptr ? inputDataArray->getArrayType() : destDataArray->getArrayType(); auto destGeomDimsVec = destGeomDims.toContainer>(); std::vector destCellDataDims(destGeomDimsVec.rbegin(), destGeomDimsVec.rend()); - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - auto inputIDataArray = dataStructure.getDataAs(inputDataArrayPath); - auto destIDataArray = dataStructure.getDataAs(destDataArrayPath); + auto inputIDataArray = dataStructure.getDataAs(inputDataArrayPath); + auto destIDataArray = dataStructure.getDataAs(destDataArrayPath); auto dataType = inputIDataArray != nullptr ? inputIDataArray->getDataType() : destIDataArray->getDataType(); auto compShape = inputDataArray != nullptr ? inputDataArray->getComponentShape() : destDataArray->getComponentShape(); auto cellDataDims = pSaveAsNewGeometry ? newCellDataDims : destCellDataDims; @@ -310,17 +310,17 @@ IFilter::PreflightResult AppendImageGeometryFilter::preflightImpl(const DataStru auto createArrayAction = std::make_unique(dataType, cellDataDims, compShape, cellArrayPath, "", pDefaultValue); resultOutputActions.value().appendAction(std::move(createArrayAction)); } - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - auto inputINeighborlist = dataStructure.getDataAs(inputDataArrayPath); - auto destINeighborlist = dataStructure.getDataAs(destDataArrayPath); + auto inputINeighborlist = dataStructure.getDataAs(inputDataArrayPath); + auto destINeighborlist = dataStructure.getDataAs(destDataArrayPath); auto dataType = inputINeighborlist != nullptr ? inputINeighborlist->getDataType() : destINeighborlist->getDataType(); auto cellDataDims = pSaveAsNewGeometry ? newCellDataDims : destCellDataDims; auto cellArrayPath = pSaveAsNewGeometry ? newArrayPath : destArrayPath; auto createArrayAction = std::make_unique(dataType, cellDataDims, cellArrayPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); } - if(arrayType == IArray::ArrayType::StringArray) + if(arrayType == AbstractArray::ArrayType::StringArray) { auto cellDataDims = pSaveAsNewGeometry ? newCellDataDims : destCellDataDims; auto cellArrayPath = pSaveAsNewGeometry ? newArrayPath : destArrayPath; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.hpp index b3f4d4f1e8..8289d83c1f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/AppendImageGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class AppendImageGeometryFilter * @brief This filter allows the user to append an Image Geometry onto the "end" of another Image Geometry. */ -class SIMPLNXCORE_EXPORT AppendImageGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT AppendImageGeometryFilter : public AbstractFilter { public: AppendImageGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.cpp index 5a89fff304..5bef06ef5a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.cpp @@ -107,7 +107,7 @@ Parameters ApplyTransformationToGeometryFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Geometry"}); params.insert(std::make_unique(k_SelectedImageGeometryPath_Key, "Selected Geometry", "The target geometry on which to perform the transformation", DataPath{}, - IGeometry::GetAllGeomTypes())); + AbstractGeometry::GetAllGeomTypes())); params.insertSeparator(Parameters::Separator{"Image Geometry Resampling/Interpolation"}); params.insertLinkableParameter(std::make_unique(k_InterpolationType_Key, "Resampling or Interpolation (Image Geometry Only)", @@ -313,7 +313,7 @@ IFilter::PreflightResult ApplyTransformationToGeometryFilter::preflightImpl(cons continue; } - const auto* neighborListPtr = dataStructure.getDataAs(dataArrayPath); + const auto* neighborListPtr = dataStructure.getDataAs(dataArrayPath); if(nullptr != neighborListPtr) { resultOutputActions.warnings().push_back( @@ -389,7 +389,7 @@ IFilter::PreflightResult ApplyTransformationToGeometryFilter::preflightImpl(cons for(const auto& cellArrayName : selectedCellArrayNames) { const DataPath srcCellArrayDataPath = srcImagePath.createChildPath(cellDataName).createChildPath(cellArrayName); - const auto& srcArray = dataStructure.getDataRefAs(srcCellArrayDataPath); + const auto& srcArray = dataStructure.getDataRefAs(srcCellArrayDataPath); const ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); const std::string dataStoreFormat = srcArray.getDataFormat(); resultOutputActions.value().appendAction( @@ -417,7 +417,7 @@ IFilter::PreflightResult ApplyTransformationToGeometryFilter::preflightImpl(cons } // copy over the rest of the data from the src Image Geometry into the Target Image Geometry - auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.hpp index 855539a0bb..be8d8e1b61 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApplyTransformationToGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ApplyTransformationToGeometryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ApplyTransformationToGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT ApplyTransformationToGeometryFilter : public AbstractFilter { public: ApplyTransformationToGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.cpp index 39ede348d0..7fd619d0ca 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.cpp @@ -92,7 +92,7 @@ IFilter::PreflightResult ApproximatePointCloudHullFilter::preflightImpl(const Da auto vertexGeom = dataStructure.getDataAs(vertexGeomPath); usize numVertices = vertexGeom->getNumberOfVertices(); - auto action = std::make_unique(hullVertexGeomPath, numVertices, INodeGeometry0D::k_VertexAttributeMatrixName, VertexGeom::k_SharedVertexListName); + auto action = std::make_unique(hullVertexGeomPath, numVertices, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, VertexGeom::k_SharedVertexListName); OutputActions actions; actions.appendAction(std::move(action)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.hpp index 978d426255..f511640168 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ApproximatePointCloudHullFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class ApproximatePointCloudHullFilter * @brief */ -class SIMPLNXCORE_EXPORT ApproximatePointCloudHullFilter : public IFilter +class SIMPLNXCORE_EXPORT ApproximatePointCloudHullFilter : public AbstractFilter { public: ApproximatePointCloudHullFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ArrayCalculatorFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ArrayCalculatorFilter.hpp index 7a682648e3..db2d193281 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ArrayCalculatorFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ArrayCalculatorFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ArrayCalculatorFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ArrayCalculatorFilter : public IFilter +class SIMPLNXCORE_EXPORT ArrayCalculatorFilter : public AbstractFilter { public: ArrayCalculatorFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ChangeAngleRepresentationFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ChangeAngleRepresentationFilter.hpp index c4a111cade..8e4217a52d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ChangeAngleRepresentationFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ChangeAngleRepresentationFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ChangeAngleRepresentationFilter * @brief This filter will convert angles from Degrees to Radians or vice-versa */ -class SIMPLNXCORE_EXPORT ChangeAngleRepresentationFilter : public IFilter +class SIMPLNXCORE_EXPORT ChangeAngleRepresentationFilter : public AbstractFilter { public: ChangeAngleRepresentationFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.cpp index 3264b6be5f..e3eb9d7f20 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.cpp @@ -63,7 +63,7 @@ Parameters CombineAttributeArraysFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Data Objects"}); params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Attribute Arrays to Combine", "The complete path to each of the Attribute Arrays to combine", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); params.insertSeparator(Parameters::Separator{"Output Data Array"}); @@ -120,13 +120,13 @@ IFilter::PreflightResult CombineAttributeArraysFilter::preflightImpl(const DataS size_t numComps = 0; for(const auto& dataPath : selectedDataArrayPathsValue) { - const auto* dataArray = dataStructure.getDataAs(dataPath); + const auto* dataArray = dataStructure.getDataAs(dataPath); numComps += dataArray->getNumberOfComponents(); } // Create the output array { - const auto* dataArray = dataStructure.getDataAs(selectedDataArrayPathsValue[0]); + const auto* dataArray = dataStructure.getDataAs(selectedDataArrayPathsValue[0]); auto tupleShape = dataArray->getTupleShape(); auto action = std::make_unique(dataArray->getDataType(), tupleShape, std::vector{numComps}, selectedDataArrayPathsValue[0].replaceName(stackedDataArrayName)); resultOutputActions.value().appendAction(std::move(action)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.hpp index dda8347081..ac5ba714a3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineAttributeArraysFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CombineAttributeArraysFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CombineAttributeArraysFilter : public IFilter +class SIMPLNXCORE_EXPORT CombineAttributeArraysFilter : public AbstractFilter { public: CombineAttributeArraysFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.cpp index 04177a4870..dca3a6d9e6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/TypesUtility.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateGeometry1DAction.hpp" @@ -33,12 +33,12 @@ struct GeometryArrayInfo { std::string name; ShapeType compDims; - IArray::ArrayType arrayType; + AbstractArray::ArrayType arrayType; std::optional dataType; }; template -std::tuple> FindGeometryElements(const IGeometry* geom, GetArrayFunc getArray, GetAttrMatrixFunc getAttrMatrix) +std::tuple> FindGeometryElements(const AbstractGeometry* geom, GetArrayFunc getArray, GetAttrMatrixFunc getAttrMatrix) { bool arrayExists = false; bool attrMatrixExists = false; @@ -59,9 +59,9 @@ std::tuple> FindGeometryElements(cons { for(const auto& item : *attrMatrix) { - auto* iDataArray = dynamic_cast(item.second.get()); - auto* iNeighborList = dynamic_cast(item.second.get()); - auto* iArray = dynamic_cast(item.second.get()); + auto* iDataArray = dynamic_cast(item.second.get()); + auto* iNeighborList = dynamic_cast(item.second.get()); + auto* iArray = dynamic_cast(item.second.get()); if(iDataArray != nullptr) { geometryArraysInfo.push_back({iDataArray->getName(), iDataArray->getComponentShape(), iDataArray->getArrayType(), iDataArray->getDataType()}); @@ -81,56 +81,56 @@ std::tuple> FindGeometryElements(cons return std::make_tuple(arrayExists, attrMatrixExists, geometryArraysInfo); } -std::tuple> FindVertexElements(const IGeometry* geom) +std::tuple> FindVertexElements(const AbstractGeometry* geom) { - auto getVerticesArrayFunc = [](const INodeGeometry0D* ptr) -> auto + auto getVerticesArrayFunc = [](const AbstractNodeGeometry0D* ptr) -> auto { return ptr->getVertices(); }; - auto getVertexAttrMatrixFunc = [](const INodeGeometry0D* ptr) -> auto + auto getVertexAttrMatrixFunc = [](const AbstractNodeGeometry0D* ptr) -> auto { return ptr->getVertexAttributeMatrix(); }; - return FindGeometryElements(geom, getVerticesArrayFunc, getVertexAttrMatrixFunc); + return FindGeometryElements(geom, getVerticesArrayFunc, getVertexAttrMatrixFunc); } -std::tuple> FindEdgeElements(const IGeometry* geom) +std::tuple> FindEdgeElements(const AbstractGeometry* geom) { - auto getEdgesArrayFunc = [](const INodeGeometry1D* ptr) -> auto + auto getEdgesArrayFunc = [](const AbstractNodeGeometry1D* ptr) -> auto { return ptr->getEdges(); }; - auto getEdgeAttrMatrixFunc = [](const INodeGeometry1D* ptr) -> auto + auto getEdgeAttrMatrixFunc = [](const AbstractNodeGeometry1D* ptr) -> auto { return ptr->getEdgeAttributeMatrix(); }; - return FindGeometryElements(geom, getEdgesArrayFunc, getEdgeAttrMatrixFunc); + return FindGeometryElements(geom, getEdgesArrayFunc, getEdgeAttrMatrixFunc); } -std::tuple> FindFaceElements(const IGeometry* geom) +std::tuple> FindFaceElements(const AbstractGeometry* geom) { - auto getFacesArrayFunc = [](const INodeGeometry2D* ptr) -> auto + auto getFacesArrayFunc = [](const AbstractNodeGeometry2D* ptr) -> auto { return ptr->getFaces(); }; - auto getFaceAttrMatrixFunc = [](const INodeGeometry2D* ptr) -> auto + auto getFaceAttrMatrixFunc = [](const AbstractNodeGeometry2D* ptr) -> auto { return ptr->getFaceAttributeMatrix(); }; - return FindGeometryElements(geom, getFacesArrayFunc, getFaceAttrMatrixFunc); + return FindGeometryElements(geom, getFacesArrayFunc, getFaceAttrMatrixFunc); } -std::tuple> FindPolyElements(const IGeometry* geom) +std::tuple> FindPolyElements(const AbstractGeometry* geom) { - auto getPolyArrayFunc = [](const INodeGeometry3D* ptr) -> auto + auto getPolyArrayFunc = [](const AbstractNodeGeometry3D* ptr) -> auto { return ptr->getPolyhedra(); }; - auto getPolyAttrMatrixFunc = [](const INodeGeometry3D* ptr) -> auto + auto getPolyAttrMatrixFunc = [](const AbstractNodeGeometry3D* ptr) -> auto { return ptr->getPolyhedraAttributeMatrix(); }; - return FindGeometryElements(geom, getPolyArrayFunc, getPolyAttrMatrixFunc); + return FindGeometryElements(geom, getPolyArrayFunc, getPolyAttrMatrixFunc); } /** @@ -279,20 +279,20 @@ Result<> AddOutputArray(const GeometryArrayInfo& arrayInfo, const DataPath& outp { switch(arrayInfo.arrayType) { - case IArray::ArrayType::DataArray: { + case AbstractArray::ArrayType::DataArray: { actions.appendAction( std::make_unique(arrayInfo.dataType.value(), std::vector{1}, arrayInfo.compDims, outputGeomPath.createChildPath(attrMatrixName).createChildPath(arrayInfo.name))); break; } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { actions.appendAction(std::make_unique(std::vector{1}, outputGeomPath.createChildPath(attrMatrixName).createChildPath(arrayInfo.name))); break; } - case IArray::ArrayType::NeighborListArray: { + case AbstractArray::ArrayType::NeighborListArray: { actions.appendAction(std::make_unique(arrayInfo.dataType.value(), std::vector{1}, outputGeomPath.createChildPath(attrMatrixName).createChildPath(arrayInfo.name))); break; } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakeErrorResult(-56, fmt::format("Geometry at path '{}' has array with name '{}' that has array type 'Any'. This should NEVER happen. Please contact the developers.", arrayInfo.name, outputGeomPath.toString())); } @@ -305,7 +305,7 @@ Result<> CreateINodeGeometry0DObjects(const DataPath& outputGeomPath, const std: { for(const auto& vertexDataArrayInfo : vertexDataArraysInfo) { - auto result = AddOutputArray(vertexDataArrayInfo, outputGeomPath, INodeGeometry0D::k_VertexAttributeMatrixName, actions); + auto result = AddOutputArray(vertexDataArrayInfo, outputGeomPath, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, actions); if(result.invalid()) { return result; @@ -319,22 +319,23 @@ template Result<> CreateINodeGeometry1DObjects(const DataPath& outputGeomPath, bool edgesArrayExists, bool edgeAttrMatrixExists, const std::vector& edgeDataArraysInfo, OutputActions& actions) { - if constexpr(!std::is_same_v) + if constexpr(!std::is_same_v) { // Create Edge Attribute Matrix and Edges Array if(edgeAttrMatrixExists) { - actions.appendAction(std::make_unique(outputGeomPath.createChildPath(INodeGeometry1D::k_EdgeAttributeMatrixName), ShapeType{1})); + actions.appendAction(std::make_unique(outputGeomPath.createChildPath(AbstractNodeGeometry1D::k_EdgeAttributeMatrixName), ShapeType{1})); } if(edgesArrayExists) { - actions.appendAction(std::make_unique(DataType::uint64, std::vector{1}, std::vector{2}, outputGeomPath.createChildPath(INodeGeometry1D::k_SharedEdgeListName))); + actions.appendAction( + std::make_unique(DataType::uint64, std::vector{1}, std::vector{2}, outputGeomPath.createChildPath(AbstractNodeGeometry1D::k_SharedEdgeListName))); } } for(const auto& edgeDataArrayInfo : edgeDataArraysInfo) { - auto result = AddOutputArray(edgeDataArrayInfo, outputGeomPath, INodeGeometry1D::k_EdgeAttributeMatrixName, actions); + auto result = AddOutputArray(edgeDataArrayInfo, outputGeomPath, AbstractNodeGeometry1D::k_EdgeAttributeMatrixName, actions); if(result.invalid()) { return result; @@ -348,31 +349,31 @@ template Result<> CreateINodeGeometry2DObjects(const DataPath& outputGeomPath, bool facesArrayExists, bool faceAttrMatrixExists, const std::vector& faceDataArraysInfo, OutputActions& actions) { - if constexpr(!std::is_same_v) + if constexpr(!std::is_same_v) { // Create Face Attribute Matrix and Faces Array if(faceAttrMatrixExists) { - actions.appendAction(std::make_unique(outputGeomPath.createChildPath(INodeGeometry2D::k_FaceAttributeMatrixName), ShapeType{1})); + actions.appendAction(std::make_unique(outputGeomPath.createChildPath(AbstractNodeGeometry2D::k_FaceAttributeMatrixName), ShapeType{1})); } if(facesArrayExists) { if constexpr(std::is_same_v) { actions.appendAction(std::make_unique(DataType::uint64, std::vector{1}, std::vector{TetrahedralGeom::k_NumFaceVerts}, - outputGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName))); + outputGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName))); } else if constexpr(std::is_same_v) { actions.appendAction(std::make_unique(DataType::uint64, std::vector{1}, std::vector{HexahedralGeom::k_NumFaceVerts}, - outputGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName))); + outputGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName))); } } } for(const auto& faceDataArrayInfo : faceDataArraysInfo) { - auto result = AddOutputArray(faceDataArrayInfo, outputGeomPath, INodeGeometry2D::k_FaceAttributeMatrixName, actions); + auto result = AddOutputArray(faceDataArrayInfo, outputGeomPath, AbstractNodeGeometry2D::k_FaceAttributeMatrixName, actions); if(result.invalid()) { return result; @@ -386,7 +387,7 @@ Result<> CreateINodeGeometry3DObjects(const DataPath& outputGeomPath, const std: { for(const auto& polyDataArrayInfo : polyDataArraysInfo) { - auto result = AddOutputArray(polyDataArrayInfo, outputGeomPath, INodeGeometry3D::k_PolyhedronDataName, actions); + auto result = AddOutputArray(polyDataArrayInfo, outputGeomPath, AbstractNodeGeometry3D::k_PolyhedronDataName, actions); if(result.invalid()) { return result; @@ -401,7 +402,7 @@ Result<> CreateOtherAttrMatricesAndArrays(const DataPath& outputGeomPath, const const std::vector& edgeDataArraysInfo, bool facesArrayExists, bool faceAttrMatrixExists, const std::vector& faceDataArraysInfo, const std::vector& polyDataArraysInfo, OutputActions& actions) { - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto result = CreateINodeGeometry3DObjects(outputGeomPath, polyDataArraysInfo, actions); if(result.invalid()) @@ -410,7 +411,7 @@ Result<> CreateOtherAttrMatricesAndArrays(const DataPath& outputGeomPath, const } } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto result = CreateINodeGeometry2DObjects(outputGeomPath, facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, actions); if(result.invalid()) @@ -419,7 +420,7 @@ Result<> CreateOtherAttrMatricesAndArrays(const DataPath& outputGeomPath, const } } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto result = CreateINodeGeometry1DObjects(outputGeomPath, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, actions); if(result.invalid()) @@ -428,7 +429,7 @@ Result<> CreateOtherAttrMatricesAndArrays(const DataPath& outputGeomPath, const } } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto result = CreateINodeGeometry0DObjects(outputGeomPath, vertexDataArraysInfo, actions); if(result.invalid()) @@ -441,7 +442,7 @@ Result<> CreateOtherAttrMatricesAndArrays(const DataPath& outputGeomPath, const } template -void RecordElementPresence(FindFunc findFunc, const IGeometry* geom, usize i, usize totalCount, std::vector& arraysExist, std::vector& attrMatricesExist, +void RecordElementPresence(FindFunc findFunc, const AbstractGeometry* geom, usize i, usize totalCount, std::vector& arraysExist, std::vector& attrMatricesExist, std::map>>& dataArraysExistMap) { // Call the provided find function, which returns a tuple. @@ -546,7 +547,7 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D // Use an optional so that the first input geometry type sets the optional // and subsequent input geometries' types are checked against the optional - std::optional geometryTypeOpt; + std::optional geometryTypeOpt; // All of these structures are used to keep track of which attribute matrices // and arrays exist in each input geometry. These are then used later in preflight @@ -569,7 +570,7 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D for(usize i = 0; i < inputGeometryPaths.size(); ++i) { const auto& inputGeometryPath = inputGeometryPaths[i]; - const auto* iGeomPtr = dataStructure.getDataAs(inputGeometryPath); + const auto* iGeomPtr = dataStructure.getDataAs(inputGeometryPath); if(iGeomPtr == nullptr) { // This is not a geometry @@ -577,7 +578,7 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D to_underlying(CombineNodeBasedGeometries::ErrorCodes::ObjectNotAGeometry), fmt::format("The data object at data path '{}' is not a geometry. All data objects MUST be geometries with the same geometry type.", inputGeometryPath.toString()))}; } - const auto* iNodeGeomPtr = dataStructure.getDataAs(inputGeometryPath); + const auto* iNodeGeomPtr = dataStructure.getDataAs(inputGeometryPath); if(iNodeGeomPtr == nullptr) { // This is not a node geometry @@ -859,13 +860,13 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D // Create the output geometry with all its vertex, edge, face, and polyhedra attribute matrices and arrays OutputActions actions; - IGeometry::Type geometryType = geometryTypeOpt.value(); + AbstractGeometry::Type geometryType = geometryTypeOpt.value(); switch(geometryType) { case IGeometry::Type::Vertex: { actions.appendAction(std::make_unique(outputGeometryPath, 1, VertexGeom::k_VertexAttributeMatrixName, VertexGeom::k_SharedVertexListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, + facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; @@ -875,8 +876,8 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D case IGeometry::Type::Edge: { actions.appendAction(std::make_unique(outputGeometryPath, 1, 1, VertexGeom::k_VertexAttributeMatrixName, EdgeGeom::k_EdgeAttributeMatrixName, VertexGeom::k_SharedVertexListName, EdgeGeom::k_SharedEdgeListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, + facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; @@ -886,8 +887,8 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D case IGeometry::Type::Triangle: { actions.appendAction(std::make_unique(outputGeometryPath, 1, 1, VertexGeom::k_VertexAttributeMatrixName, TriangleGeom::k_FaceAttributeMatrixName, VertexGeom::k_SharedVertexListName, TriangleGeom::k_SharedFacesListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, + facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; @@ -897,8 +898,8 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D case IGeometry::Type::Quad: { actions.appendAction(std::make_unique(outputGeometryPath, 1, 1, VertexGeom::k_VertexAttributeMatrixName, QuadGeom::k_FaceAttributeMatrixName, VertexGeom::k_SharedVertexListName, TriangleGeom::k_SharedFacesListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, + facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; @@ -908,8 +909,8 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D case IGeometry::Type::Tetrahedral: { actions.appendAction(std::make_unique(outputGeometryPath, 1, 1, VertexGeom::k_VertexAttributeMatrixName, TetrahedralGeom::k_PolyhedronDataName, VertexGeom::k_SharedVertexListName, TetrahedralGeom::k_SharedPolyhedronListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays( + outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; @@ -919,8 +920,8 @@ IFilter::PreflightResult CombineNodeBasedGeometriesFilter::preflightImpl(const D case IGeometry::Type::Hexahedral: { actions.appendAction(std::make_unique(outputGeometryPath, 1, 1, VertexGeom::k_VertexAttributeMatrixName, HexahedralGeom::k_PolyhedronDataName, VertexGeom::k_SharedVertexListName, HexahedralGeom::k_SharedPolyhedronListName)); - auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, - facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); + auto creationResult = CreateOtherAttrMatricesAndArrays(outputGeometryPath, vertexDataArraysInfo, edgesArrayExists, edgeAttrMatrixExists, edgeDataArraysInfo, + facesArrayExists, faceAttrMatrixExists, faceDataArraysInfo, polyDataArraysInfo, actions); if(creationResult.invalid()) { return {ConvertResultTo(std::move(creationResult), {})}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.hpp index 129fc9ec98..6aeeda3e8c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineNodeBasedGeometriesFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -14,7 +14,7 @@ namespace nx::core * @brief The CombineNodeBasedGeometriesFilter is an IFilter class designed to export the * DataStructure to a target HDF5 file. */ -class SIMPLNXCORE_EXPORT CombineNodeBasedGeometriesFilter : public IFilter +class SIMPLNXCORE_EXPORT CombineNodeBasedGeometriesFilter : public AbstractFilter { public: CombineNodeBasedGeometriesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineStlFilesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineStlFilesFilter.hpp index fa11d008f7..45152878f9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineStlFilesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineStlFilesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CombineStlFilesFilter * @brief This filter will combine all of the STL files from a given directory into a single triangle geometry */ -class SIMPLNXCORE_EXPORT CombineStlFilesFilter : public IFilter +class SIMPLNXCORE_EXPORT CombineStlFilesFilter : public AbstractFilter { public: CombineStlFilesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.cpp index c7609cefdf..59979869c8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.cpp @@ -54,7 +54,7 @@ Parameters CombineTransformationMatricesFilter::parameters() const // Create the parameter descriptors that are needed for this filter params.insertSeparator(Parameters::Separator{"Input Parameter(s)"}); params.insert(std::make_unique(k_InputArrays_Key, "Input Matrices", "The list of Attribute Arrays that represent Square Matrices of all the same dimensions", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{DataType::float32})); params.insertSeparator(Parameters::Separator{"Output Parameters"}); @@ -98,13 +98,13 @@ IFilter::PreflightResult CombineTransformationMatricesFilter::preflightImpl(cons // Check for unequal array types, data types, and component dimensions ShapeType cDims; - IArray::ArrayType arrayType; + AbstractArray::ArrayType arrayType; std::string arrayTypeName; usize numTuples = 0; nx::core::DataType arrayDataType; for(usize i = 0; i < inputArrayPaths.size(); ++i) { - const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[i]); + const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[i]); auto totalElements = inputDataArray.getNumberOfTuples() * inputDataArray.getNumberOfComponents(); if(totalElements != 16) @@ -116,7 +116,7 @@ IFilter::PreflightResult CombineTransformationMatricesFilter::preflightImpl(cons for(usize j = i + 1; j < inputArrayPaths.size(); ++j) { - const auto& inputDataArray2 = dataStructure.getDataRefAs(inputArrayPaths[j]); + const auto& inputDataArray2 = dataStructure.getDataRefAs(inputArrayPaths[j]); if(inputDataArray.getDataType() != inputDataArray2.getDataType()) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.hpp index 290d73e2eb..90499819d0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CombineTransformationMatricesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CombineTransformationMatricesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CombineTransformationMatricesFilter : public IFilter +class SIMPLNXCORE_EXPORT CombineTransformationMatricesFilter : public AbstractFilter { public: CombineTransformationMatricesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.cpp index 9e140ddb9c..51ed2cbc5f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.cpp @@ -70,7 +70,7 @@ Parameters ComputeArrayHistogramByFeatureFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Data"}); params.insert(std::make_unique(k_SelectedArrayPaths_Key, "Input Data Arrays", "The list of arrays to calculate histogram(s) for", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllNumericTypes())); params.insert(std::make_unique(k_CellFeatureIdsArrayPath_Key, "Cell Feature Ids", "Specifies to which feature each cell belongs.", DataPath({"Cell Data", "FeatureIds"}), ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); @@ -145,15 +145,15 @@ IFilter::PreflightResult ComputeArrayHistogramByFeatureFilter::preflightImpl(con parentPath = pDataGroupNameValue; } - const IDataArray* maskArray = nullptr; + const AbstractDataArray* maskArray = nullptr; if(pUseMaskValue) { - maskArray = dataStructure.getDataAs(pMaskArrayPathValue); + maskArray = dataStructure.getDataAs(pMaskArrayPathValue); } for(auto& selectedArrayPath : pSelectedArrayPathsValue) { - const auto* dataArray = dataStructure.getDataAs(selectedArrayPath); + const auto* dataArray = dataStructure.getDataAs(selectedArrayPath); if(maskArray && maskArray->getNumberOfTuples() != dataArray->getNumberOfTuples()) { return {MakeErrorResult(-57207, fmt::format("Mask array '{}' has tuple count {} and input array '{}' has tuple count {}. These tuple counts MUST match.", maskArray->getName(), @@ -224,7 +224,7 @@ Result<> ComputeArrayHistogramByFeatureFilter::executeImpl(DataStructure& dataSt std::vector createdModalRangesDataPaths; for(auto& selectedArrayPath : inputValues.SelectedArrayPaths) // regenerate based on preflight { - const auto& dataArray = dataStructure.getDataAs(selectedArrayPath); + const auto& dataArray = dataStructure.getDataAs(selectedArrayPath); auto arrayGroupPath = dataGroupPath.createChildPath(fmt::format("\"{}\" Histogram", dataArray->getName())); auto countsPath = arrayGroupPath.createChildPath(binCountName); createdCountsDataPaths.push_back(countsPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.hpp index cc7c12c0fa..c1150b55c6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramByFeatureFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeArrayHistogramByFeature * @brief This filter calculate the frequency histogram of a data structure, by feature */ -class SIMPLNXCORE_EXPORT ComputeArrayHistogramByFeatureFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeArrayHistogramByFeatureFilter : public AbstractFilter { public: ComputeArrayHistogramByFeatureFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.cpp index 962a935eaa..5b5df85898 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.cpp @@ -71,7 +71,7 @@ Parameters ComputeArrayHistogramFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Data"}); params.insert(std::make_unique(k_SelectedArrayPaths_Key, "Input Data Arrays", "The list of arrays to calculate histogram(s) for", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllNumericTypes())); params.insertSeparator(Parameters::Separator{"Output Parameters"}); @@ -145,15 +145,15 @@ IFilter::PreflightResult ComputeArrayHistogramFilter::preflightImpl(const DataSt parentPath = pDataGroupNameValue; } - const IDataArray* maskArray = nullptr; + const AbstractDataArray* maskArray = nullptr; if(useMask) { - maskArray = dataStructure.getDataAs(maskArrayPath); + maskArray = dataStructure.getDataAs(maskArrayPath); } for(auto& selectedArrayPath : pSelectedArrayPathsValue) { - const auto* dataArray = dataStructure.getDataAs(selectedArrayPath); + const auto* dataArray = dataStructure.getDataAs(selectedArrayPath); if(maskArray && maskArray->getNumberOfTuples() != dataArray->getNumberOfTuples()) { return {MakeErrorResult(-57207, fmt::format("Mask array '{}' has tuple count {} and input array '{}' has tuple count {}. These tuple counts MUST match.", maskArray->getName(), @@ -223,7 +223,7 @@ Result<> ComputeArrayHistogramFilter::executeImpl(DataStructure& dataStructure, std::vector createdModalRangesDataPaths; for(auto& selectedArrayPath : inputValues.SelectedArrayPaths) // regenerate based on preflight { - const auto& dataArray = dataStructure.getDataAs(selectedArrayPath); + const auto& dataArray = dataStructure.getDataAs(selectedArrayPath); auto arrayGroupPath = dataGroupPath.createChildPath(fmt::format("\"{}\" Histogram", dataArray->getName())); auto countsPath = arrayGroupPath.createChildPath(binCountName); createdCountsDataPaths.push_back(countsPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.hpp index 1287a6c8b5..6969d67b33 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayHistogramFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeArrayHistogram * @brief This filter calculate the frequency histogram of a data structure */ -class SIMPLNXCORE_EXPORT ComputeArrayHistogramFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeArrayHistogramFilter : public AbstractFilter { public: ComputeArrayHistogramFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.cpp index 12eeac0280..7e4368438b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.cpp @@ -50,7 +50,7 @@ OutputActions CreateCompatibleArrays(const DataStructure& dataStructure, const A auto computeByIndexValue = filterArgs.value(ComputeArrayStatisticsFilter::k_ComputeByIndex_Key); auto standardizeDataValue = filterArgs.value(ComputeArrayStatisticsFilter::k_StandardizeData_Key); auto inputArrayPath = filterArgs.value(ComputeArrayStatisticsFilter::k_SelectedArrayPath_Key); - auto* inputArray = dataStructure.getDataAs(inputArrayPath); + auto* inputArray = dataStructure.getDataAs(inputArrayPath); auto destinationAttributeMatrixValue = filterArgs.value(ComputeArrayStatisticsFilter::k_DestinationAttributeMatrixPath_Key); DataType dataType = inputArray->getDataType(); @@ -344,7 +344,7 @@ IFilter::PreflightResult ComputeArrayStatisticsFilter::preflightImpl(const DataS std::vector inputDataArrayPaths; - const auto* inputArrayPtr = dataStructure.getDataAs(pSelectedArrayPathValue); + const auto* inputArrayPtr = dataStructure.getDataAs(pSelectedArrayPathValue); if(inputArrayPtr == nullptr) { @@ -413,7 +413,7 @@ IFilter::PreflightResult ComputeArrayStatisticsFilter::preflightImpl(const DataS if(pUseMaskValue) { - const auto* maskPtr = dataStructure.getDataAs(pMaskArrayPathValue); + const auto* maskPtr = dataStructure.getDataAs(pMaskArrayPathValue); if(maskPtr == nullptr) { return MakePreflightErrorResult(-57205, fmt::format("Could not find mask array at path '{}' ", pMaskArrayPathValue.toString())); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.hpp index 3c7abacb8b..9783b9e405 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeArrayStatisticsFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class ComputeArrayStatisticsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeArrayStatisticsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeArrayStatisticsFilter : public AbstractFilter { public: ComputeArrayStatisticsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.cpp index 0ac6d3e4ad..32c8acce86 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.cpp @@ -111,7 +111,7 @@ IFilter::PreflightResult ComputeBiasedFeaturesFilter::preflightImpl(const DataSt return {MakeErrorResult(-7460, fmt::format("The following DataArrays all must have equal number of tuples but this was not satisfied.\n{}", tupleValidityCheck.error()))}; } - const auto& surfaceFeaturesMaskArray = dataStructure.getDataRefAs(pSurfaceFeaturesArrayPathValue); + const auto& surfaceFeaturesMaskArray = dataStructure.getDataRefAs(pSurfaceFeaturesArrayPathValue); auto action = std::make_unique(DataType::boolean, surfaceFeaturesMaskArray.getTupleShape(), std::vector{1}, pCentroidsArrayPathValue.replaceName(pBiasedFeaturesArrayNameValue)); resultOutputActions.value().appendAction(std::move(action)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.hpp index 4eb73ec8a9..0b607132e4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBiasedFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeBiasedFeaturesFilter * @brief This filter determines which Features are biased by the outer surfaces of the sample. */ -class SIMPLNXCORE_EXPORT ComputeBiasedFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeBiasedFeaturesFilter : public AbstractFilter { public: ComputeBiasedFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryCellsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryCellsFilter.hpp index 6a278abef2..a6b97761af 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryCellsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryCellsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeBoundaryCellsFilter * @brief This filter will determine, for each Cell, the number of neighboring Cells that are owned by a different Feature. */ -class SIMPLNXCORE_EXPORT ComputeBoundaryCellsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeBoundaryCellsFilter : public AbstractFilter { public: ComputeBoundaryCellsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryElementFractionsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryElementFractionsFilter.hpp index 28089a8d0f..8a7a21f5ea 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryElementFractionsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundaryElementFractionsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeBoundaryElementFractionsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeBoundaryElementFractionsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeBoundaryElementFractionsFilter : public AbstractFilter { public: ComputeBoundaryElementFractionsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.cpp index b3ee58cf2f..fd07c1e327 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.cpp @@ -3,11 +3,11 @@ #include "SimplnxCore/Filters/Algorithms/ComputeBoundingBoxStats.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateNeighborListAction.hpp" @@ -43,7 +43,7 @@ void CreateCompatibleArrays(Result& resultOutputActions, const Da auto calculateSummation = filterArgs.value(ComputeBoundingBoxStatsFilter::k_CalculateSummation_Key); auto calculateNumUniqueValuesValue = filterArgs.value(ComputeBoundingBoxStatsFilter::k_CalculateUniqueValues_Key); - auto* inputArray = dataStructure.getDataAs(filterArgs.value(ComputeBoundingBoxStatsFilter::k_InputArrayPath_Key)); + auto* inputArray = dataStructure.getDataAs(filterArgs.value(ComputeBoundingBoxStatsFilter::k_InputArrayPath_Key)); DataType dataType = inputArray->getDataType(); { @@ -259,7 +259,7 @@ IFilter::PreflightResult ComputeBoundingBoxStatsFilter::preflightImpl(const Data Result resultOutputActions; - const auto* unifiedBoundsPtr = dataStructure.getDataAs(pUnifiedBoundsPathValue); + const auto* unifiedBoundsPtr = dataStructure.getDataAs(pUnifiedBoundsPathValue); DataPath outputAMPath = {}; @@ -286,7 +286,7 @@ IFilter::PreflightResult ComputeBoundingBoxStatsFilter::preflightImpl(const Data return MakePreflightErrorResult(-59202, "No statistics have been selected, so this filter will perform no operations"); } - const auto* inputArrayPtr = dataStructure.getDataAs(pInputArrayPathValue); + const auto* inputArrayPtr = dataStructure.getDataAs(pInputArrayPathValue); if(pCalculateModeValue && !ExecuteDataFunction(IsIntegerType{}, inputArrayPtr->getDataType())) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.hpp index d9151d5eb6..10249fd3dc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeBoundingBoxStatsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeBoundingBoxStatsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeBoundingBoxStatsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeBoundingBoxStatsFilter : public AbstractFilter { public: ComputeBoundingBoxStatsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.cpp index d136d08170..cb5daa9dbc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.cpp @@ -3,10 +3,10 @@ #include "SimplnxCore/Filters/Algorithms/ComputeCoordinateThreshold.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArrayCreationParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -106,7 +106,7 @@ IFilter::PreflightResult ComputeCoordinateThresholdFilter::preflightImpl(const D auto pSelectedGeomPathValue = filterArgs.value(k_SelectedGeometryPath_Key); auto pCreatedMaskPathValue = filterArgs.value(k_CreatedMaskPath_Key); - const auto& geom = dataStructure.getDataRefAs(pSelectedGeomPathValue); + const auto& geom = dataStructure.getDataRefAs(pSelectedGeomPathValue); std::vector preflightUpdatedValues; if(geom.getGeomType() == IGeometry::Type::Image) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.hpp index 9cb5f8b1c7..8361fe3151 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinateThresholdFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeCoordinateThresholdFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeCoordinateThresholdFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeCoordinateThresholdFilter : public AbstractFilter { public: ComputeCoordinateThresholdFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinatesImageGeomFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinatesImageGeomFilter.hpp index 40abc93c9e..a35feef2da 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinatesImageGeomFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeCoordinatesImageGeomFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeCoordinatesImageGeomFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeCoordinatesImageGeomFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeCoordinatesImageGeomFilter : public AbstractFilter { public: ComputeCoordinatesImageGeomFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.cpp index 794c733c74..b52c00c635 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.cpp @@ -25,7 +25,7 @@ IFilter::PreflightResult validateArrayTypes(const DataStructure& dataStructure, std::optional dataType = {}; for(const auto& dataPath : dataPaths) { - if(auto dataArray = dataStructure.getDataAs(dataPath)) + if(auto dataArray = dataStructure.getDataAs(dataPath)) { if(!dataType.has_value()) { @@ -141,10 +141,10 @@ IFilter::PreflightResult ComputeDifferencesMapFilter::preflightImpl(const DataSt std::vector dataArrayPaths; - const auto& firstInputArray = dataStructure.getDataRefAs(firstInputArrayPath); + const auto& firstInputArray = dataStructure.getDataRefAs(firstInputArrayPath); dataArrayPaths.push_back(firstInputArrayPath); - const auto& secondInputArray = dataStructure.getDataRefAs(secondInputArrayPath); + const auto& secondInputArray = dataStructure.getDataRefAs(secondInputArrayPath); dataArrayPaths.push_back(secondInputArrayPath); if(!dataArrayPaths.empty()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.hpp index 600e72bbf0..84240190e6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeDifferencesMapFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class ComputeDifferencesMapFilter * @brief */ -class SIMPLNXCORE_EXPORT ComputeDifferencesMapFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeDifferencesMapFilter : public AbstractFilter { public: ComputeDifferencesMapFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeEuclideanDistMapFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeEuclideanDistMapFilter.hpp index da2757f3e3..582e53bbb6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeEuclideanDistMapFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeEuclideanDistMapFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeEuclideanDistMapFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeEuclideanDistMapFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeEuclideanDistMapFilter : public AbstractFilter { public: ComputeEuclideanDistMapFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.cpp index 3d733fc8ac..8ea7981a5a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.cpp @@ -3,15 +3,15 @@ #include "SimplnxCore/Filters/Algorithms/ComputeFeatureBounds.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataPath.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateGeometry1DAction.hpp" @@ -133,7 +133,7 @@ IFilter::PreflightResult ComputeFeatureBoundsFilter::preflightImpl(const DataStr auto pEdgeAttributeMatrixNameValue = filterArgs.value(k_EdgeAttributeMatrixName_Key); auto pFeatureIdsArrayName = filterArgs.value(k_CreatedFeatureIdsArrayName_Key); - const auto& geom = dataStructure.getDataRefAs(pSelectedGeomPathValue); + const auto& geom = dataStructure.getDataRefAs(pSelectedGeomPathValue); usize expectedFeatureSize = geom.getNumberOfCells(); @@ -175,7 +175,7 @@ IFilter::PreflightResult ComputeFeatureBoundsFilter::preflightImpl(const DataStr // optionally create the edge geometry if(pCreateEdgeGeometry) { - auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, INodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, + auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, EdgeGeom::k_SharedVertexListName, EdgeGeom::k_SharedEdgeListName); resultOutputActions.value().appendAction(std::move(createGeometryAction)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.hpp index 51c286de91..fa50fe8983 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureBoundsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureBoundsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeFeatureBoundsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureBoundsFilter : public AbstractFilter { public: ComputeFeatureBoundsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.cpp index adecbe4cb5..d2a324f11a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.cpp @@ -102,7 +102,7 @@ IFilter::PreflightResult ComputeFeatureCentroidsFilter::preflightImpl(const Data // Feature Data: // Validating the Feature Attribute Matrix and trying to find a child of the Group - // that is an IDataArray subclass, so we can get the proper tuple shape + // that is an AbstractDataArray subclass, so we can get the proper tuple shape const auto* featureAttrMatrix = dataStructure.getDataAs(featureAttrMatrixPath); if(featureAttrMatrix == nullptr) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.hpp index 93f2396d99..b21676b7eb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureCentroidsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureCentroidsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeFeatureCentroidsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureCentroidsFilter : public AbstractFilter { public: ComputeFeatureCentroidsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureClusteringFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureClusteringFilter.hpp index fb6e5a7d3b..a6bb33799b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureClusteringFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureClusteringFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeatureClusteringFilter * @brief This filter determines the radial distribution function (RDF), as a histogram, of a given set of Features. */ -class SIMPLNXCORE_EXPORT ComputeFeatureClusteringFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureClusteringFilter : public AbstractFilter { public: ComputeFeatureClusteringFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.cpp index fa331a91a7..da36c39956 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.cpp @@ -139,7 +139,7 @@ IFilter::PreflightResult ComputeFeatureNeighborsFilter::preflightImpl(const Data // Feature Data: // Validating the Feature Attribute Matrix and trying to find a child of the Group - // that is an IDataArray subclass, so we can get the proper tuple shape + // that is an AbstractDataArray subclass, so we can get the proper tuple shape const auto& featureAttrMatrix = dataStructure.getDataRefAs(featureAttrMatrixPath); tupleShape = featureAttrMatrix.getShape(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.hpp index d98bf5d22d..8ad09a8676 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureNeighborsFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ComputeFeatureNeighborsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureNeighborsFilter : public AbstractFilter { public: ComputeFeatureNeighborsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.cpp index 4c37ebf533..8d7020b08b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.cpp @@ -110,7 +110,7 @@ Result<> ComputeFeaturePhasesBinaryFilter::executeImpl(DataStructure& dataStruct auto& featurePhasesArray = dataStructure.getDataAs(filterArgs.value(k_CellDataAMPath_Key).createChildPath(filterArgs.value(k_FeaturePhasesArrayName_Key)))->getDataStoreRef(); - std::unique_ptr goodVoxelsMask; + std::unique_ptr goodVoxelsMask; try { goodVoxelsMask = MaskCompareUtilities::InstantiateMaskCompare(dataStructure, filterArgs.value(k_MaskArrayPath_Key)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.hpp index 74487a06bc..c6c40ee44f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesBinaryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeFeaturePhasesBinaryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeFeaturePhasesBinaryFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeaturePhasesBinaryFilter : public AbstractFilter { public: ComputeFeaturePhasesBinaryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesFilter.hpp index 6452bbab89..ab1590c9a9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeaturePhasesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -15,7 +15,7 @@ namespace nx::core * any Element can be used to determine the Ensemble of the Feature that owns * that Element. */ -class SIMPLNXCORE_EXPORT ComputeFeaturePhasesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeaturePhasesFilter : public AbstractFilter { public: ComputeFeaturePhasesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.cpp index 469c809444..409923c759 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.cpp @@ -2,7 +2,7 @@ #include "SimplnxCore/Filters/Algorithms/ComputeFeatureRect.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp" diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.hpp index 139a4df67d..55da7a3c7b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureRectFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * This data can be important for finding the smallest encompassing volume. The values are given in pixel * coordinates. */ -class SIMPLNXCORE_EXPORT ComputeFeatureRectFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureRectFilter : public AbstractFilter { public: ComputeFeatureRectFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.cpp index 0654c7baee..c3ff086d70 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.cpp @@ -104,7 +104,7 @@ IFilter::PreflightResult ComputeFeatureSizesFilter::preflightImpl(const DataStru DataPath equivalentDiametersPath = featureAttributeMatrixPath.createChildPath(equivalentDiametersName); DataPath numElementsPath = featureAttributeMatrixPath.createChildPath(numElementsName); - const auto& geomRef = dataStructure.getDataRefAs(geometryPath); + const auto& geomRef = dataStructure.getDataRefAs(geometryPath); IGeometry::Type geomType = geomRef.getGeomType(); if(geomType == IGeometry::Type::Image) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.hpp index 1b3131019b..31f62cd9d1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeFeatureSizesFilter.hpp @@ -4,8 +4,8 @@ #include "simplnx/Common/StringLiteral.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * @class ComputeFeatureSizesFilter * @brief */ -class SIMPLNXCORE_EXPORT ComputeFeatureSizesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeFeatureSizesFilter : public AbstractFilter { public: ComputeFeatureSizesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.cpp index 91932895f9..f89c167821 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.cpp @@ -3,9 +3,9 @@ #include "SimplnxCore/Filters/Algorithms/ComputeKMeans.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" @@ -130,7 +130,7 @@ IFilter::PreflightResult ComputeKMeansFilter::preflightImpl(const DataStructure& nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); + auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); if(clusterArray == nullptr) { return MakePreflightErrorResult(-7585, "Array to Cluster MUST be a valid DataPath."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.hpp index 94a6c6e927..a5d6a99617 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMeansFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeKMeansFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeKMeansFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeKMeansFilter : public AbstractFilter { public: ComputeKMeansFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.cpp index 7051340eb9..0840863646 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.cpp @@ -3,9 +3,9 @@ #include "SimplnxCore/Filters/Algorithms/ComputeKMedoids.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" @@ -125,7 +125,7 @@ IFilter::PreflightResult ComputeKMedoidsFilter::preflightImpl(const DataStructur nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); + auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); if(clusterArray == nullptr) { return MakePreflightErrorResult(-7584, "Array to Cluster MUST be a valid DataPath."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.hpp index 3005e31051..a9677745fb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeKMedoidsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeKMedoidsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeKMedoidsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeKMedoidsFilter : public AbstractFilter { public: ComputeKMedoidsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeLargestCrossSectionsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeLargestCrossSectionsFilter.hpp index 999fbe2d69..4ec1a5fd8a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeLargestCrossSectionsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeLargestCrossSectionsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeLargestCrossSectionsFilter * @brief This filter will find the largest cross sections of an image geometry. */ -class SIMPLNXCORE_EXPORT ComputeLargestCrossSectionsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeLargestCrossSectionsFilter : public AbstractFilter { public: ComputeLargestCrossSectionsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeMomentInvariants2DFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeMomentInvariants2DFilter.hpp index e8b49a5788..944827ba74 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeMomentInvariants2DFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeMomentInvariants2DFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter computes the 2D Omega-1 and Omega 2 values from the Central Moments matrix and optionally will normalize the values to a unit circle and also optionally save the Central Moments * matrix as a DataArray to the Cell Feature Attribute Matrix. */ -class SIMPLNXCORE_EXPORT ComputeMomentInvariants2DFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeMomentInvariants2DFilter : public AbstractFilter { public: ComputeMomentInvariants2DFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.cpp index 6c1c7580eb..b2615161a2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.cpp @@ -2,7 +2,7 @@ #include "SimplnxCore/Filters/Algorithms/ComputeNeighborListStatistics.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -29,7 +29,7 @@ OutputActions CreateCompatibleArrays(const DataStructure& dataStructure, const A auto findSummation = filterArgs.value(ComputeNeighborListStatisticsFilter::k_FindSummation_Key); auto inputArrayPath = filterArgs.value(ComputeNeighborListStatisticsFilter::k_InputNeighborListPath_Key); - auto* inputArray = dataStructure.getDataAs(inputArrayPath); + auto* inputArray = dataStructure.getDataAs(inputArrayPath); ShapeType tupleDims{inputArray->getNumberOfTuples()}; DataType dataType = inputArray->getDataType(); const DataPath outputGroupPath = inputArrayPath.getParent(); @@ -185,7 +185,7 @@ IFilter::PreflightResult ComputeNeighborListStatisticsFilter::preflightImpl(cons std::vector dataArrayPaths; - auto inputArray = dataStructure.getDataAs(inputArrayPath); + auto inputArray = dataStructure.getDataAs(inputArrayPath); if(inputArray == nullptr) { return MakePreflightErrorResult(k_MissingInputArray, "Missing input array"); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.hpp index 9c09ffc28e..0e32637c16 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborListStatisticsFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class ComputeNeighborListStatisticsFilter * @brief */ -class SIMPLNXCORE_EXPORT ComputeNeighborListStatisticsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeNeighborListStatisticsFilter : public AbstractFilter { public: ComputeNeighborListStatisticsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborhoodsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborhoodsFilter.hpp index 9d975f33c0..cc625644ed 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborhoodsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNeighborhoodsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeNeighborhoodsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeNeighborhoodsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeNeighborhoodsFilter : public AbstractFilter { public: ComputeNeighborhoodsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNumFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNumFeaturesFilter.hpp index 3d333023f5..96433cfac0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNumFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeNumFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeNumFeaturesFilter * @brief This filter will create a new array containing the number of features */ -class SIMPLNXCORE_EXPORT ComputeNumFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeNumFeaturesFilter : public AbstractFilter { public: ComputeNumFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceAreaToVolumeFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceAreaToVolumeFilter.hpp index 24a54fe46b..4f20598aac 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceAreaToVolumeFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceAreaToVolumeFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeSurfaceAreaToVolumeFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeSurfaceAreaToVolumeFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeSurfaceAreaToVolumeFilter : public AbstractFilter { public: ComputeSurfaceAreaToVolumeFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceFeaturesFilter.hpp index 8311bc7515..bed8324916 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeSurfaceFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -26,7 +26,7 @@ namespace nx::core * Note: If there are voxels within the volume that have Feature ID=0 then any feature touching * those voxels will be considered a Surface feature. */ -class SIMPLNXCORE_EXPORT ComputeSurfaceFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeSurfaceFeaturesFilter : public AbstractFilter { public: ComputeSurfaceFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.cpp index abbd453fe1..8a75908aa5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Range.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/DataGroupSelectionParameter.hpp" diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.hpp index 4ae0ac3922..8bde517e52 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleAreasFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeTriangleAreasFilter * @brief This filter will compute the area for each triangle within a TriangleGeometry */ -class SIMPLNXCORE_EXPORT ComputeTriangleAreasFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeTriangleAreasFilter : public AbstractFilter { public: ComputeTriangleAreasFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomCentroidsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomCentroidsFilter.hpp index c6a8a15924..c6446c2173 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomCentroidsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomCentroidsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeTriangleGeomCentroidsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeTriangleGeomCentroidsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeTriangleGeomCentroidsFilter : public AbstractFilter { public: ComputeTriangleGeomCentroidsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomVolumesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomVolumesFilter.hpp index 1bf25324ac..d7ce9eded8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomVolumesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeTriangleGeomVolumesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeTriangleGeomSizesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeTriangleGeomVolumesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeTriangleGeomVolumesFilter : public AbstractFilter { public: ComputeTriangleGeomVolumesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVectorColorsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVectorColorsFilter.hpp index 3491cf3ff6..49dc1ea899 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVectorColorsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVectorColorsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeVectorColorsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeVectorColorsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeVectorColorsFilter : public AbstractFilter { public: ComputeVectorColorsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVertexToTriangleDistancesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVertexToTriangleDistancesFilter.hpp index 433fc05aa4..3aca6cf88d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVertexToTriangleDistancesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVertexToTriangleDistancesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeVertexToTriangleDistancesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ComputeVertexToTriangleDistancesFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeVertexToTriangleDistancesFilter : public AbstractFilter { public: ComputeVertexToTriangleDistancesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVolumeFractionsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVolumeFractionsFilter.hpp index 5428716a6b..6c25e6dabe 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVolumeFractionsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeVolumeFractionsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ComputeVolumeFractionsFilter * @brief This filter will calculate the volume fraction for each Ensemble */ -class SIMPLNXCORE_EXPORT ComputeVolumeFractionsFilter : public IFilter +class SIMPLNXCORE_EXPORT ComputeVolumeFractionsFilter : public AbstractFilter { public: ComputeVolumeFractionsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.cpp index 0068855dd6..053bd2c170 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.cpp @@ -1,7 +1,7 @@ #include "ConcatenateDataArraysFilter.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateNeighborListAction.hpp" #include "simplnx/Filter/Actions/CreateStringArrayAction.hpp" @@ -54,7 +54,7 @@ Parameters ConcatenateDataArraysFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Parameters"}); params.insert(std::make_unique(k_InputArrays_Key, "Arrays To Concatenate", "Select the arrays that will be concatenated together. The arrays will be concatenated in the order they are listed here.", - std::vector{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::Any}, GetAllDataTypes())); + std::vector{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::Any}, GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Parameters"}); params.insert(std::make_unique(k_OutputArray_Key, "Output Array", "The output array that contains the concatenated arrays.", DataPath({"Concatenated Array"}))); @@ -93,15 +93,15 @@ IFilter::PreflightResult ConcatenateDataArraysFilter::preflightImpl(const DataSt // Check for unequal array types, data types, and component dimensions ShapeType cDims; - IArray::ArrayType arrayType; + AbstractArray::ArrayType arrayType; std::string arrayTypeName; usize numTuples = 0; for(usize i = 0; i < inputArrayPaths.size(); ++i) { - const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[i]); + const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[i]); for(usize j = i + 1; j < inputArrayPaths.size(); ++j) { - const auto& inputDataArray2 = dataStructure.getDataRefAs(inputArrayPaths[j]); + const auto& inputDataArray2 = dataStructure.getDataRefAs(inputArrayPaths[j]); if(inputDataArray.getTypeName() != inputDataArray2.getTypeName()) { @@ -134,24 +134,24 @@ IFilter::PreflightResult ConcatenateDataArraysFilter::preflightImpl(const DataSt switch(arrayType) { - case IArray::ArrayType::DataArray: { - const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[0]); + case AbstractArray::ArrayType::DataArray: { + const auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPaths[0]); auto action = std::make_unique(inputDataArray.getDataType(), tDims, cDims, outputArrayPath); resultOutputActions.value().appendAction(std::move(action)); break; } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { auto action = std::make_unique(tDims, outputArrayPath); resultOutputActions.value().appendAction(std::move(action)); break; } - case IArray::ArrayType::NeighborListArray: { - const auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPaths[0]); + case AbstractArray::ArrayType::NeighborListArray: { + const auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPaths[0]); auto action = std::make_unique(inputNeighborList.getDataType(), tDims, outputArrayPath); resultOutputActions.value().appendAction(std::move(action)); break; } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakePreflightErrorResult(to_underlying(ConcatenateDataArrays::ErrorCodes::InputArraysEqualAny), "Every array in the input arrays list has array type 'Any'. This SHOULD NOT be possible, so please contact the developers."); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.hpp index 5d3e5737f7..06f02d662f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConcatenateDataArraysFilter.hpp @@ -2,12 +2,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ConcatenateDataArraysFilter : public IFilter +class SIMPLNXCORE_EXPORT ConcatenateDataArraysFilter : public AbstractFilter { public: ConcatenateDataArraysFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.cpp index f0e5e9329b..be7b64c6f1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.cpp @@ -95,7 +95,7 @@ IFilter::PreflightResult ConditionalSetValueFilter::preflightImpl(const DataStru auto selectedArrayPath = filterArgs.value(k_SelectedArrayPath_Key); auto pConditionalPath = filterArgs.value(k_ConditionalArrayPath_Key); - const auto& inputDataObject = dataStructure.getDataAs(selectedArrayPath); + const auto& inputDataObject = dataStructure.getDataAs(selectedArrayPath); if(replaceValueString.empty()) { @@ -109,7 +109,7 @@ IFilter::PreflightResult ConditionalSetValueFilter::preflightImpl(const DataStru if(useConditionalValue) { // Validate that the Conditional Array is of the correct type - const auto* dataObject = dataStructure.getDataAs(pConditionalPath); + const auto* dataObject = dataStructure.getDataAs(pConditionalPath); if(dataObject->getDataType() != nx::core::DataType::boolean && dataObject->getDataType() != nx::core::DataType::uint8 && dataObject->getDataType() != nx::core::DataType::int8) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.hpp index b636c9287e..0ddb7481c3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConditionalSetValueFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConditionalSetValueFilter */ -class SIMPLNXCORE_EXPORT ConditionalSetValueFilter : public IFilter +class SIMPLNXCORE_EXPORT ConditionalSetValueFilter : public AbstractFilter { public: ConditionalSetValueFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.cpp index f8ab184b8f..d5eab9e0b0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/Algorithms/ConvertColorToGrayScale.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" #include "simplnx/Parameters/MultiArraySelectionParameter.hpp" @@ -65,7 +65,7 @@ Parameters ConvertColorToGrayScaleFilter::parameters() const params.linkParameters(k_ConversionAlgorithm_Key, k_ColorChannel_Key, std::make_any(3)); params.insert(std::make_unique(k_InputDataArrayPath_Key, "Input Data Arrays", "Select all DataArrays that need to be converted to GrayScale", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{DataType::uint8}, MultiArraySelectionParameter::AllowedComponentShapes{{3}})); params.insertSeparator(Parameters::Separator{"Output Parameters"}); params.insert(std::make_unique(k_OutputArrayPrefix_Key, "Output Data Array Prefix", @@ -129,7 +129,7 @@ IFilter::PreflightResult ConvertColorToGrayScaleFilter::preflightImpl(const Data DataPath outputDataArrayPath; for(const auto& inputDataArrayPath : inputDataArrayPaths) { - const auto& inputArray = dataStructure.getDataRefAs(inputDataArrayPath); + const auto& inputArray = dataStructure.getDataRefAs(inputDataArrayPath); std::vector inputPathVector = inputDataArrayPath.getPathVector(); std::string inputArrayName = inputDataArrayPath.getTargetName(); std::string outputArrayName = fmt::format("{}{}", outputArrayPrefix, inputArrayName); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.hpp index cb7cdbe62a..990d93904a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertColorToGrayScaleFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConvertColorToGrayScaleFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ConvertColorToGrayScaleFilter : public IFilter +class SIMPLNXCORE_EXPORT ConvertColorToGrayScaleFilter : public AbstractFilter { public: ConvertColorToGrayScaleFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.cpp index 8d1c30cf1a..b5a4da8e99 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.cpp @@ -3,8 +3,8 @@ #include "SimplnxCore/Filters/Algorithms/ConvertData.hpp" #include "simplnx/Common/TypesUtility.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Filter/Actions/RenameDataAction.hpp" @@ -104,7 +104,7 @@ IFilter::PreflightResult ConvertDataFilter::preflightImpl(const DataStructure& d Result resultOutputActions; - const auto& inputArray = dataStructure.getDataRefAs(pInputArrayPath); + const auto& inputArray = dataStructure.getDataRefAs(pInputArrayPath); resultOutputActions.value().appendAction( std::make_unique(pScalarType, inputArray.getIDataStoreRef().getTupleShape(), inputArray.getIDataStoreRef().getComponentShape(), convertedArrayPath)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.hpp index b610e8c12b..573672ef61 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ConvertDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ConvertDataFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ConvertDataFilter : public IFilter +class SIMPLNXCORE_EXPORT ConvertDataFilter : public AbstractFilter { public: ConvertDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.cpp index af89460895..26a6d89a9c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.cpp @@ -105,7 +105,7 @@ IFilter::PreflightResult CopyDataObjectFilter::preflightImpl(const DataStructure { for(const auto& path : dataArrayPaths) { - const auto* possibleIArray = dataStructure.getDataAs(path); + const auto* possibleIArray = dataStructure.getDataAs(path); if(possibleIArray != nullptr) { if(possibleAM->getShape() != possibleIArray->getTupleShape()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.hpp index cde14bfbd4..4b0b6d899e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyDataObjectFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CopyDataObjectFilter : public IFilter +class SIMPLNXCORE_EXPORT CopyDataObjectFilter : public AbstractFilter { public: CopyDataObjectFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp index 407614bc23..1fac4e7bf3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.cpp @@ -23,7 +23,8 @@ class CopyFeatureArrayToElementArrayImpl public: using StoreType = AbstractDataStore; - CopyFeatureArrayToElementArrayImpl(const IDataArray* selectedFeatureArray, const Int32AbstractDataStore& featureIdsStore, IDataArray* createdArray, const std::atomic_bool& shouldCancel) + CopyFeatureArrayToElementArrayImpl(const AbstractDataArray* selectedFeatureArray, const Int32AbstractDataStore& featureIdsStore, AbstractDataArray* createdArray, + const std::atomic_bool& shouldCancel) : m_SelectedFeature(selectedFeatureArray->template getIDataStoreRefAs()) , m_FeatureIdsStore(featureIdsStore) , m_CreatedStore(createdArray->template getIDataStoreRefAs()) @@ -100,7 +101,7 @@ Parameters CopyFeatureArrayToElementArrayFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Feature Data"}); params.insert(std::make_unique(k_SelectedFeatureArrayPath_Key, "Feature Data to Copy to Cell Data", "The DataPath to the feature data that should be copied to the cell level", MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::Any}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::Any}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Input Cell Data"}); params.insert(std::make_unique(k_CellFeatureIdsArrayPath_Key, "Cell Feature Ids", "Specifies to which feature each cell belongs.", DataPath({"Cell Data", "FeatureIds"}), @@ -145,14 +146,14 @@ IFilter::PreflightResult CopyFeatureArrayToElementArrayFilter::preflightImpl(con return {MakeErrorResult(-3020, fmt::format("The following DataArrays all must have equal number of tuples but this was not satisfied.\n{}", tupleValidityCheck.error()))}; } - const auto& featureIdsArray = dataStructure.getDataRefAs(pFeatureIdsArrayPathValue); + const auto& featureIdsArray = dataStructure.getDataRefAs(pFeatureIdsArrayPathValue); const IDataStore& featureIdsArrayStore = featureIdsArray.getIDataStoreRef(); const std::vector& tDims = featureIdsArrayStore.getTupleShape(); for(const auto& selectedFeatureArrayPath : pSelectedFeatureArrayPathsValue) { DataPath createdArrayPath = pFeatureIdsArrayPathValue.replaceName(selectedFeatureArrayPath.getTargetName() + createdArraySuffix); - const auto& selectedFeatureArray = dataStructure.getDataRefAs(selectedFeatureArrayPath); + const auto& selectedFeatureArray = dataStructure.getDataRefAs(selectedFeatureArrayPath); DataType dataType = selectedFeatureArray.getDataType(); auto createArrayAction = std::make_unique(dataType, tDims, selectedFeatureArray.getComponentShape(), createdArrayPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); @@ -174,7 +175,7 @@ Result<> CopyFeatureArrayToElementArrayFilter::executeImpl(DataStructure& dataSt for(const auto& selectedFeatureArrayPath : pSelectedFeatureArrayPathsValue) { DataPath createdArrayPath = pFeatureIdsArrayPathValue.replaceName(selectedFeatureArrayPath.getTargetName() + createdArraySuffix); - const auto* selectedFeatureArray = dataStructure.getDataAs(selectedFeatureArrayPath); + const auto* selectedFeatureArray = dataStructure.getDataAs(selectedFeatureArrayPath); auto validateNumFeatResult = ValidateFeatureIdsToFeatureAttributeMatrixIndexing(dataStructure, selectedFeatureArrayPath, featureIds, false, messageHandler); if(validateNumFeatResult.invalid()) @@ -186,7 +187,7 @@ Result<> CopyFeatureArrayToElementArrayFilter::executeImpl(DataStructure& dataSt ParallelDataAlgorithm dataAlg; dataAlg.setRange(0, featureIds.getNumberOfTuples()); ExecuteParallelFunction<::CopyFeatureArrayToElementArrayImpl>(selectedFeatureArray->getDataType(), dataAlg, selectedFeatureArray, featureIds.getDataStoreRef(), - dataStructure.getDataAs(createdArrayPath), shouldCancel); + dataStructure.getDataAs(createdArrayPath), shouldCancel); } return {}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.hpp index fe441a3da6..be5bb4c041 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CopyFeatureArrayToElementArrayFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -14,7 +14,7 @@ namespace nx::core * so if the user wants to display a spatial map of a Feature level attribute, * this Filter will transfer that information down to the Element level. */ -class SIMPLNXCORE_EXPORT CopyFeatureArrayToElementArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT CopyFeatureArrayToElementArrayFilter : public AbstractFilter { public: CopyFeatureArrayToElementArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAMScanPathsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAMScanPathsFilter.hpp index e0e6400ac0..ccd7586498 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAMScanPathsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAMScanPathsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreateAMScanPathsFilter * @brief This filter will generate additive manufacturing scan paths from an edge geometry */ -class SIMPLNXCORE_EXPORT CreateAMScanPathsFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateAMScanPathsFilter : public AbstractFilter { public: CreateAMScanPathsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAttributeMatrixFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAttributeMatrixFilter.hpp index d9bc60fc74..24923d9562 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAttributeMatrixFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateAttributeMatrixFilter.hpp @@ -3,14 +3,14 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CreateAttributeMatrixFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateAttributeMatrixFilter : public AbstractFilter { public: CreateAttributeMatrixFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp index a9874d487b..fb687c1aa3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp @@ -2,8 +2,8 @@ #include "Algorithms/CreateColorMap.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -110,7 +110,7 @@ IFilter::PreflightResult CreateColorMapFilter::preflightImpl(const DataStructure nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& dataArray = dataStructure.getDataRefAs(pSelectedDataArrayPathValue); + const auto& dataArray = dataStructure.getDataRefAs(pSelectedDataArrayPathValue); auto createArrayAction = std::make_unique(DataType::uint8, dataArray.getTupleShape(), std::vector{3}, pRgbArrayPathValue); resultOutputActions.value().appendAction(std::move(createArrayAction)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp index a1a0b9da72..8a46b06ecf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * Each element of the input array is normalized and converted to a color based on where * the value falls in the spectrum of the selected color preset. */ -class SIMPLNXCORE_EXPORT CreateColorMapFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateColorMapFilter : public AbstractFilter { public: CreateColorMapFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp index a8495e4ca2..28c1ec3461 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CreateDataArrayAdvancedFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateDataArrayAdvancedFilter : public AbstractFilter { public: CreateDataArrayAdvancedFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp index d2eb55a730..5050cfc75e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp @@ -1,8 +1,8 @@ #include "CreateDataArrayFilter.hpp" #include "simplnx/Common/TypesUtility.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArrayCreationParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp index 7965b169e7..ba1ed22c36 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CreateDataArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateDataArrayFilter : public AbstractFilter { public: CreateDataArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataGroupFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataGroupFilter.hpp index 5e6cb04007..b9c3ee73df 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataGroupFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataGroupFilter.hpp @@ -3,14 +3,14 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CreateDataGroupFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateDataGroupFilter : public AbstractFilter { public: CreateDataGroupFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.cpp index c47fa39a7d..04c60f03e8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.cpp @@ -18,7 +18,7 @@ namespace struct CopyCellDataFunctor { template - Result<> operator()(const IDataArray* selectedCellArray, const Int32AbstractDataStore& featureIds, IDataArray* createdArray, const std::atomic_bool& shouldCancel) + Result<> operator()(const AbstractDataArray* selectedCellArray, const Int32AbstractDataStore& featureIds, AbstractDataArray* createdArray, const std::atomic_bool& shouldCancel) { const auto& selectedCellStore = selectedCellArray->template getIDataStoreRefAs>(); auto& createdDataStore = createdArray->template getIDataStoreRefAs>(); @@ -141,7 +141,7 @@ IFilter::PreflightResult CreateFeatureArrayFromElementArrayFilter::preflightImpl auto pCellFeatureAttributeMatrixPathValue = filterArgs.value(k_CellFeatureAttributeMatrixPath_Key); auto pCreatedArrayNameValue = filterArgs.value(k_CreatedArrayName_Key); - const auto& selectedCellArray = dataStructure.getDataRefAs(pSelectedCellArrayPathValue); + const auto& selectedCellArray = dataStructure.getDataRefAs(pSelectedCellArrayPathValue); const IDataStore& selectedCellArrayStore = selectedCellArray.getIDataStoreRef(); nx::core::Result resultOutputActions; @@ -177,9 +177,9 @@ Result<> CreateFeatureArrayFromElementArrayFilter::executeImpl(DataStructure& da auto pCreatedArrayNameValue = filterArgs.value(k_CreatedArrayName_Key); const DataPath createdArrayPath = pCellFeatureAttributeMatrixPathValue.createChildPath(pCreatedArrayNameValue); - const auto* selectedCellArray = dataStructure.getDataAs(pSelectedCellArrayPathValue); + const auto* selectedCellArray = dataStructure.getDataAs(pSelectedCellArrayPathValue); const auto& featureIds = dataStructure.getDataAs(pFeatureIdsArrayPathValue)->getDataStoreRef(); - auto* createdArray = dataStructure.getDataAs(createdArrayPath); + auto* createdArray = dataStructure.getDataAs(createdArrayPath); // Resize the created array to the proper size usize featureIdsMaxIdx = std::distance(featureIds.begin(), std::max_element(featureIds.cbegin(), featureIds.cend())); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.hpp index e7bd2d4fc6..864648280d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateFeatureArrayFromElementArrayFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreateFeatureArrayFromElementArrayFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CreateFeatureArrayFromElementArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateFeatureArrayFromElementArrayFilter : public AbstractFilter { public: CreateFeatureArrayFromElementArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.cpp index a05816ceb3..c0fae82229 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.cpp @@ -3,7 +3,7 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/TypesUtility.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/Filter/Actions/CreateGeometry1DAction.hpp" #include "simplnx/Filter/Actions/CreateGeometry2DAction.hpp" #include "simplnx/Filter/Actions/CreateGeometry3DAction.hpp" @@ -112,8 +112,8 @@ Parameters CreateGeometryFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Parameter(s)"}); params.insertLinkableParameter(std::make_unique(k_GeometryType_Key, "Geometry Type", "The type of Geometry to create", 0, GetAllGeometryTypesAsStrings())); - params.insert(std::make_unique(k_LengthUnitType_Key, "Length Unit", "The length unit to be used in the geometry", to_underlying(IGeometry::LengthUnit::Millimeter), - IGeometry::GetAllLengthUnitStrings())); + params.insert(std::make_unique(k_LengthUnitType_Key, "Length Unit", "The length unit to be used in the geometry", to_underlying(AbstractGeometry::LengthUnit::Millimeter), + AbstractGeometry::GetAllLengthUnitStrings())); params.insert(std::make_unique(k_WarningsAsErrors_Key, "Treat Geometry Warnings as Errors", "Whether run time warnings for Geometries should be treated as errors", false)); params.insert(std::make_unique(k_ArrayHandling_Key, "Array Handling", "Determines if the arrays that make up the geometry primitives should be Moved or Copied to the created Geometry object.", @@ -149,13 +149,13 @@ Parameters CreateGeometryFilter::parameters() const params.insertSeparator(Parameters::Separator{"Output Data Object(s)"}); params.insert(std::make_unique(k_GeometryPath_Key, "Geometry Name", "The complete path to the geometry to be created", DataPath({"Geometry"}))); params.insert(std::make_unique(k_VertexAttributeMatrixName_Key, "Vertex Attribute Matrix", "The name of the vertex attribute matrix to be created with the geometry", - INodeGeometry0D::k_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insert(std::make_unique(k_EdgeAttributeMatrixName_Key, "Edge Attribute Matrix", "The name of the edge attribute matrix to be created with the geometry", - INodeGeometry1D::k_EdgeAttributeMatrixName)); + AbstractNodeGeometry1D::k_EdgeAttributeMatrixName)); params.insert(std::make_unique(k_FaceAttributeMatrixName_Key, "Face Attribute Matrix", "The name of the face attribute matrix to be created with the geometry", - INodeGeometry2D::k_FaceAttributeMatrixName)); + AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); params.insert(std::make_unique(k_CellAttributeMatrixName_Key, "Cell Attribute Matrix", "The name of the cell attribute matrix to be created with the geometry", - IGridGeometry::k_CellAttributeMatrixName)); + AbstractGridGeometry::k_CellAttributeMatrixName)); // setup linked parameters // image @@ -345,8 +345,8 @@ Result<> CreateGeometryFilter::executeImpl(DataStructure& dataStructure, const A auto geometryType = filterArgs.value(k_GeometryType_Key); auto treatWarningsAsErrors = filterArgs.value(k_WarningsAsErrors_Key); - auto* iGeometry = dataStructure.getDataAs(geometryPath); - auto lengthUnit = static_cast(filterArgs.value(k_LengthUnitType_Key)); + auto* iGeometry = dataStructure.getDataAs(geometryPath); + auto lengthUnit = static_cast(filterArgs.value(k_LengthUnitType_Key)); iGeometry->setUnits(lengthUnit); DataPath sharedVertexListArrayPath; @@ -487,7 +487,7 @@ Result CreateGeometryFilter::FromSIMPLJson(const nlohmann::json& json auto result = SIMPLConversion::ChoiceFilterParameterConverter::convert(json[SIMPL::k_GeometryTypeKey]); if(result.valid()) { - auto geometryType = static_cast(result.value()); + auto geometryType = static_cast(result.value()); switch(geometryType) { case IGeometry::Type::Vertex: { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.hpp index a63a509151..e9178be5a0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreateGeometryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CreateGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateGeometryFilter : public AbstractFilter { public: CreateGeometryFilter() = default; @@ -57,18 +57,18 @@ class SIMPLNXCORE_EXPORT CreateGeometryFilter : public IFilter static constexpr StringLiteral k_CellAttributeMatrixName_Key = "cell_attribute_matrix_name"; // GeometryType values - static inline constexpr uint64 k_ImageGeometry = 0; - static inline constexpr uint64 k_RectGridGeometry = 1; - static inline constexpr uint64 k_VertexGeometry = 2; - static inline constexpr uint64 k_EdgeGeometry = 3; - static inline constexpr uint64 k_TriangleGeometry = 4; - static inline constexpr uint64 k_QuadGeometry = 5; - static inline constexpr uint64 k_TetGeometry = 6; - static inline constexpr uint64 k_HexGeometry = 7; + static constexpr uint64 k_ImageGeometry = 0; + static constexpr uint64 k_RectGridGeometry = 1; + static constexpr uint64 k_VertexGeometry = 2; + static constexpr uint64 k_EdgeGeometry = 3; + static constexpr uint64 k_TriangleGeometry = 4; + static constexpr uint64 k_QuadGeometry = 5; + static constexpr uint64 k_TetGeometry = 6; + static constexpr uint64 k_HexGeometry = 7; // ArrayHandling values - static inline constexpr uint64 k_CopyArray = 0; - static inline constexpr uint64 k_MoveArray = 1; - static inline constexpr uint64 k_ReferenceArray = 2; + static constexpr uint64 k_CopyArray = 0; + static constexpr uint64 k_MoveArray = 1; + static constexpr uint64 k_ReferenceArray = 2; /** * @brief Reads SIMPL json and converts it simplnx Arguments. diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateImageGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateImageGeometryFilter.hpp index b46024325f..56c2e1f75c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateImageGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateImageGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreateImageGeometryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CreateImageGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateImageGeometryFilter : public AbstractFilter { public: CreateImageGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreatePythonSkeletonFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreatePythonSkeletonFilter.hpp index 42c829de29..8b10679504 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreatePythonSkeletonFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreatePythonSkeletonFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class CreatePythonSkeletonFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT CreatePythonSkeletonFilter : public IFilter +class SIMPLNXCORE_EXPORT CreatePythonSkeletonFilter : public AbstractFilter { public: CreatePythonSkeletonFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.cpp index d0fbce925b..13fa54938c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.cpp @@ -1,8 +1,8 @@ #include "CropEdgeGeometryFilter.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Filter/Actions/CopyDataObjectAction.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" @@ -207,7 +207,7 @@ IFilter::PreflightResult CropEdgeGeometryFilter::preflightImpl(const DataStructu DataPath newEdgeAttributeMatrixPath = destEdgeGeomPath.createChildPath(selectedEdgeData.getName()); for(const auto& [identifier, object] : selectedEdgeData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newEdgeAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -218,7 +218,7 @@ IFilter::PreflightResult CropEdgeGeometryFilter::preflightImpl(const DataStructu // in the destination edge geometry's vertex attribute matrix DataPath newVertexAttributeMatrixPath = destEdgeGeomPath.createChildPath(selectedVertexData.getName()); - auto vertexArraysResult = selectedVertexData.findAllChildrenOfType(); + auto vertexArraysResult = selectedVertexData.findAllChildrenOfType(); if(!vertexArraysResult.empty()) { // Detected at least one vertex array, throw a warning @@ -228,7 +228,7 @@ IFilter::PreflightResult CropEdgeGeometryFilter::preflightImpl(const DataStructu for(const auto& [identifier, object] : selectedVertexData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newVertexAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -246,7 +246,7 @@ IFilter::PreflightResult CropEdgeGeometryFilter::preflightImpl(const DataStructu // This section covers copying the other Attribute Matrix objects from the source geometry // to the destination geometry - auto childPaths = GetAllChildDataPaths(dataStructure, srcEdgeGeomPath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcEdgeGeomPath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.hpp index 7ceafe92b3..fe87999887 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropEdgeGeometryFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CropEdgeGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT CropEdgeGeometryFilter : public AbstractFilter { public: CropEdgeGeometryFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.cpp index 04d78e7164..4ee43ca4e2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.cpp @@ -1,8 +1,8 @@ #include "CropImageGeometryFilter.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/DataStructure/StringArray.hpp" #include "simplnx/Filter/Actions/CopyDataObjectAction.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" @@ -71,7 +71,7 @@ template class CropImageGeomDataArray { public: - CropImageGeomDataArray(const IDataArray& oldCellArray, IDataArray& newCellArray, const ImageGeom& srcImageGeom, std::array bounds, const std::atomic_bool& shouldCancel) + CropImageGeomDataArray(const AbstractDataArray& oldCellArray, AbstractDataArray& newCellArray, const ImageGeom& srcImageGeom, std::array bounds, const std::atomic_bool& shouldCancel) : m_OldCellStore(oldCellArray.template getIDataStoreRefAs>()) , m_NewCellStore(newCellArray.template getIDataStoreRefAs>()) , m_SrcImageGeom(srcImageGeom) @@ -474,7 +474,7 @@ IFilter::PreflightResult CropImageGeometryFilter::preflightImpl(const DataStruct DataPath newCellAttributeMatrixPath = destImagePath.createChildPath(cellDataName); for(const auto& [identifier, object] : *selectedCellData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newCellAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -499,14 +499,14 @@ IFilter::PreflightResult CropImageGeometryFilter::preflightImpl(const DataStruct resultOutputActions.value().appendAction(std::make_unique(destCellFeatureAmPath, tDims)); for(const auto& [identifier, object] : srcCellFeatureData) { - if(const auto* srcArray = dynamic_cast(object.get()); srcArray != nullptr) + if(const auto* srcArray = dynamic_cast(object.get()); srcArray != nullptr) { DataType dataType = srcArray->getDataType(); ShapeType componentShape = srcArray->getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = destCellFeatureAmPath.createChildPath(srcArray->getName()); resultOutputActions.value().appendAction(std::make_unique(dataType, tDims, std::move(componentShape), dataArrayPath)); } - else if(const auto* srcNeighborListArray = dynamic_cast(object.get()); srcNeighborListArray != nullptr) + else if(const auto* srcNeighborListArray = dynamic_cast(object.get()); srcNeighborListArray != nullptr) { warningMsg += "\n" + cellFeatureAmPath.toString() + "/" + srcNeighborListArray->getName(); } @@ -523,7 +523,7 @@ IFilter::PreflightResult CropImageGeometryFilter::preflightImpl(const DataStruct // This section covers copying the other Attribute Matrix objects from the source geometry // to the destination geometry - auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) @@ -644,10 +644,10 @@ Result<> CropImageGeometryFilter::executeImpl(DataStructure& dataStructure, cons return {}; } - const auto& oldDataArray = dynamic_cast(*oldDataObject); + const auto& oldDataArray = dynamic_cast(*oldDataObject); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); + auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); messageHandler(fmt::format("Cropping Volume || Copying Data Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, oldDataArray, newDataArray, srcImageGeom, bounds, shouldCancel); @@ -692,16 +692,16 @@ Result<> CropImageGeometryFilter::executeImpl(DataStructure& dataStructure, cons // created, so we can use the convenience of the DataArray.deepCopy() function. for(size_t index = 0; index < sourceFeatureDataPaths.size(); index++) { - DataObject* dataObject = dataStructure.getData(sourceFeatureDataPaths[index]); - if(dataObject->getDataObjectType() == DataObject::Type::DataArray) + AbstractDataObject* dataObject = dataStructure.getData(sourceFeatureDataPaths[index]); + if(dataObject->getDataObjectType() == IDataObject::Type::DataArray) { - auto result = DeepCopy(dataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); + auto result = DeepCopy(dataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); if(result.invalid()) { return result; } } - else if(dataObject->getDataObjectType() == DataObject::Type::StringArray) + else if(dataObject->getDataObjectType() == IDataObject::Type::StringArray) { auto result = DeepCopy(dataStructure, sourceFeatureDataPaths[index], destFeatureDataPaths[index]); if(result.invalid()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.hpp index d550da6257..7f09b31274 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropImageGeometryFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CropImageGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT CropImageGeometryFilter : public AbstractFilter { public: CropImageGeometryFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.cpp index c259c740a9..dec8b18b3c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.cpp @@ -20,7 +20,7 @@ namespace struct CopyDataToCroppedGeometryFunctor { template - void operator()(const IDataArray* inDataRef, IDataArray* outDataRef, const std::vector& croppedPoints) + void operator()(const AbstractDataArray* inDataRef, AbstractDataArray* outDataRef, const std::vector& croppedPoints) { const auto& inputData = inDataRef->template getIDataStoreRefAs>(); auto& croppedData = outDataRef->template getIDataStoreRefAs>(); @@ -80,11 +80,11 @@ Parameters CropVertexGeometryFilter::parameters() const GeometrySelectionParameter::AllowedTypes{IGeometry::Type::Vertex})); params.insert(std::make_unique(k_CreatedVertexGeometryPath_Key, "Cropped Vertex Geometry", "Created VertexGeom path", DataPath{})); params.insert( - std::make_unique(k_VertexAttributeMatrixName_Key, "Vertex Data Name", "Name of the vertex data AttributeMatrix", INodeGeometry0D::k_VertexAttributeMatrixName)); + std::make_unique(k_VertexAttributeMatrixName_Key, "Vertex Data Name", "Name of the vertex data AttributeMatrix", AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insert(std::make_unique(k_MinPos_Key, "Min Pos", "Minimum vertex position", std::vector{0.0f, 0.0f, 0.0f}, std::vector{"X", "Y", "Z"})); params.insert(std::make_unique(k_MaxPos_Key, "Max Pos", "Maximum vertex position", std::vector{0.0f, 0.0f, 0.0f}, std::vector{"X", "Y", "Z"})); params.insert(std::make_unique(k_TargetArrayPaths_Key, "Vertex Data Arrays to crop", "The complete path to all the vertex data arrays to crop", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); return params; } @@ -187,7 +187,7 @@ IFilter::PreflightResult CropVertexGeometryFilter::preflightImpl(const DataStruc for(auto&& targetArrayPath : targetArrays) { - auto& targetArray = dataStructure.getDataRefAs(targetArrayPath); + auto& targetArray = dataStructure.getDataRefAs(targetArrayPath); DataType type = targetArray.getDataType(); auto tDims = targetArray.getNumberOfTuples(); @@ -261,8 +261,8 @@ Result<> CropVertexGeometryFilter::executeImpl(DataStructure& dataStructure, con { DataPath destArrayPath(croppedVertexDataPath.createChildPath(targetArrayPath.getTargetName())); - const auto* srcArray = dataStructure.getDataAs(targetArrayPath); - auto* destArray = dataStructure.getDataAs(destArrayPath); + const auto* srcArray = dataStructure.getDataAs(targetArrayPath); + auto* destArray = dataStructure.getDataAs(destArrayPath); ExecuteDataFunction(CopyDataToCroppedGeometryFunctor{}, srcArray->getDataType(), srcArray, destArray, croppedPoints); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.hpp index 6714282394..8ee56cf788 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CropVertexGeometryFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT CropVertexGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT CropVertexGeometryFilter : public AbstractFilter { public: CropVertexGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.cpp index 35966f14b1..37b8754b87 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.cpp @@ -3,9 +3,9 @@ #include "SimplnxCore/Filters/Algorithms/DBSCAN.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" @@ -153,7 +153,7 @@ IFilter::PreflightResult DBSCANFilter::preflightImpl(const DataStructure& dataSt nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); + auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); if(clusterArray == nullptr) { return MakePreflightErrorResult(-7586, "Array to Cluster MUST be a valid DataPath."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.hpp index 4247baeb70..2ffbf353ed 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DBSCANFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class DBSCANFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT DBSCANFilter : public IFilter +class SIMPLNXCORE_EXPORT DBSCANFilter : public AbstractFilter { public: DBSCANFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.cpp index c132261516..678f9ae6a9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.cpp @@ -83,7 +83,7 @@ IFilter::PreflightResult DeleteDataFilter::preflightImpl(const DataStructure& da OutputActions deleteActions; for(const auto& dataObjectPath : dataObjectPaths) { - const auto* dataObject = dataStructure.getDataAs(dataObjectPath); + const auto* dataObject = dataStructure.getDataAs(dataObjectPath); // switch(deletionType) //{ diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.hpp index 10e7ec89e2..2dd68dfeed 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/DeleteDataFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT DeleteDataFilter : public IFilter +class SIMPLNXCORE_EXPORT DeleteDataFilter : public AbstractFilter { public: DeleteDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.cpp index 0ca6ab44a7..352854d763 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.cpp @@ -72,7 +72,7 @@ Parameters ErodeDilateBadDataFilter::parameters() const ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_IgnoredDataArrayPaths_Key, "Attribute Arrays to Ignore", "The list of arrays to ignore when performing the algorithm", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); return params; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.hpp index 677e000af3..f9a0dc0a3e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateBadDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * copying neighbor data into the voxel with featureId = 0. See the Markdown for * a more comprehensive explanation */ -class SIMPLNXCORE_EXPORT ErodeDilateBadDataFilter : public IFilter +class SIMPLNXCORE_EXPORT ErodeDilateBadDataFilter : public AbstractFilter { public: ErodeDilateBadDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.cpp index 3123257afb..df498308c0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.cpp @@ -64,7 +64,7 @@ Parameters ErodeDilateCoordinationNumberFilter::parameters() const ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_IgnoredDataArrayPaths_Key, "Attribute Arrays to Ignore", "The list of arrays to ignore when performing the algorithm", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); return params; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.hpp index 715f504d6c..ddb9f0edf8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateCoordinationNumberFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ErodeDilateCoordinationNumberFilter * @brief This **Filter** will smooth the interface between *good* and *bad* data. */ -class SIMPLNXCORE_EXPORT ErodeDilateCoordinationNumberFilter : public IFilter +class SIMPLNXCORE_EXPORT ErodeDilateCoordinationNumberFilter : public AbstractFilter { public: ErodeDilateCoordinationNumberFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateMaskFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateMaskFilter.hpp index 99067ed142..e42552a6be 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateMaskFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ErodeDilateMaskFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * If the mask is _dilated_, the **Filter** grows the *true* regions by one **Cell** in an iterative sequence for a user defined number of iterations. */ -class SIMPLNXCORE_EXPORT ErodeDilateMaskFilter : public IFilter +class SIMPLNXCORE_EXPORT ErodeDilateMaskFilter : public AbstractFilter { public: ErodeDilateMaskFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExecuteProcessFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExecuteProcessFilter.hpp index ec5029cbdb..25b60096d5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExecuteProcessFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExecuteProcessFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ExecuteProcessFilter * @brief This filter allows the user to execute any application, program, shell script or any other executable program on the computer system as an external process */ -class SIMPLNXCORE_EXPORT ExecuteProcessFilter : public IFilter +class SIMPLNXCORE_EXPORT ExecuteProcessFilter : public AbstractFilter { public: ExecuteProcessFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.cpp index 4e5d23760b..747d1254f0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/Algorithms/ExtractComponentAsArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Filter/Actions/RenameDataAction.hpp" @@ -97,7 +97,7 @@ IFilter::PreflightResult ExtractComponentAsArrayFilter::preflightImpl(const Data nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& selectedArray = dataStructure.getDataRefAs(pSelectedArrayPathValue); + const auto& selectedArray = dataStructure.getDataRefAs(pSelectedArrayPathValue); // Verify Components const usize selectedArrayComp = selectedArray.getNumberOfComponents(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.hpp index f3d94a9c3f..7f6583d19f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractComponentAsArrayFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will extract components of an array either to a new array or * delete it. */ -class SIMPLNXCORE_EXPORT ExtractComponentAsArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT ExtractComponentAsArrayFilter : public AbstractFilter { public: ExtractComponentAsArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.cpp index dc77754c0c..f6bd37ca16 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.cpp @@ -4,7 +4,7 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/Filter/Actions/CreateGeometry1DAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" @@ -130,8 +130,9 @@ IFilter::PreflightResult ExtractFeatureBoundaries2DFilter::preflightImpl(const D usize maxVertices = maxEdges * 2; // Conservative estimate. It will be reduced by deduplication // Create the Edge Geometry action - auto createEdgeGeomAction = std::make_unique(pOutputEdgeGeometryPathValue, maxEdges, maxVertices, INodeGeometry0D::k_VertexAttributeMatrixName, - INodeGeometry1D::k_EdgeAttributeMatrixName, INodeGeometry0D::k_SharedVertexListName, INodeGeometry1D::k_SharedEdgeListName); + auto createEdgeGeomAction = + std::make_unique(pOutputEdgeGeometryPathValue, maxEdges, maxVertices, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, + AbstractNodeGeometry1D::k_EdgeAttributeMatrixName, AbstractNodeGeometry0D::k_SharedVertexListName, AbstractNodeGeometry1D::k_SharedEdgeListName); resultOutputActions.value().appendAction(std::move(createEdgeGeomAction)); return {std::move(resultOutputActions), std::move(preflightUpdatedValues)}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.hpp index 4589f9f9ed..1d68d797bf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractFeatureBoundaries2DFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ExtractFeatureBoundaries2DFilter * @brief This filter extracts 2D feature boundaries from an Image Geometry and creates an Edge Geometry. */ -class SIMPLNXCORE_EXPORT ExtractFeatureBoundaries2DFilter : public IFilter +class SIMPLNXCORE_EXPORT ExtractFeatureBoundaries2DFilter : public AbstractFilter { public: ExtractFeatureBoundaries2DFilter() = default; @@ -24,12 +24,12 @@ class SIMPLNXCORE_EXPORT ExtractFeatureBoundaries2DFilter : public IFilter ExtractFeatureBoundaries2DFilter& operator=(ExtractFeatureBoundaries2DFilter&&) noexcept = delete; // Parameter Keys - static inline constexpr StringLiteral k_InputImageGeometryPath_Key = "input_image_geometry_path"; - static inline constexpr StringLiteral k_FeatureIdsArrayPath_Key = "feature_ids_array_path"; - static inline constexpr StringLiteral k_OutputEdgeGeometryPath_Key = "output_edge_geometry_path"; - static inline constexpr StringLiteral k_ZValueChoice_Key = "z_value_choice_index"; - static inline constexpr StringLiteral k_CustomZValue_Key = "custom_z_value"; - static inline constexpr StringLiteral k_ExtractVirtualSampleEdges_Key = "extract_virtual_sample_edges"; + static constexpr StringLiteral k_InputImageGeometryPath_Key = "input_image_geometry_path"; + static constexpr StringLiteral k_FeatureIdsArrayPath_Key = "feature_ids_array_path"; + static constexpr StringLiteral k_OutputEdgeGeometryPath_Key = "output_edge_geometry_path"; + static constexpr StringLiteral k_ZValueChoice_Key = "z_value_choice_index"; + static constexpr StringLiteral k_CustomZValue_Key = "custom_z_value"; + static constexpr StringLiteral k_ExtractVirtualSampleEdges_Key = "extract_virtual_sample_edges"; /** * @brief Returns the name of the filter. diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.cpp index 9cefb20a6a..ad7e7d0c75 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.cpp @@ -72,15 +72,15 @@ Parameters ExtractInternalSurfacesFromTriangleGeometryFilter::parameters() const params.insertSeparator(Parameters::Separator{"Output Data Object(s)"}); params.insert(std::make_unique(k_CreatedTriangleGeometryPath_Key, "Created Triangle Geometry Path", "Path to create the new Triangle Geometry", DataPath())); params.insert(std::make_unique(k_VertexAttributeMatrixName_Key, "Vertex Data Attribute Matrix", "Created vertex data AttributeMatrix name", - INodeGeometry0D::k_VertexAttributeMatrixName)); - params.insert( - std::make_unique(k_TriangleAttributeMatrixName_Key, "Face Data Attribute Matrix", "Created face data AttributeMatrix name", INodeGeometry2D::k_FaceAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); + params.insert(std::make_unique(k_TriangleAttributeMatrixName_Key, "Face Data Attribute Matrix", "Created face data AttributeMatrix name", + AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); params.insertSeparator(Parameters::Separator{"Optional Transferred Data"}); params.insert(std::make_unique(k_CopyVertexPaths_Key, "Copy Vertex Arrays", "Paths to vertex-related DataArrays that should be copied to the new geometry", - std::vector{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllDataTypes())); + std::vector{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllDataTypes())); params.insert(std::make_unique(k_CopyTrianglePaths_Key, "Copy Face Arrays", "Paths to face-related DataArrays that should be copied to the new geometry", - std::vector{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllDataTypes())); + std::vector{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllDataTypes())); return params; } @@ -155,7 +155,7 @@ IFilter::PreflightResult ExtractInternalSurfacesFromTriangleGeometryFilter::pref for(const auto& data_array : copyVertexPaths) { copiedArrays.push_back(data_array); - auto targetDataArray = dataStructure.getDataAs(data_array); + auto targetDataArray = dataStructure.getDataAs(data_array); if(targetDataArray == nullptr) { std::string ss = fmt::format("Could not find DataArray at path '{}'", data_array.toString()); @@ -182,7 +182,7 @@ IFilter::PreflightResult ExtractInternalSurfacesFromTriangleGeometryFilter::pref for(const auto& data_array : copyTrianglePaths) { copiedArrays.push_back(data_array); - auto targetDataArray = dataStructure.getDataAs(data_array); + auto targetDataArray = dataStructure.getDataAs(data_array); if(targetDataArray == nullptr) { std::string ss = fmt::format("Could not find DataArray at path '{}'", data_array.toString()); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.hpp index acbd23d411..b19fef8905 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractInternalSurfacesFromTriangleGeometryFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ExtractInternalSurfacesFromTriangleGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT ExtractInternalSurfacesFromTriangleGeometryFilter : public AbstractFilter { public: ExtractInternalSurfacesFromTriangleGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractPipelineToFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractPipelineToFileFilter.hpp index a096b800b1..0938b09cc2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractPipelineToFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractPipelineToFileFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -14,7 +14,7 @@ namespace nx::core * @brief The ExtractPipelineToFileFilter is an IFilter class designed to extract the pipeline data * from a target DREAM3D-NX file and export it out to it's own file. */ -class SIMPLNXCORE_EXPORT ExtractPipelineToFileFilter : public IFilter +class SIMPLNXCORE_EXPORT ExtractPipelineToFileFilter : public AbstractFilter { public: ExtractPipelineToFileFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.cpp index e7f8e43fcd..1fa422c48f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.cpp @@ -3,7 +3,7 @@ #include "SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateVertexGeometryAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" @@ -72,7 +72,7 @@ Parameters ExtractVertexGeometryFilter::parameters() const ChoicesParameter::Choices{"Copy Attribute Arrays", "Move Attribute Arrays"})); params.insert(std::make_unique(k_IncludedDataArrayPaths_Key, "Included Attribute Arrays", "The arrays to copy/move to the vertex array", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Vertex Geometry"}); @@ -116,7 +116,7 @@ IFilter::PreflightResult ExtractVertexGeometryFilter::preflightImpl(const DataSt nx::core::Result resultOutputActions; - const auto& geometry = dataStructure.getDataRefAs({pInputGeometryPathValue}); + const auto& geometry = dataStructure.getDataRefAs({pInputGeometryPathValue}); SizeVec3 dims = geometry.getDimensions(); usize geomElementCount = dims[0] * dims[1] * dims[2]; @@ -143,7 +143,7 @@ IFilter::PreflightResult ExtractVertexGeometryFilter::preflightImpl(const DataSt // as the output Vertex Geometry if(!dataPaths.empty()) { - const auto& dataArray = dataStructure.getDataRefAs(dataPaths.front()); + const auto& dataArray = dataStructure.getDataRefAs(dataPaths.front()); if(dataArray.getNumberOfTuples() != geomElementCount) { return {MakeErrorResult(-2006, fmt::format("The selected DataArrays do not have the correct number of tuples. The Input Geometry ({}) has {} tuples but the " @@ -156,7 +156,7 @@ IFilter::PreflightResult ExtractVertexGeometryFilter::preflightImpl(const DataSt const DataPath vertexAttrMatrixPath = pVertexGeometryPathValue.createChildPath(pVertexAttrMatrixNameValue); for(const DataPath& dataPath : pIncludedDataArrayPathsValue) { - const auto& dataArray = dataStructure.getDataRefAs(dataPath); + const auto& dataArray = dataStructure.getDataRefAs(dataPath); DataPath newDataPath = vertexAttrMatrixPath.createChildPath(dataPath.getTargetName()); auto createArrayAction = std::make_unique(dataArray.getDataType(), std::vector{dataArray.getNumberOfTuples()}, dataArray.getComponentShape(), newDataPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.hpp index a777826b73..a214feda4f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ExtractVertexGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * geometry into a new VertexGeometry. The user is given the option to copy or move cell arrays * over to the newly created VertexGeometry. */ -class SIMPLNXCORE_EXPORT ExtractVertexGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT ExtractVertexGeometryFilter : public AbstractFilter { public: ExtractVertexGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.cpp index 0bee1d1245..63fcf442b3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.cpp @@ -155,7 +155,7 @@ IFilter::PreflightResult FeatureFaceCurvatureFilter::preflightImpl(const DataStr dataArrays.push_back(surfaceMeshTriangleCentroidsPath); } - // auto* dataArray = dataStructure.getDataAs(triangles->getFaceAttributeMatrixDataPath()); + // auto* dataArray = dataStructure.getDataAs(triangles->getFaceAttributeMatrixDataPath()); ShapeType tupleShape = triangleMatrix->getShape(); nx::core::Result resultOutputActions; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.hpp index f4b8a4246c..3d874ae1b4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FeatureFaceCurvatureFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will replace data using data from surrounding voxels. See more * at the help file. */ -class SIMPLNXCORE_EXPORT FeatureFaceCurvatureFilter : public IFilter +class SIMPLNXCORE_EXPORT FeatureFaceCurvatureFilter : public AbstractFilter { public: FeatureFaceCurvatureFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.cpp index fb5f642883..985e67045f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.cpp @@ -68,7 +68,7 @@ Parameters FillBadDataFilter::parameters() const ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_IgnoredDataArrayPaths_Key, "Attribute Arrays to Ignore", "The list of arrays to ignore when performing the algorithm", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_StoreAsNewPhase_Key, k_CellPhasesArrayPath_Key, true); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.hpp index 5e32af3e3d..b8dd5df89a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FillBadDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will replace data using data from surrounding voxels. See more * at the help file. */ -class SIMPLNXCORE_EXPORT FillBadDataFilter : public IFilter +class SIMPLNXCORE_EXPORT FillBadDataFilter : public AbstractFilter { public: FillBadDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.cpp index c6500387df..028b9b05c3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.cpp @@ -96,8 +96,8 @@ IFilter::PreflightResult FlyingEdges3DFilter::preflightImpl(const DataStructure& // Create the Triangle Geometry action and store it auto createTriangleGeometryAction = - std::make_unique(pTriangleGeomName, static_cast(1), static_cast(1), INodeGeometry0D::k_VertexAttributeMatrixName, - INodeGeometry2D::k_FaceAttributeMatrixName, TriangleGeom::k_SharedVertexListName, TriangleGeom::k_SharedFacesListName); + std::make_unique(pTriangleGeomName, static_cast(1), static_cast(1), AbstractNodeGeometry0D::k_VertexAttributeMatrixName, + AbstractNodeGeometry2D::k_FaceAttributeMatrixName, TriangleGeom::k_SharedVertexListName, TriangleGeom::k_SharedFacesListName); auto vertexNormalsPath = createTriangleGeometryAction->getVertexDataPath().createChildPath(k_VertexNormals); resultOutputActions.value().appendAction(std::move(createTriangleGeometryAction)); @@ -118,7 +118,7 @@ Result<> FlyingEdges3DFilter::executeImpl(DataStructure& dataStructure, const Ar inputValues.contouringArrayPath = filterArgs.value(k_SelectedDataArrayPath_Key); inputValues.triangleGeomPath = filterArgs.value(k_CreatedTriangleGeometryPath_Key); inputValues.isoVal = filterArgs.value(k_IsoVal_Key); - inputValues.normalsArrayPath = inputValues.triangleGeomPath.createChildPath(INodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); + inputValues.normalsArrayPath = inputValues.triangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); return FlyingEdges3D(dataStructure, messageHandler, shouldCancel, &inputValues)(); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.hpp index de0f2055c4..aa9809f882 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/FlyingEdges3DFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class FlyingEdges3DFilter * @brief This filter will draw a 3 dimensional contouring line through an Image Geometry based on an input value. */ -class SIMPLNXCORE_EXPORT FlyingEdges3DFilter : public IFilter +class SIMPLNXCORE_EXPORT FlyingEdges3DFilter : public AbstractFilter { public: FlyingEdges3DFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.cpp index 018d890878..65b11d1c25 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.cpp @@ -77,7 +77,7 @@ IFilter::PreflightResult IdentifyDuplicateVerticesFilter::preflightImpl(const Da const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const { auto pGeomPath = filterArgs.value(k_InputGeomPath_Key); - const auto* geom = dataStructure.getDataAs(pGeomPath); + const auto* geom = dataStructure.getDataAs(pGeomPath); if(geom == nullptr || geom->getVertices() == nullptr) { return MakePreflightErrorResult(-62910, "Input Geometry must contain a SharedVertexList."); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.hpp index 1d5b9c8352..a42f60b674 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifyDuplicateVerticesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class IdentifyDuplicateVerticesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT IdentifyDuplicateVerticesFilter : public IFilter +class SIMPLNXCORE_EXPORT IdentifyDuplicateVerticesFilter : public AbstractFilter { public: IdentifyDuplicateVerticesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifySampleFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifySampleFilter.hpp index 53b76ceb14..158374d0cf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifySampleFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IdentifySampleFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT IdentifySampleFilter : public IFilter +class SIMPLNXCORE_EXPORT IdentifySampleFilter : public AbstractFilter { public: IdentifySampleFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.cpp index e7f13d69fa..ea5ac5e4ba 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.cpp @@ -145,7 +145,7 @@ IFilter::PreflightResult InitializeDataFilter::preflightImpl(const DataStructure nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - auto& iDataArray = dataStructure.getDataRefAs(filterArgs.value(k_ArrayPath_Key)); + auto& iDataArray = dataStructure.getDataRefAs(filterArgs.value(k_ArrayPath_Key)); usize numComp = iDataArray.getNumberOfComponents(); // check that the values string is greater than max comps if(iDataArray.getDataType() == DataType::boolean) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.hpp index f250c43b74..864745f1b8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeDataFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT InitializeDataFilter : public IFilter +class SIMPLNXCORE_EXPORT InitializeDataFilter : public AbstractFilter { public: InitializeDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.cpp index 60a580f297..9f5d1e2553 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.cpp @@ -104,7 +104,7 @@ auto CreateRandomGenerator(T rangeMin, T rangeMax, uint64 seed) struct InitializeArrayFunctor { template - void operator()(IDataArray& dataArray, const std::array& dims, uint64 xMin, uint64 xMax, uint64 yMin, uint64 yMax, uint64 zMin, uint64 zMax, + void operator()(AbstractDataArray& dataArray, const std::array& dims, uint64 xMin, uint64 xMax, uint64 yMin, uint64 yMax, uint64 zMin, uint64 zMax, InitializeImageGeomCellDataFilter::InitType initType, float64 initValue, const RangeType& initRange, uint64 seed) { T rangeMin; @@ -207,7 +207,7 @@ Parameters InitializeImageGeomCellDataFilter::parameters() const params.insertSeparator(Parameters::Separator{"Input Data Objects"}); params.insert(std::make_unique(k_CellArrayPaths_Key, "Cell Arrays", "The cell data arrays in which to initialize a sub-volume to zeros", std::vector{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insert(std::make_unique(k_ImageGeometryPath_Key, "Image Geometry", "The geometry containing the cell data for which to initialize", DataPath{}, GeometrySelectionParameter::AllowedTypes{IGeometry::Type::Image})); @@ -294,7 +294,7 @@ IFilter::PreflightResult InitializeImageGeomCellDataFilter::preflightImpl(const for(const DataPath& path : cellArrayPaths) { - const auto& dataArray = dataStructure.getDataRefAs(path); + const auto& dataArray = dataStructure.getDataRefAs(path); ShapeType tupleShape = dataArray.getIDataStoreRef().getTupleShape(); if(tupleShape.size() != reversedImageDims.size()) @@ -369,7 +369,7 @@ Result<> InitializeImageGeomCellDataFilter::executeImpl(DataStructure& dataStruc for(const DataPath& path : cellArrayPaths) { - auto& iDataArray = dataStructure.getDataRefAs(path); + auto& iDataArray = dataStructure.getDataRefAs(path); ExecuteNeighborFunction(InitializeArrayFunctor{}, iDataArray.getDataType(), iDataArray, dims, xMin, xMax, yMin, yMax, zMin, zMax, initType, initValue, initRange, seed); // NO BOOL diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.hpp index a028ba45be..e04c081195 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InitializeImageGeomCellDataFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT InitializeImageGeomCellDataFilter : public IFilter +class SIMPLNXCORE_EXPORT InitializeImageGeomCellDataFilter : public AbstractFilter { public: InitializeImageGeomCellDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp index e0a90877db..e06ecca846 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.cpp @@ -30,7 +30,8 @@ namespace struct MapPointCloudDataByKernelFunctor { template - void operator()(IDataArray* source, INeighborList* dynamic, std::vector& kernelVals, const int64 kernel[3], const usize dims[3], usize curX, usize curY, usize curZ, usize vertIdx) + void operator()(AbstractDataArray* source, AbstractNeighborList* dynamic, std::vector& kernelVals, const int64 kernel[3], const usize dims[3], usize curX, usize curY, usize curZ, + usize vertIdx) { auto& inputData = source->template getIDataStoreRefAs>(); auto* interpolatedDataPtr = dynamic_cast*>(dynamic); @@ -199,10 +200,10 @@ Parameters InterpolatePointCloudToRegularGridFilter::parameters() const params.insert(std::make_unique(k_InputMaskPath_Key, "Mask", "DataPath to the boolean mask array. Values that are true will mark that cell/point as usable.", DataPath{}, ArraySelectionParameter::AllowedTypes{DataType::boolean}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_InterpolateArrays_Key, "Attribute Arrays to Interpolate", "DataPaths to interpolate", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllNumericTypes(), + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllNumericTypes(), MultiArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_CopyArrays_Key, "Attribute Arrays to Copy", "DataPaths to copy", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllDataTypes(), + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllDataTypes(), MultiArraySelectionParameter::AllowedComponentShapes{{1}})); params.insertSeparator(Parameters::Separator{"Output Data Object(s)"}); @@ -284,7 +285,7 @@ IFilter::PreflightResult InterpolatePointCloudToRegularGridFilter::preflightImpl { dataArrays.push_back(interpolatePath); - auto targetArray = dataStructure.getDataAs(interpolatePath); + auto targetArray = dataStructure.getDataAs(interpolatePath); auto targetPath = interpolatedGroupPath.createChildPath(targetArray->getName()); if(targetArray->getNumberOfComponents() != 1) { @@ -304,7 +305,7 @@ IFilter::PreflightResult InterpolatePointCloudToRegularGridFilter::preflightImpl { dataArrays.push_back(copyPath); - auto targetArray = dataStructure.getDataAs(copyPath); + auto targetArray = dataStructure.getDataAs(copyPath); auto targetPath = interpolatedGroupPath.createChildPath(targetArray->getName()); if(targetArray->getNumberOfComponents() != 1) { @@ -459,8 +460,8 @@ Result<> InterpolatePointCloudToRegularGridFilter::executeImpl(DataStructure& da for(const auto& interpolatedDataPathItem : interpolatedDataPaths) { const auto dynamicArrayPath = interpolatedGroupPath.createChildPath(interpolatedDataPathItem.getTargetName()); - auto* dynamicArrayToInterpolate = dataStructure.getDataAs(dynamicArrayPath); - auto* sourceArray = dataStructure.getDataAs(interpolatedDataPathItem); + auto* dynamicArrayToInterpolate = dataStructure.getDataAs(dynamicArrayPath); + auto* sourceArray = dataStructure.getDataAs(interpolatedDataPathItem); const auto& type = sourceArray->getDataType(); if(type == DataType::boolean) // Can't be executed will throw error @@ -475,8 +476,8 @@ Result<> InterpolatePointCloudToRegularGridFilter::executeImpl(DataStructure& da for(const auto& copyDataPath : copyDataPaths) { auto dynamicArrayPath = interpolatedGroupPath.createChildPath(copyDataPath.getTargetName()); - auto* dynamicArrayToCopy = dataStructure.getDataAs(dynamicArrayPath); - auto* sourceArray = dataStructure.getDataAs(copyDataPath); + auto* dynamicArrayToCopy = dataStructure.getDataAs(dynamicArrayPath); + auto* sourceArray = dataStructure.getDataAs(copyDataPath); const auto& type = sourceArray->getDataType(); if(type == DataType::boolean) // Can't be executed will throw error diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.hpp index 6903b6e265..d44a1d1da8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/InterpolatePointCloudToRegularGridFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class InterpolatePointCloudToRegularGridFilter * @brief This Filter interpolates the values of arrays stored in a Vertex Geometry onto a user-selected Image Geometry. */ -class SIMPLNXCORE_EXPORT InterpolatePointCloudToRegularGridFilter : public IFilter +class SIMPLNXCORE_EXPORT InterpolatePointCloudToRegularGridFilter : public AbstractFilter { public: InterpolatePointCloudToRegularGridFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IterativeClosestPointFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IterativeClosestPointFilter.hpp index ee0e274a48..bf97a1a025 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IterativeClosestPointFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/IterativeClosestPointFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT IterativeClosestPointFilter : public IFilter +class SIMPLNXCORE_EXPORT IterativeClosestPointFilter : public AbstractFilter { public: IterativeClosestPointFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LabelTriangleGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LabelTriangleGeometryFilter.hpp index 348a2fb8ec..a921a69cc7 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LabelTriangleGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LabelTriangleGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class LabelTriangleGeometryFilter * @brief */ -class SIMPLNXCORE_EXPORT LabelTriangleGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT LabelTriangleGeometryFilter : public AbstractFilter { public: LabelTriangleGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LaplacianSmoothingFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LaplacianSmoothingFilter.hpp index 4f28492910..258ac78fcb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LaplacianSmoothingFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/LaplacianSmoothingFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class LaplacianSmoothingFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT LaplacianSmoothingFilter : public IFilter +class SIMPLNXCORE_EXPORT LaplacianSmoothingFilter : public AbstractFilter { public: LaplacianSmoothingFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.cpp index 0395219548..9fe6d94cd9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.cpp @@ -338,7 +338,7 @@ IFilter::PreflightResult MapPointCloudToRegularGridFilter::preflightImpl(const D if(useMask) { auto maskArrayPath = filterArgs.value(k_InputMaskPath_Key); - const auto numMaskTuples = dataStructure.getDataRefAs(maskArrayPath).getNumberOfTuples(); + const auto numMaskTuples = dataStructure.getDataRefAs(maskArrayPath).getNumberOfTuples(); const auto numVoxelTuples = vertexData->getNumberOfTuples(); if(numMaskTuples != numVoxelTuples) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.hpp index b51bd8d3e7..d80f529966 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MapPointCloudToRegularGridFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class MapPointCloudToRegularGridFilter * @brief */ -class SIMPLNXCORE_EXPORT MapPointCloudToRegularGridFilter : public IFilter +class SIMPLNXCORE_EXPORT MapPointCloudToRegularGridFilter : public AbstractFilter { public: MapPointCloudToRegularGridFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.cpp index 1d5d7de207..3ed8119c4d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.cpp @@ -81,7 +81,7 @@ IFilter::PreflightResult MoveDataFilter::preflightImpl(const DataStructure& data { for(const auto& path : dataPaths) { - const auto* possibleIArray = dataStructure.getDataAs(path); + const auto* possibleIArray = dataStructure.getDataAs(path); if(possibleIArray != nullptr) { if(possibleAM->getShape() != possibleIArray->getTupleShape()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.hpp index 490859240d..32eb084482 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MoveDataFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT MoveDataFilter : public IFilter +class SIMPLNXCORE_EXPORT MoveDataFilter : public AbstractFilter { public: MoveDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.cpp index 192bac1f57..a8b39703c3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.cpp @@ -33,7 +33,7 @@ Result<> CheckComponentIndicesInThresholds(const ArrayThresholdSet& thresholds, else if(const auto* comparisonValue = dynamic_cast(thresholdPtr); comparisonValue != nullptr) { DataPath dataPath = comparisonValue->getArrayPath(); - const auto& currentDataArray = dataStructure.getDataRefAs(dataPath); + const auto& currentDataArray = dataStructure.getDataRefAs(dataPath); usize index = comparisonValue->getComponentIndex(); usize numComponents = currentDataArray.getNumberOfComponents(); if(index >= currentDataArray.getNumberOfComponents()) @@ -108,7 +108,7 @@ class ThresholdFilterHelper struct ExecuteThresholdHelper { template - void operator()(ThresholdFilterHelper& helper, const IDataArray& iDataArray, Type trueValue, Type falseValue) + void operator()(ThresholdFilterHelper& helper, const AbstractDataArray& iDataArray, Type trueValue, Type falseValue) { const auto& dataStore = iDataArray.template getIDataStoreRefAs>(); helper.template filterData(dataStore, trueValue, falseValue); @@ -163,7 +163,7 @@ void ThresholdValue(const ArrayThreshold& comparisonValue, const DataStructure& ThresholdFilterHelper helper(compOperator, compValue, componentIndex, tempResultVector); - const auto& iDataArray = dataStructure.getDataRefAs(inputDataArrayPath); + const auto& iDataArray = dataStructure.getDataRefAs(inputDataArrayPath); ExecuteDataFunction(ExecuteThresholdHelper{}, iDataArray.getDataType(), helper, iDataArray, trueValue, falseValue); @@ -189,7 +189,8 @@ void ThresholdValue(const ArrayThreshold& comparisonValue, const DataStructure& struct ThresholdValueFunctor { template - void operator()(const ArrayThreshold& comparisonValue, const DataStructure& dataStructure, IDataArray& outputResultArray, int32_t& err, bool replaceInput, bool inverse, T trueValue, T falseValue) + void operator()(const ArrayThreshold& comparisonValue, const DataStructure& dataStructure, AbstractDataArray& outputResultArray, int32_t& err, bool replaceInput, bool inverse, T trueValue, + T falseValue) { // Traditionally we would do a check to ensure we get a valid pointer, I'm forgoing that check because it // was essentially done in the preflight part. @@ -245,7 +246,7 @@ void ThresholdSet(const ArrayThresholdSet& inputComparisonSet, const DataStructu struct ThresholdSetFunctor { template - void operator()(const ArrayThresholdSet& inputComparisonSet, const DataStructure& dataStructure, IDataArray& outputResultArray, int32_t& err, bool replaceInput, bool inverse, T trueValue, + void operator()(const ArrayThresholdSet& inputComparisonSet, const DataStructure& dataStructure, AbstractDataArray& outputResultArray, int32_t& err, bool replaceInput, bool inverse, T trueValue, T falseValue) { // Traditionally we would do a check to ensure we get a valid pointer, I'm forgoing that check because it @@ -367,14 +368,14 @@ IFilter::PreflightResult MultiThresholdObjectsFilter::preflightImpl(const DataSt } DataPath firstDataPath = *(thresholdPaths.begin()); - const auto& dataArray = dataStructure.getDataRefAs(firstDataPath); + const auto& dataArray = dataStructure.getDataRefAs(firstDataPath); // Check for same number of tuples and components usize numTuples = dataArray.getNumberOfTuples(); usize numComponents = dataArray.getNumberOfComponents(); for(const auto& dataPath : thresholdPaths) { - const auto& currentDataArray = dataStructure.getDataRefAs(dataPath); + const auto& currentDataArray = dataStructure.getDataRefAs(dataPath); usize currentNumTuples = currentDataArray.getNumberOfTuples(); if(currentNumTuples != numTuples) { @@ -463,13 +464,13 @@ Result<> MultiThresholdObjectsFilter::executeImpl(DataStructure& dataStructure, const IArrayThreshold* thresholdPtr = threshold.get(); if(const auto* comparisonSet = dynamic_cast(thresholdPtr); comparisonSet != nullptr) { - ExecuteDataFunction(ThresholdSetFunctor{}, maskArrayType, *comparisonSet, dataStructure, dataStructure.getDataRefAs(maskArrayPath), err, !firstValueFound, + ExecuteDataFunction(ThresholdSetFunctor{}, maskArrayType, *comparisonSet, dataStructure, dataStructure.getDataRefAs(maskArrayPath), err, !firstValueFound, thresholdsObject.isInverted(), trueValue, falseValue); firstValueFound = true; } else if(const auto* comparisonValue = dynamic_cast(thresholdPtr); comparisonValue != nullptr) { - ExecuteDataFunction(ThresholdValueFunctor{}, maskArrayType, *comparisonValue, dataStructure, dataStructure.getDataRefAs(maskArrayPath), err, !firstValueFound, + ExecuteDataFunction(ThresholdValueFunctor{}, maskArrayType, *comparisonValue, dataStructure, dataStructure.getDataRefAs(maskArrayPath), err, !firstValueFound, thresholdsObject.isInverted(), trueValue, falseValue); firstValueFound = true; } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.hpp index ed99745f3d..6bb8303baa 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/MultiThresholdObjectsFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT MultiThresholdObjectsFilter : public IFilter +class SIMPLNXCORE_EXPORT MultiThresholdObjectsFilter : public AbstractFilter { public: MultiThresholdObjectsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.cpp index 055d5f4690..42bf1a392d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.cpp @@ -2,9 +2,9 @@ #include "SimplnxCore/Filters/Algorithms/NearestPointFuseRegularGrids.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/DataStructure/StringArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateStringArrayAction.hpp" @@ -106,7 +106,7 @@ IFilter::PreflightResult NearestPointFuseRegularGridsFilter::preflightImpl(const // Create arrays on the reference grid to hold data present on the sampling grid { - auto sampleVoxelArrays = sampleAM->findAllChildrenOfType(); + auto sampleVoxelArrays = sampleAM->findAllChildrenOfType(); for(const auto& array : sampleVoxelArrays) { DataPath createdArrayPath = pReferenceCellAttributeMatrixPathValue.createChildPath(array->getName()); @@ -127,7 +127,7 @@ IFilter::PreflightResult NearestPointFuseRegularGridsFilter::preflightImpl(const // !!!! Not implemented for v1 !!!! // { - // auto sampleVoxelArrays = sampleAM->findAllChildrenOfType(); + // auto sampleVoxelArrays = sampleAM->findAllChildrenOfType(); // for(const auto& array : sampleVoxelArrays) // { // DataPath createdArrayPath = pReferenceCellAttributeMatrixPathValue.createChildPath(array->getName()); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.hpp index a91d14ce86..62ce0a4e34 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/NearestPointFuseRegularGridsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class NearestPointFuseRegularGridsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT NearestPointFuseRegularGridsFilter : public IFilter +class SIMPLNXCORE_EXPORT NearestPointFuseRegularGridsFilter : public AbstractFilter { public: NearestPointFuseRegularGridsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.cpp index 083ae9668d..8a486cdbaf 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.cpp @@ -224,7 +224,7 @@ IFilter::PreflightResult PadImageGeometryFilter::preflightImpl(const DataStructu DataPath newCellAttributeMatrixPath = destImagePath.createChildPath(cellDataName); for(const auto& [identifier, object] : *selectedCellData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newCellAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -246,7 +246,7 @@ IFilter::PreflightResult PadImageGeometryFilter::preflightImpl(const DataStructu // This section covers copying the other Attribute Matrix objects from the source geometry // to the destination geometry - auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.hpp index 8f681d410f..57a3934203 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PadImageGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class PadImageGeometryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT PadImageGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT PadImageGeometryFilter : public AbstractFilter { public: PadImageGeometryFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.cpp index 3f6973801e..184f58ed39 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.cpp @@ -44,10 +44,10 @@ const ChoicesParameter::ValueType k_ExistingSchemeModeIndex = 3; * @param lengthUnits The length units of the input geometry * @return The text description of the current input geometry. */ -std::string GenerateInputGeometryDisplayText(const SizeVec3& dims, const FloatVec3& origin, const FloatVec3& spacing, const IGeometry::LengthUnit& lengthUnits) +std::string GenerateInputGeometryDisplayText(const SizeVec3& dims, const FloatVec3& origin, const FloatVec3& spacing, const AbstractGeometry::LengthUnit& lengthUnits) { - std::string lengthUnitStr = IGeometry::LengthUnitToString(lengthUnits); - if(lengthUnits == IGeometry::LengthUnit::Unspecified) + std::string lengthUnitStr = AbstractGeometry::LengthUnitToString(lengthUnits); + if(lengthUnits == AbstractGeometry::LengthUnit::Unspecified) { lengthUnitStr.append(" Units"); } @@ -75,7 +75,8 @@ std::string GenerateInputGeometryDisplayText(const SizeVec3& dims, const FloatVe * partitioning scheme geometry fits the input geometry or not. * @return The text description of the partitioning scheme geometry. */ -std::string GeneratePartitioningSchemeDisplayText(const SizeVec3& psDims, const FloatVec3& psOrigin, const FloatVec3& psSpacing, const IGeometry::LengthUnit& lengthUnits, const IGeometry& iGeom) +std::string GeneratePartitioningSchemeDisplayText(const SizeVec3& psDims, const FloatVec3& psOrigin, const FloatVec3& psSpacing, const AbstractGeometry::LengthUnit& lengthUnits, + const AbstractGeometry& iGeom) { const float32 xRangeMax = (psOrigin[0] + (static_cast(psDims[0]) * psSpacing[0])); const float32 xDelta = static_cast(psDims[0]) * psSpacing[0]; @@ -84,8 +85,8 @@ std::string GeneratePartitioningSchemeDisplayText(const SizeVec3& psDims, const const float32 zRangeMax = (psOrigin[2] + (static_cast(psDims[2]) * psSpacing[2])); const float32 zDelta = static_cast(psDims[2]) * psSpacing[2]; - std::string lengthUnitStr = IGeometry::LengthUnitToString(lengthUnits); - if(lengthUnits == IGeometry::LengthUnit::Unspecified) + std::string lengthUnitStr = AbstractGeometry::LengthUnitToString(lengthUnits); + if(lengthUnits == AbstractGeometry::LengthUnit::Unspecified) { lengthUnitStr.append(" Units"); } @@ -244,7 +245,7 @@ Parameters PartitionGeometryFilter::parameters() const // Create the parameter descriptors that are needed for this filter params.insertSeparator(Parameters::Separator{"Input Geometry Parameters"}); params.insert(std::make_unique(k_InputGeometryToPartition_Key, "Input Geometry to Partition", "The input geometry that will be partitioned", DataPath{}, - IGeometry::GetAllGeomTypes())); + AbstractGeometry::GetAllGeomTypes())); params.insert(std::make_unique(k_InputGeometryCellAttributeMatrixPath_Key, "Input Geometry Cell Attribute Matrix ", "The attribute matrix that represents the cell data for the geometry.(Vertex=>Node Geometry, Cell=>Image/Rectilinear)", DataPath{})); @@ -352,7 +353,7 @@ IFilter::PreflightResult PartitionGeometryFilter::preflightImpl(const DataStruct const SizeVec3 numberOfPartitionsPerAxis = {static_cast(pNumberOfCellsPerAxisValue[0]), static_cast(pNumberOfCellsPerAxisValue[1]), static_cast(pNumberOfCellsPerAxisValue[2])}; const auto& attrMatrix = dataStructure.getDataRefAs(pInputGeomCellAMPathValue); - const auto& iGeom = dataStructure.getDataRefAs({pInputGeometryToPartitionValue}); + const auto& iGeom = dataStructure.getDataRefAs({pInputGeometryToPartitionValue}); std::string inputGeometryInformation; Result psInfo; switch(iGeom.getGeomType()) @@ -496,8 +497,8 @@ IFilter::PreflightResult PartitionGeometryFilter::preflightImpl(const DataStruct Result PartitionGeometryFilter::generateNodeBasedPSInfo(const DataStructure& dataStructure, const Arguments& filterArgs, const DataPath& geometryToPartitionPath, const DataPath& attrMatrixPath) const { - const auto& geometry = dataStructure.getDataRefAs({geometryToPartitionPath}); - const IGeometry::SharedVertexList& vertexList = geometry.getVerticesRef(); + const auto& geometry = dataStructure.getDataRefAs({geometryToPartitionPath}); + const AbstractGeometry::SharedVertexList& vertexList = geometry.getVerticesRef(); const auto& attrMatrix = dataStructure.getDataRefAs(attrMatrixPath); if(attrMatrix.getNumberOfTuples() != vertexList.getNumberOfTuples()) { @@ -513,7 +514,7 @@ Result PartitionGeometryFilter::generateNodeBased } // ----------------------------------------------------------------------------- -Result<> PartitionGeometryFilter::DataCheckDimensionality(const INodeGeometry0D& geometry) +Result<> PartitionGeometryFilter::DataCheckDimensionality(const AbstractNodeGeometry0D& geometry) { Result yzPlaneResult = geometry.isYZPlane(); if(yzPlaneResult.valid() && yzPlaneResult.value()) @@ -679,7 +680,7 @@ Result<> PartitionGeometryFilter::dataCheckPartitioningScheme(const GeomType& ge } else { - const IGeometry::SharedVertexList& vertexList = geometryToPartition.getVertices(); + const AbstractGeometry::SharedVertexList& vertexList = geometryToPartition.getVertices(); if(attrMatrix.getNumberOfTuples() != vertexList.getNumberOfTuples()) { return MakeErrorResult(-3010, fmt::format("{}: The attribute matrix '{}' does not have the same tuple count ({}) as geometry \"{}\"'s vertex count ({}).", humanName(), attrMatrix.getName(), diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.hpp index 51ecf2c695..61e71c3870 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PartitionGeometryFilter.hpp @@ -6,10 +6,10 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -31,7 +31,7 @@ namespace nx::core * possible, using this mode, to create a partitioning scheme that does not completely fit the input geometry. * In this case, the out-of-bounds value is used to label those particular cells/vertices. */ -class SIMPLNXCORE_EXPORT PartitionGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT PartitionGeometryFilter : public AbstractFilter { public: PartitionGeometryFilter() = default; @@ -173,7 +173,7 @@ class SIMPLNXCORE_EXPORT PartitionGeometryFilter : public IFilter */ static Result<> DataCheckNumberOfPartitions(const SizeVec3& numberOfPartitionsPerAxis); - static Result<> DataCheckDimensionality(const INodeGeometry0D& geometry); + static Result<> DataCheckDimensionality(const AbstractNodeGeometry0D& geometry); Result generateNodeBasedPSInfo(const DataStructure& dataStructure, const Arguments& filterArgs, const DataPath& geometryToPartitionPath, const DataPath& attrMatrixPath) const; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.cpp index e632db5557..c213228a6d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.cpp @@ -67,14 +67,14 @@ Parameters PointSampleEdgeGeometryFilter::parameters() const params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Edge Attribute Arrays to Transfer", "The paths to the Edge Attribute Arrays to transfer to the created Vertex Geometry", MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Parameter(s)"}); params.insert(std::make_unique(k_SampledVertexGeometryPath_Key, "Output Vertex Geometry", "Location in the data structure where the new Vertex Geometry, containing all points sampled along each scan vector, will be created.", DataPath({"Sampled Vertex Geometry"}))); params.insert(std::make_unique(k_VertexDataGroupName_Key, "Created Vertex Data Attribute Matrix Name", "The name of the created Vertex Attribute Matrix", - INodeGeometry0D::k_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insert(std::make_unique(k_EdgeIdsArrayName_Key, "Output Edge Ids Array Name", "Name for the array that will hold, for each sampled vertex, the id of the edge that it belongs to.", "Edge Ids")); @@ -130,7 +130,7 @@ IFilter::PreflightResult PointSampleEdgeGeometryFilter::preflightImpl(const Data for(const auto& selectedDataPath : pSelectedDataArrayPaths) { DataPath createdDataPath = pVertexGroupDataPath.createChildPath(selectedDataPath.getTargetName()); - const auto& selectedDataArray = dataStructure.getDataRefAs(selectedDataPath); + const auto& selectedDataArray = dataStructure.getDataRefAs(selectedDataPath); DataType dataType = selectedDataArray.getDataType(); auto createArrayAction = std::make_unique(dataType, tDims, selectedDataArray.getComponentShape(), createdDataPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.hpp index 5d68be9d87..0284b1e89d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleEdgeGeometryFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT PointSampleEdgeGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT PointSampleEdgeGeometryFilter : public AbstractFilter { public: PointSampleEdgeGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.cpp index 5595d9fd22..571e8750d4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.cpp @@ -79,7 +79,7 @@ Parameters PointSampleTriangleGeometryFilter::parameters() const params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Face Attribute Arrays to Transfer", "The paths to the Face Attribute Arrays to transfer to the created Vertex Geometry where the mask is false, if Use Mask is checked", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Vertex Geometry"}); @@ -87,7 +87,7 @@ Parameters PointSampleTriangleGeometryFilter::parameters() const "The complete path to the DataGroup holding the Vertex Geometry that represents the sampling points", DataPath({"[Vertex Geometry]"}))); params.insertSeparator(Parameters::Separator{"Output Vertex Attribute Matrix"}); params.insert(std::make_unique(k_VertexDataGroupName_Key, "Vertex Data", "The complete path to the vertex data arrays for the Vertex Geometry", - INodeGeometry0D::k_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_UseMask_Key, k_MaskArrayPath_Key, true); @@ -131,7 +131,7 @@ IFilter::PreflightResult PointSampleTriangleGeometryFilter::preflightImpl(const uint64 numTuples = 0; if(!pSelectedDataArrayPaths.empty()) { - numTuples = dataStructure.getDataAs(pSelectedDataArrayPaths[0])->getNumberOfTuples(); + numTuples = dataStructure.getDataAs(pSelectedDataArrayPaths[0])->getNumberOfTuples(); } auto createVertexGeometryAction = std::make_unique(pVertexGeometryDataPath, numTuples, pVertexGroupDataName, VertexGeom::k_SharedVertexListName); @@ -152,7 +152,7 @@ IFilter::PreflightResult PointSampleTriangleGeometryFilter::preflightImpl(const // Ensure that if pMaskValue is TRUE that the Mask Path is valid if(pUseMask) { - const DataObject* maskArray = dataStructure.getData(pMaskArrayPath); + const AbstractDataObject* maskArray = dataStructure.getData(pMaskArrayPath); if(nullptr == maskArray) { Error result = {-500, fmt::format("'Use Mask Array' is selected but the DataPath '{}' does not exist. Please ensure the mask array exists in the DataStructure.", pMaskArrayPath.toString())}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.hpp index aeb7800bdd..8ba9d51984 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/PointSampleTriangleGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class PointSampleTriangleGeometryFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT PointSampleTriangleGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT PointSampleTriangleGeometryFilter : public AbstractFilter { public: PointSampleTriangleGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.cpp index bc0fba90bc..0de66d3ee1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.cpp @@ -70,12 +70,12 @@ Parameters QuickSurfaceMeshFilter::parameters() const ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique( k_SelectedDataArrayPaths_Key, "Cell Attribute Arrays to Transfer", "The paths to the Arrays specifying which Cell Attribute Arrays to transfer to the created Triangle Geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Input Feature Data"}); params.insert(std::make_unique( k_SelectedFeatureDataArrayPaths_Key, "Feature Attribute Arrays to Transfer", "The paths to the Arrays specifying which feature Attribute Arrays to transfer to the created Triangle Geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Triangle Geometry"}); params.insert( @@ -84,13 +84,13 @@ Parameters QuickSurfaceMeshFilter::parameters() const params.insertSeparator(Parameters::Separator{"Output 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_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insert(std::make_unique(k_NodeTypesArrayName_Key, "Node Type", "The name of the Array specifying the type of node in the Triangle Geometry", "NodeTypes")); params.insertSeparator(Parameters::Separator{"Output 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_FaceAttributeMatrixName)); + AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); params.insert(std::make_unique(k_FaceLabelsArrayName_Key, "Face Labels", "The name of the Array specifying which Features are on either side of each Face in the Triangle Geometry", "FaceLabels")); @@ -136,13 +136,13 @@ IFilter::PreflightResult QuickSurfaceMeshFilter::preflightImpl(const DataStructu nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& gridGeom = dataStructure.getDataRefAs(pGridGeomDataPath); + const auto& gridGeom = dataStructure.getDataRefAs(pGridGeomDataPath); const usize elementTupleCount = gridGeom.getCellData()->getNumberOfTuples(); constexpr usize numElements = 0; // Use FeatureIds DataStore format for created DataArrays - const auto* featureIdsArrayPtr = dataStructure.getDataAs(pFeatureIdsArrayPathValue); + const auto* featureIdsArrayPtr = dataStructure.getDataAs(pFeatureIdsArrayPathValue); const std::string dataStoreFormat = featureIdsArrayPtr->getDataFormat(); // Create the Triangle Geometry action and store it @@ -167,14 +167,14 @@ IFilter::PreflightResult QuickSurfaceMeshFilter::preflightImpl(const DataStructu for(const auto& selectedDataPath : pSelectedDataArrayPaths) { // Check that the feature array has the correct tuple count to avoid crashing in execute. - const IDataArray* elementArray = dataStructure.getDataAs(selectedDataPath); + const AbstractDataArray* elementArray = dataStructure.getDataAs(selectedDataPath); if(elementArray->getNumberOfTuples() != elementTupleCount) { return {MakeErrorResult(-76531, fmt::format("Cannot copy element data at path '{}'. DataArray does not have the correct tuple count.", selectedDataPath.toString()))}; } DataPath createdDataPath = pFaceGroupDataPath.createChildPath(selectedDataPath.getTargetName()); - const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); + const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); auto compShape = iDataArray.getComponentShape(); // Double the size of the DataArray because we need the value from both sides of the triangle. compShape.insert(compShape.begin(), 2); @@ -187,9 +187,9 @@ IFilter::PreflightResult QuickSurfaceMeshFilter::preflightImpl(const DataStructu for(const DataPath& selectedDataPath : pFeatureDataPaths) { // Check that the feature array has the correct tuple count to avoid crashing in execute. - const IDataArray* featureArray = dataStructure.getDataAs(selectedDataPath); + const AbstractDataArray* featureArray = dataStructure.getDataAs(selectedDataPath); DataPath createdDataPath = pFaceGroupDataPath.createChildPath(selectedDataPath.getTargetName()); - const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); + const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); auto compShape = iDataArray.getComponentShape(); // Double the size of the DataArray because we need the value from both sides of the triangle. compShape.insert(compShape.begin(), 2); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.hpp index a9dcc96f39..4c84886054 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/QuickSurfaceMeshFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class QuickSurfaceMeshFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT QuickSurfaceMeshFilter : public IFilter +class SIMPLNXCORE_EXPORT QuickSurfaceMeshFilter : public AbstractFilter { public: QuickSurfaceMeshFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.cpp index 7b02d8827e..eb9ee8b564 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.cpp @@ -117,12 +117,12 @@ Result<> RandomizeFeatureIdsFilter::executeImpl(DataStructure& dataStructure, co std::optional> amChildPaths = GetAllChildArrayDataPaths(dataStructure, featureAMPath); - std::vector featureIArrays = {}; + std::vector featureIArrays = {}; if(amChildPaths.has_value()) { for(const auto& childPath : amChildPaths.value()) { - featureIArrays.push_back(dataStructure.getDataAs(childPath)); + featureIArrays.push_back(dataStructure.getDataAs(childPath)); } } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.hpp index 5752b21107..fe496e67f8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RandomizeFeatureIdsFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT RandomizeFeatureIdsFilter : public IFilter +class SIMPLNXCORE_EXPORT RandomizeFeatureIdsFilter : public AbstractFilter { public: RandomizeFeatureIdsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.cpp index 9d688ecd0b..f6024e92cc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.cpp @@ -2,7 +2,7 @@ #include "SimplnxCore/Filters/Algorithms/ReadBinaryCTNorthstar.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateImageGeometryAction.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -51,12 +51,12 @@ std::vector ParseNextLine(std::ifstream& inStream, char delimiter, } // ----------------------------------------------------------------------------- -std::string GenerateGeometryInfoString(const ReadBinaryCTNorthstarFilter::ImageGeometryInfo& info, const IGeometry::LengthUnit& lengthUnit) +std::string GenerateGeometryInfoString(const ReadBinaryCTNorthstarFilter::ImageGeometryInfo& info, const AbstractGeometry::LengthUnit& lengthUnit) { SizeVec3 dims = info.Dimensions; FloatVec3 origin = info.Origin; FloatVec3 spacing = info.Spacing; - std::string lengthUnitStr = IGeometry::LengthUnitToString(lengthUnit); + std::string lengthUnitStr = AbstractGeometry::LengthUnitToString(lengthUnit); std::string desc = fmt::format("X Range: {} to {} (Delta: {} {}) 0-{} Voxels\n", origin[0], origin[0] + (static_cast(dims[0]) * spacing[0]), static_cast(dims[0]) * spacing[0], lengthUnitStr, dims[0] - 1); desc.append(fmt::format("Y Range: {} to {} (Delta: {} {}) 0-{} Voxels\n", origin[1], origin[1] + (static_cast(dims[1]) * spacing[1]), static_cast(dims[1]) * spacing[1], @@ -375,7 +375,8 @@ Parameters ReadBinaryCTNorthstarFilter::parameters() const params.insert(std::make_unique(k_EndVoxelCoord_Key, "Ending XYZ Voxel for Subvolume", "The ending subvolume voxel (inclusive)", std::vector({1, 1, 1}), std::vector(3))); - params.insert(std::make_unique(k_LengthUnit_Key, "Length Unit", "The length unit that will be set into the created image geometry", 0, IGeometry::GetAllLengthUnitStrings())); + params.insert( + std::make_unique(k_LengthUnit_Key, "Length Unit", "The length unit that will be set into the created image geometry", 0, AbstractGeometry::GetAllLengthUnitStrings())); params.insertSeparator(Parameters::Separator{"Output Data Object(s)"}); params.insert( @@ -512,7 +513,7 @@ IFilter::PreflightResult ReadBinaryCTNorthstarFilter::preflightImpl(const DataSt DataType::float32, std::vector{importedGeometryInfo.Dimensions[2], importedGeometryInfo.Dimensions[1], importedGeometryInfo.Dimensions[0]}, std::vector{1}, densityArrayPath)); // Set the preflight updated values - std::string volumeDescription = GenerateGeometryInfoString(geometryInfo, static_cast(pLengthUnitValue)); + std::string volumeDescription = GenerateGeometryInfoString(geometryInfo, static_cast(pLengthUnitValue)); std::string dataFileInfo = GenerateDataFileListInfoString(dataFiles); std::vector preflightUpdatedValues; @@ -521,7 +522,7 @@ IFilter::PreflightResult ReadBinaryCTNorthstarFilter::preflightImpl(const DataSt if(pImportSubvolumeValue) { - std::string importedVolumeDescription = GenerateGeometryInfoString(importedGeometryInfo, static_cast(pLengthUnitValue)); + std::string importedVolumeDescription = GenerateGeometryInfoString(importedGeometryInfo, static_cast(pLengthUnitValue)); preflightUpdatedValues.push_back({"Subvolume", importedVolumeDescription}); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.hpp index c0210602cf..e6315042b3 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.hpp @@ -2,6 +2,7 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" #include @@ -20,7 +21,7 @@ namespace nx::core * files are in the same directory as the .nsihdr files. */ -class SIMPLNXCORE_EXPORT ReadBinaryCTNorthstarFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadBinaryCTNorthstarFilter : public AbstractFilter { public: ReadBinaryCTNorthstarFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp index 43542c669c..3cc8471ad4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp @@ -2,10 +2,10 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateStringArrayAction.hpp" @@ -51,8 +51,8 @@ Result validateExistingGroup(const DataPath& groupPath, const Dat } const auto& selectedGroup = dataStructure.getDataRefAs(groupPath); - const auto arrays = selectedGroup.findAllChildrenOfType(); - for(const std::shared_ptr& array : arrays) + const auto arrays = selectedGroup.findAllChildrenOfType(); + for(const std::shared_ptr& array : arrays) { std::string arrayName = array->getName(); for(const std::string& headerName : headers) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.hpp index cd711abae1..927bf23e34 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" class AbstractDataParser; @@ -21,7 +21,7 @@ namespace nx::core * If multiple columns are in fact different components of the same array, then the columns may be imported as * separate arrays and then combined in the correct order using the Combine Attribute Arrays filter. */ -class SIMPLNXCORE_EXPORT ReadCSVFileFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadCSVFileFilter : public AbstractFilter { public: ReadCSVFileFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp index 98104a8658..067c0e4ec5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp @@ -162,7 +162,7 @@ Result<> ReadDREAM3DFilter::executeImpl(DataStructure& dataStructure, const Argu nlohmann::json ReadDREAM3DFilter::toJson(const Arguments& args) const { - auto json = IFilter::toJson(args); + auto json = AbstractFilter::toJson(args); // Disabled writing pipeline json from DREAM3D file to prevent infinite recursive loop // when the pipeline reads and writes to the same file // See https://github.com/BlueQuartzSoftware/simplnx/pull/1033 diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.hpp index 860e331451..9e51418014 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -14,7 +14,7 @@ namespace nx::core * @brief The ReadDREAM3DFilter is an IFilter class designed to import data * from a target DREAM3D-NX file. */ -class SIMPLNXCORE_EXPORT ReadDREAM3DFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadDREAM3DFilter : public AbstractFilter { public: ReadDREAM3DFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDeformKeyFileV12Filter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDeformKeyFileV12Filter.hpp index 1b23cda509..a62766791d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDeformKeyFileV12Filter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDeformKeyFileV12Filter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include @@ -15,7 +15,7 @@ namespace nx::core * @class ReadDeformKeyFileV12Filter * @brief This filter will... */ -class SIMPLNXCORE_EXPORT ReadDeformKeyFileV12Filter : public IFilter +class SIMPLNXCORE_EXPORT ReadDeformKeyFileV12Filter : public AbstractFilter { public: ReadDeformKeyFileV12Filter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadHDF5DatasetFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadHDF5DatasetFilter.hpp index deeea869d6..29088510c4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadHDF5DatasetFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadHDF5DatasetFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -13,7 +13,7 @@ namespace nx::core * @class ReadHDF5DatasetFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ReadHDF5DatasetFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadHDF5DatasetFilter : public AbstractFilter { public: ReadHDF5DatasetFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadRawBinaryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadRawBinaryFilter.hpp index afe6b09200..29e136e1dc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadRawBinaryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadRawBinaryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * this filter is simply reading the data into a pre-allocated array * interpreted as the user defines. */ -class SIMPLNXCORE_EXPORT ReadRawBinaryFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadRawBinaryFilter : public AbstractFilter { public: ReadRawBinaryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.cpp index d5d105e4d8..684c7e610f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.cpp @@ -74,11 +74,12 @@ Parameters ReadStlFileFilter::parameters() const params.insertSeparator(Parameters::Separator{"Output Vertex Data"}); params.insert(std::make_unique(k_VertexAttributeMatrixName_Key, "Vertex Data [AttributeMatrix]", "The name of the AttributeMatrix where the Vertex Data of the Triangle Geometry will be created", - INodeGeometry0D::k_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insertSeparator(Parameters::Separator{"Output Face Data"}); params.insert(std::make_unique(k_FaceAttributeMatrixName_Key, "Face Data [AttributeMatrix]", - "The name of the AttributeMatrix where the Face Data of the Triangle Geometry will be created", INodeGeometry2D::k_FaceAttributeMatrixName)); + "The name of the AttributeMatrix where the Face Data of the Triangle Geometry will be created", + AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); params.insert(std::make_unique(k_FaceNormalsName_Key, "Face Normals", "The name of the triangle normals data array", "Face Normals")); params.insert(std::make_unique(k_FaceLabelsName_Key, "Created Face Labels Array", "The name of the 'Face Labels' data array", "Face Labels")); params.linkParameters(k_CreateFaceLabels_Key, k_FaceLabelsName_Key, true); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.hpp index d0bb220106..82a173cd39 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStlFileFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * contained in the SimplnxCore/Filters/Algorithms/ReadStlFile * */ -class SIMPLNXCORE_EXPORT ReadStlFileFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadStlFileFilter : public AbstractFilter { public: ReadStlFileFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStringDataArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStringDataArrayFilter.hpp index 67e912b137..b1f30a1b22 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStringDataArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadStringDataArrayFilter.hpp @@ -2,12 +2,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ReadStringDataArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadStringDataArrayFilter : public AbstractFilter { public: ReadStringDataArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.cpp index 516ece08bd..025c38e830 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.cpp @@ -26,7 +26,7 @@ namespace struct CSVReadFileFunctor { template - Result<> operator()(IDataArray* inputIDataArray, const fs::path& inputFilePath, uint64 skipLines, char delimiter) + Result<> operator()(AbstractDataArray* inputIDataArray, const fs::path& inputFilePath, uint64 skipLines, char delimiter) { auto& store = inputIDataArray->template getIDataStoreRefAs>(); return CsvParser::ReadFile(inputFilePath, store, skipLines, delimiter); @@ -173,7 +173,7 @@ Result<> ReadTextDataArrayFilter::executeImpl(DataStructure& dataStructure, cons char delimiter = nx::core::CsvParser::IndexToDelimiter(choiceIndex); - auto* iDataArray = dataStructure.getDataAs(path); + auto* iDataArray = dataStructure.getDataAs(path); return ExecuteDataFunction(CSVReadFileFunctor{}, iDataArray->getDataType(), iDataArray, inputFilePath, skipLines, delimiter); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.hpp index 008ad1e08b..dc048891c2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadTextDataArrayFilter.hpp @@ -2,12 +2,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ReadTextDataArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadTextDataArrayFilter : public AbstractFilter { public: ReadTextDataArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp index da656e2d89..70104a05a5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.cpp @@ -321,7 +321,7 @@ Result ReadHeaderMetaData(const st metadata.Spacing = geomBlock.Resolution; if(geomBlock.Unit == k_Millimeter) { - metadata.Units = IGeometry::LengthUnit::Millimeter; + metadata.Units = AbstractGeometry::LengthUnit::Millimeter; } const fs::path fiHdr = fs::path(vgHeaderFilePath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.hpp index 880695b185..60bd719268 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVolumeGraphicsFileFilter.hpp @@ -3,9 +3,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -16,7 +16,7 @@ namespace nx::core * is read to find out the dimensions, spacing and units of the data. The name of the .vol * file is also contained in the .vgi file. */ -class SIMPLNXCORE_EXPORT ReadVolumeGraphicsFileFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadVolumeGraphicsFileFilter : public AbstractFilter { public: ReadVolumeGraphicsFileFilter(); @@ -45,7 +45,7 @@ class SIMPLNXCORE_EXPORT ReadVolumeGraphicsFileFilter : public IFilter { SizeVec3 Dimensions; FloatVec3 Spacing; - IGeometry::LengthUnit Units = IGeometry::LengthUnit::Unspecified; + AbstractGeometry::LengthUnit Units = AbstractGeometry::LengthUnit::Unspecified; std::string DataFilePath; }; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVtkStructuredPointsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVtkStructuredPointsFilter.hpp index 5170175d60..69804506d6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVtkStructuredPointsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadVtkStructuredPointsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReadVtkStructuredPointsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ReadVtkStructuredPointsFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadVtkStructuredPointsFilter : public AbstractFilter { public: ReadVtkStructuredPointsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadZeissTxmFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadZeissTxmFileFilter.hpp index 5fe88b53a0..0fa4e63d33 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadZeissTxmFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadZeissTxmFileFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class ReadZeissTxmFileFilter * @brief This filter will read a .txm or .txrm file that is generated from a Zeiss x-ray computed tomography machine */ -class SIMPLNXCORE_EXPORT ReadZeissTxmFileFilter : public IFilter +class SIMPLNXCORE_EXPORT ReadZeissTxmFileFilter : public AbstractFilter { public: ReadZeissTxmFileFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.cpp index ed44f9102a..79a0779caa 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.cpp @@ -88,8 +88,8 @@ Parameters RegularGridSampleSurfaceMeshFilter::parameters() const std::make_unique(k_Origin_Key, "Origin", "The origin of the created Image geometry", std::vector{0.0F, 0.0F, 0.0F}, std::vector{"x", "y", "z"})); params.insert( std::make_unique(k_Spacing_Key, "Spacing", "The spacing of the created Image geometry", std::vector{1.0F, 1.0F, 1.0F}, std::vector{"x", "y", "z"})); - params.insert(std::make_unique(k_LengthUnit_Key, "Length Units (For Description Only)", "The units to be displayed below", to_underlying(IGeometry::LengthUnit::Micrometer), - IGeometry::GetAllLengthUnitStrings())); + params.insert(std::make_unique(k_LengthUnit_Key, "Length Units (For Description Only)", "The units to be displayed below", to_underlying(AbstractGeometry::LengthUnit::Micrometer), + AbstractGeometry::GetAllLengthUnitStrings())); params.insertSeparator(Parameters::Separator{"Input Data Objects"}); params.insert(std::make_unique(k_TriangleGeometryPath_Key, "Triangle Geometry", "The geometry to be sampled onto grid", DataPath{}, @@ -165,7 +165,7 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const std::stringstream boxDimensions = std::stringstream(); - std::string lengthUnit = IGeometry::LengthUnitToString(static_cast(pLengthUnitValue)); + std::string lengthUnit = AbstractGeometry::LengthUnitToString(static_cast(pLengthUnitValue)); boxDimensions << "X Range: " << std::setprecision(8) << std::noshowpoint << pOriginValue[0] << " to " << std::setprecision(8) << std::noshowpoint << (pOriginValue[0] + (pDimensionsValue[0] * pSpacingValue[0])) << " (Delta: " << std::setprecision(8) << std::noshowpoint << (pDimensionsValue[0] * pSpacingValue[0]) << ") " @@ -207,7 +207,7 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const std::string pSliceAttributeMatrixNameValue("SliceAttributeMatrix"); // create the edge geometry { - auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, INodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, + auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, EdgeGeom::k_SharedVertexListName, EdgeGeom::k_SharedEdgeListName); resultOutputActions.value().appendAction(std::move(createGeometryAction)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.hpp index 438231cbe1..f0f4a326c7 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RegularGridSampleSurfaceMeshFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RegularGridSampleSurfaceMeshFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT RegularGridSampleSurfaceMeshFilter : public IFilter +class SIMPLNXCORE_EXPORT RegularGridSampleSurfaceMeshFilter : public AbstractFilter { public: RegularGridSampleSurfaceMeshFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.cpp index a3ba5e96d2..c6b69fa0da 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.cpp @@ -71,7 +71,7 @@ Parameters RemoveFlaggedEdgesFilter::parameters() const params.insert( std::make_unique(k_VertexDataSelectedAttributeMatrix_Key, "Vertex Data", "Vertex Attribute Matrix that will be copied to the reduced geometry", DataPath{})); params.insert(std::make_unique(k_VertexDataSelectedArrays_Key, "Vertex Attribute Arrays to Copy", "Vertex DataPaths to copy", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllNumericTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllNumericTypes())); params.linkParameters(k_VertexDataHandling_Key, k_VertexDataSelectedAttributeMatrix_Key, detail::k_CopyAllVertexArraysIdx); params.linkParameters(k_VertexDataHandling_Key, k_VertexDataSelectedArrays_Key, detail::k_CopySelectedVertexArraysIdx); @@ -83,7 +83,7 @@ Parameters RemoveFlaggedEdgesFilter::parameters() const params.insert( std::make_unique(k_EdgeDataSelectedAttributeMatrix_Key, "Edge Data", "Edge Attribute Matrix that will be copied to the reduced geometry", DataPath{})); params.insert(std::make_unique(k_EdgeDataSelectedArrays_Key, "Edge Attribute Arrays to Copy", "Edge DataPaths to copy", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllNumericTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllNumericTypes())); params.linkParameters(k_EdgeDataHandling_Key, k_EdgeDataSelectedArrays_Key, detail::k_CopySelectedEdgeArraysIdx); params.linkParameters(k_EdgeDataHandling_Key, k_EdgeDataSelectedAttributeMatrix_Key, detail::k_CopyAllEdgeArraysIdx); @@ -118,7 +118,7 @@ IFilter::PreflightResult RemoveFlaggedEdgesFilter::preflightImpl(const DataStruc Result resultOutputActions; - const auto* initialGeomPtr = dataStructure.getDataAs(pInitialGeometryPathValue); + const auto* initialGeomPtr = dataStructure.getDataAs(pInitialGeometryPathValue); std::string reducedVertexAttributeMatrixName = (initialGeomPtr->getVertexAttributeMatrix() == nullptr ? "Vertex Data" : initialGeomPtr->getVertexAttributeMatrix()->getName()); std::string reducedEdgeAttributeMatrixName = (initialGeomPtr->getEdgeAttributeMatrix() == nullptr ? "Edge Data" : initialGeomPtr->getEdgeAttributeMatrix()->getName()); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.hpp index ce5a0205ef..cd1dcf9770 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedEdgesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RemoveFlaggedEdgesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT RemoveFlaggedEdgesFilter : public IFilter +class SIMPLNXCORE_EXPORT RemoveFlaggedEdgesFilter : public AbstractFilter { public: RemoveFlaggedEdgesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.cpp index 9189b6a575..34797fa893 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.cpp @@ -2,10 +2,10 @@ #include "Algorithms/RemoveFlaggedFeatures.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" @@ -83,7 +83,7 @@ Parameters RemoveFlaggedFeaturesFilter::parameters() const params.insert(std::make_unique(k_FlaggedFeaturesArrayPath_Key, "Flagged Features", "Specifies whether the Feature will remain in the structure or not", DataPath{}, ArraySelectionParameter::AllowedTypes{DataType::boolean, DataType::uint8}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique(k_IgnoredDataArrayPaths_Key, "Attribute Arrays to Ignore", "The list of arrays to ignore when removing flagged features", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); // Associate the Linkable Parameter(s) to the children parameters that they control @@ -134,7 +134,7 @@ IFilter::PreflightResult RemoveFlaggedFeaturesFilter::preflightImpl(const DataSt std::string warningMsg; for(const auto& [identifier, object] : *cellFeatureAmPtr) { - if(const auto* srcNeighborListArrayPtr = dynamic_cast(object.get()); srcNeighborListArrayPtr != nullptr) + if(const auto* srcNeighborListArrayPtr = dynamic_cast(object.get()); srcNeighborListArrayPtr != nullptr) { warningMsg += "\n" + cellFeatureAttributeMatrixPath.toString() + "/" + srcNeighborListArrayPtr->getName(); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.hpp index 5755d81567..d3adff7e92 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedFeaturesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RemoveFlaggedFeaturesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT RemoveFlaggedFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT RemoveFlaggedFeaturesFilter : public AbstractFilter { public: RemoveFlaggedFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.cpp index ed1189b78a..fcb3bc36f4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.cpp @@ -70,7 +70,7 @@ Parameters RemoveFlaggedTrianglesFilter::parameters() const params.insert( std::make_unique(k_VertexDataSelectedAttributeMatrix_Key, "Vertex Data", "Vertex Attribute Matrix that will be copied to the reduced geometry", DataPath{})); params.insert(std::make_unique(k_VertexDataSelectedArrays_Key, "Vertex Attribute Arrays to Copy", "Vertex DataPaths to copy", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllNumericTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllNumericTypes())); params.linkParameters(k_VertexDataHandling_Key, k_VertexDataSelectedAttributeMatrix_Key, detail::k_CopyAllVertexArraysIdx); params.linkParameters(k_VertexDataHandling_Key, k_VertexDataSelectedArrays_Key, detail::k_CopySelectedVertexArraysIdx); @@ -82,7 +82,7 @@ Parameters RemoveFlaggedTrianglesFilter::parameters() const params.insert(std::make_unique(k_TriangleDataSelectedAttributeMatrix_Key, "Triangle Data", "Triangle Attribute Matrix that will be copied to the reduced geometry", DataPath{})); params.insert(std::make_unique(k_TriangleDataSelectedArrays_Key, "Triangle Attribute Arrays to Copy", "Triangle DataPaths to copy", std::vector(), - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllNumericTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, GetAllNumericTypes())); params.linkParameters(k_TriangleDataHandling_Key, k_TriangleDataSelectedArrays_Key, detail::k_CopySelectedTriangleArraysIdx); params.linkParameters(k_TriangleDataHandling_Key, k_TriangleDataSelectedAttributeMatrix_Key, detail::k_CopyAllTriangleArraysIdx); @@ -118,7 +118,7 @@ IFilter::PreflightResult RemoveFlaggedTrianglesFilter::preflightImpl(const DataS Result resultOutputActions; - const auto* initialGeomPtr = dataStructure.getDataAs(pInitialGeometryPathValue); + const auto* initialGeomPtr = dataStructure.getDataAs(pInitialGeometryPathValue); std::string reducedVertexAttributeMatrixName = (initialGeomPtr->getVertexAttributeMatrix() == nullptr ? "Vertex Data" : initialGeomPtr->getVertexAttributeMatrix()->getName()); std::string reducedFaceAttributeMatrixName = (initialGeomPtr->getEdgeAttributeMatrix() == nullptr ? "Face Data" : initialGeomPtr->getEdgeAttributeMatrix()->getName()); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.hpp index e42e4c06b3..0ceed19a09 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedTrianglesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RemoveFlaggedTrianglesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT RemoveFlaggedTrianglesFilter : public IFilter +class SIMPLNXCORE_EXPORT RemoveFlaggedTrianglesFilter : public AbstractFilter { public: RemoveFlaggedTrianglesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.cpp index 8ada69f942..a17f8d7fc2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.cpp @@ -1,8 +1,8 @@ #include "RemoveFlaggedVerticesFilter.hpp" #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CopyDataObjectAction.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateVertexGeometryAction.hpp" @@ -31,7 +31,7 @@ struct RemoveFlaggedVerticesFunctor { // copy data to masked geometry template - void operator()(const IDataArray& sourceIDataArray, IDataArray& destIDataArray, const std::unique_ptr& maskCompare, size_t numVerticesToKeep) const + void operator()(const AbstractDataArray& sourceIDataArray, AbstractDataArray& destIDataArray, const std::unique_ptr& maskCompare, size_t numVerticesToKeep) const { const auto& sourceDataStore = sourceIDataArray.template getIDataStoreRefAs>(); auto& destinationDataStore = destIDataArray.template getIDataStoreRefAs>(); @@ -162,7 +162,7 @@ IFilter::PreflightResult RemoveFlaggedVerticesFilter::preflightImpl(const DataSt const DataPath reducedVertGeomAttrMatPath = reducedVertexPath.createChildPath(vertexAttrMatName); for(const auto& [identifier, object] : *selectedCellDataPtr) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); const DataType dataType = srcArray.getDataType(); const ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); const ShapeType tupleShape = srcArray.getIDataStoreRef().getTupleShape(); @@ -174,7 +174,7 @@ IFilter::PreflightResult RemoveFlaggedVerticesFilter::preflightImpl(const DataSt // This section covers copying the other Attribute Matrix objects from the source geometry // to the destination geometry - auto childPaths = GetAllChildDataPaths(dataStructure, vertexGeomPath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, vertexGeomPath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) @@ -225,7 +225,7 @@ Result<> RemoveFlaggedVerticesFilter::executeImpl(DataStructure& dataStructure, const VertexGeom& vertexGeom = dataStructure.getDataRefAs(vertexGeomPath); const std::string vertexDataName = vertexGeom.getVertexAttributeMatrixDataPath().getTargetName(); - std::unique_ptr maskCompare; + std::unique_ptr maskCompare; try { maskCompare = MaskCompareUtilities::InstantiateMaskCompare(dataStructure, maskArrayPath); @@ -269,11 +269,11 @@ Result<> RemoveFlaggedVerticesFilter::executeImpl(DataStructure& dataStructure, const AttributeMatrix* sourceVertexAttrMatPtr = vertexGeom.getVertexAttributeMatrix(); for(const auto& [identifier, object] : *sourceVertexAttrMatPtr) { - const auto& src = dynamic_cast(*object); + const auto& src = dynamic_cast(*object); const DataPath destinationPath = reducedVertexGeom.getVertexAttributeMatrixDataPath().createChildPath(src.getName()); - auto& dest = dataStructure.getDataRefAs(destinationPath); + auto& dest = dataStructure.getDataRefAs(destinationPath); messageHandler(nx::core::IFilter::Message{nx::core::IFilter::Message::Type::Info, fmt::format("Copying source array '{}' to reduced geometry vertex data.", src.getName())}); ExecuteDataFunction(RemoveFlaggedVerticesFunctor{}, src.getDataType(), src, dest, maskCompare, numVerticesToKeep); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.hpp index 3d661e7088..faf08b70f5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RemoveFlaggedVerticesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class RemoveFlaggedVerticesFilter * @brief This filter will remove specified vertices from the specified geometry. */ -class SIMPLNXCORE_EXPORT RemoveFlaggedVerticesFilter : public IFilter +class SIMPLNXCORE_EXPORT RemoveFlaggedVerticesFilter : public AbstractFilter { public: RemoveFlaggedVerticesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RenameDataObjectFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RenameDataObjectFilter.hpp index 049fd33024..6daa3d03b6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RenameDataObjectFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RenameDataObjectFilter.hpp @@ -3,16 +3,16 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { /** * @class RenameDataObjectFilter - * @brief RenameDataObjectFilter class is used to rename any DataObject. + * @brief RenameDataObjectFilter class is used to rename any AbstractDataObject. */ -class SIMPLNXCORE_EXPORT RenameDataObjectFilter : public IFilter +class SIMPLNXCORE_EXPORT RenameDataObjectFilter : public AbstractFilter { public: RenameDataObjectFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReplaceElementAttributesWithNeighborValuesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReplaceElementAttributesWithNeighborValuesFilter.hpp index 9aef6aba05..431c9c428f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReplaceElementAttributesWithNeighborValuesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReplaceElementAttributesWithNeighborValuesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @brief This filter will replace values based on neighbor values. More information can * be found in the help file located in docs/ReplaceElementAttributesWithNeighborValuesFilter.md */ -class SIMPLNXCORE_EXPORT ReplaceElementAttributesWithNeighborValuesFilter : public IFilter +class SIMPLNXCORE_EXPORT ReplaceElementAttributesWithNeighborValuesFilter : public AbstractFilter { public: ReplaceElementAttributesWithNeighborValuesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.cpp index d3e5665c9a..80e9e5ef68 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.cpp @@ -78,7 +78,7 @@ Parameters RequireMinNumNeighborsFilter::parameters() const DataPath({"Data Container", "Feature Data", "Phases"}), ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); // Attribute Arrays to Ignore params.insert(std::make_unique(k_IgnoredVoxelArrays_Key, "Cell Arrays to Ignore", "The arrays to ignore when applying the minimum neighbors algorithm", - std::vector{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + std::vector{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, MultiArraySelectionParameter::AllowedDataTypes{})); params.linkParameters(k_ApplyToSinglePhase_Key, k_PhaseNumber_Key, std::make_any(true)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.hpp index 308b9328f9..f88bc9653a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinNumNeighborsFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT RequireMinNumNeighborsFilter : public IFilter +class SIMPLNXCORE_EXPORT RequireMinNumNeighborsFilter : public AbstractFilter { public: RequireMinNumNeighborsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinimumSizeFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinimumSizeFeaturesFilter.hpp index c40f6ecb15..286cf5d489 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinimumSizeFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RequireMinimumSizeFeaturesFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class RequireMinimumSizeFeaturesFilter * @brief */ -class SIMPLNXCORE_EXPORT RequireMinimumSizeFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT RequireMinimumSizeFeaturesFilter : public AbstractFilter { public: RequireMinimumSizeFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.cpp index 3269603546..6916663fa8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.cpp @@ -2,9 +2,9 @@ #include "SimplnxCore/Filters/Algorithms/ResampleImageGeom.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Filter/Actions/CopyDataObjectAction.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" @@ -252,7 +252,7 @@ IFilter::PreflightResult ResampleImageGeomFilter::preflightImpl(const DataStruct DataPath newCellAttributeMatrixPath = destImagePath.createChildPath(cellDataName); for(const auto& [identifier, object] : *selectedCellData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newCellAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -282,14 +282,14 @@ IFilter::PreflightResult ResampleImageGeomFilter::preflightImpl(const DataStruct resultOutputActions.value().appendAction(std::make_unique(destCellFeatureAmPath, tDims)); for(const auto& [identifier, object] : *srcCellFeatureData) { - if(const auto* srcArray = dynamic_cast(object.get()); srcArray != nullptr) + if(const auto* srcArray = dynamic_cast(object.get()); srcArray != nullptr) { DataType dataType = srcArray->getDataType(); ShapeType componentShape = srcArray->getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = destCellFeatureAmPath.createChildPath(srcArray->getName()); resultOutputActions.value().appendAction(std::make_unique(dataType, tDims, std::move(componentShape), dataArrayPath)); } - else if(const auto* srcNeighborListArray = dynamic_cast(object.get()); srcNeighborListArray != nullptr) + else if(const auto* srcNeighborListArray = dynamic_cast(object.get()); srcNeighborListArray != nullptr) { warningMsg += "\n" + cellFeatureAmPath.toString() + "/" + srcNeighborListArray->getName(); } @@ -307,7 +307,7 @@ IFilter::PreflightResult ResampleImageGeomFilter::preflightImpl(const DataStruct // This section copies any remaining data groups or data arrays that are loose // in the source image geometry and creates CopyDataObjectAction instances for // those objects - auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.hpp index a43899b024..e8c869b12c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleImageGeomFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ResampleImageGeomFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ResampleImageGeomFilter : public IFilter +class SIMPLNXCORE_EXPORT ResampleImageGeomFilter : public AbstractFilter { public: ResampleImageGeomFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.cpp index 8e3921b620..c734b8bb14 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.cpp @@ -2,10 +2,10 @@ #include "SimplnxCore/Filters/Algorithms/ResampleRectGridToImageGeom.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/RectGridGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateImageGeometryAction.hpp" #include "simplnx/Filter/Actions/CreateNeighborListAction.hpp" @@ -62,7 +62,7 @@ Parameters ResampleRectGridToImageGeomFilter::parameters() const GeometrySelectionParameter::AllowedTypes{IGeometry::Type::RectGrid})); params.insert(std::make_unique( k_SelectedDataArrayPaths_Key, "Attribute Arrays to Copy", "Rectilinear Grid Cell Data to possibly copy", MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray, IArray::ArrayType::StringArray, IArray::ArrayType::NeighborListArray}, GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray, AbstractArray::ArrayType::StringArray, AbstractArray::ArrayType::NeighborListArray}, GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Image Geometry"}); params.insert(std::make_unique(k_Dimensions_Key, "Dimensions (Voxels)", "The image geometry voxel dimensions in which to re-sample the rectilinear grid geometry", std::vector{128, 128, 128}, std::vector{"x", "y", "z"})); @@ -139,7 +139,7 @@ IFilter::PreflightResult ResampleRectGridToImageGeomFilter::preflightImpl(const for(const auto& path : pSelectedDataArrayPathsValue) { const DataPath destPath = destCellDataPath.createChildPath(path.getTargetName()); - const auto* srcArray = dataStructure.getDataAs(path); + const auto* srcArray = dataStructure.getDataAs(path); if(srcCellDataPath != path.getParent()) { @@ -162,27 +162,28 @@ IFilter::PreflightResult ResampleRectGridToImageGeomFilter::preflightImpl(const } } - IArray::ArrayType arrayType = srcArray->getArrayType(); - if(arrayType == IArray::ArrayType::DataArray) + AbstractArray::ArrayType arrayType = srcArray->getArrayType(); + if(arrayType == AbstractArray::ArrayType::DataArray) { - const auto* srcDataArray = dataStructure.getDataAs(path); + const auto* srcDataArray = dataStructure.getDataAs(path); auto createArrayAction = std::make_unique(srcDataArray->getDataType(), dims, srcDataArray->getComponentShape(), destPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); } - else if(arrayType == IArray::ArrayType::NeighborListArray) + else if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - const auto* srcDataArray = dataStructure.getDataAs(path); + const auto* srcDataArray = dataStructure.getDataAs(path); auto createArrayAction = std::make_unique(srcDataArray->getDataType(), dims, destPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); } - else if(arrayType == IArray::ArrayType::StringArray) + else if(arrayType == AbstractArray::ArrayType::StringArray) { auto createArrayAction = std::make_unique(dims, destPath); resultOutputActions.value().appendAction(std::move(createArrayAction)); } else { - resultOutputActions.warnings().push_back({-7366, fmt::format("Data Object at path '{}' is not an IArray type and thus cannot be copied over to the re-sampled image geometry", path.toString())}); + resultOutputActions.warnings().push_back( + {-7366, fmt::format("Data Object at path '{}' is not an AbstractArray type and thus cannot be copied over to the re-sampled image geometry", path.toString())}); } } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.hpp index 9d512b4115..e65019d7e2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ResampleRectGridToImageGeomFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ResampleRectGridToImageGeomFilter * @brief This filter will re-sample an existing RectilinearGrid onto a regular grid (Image Geometry) and copy cell data into the newly created Image Geometry Data Container during the process. */ -class SIMPLNXCORE_EXPORT ResampleRectGridToImageGeomFilter : public IFilter +class SIMPLNXCORE_EXPORT ResampleRectGridToImageGeomFilter : public AbstractFilter { public: ResampleRectGridToImageGeomFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.cpp index ad059f0b04..75b124a095 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/Algorithms/ReshapeDataArray.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/StringArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateNeighborListAction.hpp" @@ -103,7 +103,7 @@ IFilter::PreflightResult ReshapeDataArrayFilter::preflightImpl(const DataStructu tDims.push_back(static_cast(floatValue)); } - auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); + auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); auto inputArrayTupleShape = inputArray.getTupleShape(); if(inputArrayTupleShape == tDims) { @@ -117,22 +117,22 @@ IFilter::PreflightResult ReshapeDataArrayFilter::preflightImpl(const DataStructu auto outputArrayPath = inputArrayPath.getParent().createChildPath(fmt::format(".{}", inputArrayPath.getTargetName())); switch(inputArrayType) { - case IArray::ArrayType::DataArray: { - auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPath); + case AbstractArray::ArrayType::DataArray: { + auto& inputDataArray = dataStructure.getDataRefAs(inputArrayPath); resultOutputActions.value().appendAction( std::make_unique(inputDataArray.getDataType(), tDims, inputDataArray.getComponentShape(), outputArrayPath, inputDataArray.getDataFormat())); break; } - case IArray::ArrayType::NeighborListArray: { - auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPath); + case AbstractArray::ArrayType::NeighborListArray: { + auto& inputNeighborList = dataStructure.getDataRefAs(inputArrayPath); resultOutputActions.value().appendAction(std::make_unique(inputNeighborList.getDataType(), tDims, outputArrayPath)); break; } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { resultOutputActions.value().appendAction(std::make_unique(tDims, outputArrayPath)); break; } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return MakePreflightErrorResult(to_underlying(ReshapeDataArray::ErrorCodes::InputArrayEqualsAny), fmt::format("Input array '{}' has array type 'Any'. Something has gone horribly wrong, please contact the developers.", inputArray.getName())); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.hpp index a2c4e05526..7851fe7c62 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReshapeDataArrayFilter.hpp @@ -3,12 +3,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT ReshapeDataArrayFilter : public IFilter +class SIMPLNXCORE_EXPORT ReshapeDataArrayFilter : public AbstractFilter { public: ReshapeDataArrayFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReverseTriangleWindingFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReverseTriangleWindingFilter.hpp index c9971dfa93..8e793c4af9 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReverseTriangleWindingFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReverseTriangleWindingFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class ReverseTriangleWindingFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT ReverseTriangleWindingFilter : public IFilter +class SIMPLNXCORE_EXPORT ReverseTriangleWindingFilter : public AbstractFilter { public: ReverseTriangleWindingFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.cpp index 741395e2a3..003faed7fc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.cpp @@ -19,7 +19,7 @@ constexpr int32 k_InconsistentTupleCount = -2364; struct FindThresholdFunctor { template - void operator()(const IDataArray* inputObject, const Float32AbstractDataStore& gradMag, BoolAbstractDataStore& maskStore) + void operator()(const AbstractDataArray* inputObject, const Float32AbstractDataStore& gradMag, BoolAbstractDataStore& maskStore) { const auto& inputData = inputObject->template getIDataStoreRefAs>(); usize numTuples = inputData.getNumberOfTuples(); @@ -113,7 +113,7 @@ IFilter::PreflightResult RobustAutomaticThresholdFilter::preflightImpl(const Dat std::vector dataPaths; - const auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); + const auto& inputArray = dataStructure.getDataRefAs(inputArrayPath); dataPaths.push_back(inputArrayPath); dataPaths.push_back(gradientArrayPath); @@ -142,7 +142,7 @@ Result<> RobustAutomaticThresholdFilter::executeImpl(DataStructure& dataStructur auto gradientArrayPath = filterArgs.value(k_GradientMagnitudePath_Key); auto createdMaskName = filterArgs.value(k_ArrayCreationName_Key); - const auto* inputArray = dataStructure.getDataAs(inputArrayPath); + const auto* inputArray = dataStructure.getDataAs(inputArrayPath); const auto& gradientStore = dataStructure.getDataAs(gradientArrayPath)->getDataStoreRef(); auto& maskStore = dataStructure.getDataAs(inputArrayPath.replaceName(createdMaskName))->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.hpp index d230973a72..fa364cbe9f 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RobustAutomaticThresholdFilter.hpp @@ -2,12 +2,12 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { -class SIMPLNXCORE_EXPORT RobustAutomaticThresholdFilter : public IFilter +class SIMPLNXCORE_EXPORT RobustAutomaticThresholdFilter : public AbstractFilter { public: RobustAutomaticThresholdFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.cpp index 0d54a5fad1..06ae080ec5 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/Algorithms/RotateSampleRefFrame.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/Filter/Actions/CopyDataObjectAction.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" @@ -201,7 +201,7 @@ IFilter::PreflightResult RotateSampleRefFrameFilter::preflightImpl(const DataStr for(const auto& [id, object] : selectedCellData) { - const auto& srcArray = dynamic_cast(*object); + const auto& srcArray = dynamic_cast(*object); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = newCellAttributeMatrixPath.createChildPath(srcArray.getName()); @@ -220,7 +220,7 @@ IFilter::PreflightResult RotateSampleRefFrameFilter::preflightImpl(const DataStr } // copy over the rest of the data - auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, DataObject::Type::DataObject, ignorePaths); + auto childPaths = GetAllChildDataPaths(dataStructure, srcImagePath, IDataObject::Type::AbstractDataObject, ignorePaths); if(childPaths.has_value()) { for(const auto& childPath : childPaths.value()) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.hpp index d80543db40..46dda2fda6 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/RotateSampleRefFrameFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace nx::core * @class RotateSampleRefFrameFilter * @brief */ -class SIMPLNXCORE_EXPORT RotateSampleRefFrameFilter : public IFilter +class SIMPLNXCORE_EXPORT RotateSampleRefFrameFilter : public AbstractFilter { public: RotateSampleRefFrameFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.cpp index 636ca22ccf..954fb4b0f8 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.cpp @@ -2,7 +2,7 @@ #include "SimplnxCore/Filters/Algorithms/ScalarSegmentFeatures.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" @@ -112,13 +112,13 @@ IFilter::PreflightResult ScalarSegmentFeaturesFilter::preflightImpl(const DataSt DataPath cellFeaturesPath = gridGeomPath.createChildPath(cellFeaturesName); DataPath activeArrayPath = cellFeaturesPath.createChildPath(activeArrayName); - const auto& gridGeometry = dataStructure.getDataRefAs(gridGeomPath); + const auto& gridGeometry = dataStructure.getDataRefAs(gridGeomPath); auto gridDims = gridGeometry.getDimensions(); const std::vector cellTupleDims = {gridDims[2], gridDims[1], gridDims[0]}; std::vector dataPaths; // Input Array - const auto& inputDataArray = dataStructure.getDataRefAs(inputDataPath); + const auto& inputDataArray = dataStructure.getDataRefAs(inputDataPath); std::string createdArrayFormat = inputDataArray.getDataFormat(); dataPaths.push_back(inputDataPath); @@ -168,7 +168,7 @@ Result<> ScalarSegmentFeaturesFilter::executeImpl(DataStructure& dataStructure, inputValues.CellFeatureAttributeMatrixPath = inputValues.ImageGeometryPath.createChildPath(filterArgs.value(k_CellFeatureName_Key)); inputValues.ActiveArrayPath = inputValues.CellFeatureAttributeMatrixPath.createChildPath(filterArgs.value(k_ActiveArrayName_Key)); inputValues.IsPeriodic = filterArgs.value(k_IsPeriodic_Key); - inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); + inputValues.NeighborScheme = static_cast(filterArgs.value(k_NeighborScheme_Key)); return ScalarSegmentFeatures(dataStructure, &inputValues, shouldCancel, messageHandler)(); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.hpp index e6788bb112..db4261e6ac 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ScalarSegmentFeaturesFilter.hpp @@ -4,8 +4,8 @@ #include "simplnx/Common/StringLiteral.hpp" #include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -14,7 +14,7 @@ namespace nx::core * @class ScalarSegmentFeaturesFilter * @brief */ -class SIMPLNXCORE_EXPORT ScalarSegmentFeaturesFilter : public IFilter +class SIMPLNXCORE_EXPORT ScalarSegmentFeaturesFilter : public AbstractFilter { public: ScalarSegmentFeaturesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SetImageGeomOriginScalingFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SetImageGeomOriginScalingFilter.hpp index ec2f1aa121..1a815714ed 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SetImageGeomOriginScalingFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SetImageGeomOriginScalingFilter.hpp @@ -3,8 +3,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" #include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include #include @@ -12,7 +12,7 @@ namespace nx::core { -class SIMPLNXCORE_EXPORT SetImageGeomOriginScalingFilter : public IFilter +class SIMPLNXCORE_EXPORT SetImageGeomOriginScalingFilter : public AbstractFilter { public: SetImageGeomOriginScalingFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SharedFeatureFaceFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SharedFeatureFaceFilter.hpp index 842490b5f1..fedbad900a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SharedFeatureFaceFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SharedFeatureFaceFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SharedFeatureFaceFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT SharedFeatureFaceFilter : public IFilter +class SIMPLNXCORE_EXPORT SharedFeatureFaceFilter : public AbstractFilter { public: SharedFeatureFaceFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.cpp index 96a439ef57..7dffcd1299 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.cpp @@ -3,9 +3,9 @@ #include "SimplnxCore/Filters/Algorithms/Silhouette.hpp" #include "simplnx/Common/TypeTraits.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Parameters/ArrayCreationParameter.hpp" @@ -108,8 +108,8 @@ IFilter::PreflightResult SilhouetteFilter::preflightImpl(const DataStructure& da nx::core::Result resultOutputActions; - auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); - auto clusterIds = dataStructure.getDataAs(pFeatureIdsArrayPathValue); + auto clusterArray = dataStructure.getDataAs(pSelectedArrayPathValue); + auto clusterIds = dataStructure.getDataAs(pFeatureIdsArrayPathValue); if(clusterArray->getNumberOfTuples() != clusterIds->getNumberOfTuples()) { return MakePreflightErrorResult(-8976, fmt::format("The the number of tuples for {} ({}) do not match the number of tuples for {} ({})", clusterArray->getName(), clusterArray->getNumberOfTuples(), diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.hpp index 3b3cf9538e..8a1ccc871e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SilhouetteFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SilhouetteFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT SilhouetteFilter : public IFilter +class SIMPLNXCORE_EXPORT SilhouetteFilter : public AbstractFilter { public: SilhouetteFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.cpp index e2b9dfb95b..f4fb81eadc 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.cpp @@ -132,7 +132,7 @@ IFilter::PreflightResult SliceTriangleGeometryFilter::preflightImpl(const DataSt // create the edge geometry { - auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, INodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, + auto createGeometryAction = std::make_unique(pSliceDataContainerNameValue, 1, 2, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, pEdgeAttributeMatrixNameValue, EdgeGeom::k_SharedVertexListName, EdgeGeom::k_SharedEdgeListName); resultOutputActions.value().appendAction(std::move(createGeometryAction)); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.hpp index ee72f93f49..abec34efa2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SliceTriangleGeometryFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SliceTriangleGeometryFilter * @brief This filter slices an input Triangle Geometry, producing an Edge Geometry */ -class SIMPLNXCORE_EXPORT SliceTriangleGeometryFilter : public IFilter +class SIMPLNXCORE_EXPORT SliceTriangleGeometryFilter : public AbstractFilter { public: SliceTriangleGeometryFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.cpp index 0cda7bf25a..4eb5b7f8ea 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/Algorithms/SplitDataArrayByComponent.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Parameters/ArraySelectionParameter.hpp" @@ -93,7 +93,7 @@ IFilter::PreflightResult SplitDataArrayByComponentFilter::preflightImpl(const Da nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& inputArrayRef = dataStructure.getDataRefAs(pInputArrayPath); + const auto& inputArrayRef = dataStructure.getDataRefAs(pInputArrayPath); const auto* inputArray = &inputArrayRef; usize numComponents = inputArray->getNumberOfComponents(); if(numComponents <= 1) @@ -158,7 +158,7 @@ Result<> SplitDataArrayByComponentFilter::executeImpl(DataStructure& dataStructu } else { - usize numComponents = dataStructure.getDataAs(inputValues.InputArrayPath)->getNumberOfComponents(); + usize numComponents = dataStructure.getDataAs(inputValues.InputArrayPath)->getNumberOfComponents(); inputValues.ExtractComponents.reserve(numComponents); for(usize i = 0; i < numComponents; ++i) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.hpp index 555bef4f3b..4fc8a0dd59 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByComponentFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SplitDataArrayByComponentFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT SplitDataArrayByComponentFilter : public IFilter +class SIMPLNXCORE_EXPORT SplitDataArrayByComponentFilter : public AbstractFilter { public: SplitDataArrayByComponentFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.cpp index 6f10c3f86a..6117bdf346 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.cpp @@ -6,8 +6,8 @@ #include "SimplnxCore/Filters/Algorithms/SplitDataArrayByTuple.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateDataGroupAction.hpp" @@ -412,7 +412,7 @@ IFilter::PreflightResult SplitDataArrayByTupleFilter::preflightImpl(const DataSt nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; - const auto& inputArray = dataStructure.getDataRefAs(pInputArrayPath); + const auto& inputArray = dataStructure.getDataRefAs(pInputArrayPath); // Output input array's tuple shape to preflight updated values std::vector displayPaths = createDisplayPaths({pInputArrayPath.toString()}, {inputArray.getTupleShape()}); @@ -466,22 +466,22 @@ IFilter::PreflightResult SplitDataArrayByTupleFilter::preflightImpl(const DataSt { switch(inputArray.getArrayType()) { - case IArray::ArrayType::DataArray: { - auto iInputDataArray = dynamic_cast(&inputArray); + case AbstractArray::ArrayType::DataArray: { + auto iInputDataArray = dynamic_cast(&inputArray); ShapeType cDims = iInputDataArray->getComponentShape(); resultOutputActions.value().appendAction(std::make_unique(iInputDataArray->getDataType(), tupleShapes[i], cDims, arrayPaths[i])); break; } - case IArray::ArrayType::NeighborListArray: { - auto iInputNeighborList = dynamic_cast(&inputArray); + case AbstractArray::ArrayType::NeighborListArray: { + auto iInputNeighborList = dynamic_cast(&inputArray); resultOutputActions.value().appendAction(std::make_unique(iInputNeighborList->getDataType(), tupleShapes[i], arrayPaths[i])); break; } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { resultOutputActions.value().appendAction(std::make_unique(tupleShapes[i], arrayPaths[i])); break; } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { return {MakeErrorResult(to_underlying(SplitDataArrayByTuple::ErrorCodes::AnyArrayType), fmt::format("The input array '{}' has array type 'Any'. This SHOULD NOT be possible, so please contact the developers.", pInputArrayPath.toString())), preflightUpdatedValues}; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.hpp index fbbe2da6f9..df71a8398d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SplitDataArrayByTupleFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SplitDataArrayByTupleFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT SplitDataArrayByTupleFilter : public IFilter +class SIMPLNXCORE_EXPORT SplitDataArrayByTupleFilter : public AbstractFilter { public: SplitDataArrayByTupleFilter(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.cpp index c9fb9862b7..541696720b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.cpp @@ -3,10 +3,10 @@ #include "SimplnxCore/Filters/Algorithms/SurfaceNets.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" #include "simplnx/Filter/Actions/CreateGeometry2DAction.hpp" @@ -73,12 +73,12 @@ Parameters SurfaceNetsFilter::parameters() const ArraySelectionParameter::AllowedTypes{DataType::int32}, ArraySelectionParameter::AllowedComponentShapes{{1}})); params.insert(std::make_unique( k_SelectedDataArrayPaths_Key, "Cell Attribute Arrays to Transfer", "The paths to the Arrays specifying which Cell Attribute Arrays to transfer to the created Triangle Geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Input Feature Data"}); params.insert(std::make_unique( k_SelectedFeatureDataArrayPaths_Key, "Feature Attribute Arrays to Transfer", "The paths to the Arrays specifying which feature Attribute Arrays to transfer to the created Triangle Geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); params.insertSeparator(Parameters::Separator{"Output Triangle Geometry"}); params.insert( @@ -87,13 +87,13 @@ Parameters SurfaceNetsFilter::parameters() const params.insertSeparator(Parameters::Separator{"Output 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_VertexAttributeMatrixName)); + AbstractNodeGeometry0D::k_VertexAttributeMatrixName)); params.insert(std::make_unique(k_NodeTypesArrayName_Key, "Node Type", "The complete path to the Array specifying the type of node in the Triangle Geometry", "NodeTypes")); params.insertSeparator(Parameters::Separator{"Output 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_FaceAttributeMatrixName)); + AbstractNodeGeometry2D::k_FaceAttributeMatrixName)); 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")); @@ -137,11 +137,11 @@ IFilter::PreflightResult SurfaceNetsFilter::preflightImpl(const DataStructure& d nx::core::Result resultOutputActions; - const auto& gridGeom = dataStructure.getDataRefAs(pGridGeomDataPath); + const auto& gridGeom = dataStructure.getDataRefAs(pGridGeomDataPath); constexpr usize numElements = 0; // Use FeatureIds DataStore format for created DataArrays - const auto* featureIdsArrayPtr = dataStructure.getDataAs(pFeatureIdsArrayPathValue); + const auto* featureIdsArrayPtr = dataStructure.getDataAs(pFeatureIdsArrayPathValue); const std::string dataStoreFormat = featureIdsArrayPtr->getDataFormat(); // Create the Triangle Geometry action and store it @@ -166,7 +166,7 @@ IFilter::PreflightResult SurfaceNetsFilter::preflightImpl(const DataStructure& d for(const auto& selectedDataPath : pSelectedDataArrayPaths) { DataPath createdDataPath = pFaceGroupDataPath.createChildPath(selectedDataPath.getTargetName()); - const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); + const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); auto compShape = iDataArray.getComponentShape(); // Double the size of the DataArray because we need the value from both sides of the triangle. compShape.insert(compShape.begin(), 2); @@ -179,9 +179,9 @@ IFilter::PreflightResult SurfaceNetsFilter::preflightImpl(const DataStructure& d for(const DataPath& selectedDataPath : pFeatureDataPaths) { // Check that the feature array has the correct tuple count to avoid crashing in execute. - const IDataArray* featureArray = dataStructure.getDataAs(selectedDataPath); + const AbstractDataArray* featureArray = dataStructure.getDataAs(selectedDataPath); DataPath createdDataPath = pFaceGroupDataPath.createChildPath(selectedDataPath.getTargetName()); - const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); + const auto& iDataArray = dataStructure.getDataRefAs(selectedDataPath); auto compShape = iDataArray.getComponentShape(); // Double the size of the DataArray because we need the value from both sides of the triangle. compShape.insert(compShape.begin(), 2); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.hpp index e0fa0f1f8f..9414f6db5a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/SurfaceNetsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class SurfaceNetsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT SurfaceNetsFilter : public IFilter +class SIMPLNXCORE_EXPORT SurfaceNetsFilter : public AbstractFilter { public: SurfaceNetsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleCentroidFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleCentroidFilter.hpp index 01148112b5..c774084682 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleCentroidFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleCentroidFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class TriangleCentroidFilter * @brief This **Filter** computes the centroid of each **Triangle** in a **Triangle Geometry** by calculating the average position of all 3 **Vertices** that make up the **Triangle**. */ -class SIMPLNXCORE_EXPORT TriangleCentroidFilter : public IFilter +class SIMPLNXCORE_EXPORT TriangleCentroidFilter : public AbstractFilter { public: TriangleCentroidFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.cpp index 06559d799d..246e849a1b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.cpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Constants.hpp" #include "simplnx/Common/Range.hpp" #include "simplnx/DataStructure/DataPath.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/DataGroupSelectionParameter.hpp" diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.hpp index dbacc70a73..89f02a3139 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleDihedralAngleFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class TriangleDihedralAngleFilter * @brief This filter will create a list of all dihedral angles ordered from smallest angle to largest from a **TriangleGeom** object */ -class SIMPLNXCORE_EXPORT TriangleDihedralAngleFilter : public IFilter +class SIMPLNXCORE_EXPORT TriangleDihedralAngleFilter : public AbstractFilter { public: TriangleDihedralAngleFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleNormalFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleNormalFilter.hpp index 65105940f0..300c7ae484 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleNormalFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/TriangleNormalFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class TriangleNormalFilter * @brief This filter calculates the normals for each face of a **TriangleGeom** object */ -class SIMPLNXCORE_EXPORT TriangleNormalFilter : public IFilter +class SIMPLNXCORE_EXPORT TriangleNormalFilter : public AbstractFilter { public: TriangleNormalFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/UncertainRegularGridSampleSurfaceMeshFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/UncertainRegularGridSampleSurfaceMeshFilter.hpp index a62a66224e..df5e8260aa 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/UncertainRegularGridSampleSurfaceMeshFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/UncertainRegularGridSampleSurfaceMeshFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class UncertainRegularGridSampleSurfaceMeshFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT UncertainRegularGridSampleSurfaceMeshFilter : public IFilter +class SIMPLNXCORE_EXPORT UncertainRegularGridSampleSurfaceMeshFilter : public AbstractFilter { public: UncertainRegularGridSampleSurfaceMeshFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.cpp index 8bcd8d46ee..c04948af24 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.cpp @@ -113,7 +113,7 @@ IFilter::PreflightResult VerifyTriangleWindingFilter::preflightImpl(const DataSt return MakePreflightErrorResult(-25741, fmt::format("Error trying to locate parent TriangleGeometry on path {}", pLabelsPath.toString())); } - usize numComp = dataStructure.getDataAs(pLabelsPath)->getNumberOfComponents(); + usize numComp = dataStructure.getDataAs(pLabelsPath)->getNumberOfComponents(); if(numComp != 1 && numComp != 2) { return MakePreflightErrorResult( @@ -126,7 +126,7 @@ IFilter::PreflightResult VerifyTriangleWindingFilter::preflightImpl(const DataSt auto pNormalsArrayPath = filterArgs.value(k_TriangleNormalsPath_Key); - const auto* triangleGeom = dataStructure.getDataAs(targetGeomResult.value()); + const auto* triangleGeom = dataStructure.getDataAs(targetGeomResult.value()); const auto* existingNormalsPtr = dataStructure.getDataAs(pNormalsArrayPath); if(existingNormalsPtr != nullptr) @@ -142,7 +142,7 @@ IFilter::PreflightResult VerifyTriangleWindingFilter::preflightImpl(const DataSt resultOutputActions.value().appendDataObjectModificationNotification(pNormalsArrayPath, DataObjectModification::ModifiedType::Modified); return {std::move(resultOutputActions)}; } - const auto* existingObjectPtr = dataStructure.getDataAs(pNormalsArrayPath); + const auto* existingObjectPtr = dataStructure.getDataAs(pNormalsArrayPath); if(existingObjectPtr != nullptr) { resultOutputActions.value().appendAction(std::make_unique(pNormalsArrayPath, ::k_TempName)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.hpp index ca4ad5615c..73493fd3ee 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/VerifyTriangleWindingFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class VerifyTriangleWindingFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT VerifyTriangleWindingFilter : public IFilter +class SIMPLNXCORE_EXPORT VerifyTriangleWindingFilter : public AbstractFilter { public: VerifyTriangleWindingFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp index a0fb87583c..32cc5795ab 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp @@ -78,9 +78,9 @@ Parameters WriteASCIIDataFilter::parameters() const params.insert(std::make_unique(k_Includes_Key, "Header and Index Options", "Default Include is Headers only", to_underlying(Includes::Headers), ChoicesParameter::Choices{"Neither", "Headers", "Index", "Both"})); // sequence dependent DO NOT REORDER params.insertSeparator(Parameters::Separator{"Input Data Objects"}); - params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Attribute Arrays to Export", "Data Arrays to be written to disk", - MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray, IArray::ArrayType::StringArray}, nx::core::GetAllDataTypes())); + params.insert(std::make_unique( + k_SelectedDataArrayPaths_Key, "Attribute Arrays to Export", "Data Arrays to be written to disk", MultiArraySelectionParameter::ValueType{}, + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray, AbstractArray::ArrayType::StringArray}, nx::core::GetAllDataTypes())); // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_OutputStyle_Key, k_MaxTuplePerLine_Key, std::make_any(to_underlying(OutputStyle::MultipleFiles))); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.hpp index 335c1ecbdb..c70931afce 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteASCIIDataFilter * @brief This filter will export data from **DataArray** as "plaintext" to one or more files according to selection parameters */ -class SIMPLNXCORE_EXPORT WriteASCIIDataFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteASCIIDataFilter : public AbstractFilter { public: WriteASCIIDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAbaqusHexahedronFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAbaqusHexahedronFilter.hpp index 036687d49f..4ef35354a2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAbaqusHexahedronFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAbaqusHexahedronFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteAbaqusHexahedronFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteAbaqusHexahedronFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteAbaqusHexahedronFilter : public AbstractFilter { public: WriteAbaqusHexahedronFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoRectilinearCoordinateFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoRectilinearCoordinateFilter.hpp index 386cde42b8..ffa4a9b9c4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoRectilinearCoordinateFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoRectilinearCoordinateFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteAvizoRectilinearCoordinateFilter * @brief This filter writes out a native Avizo Rectilinear Coordinate data file */ -class SIMPLNXCORE_EXPORT WriteAvizoRectilinearCoordinateFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteAvizoRectilinearCoordinateFilter : public AbstractFilter { public: WriteAvizoRectilinearCoordinateFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoUniformCoordinateFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoUniformCoordinateFilter.hpp index 0cbdca62a2..b202271625 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoUniformCoordinateFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteAvizoUniformCoordinateFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteAvizoUniformCoordinateFilter * @brief This filter writes out a native Avizo Uniform Coordinate data file */ -class SIMPLNXCORE_EXPORT WriteAvizoUniformCoordinateFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteAvizoUniformCoordinateFilter : public AbstractFilter { public: WriteAvizoUniformCoordinateFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.cpp index 2b2f0e037d..124e1ca9ae 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.cpp @@ -21,7 +21,7 @@ namespace struct ByteSwapArray { template - Result<> operator()(IDataArray* inputDataArray) + Result<> operator()(AbstractDataArray* inputDataArray) { if constexpr(std::is_same_v || std::is_same_v || std::is_same_v) // byte-swap unnecessary bail early { @@ -80,7 +80,7 @@ Parameters WriteBinaryDataFilter::parameters() const params.insert(std::make_unique(k_FileExtension_Key, "File Extension", "The file extension for the output file", ".bin")); params.insertSeparator(Parameters::Separator{"Input Data Objects"}); params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Attribute Arrays to Export", "The arrays to be exported to a binary file", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, nx::core::GetAllDataTypes())); return params; @@ -119,7 +119,7 @@ Result<> WriteBinaryDataFilter::executeImpl(DataStructure& dataStructure, const } if(endian::native != endianess) // if requested endianess is not native then byteswap { - auto* oldSelectedArray = dataStructure.getDataAs(selectedArrayPath); + auto* oldSelectedArray = dataStructure.getDataAs(selectedArrayPath); ExecuteDataFunction(ByteSwapArray{}, oldSelectedArray->getDataType(), oldSelectedArray); } } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.hpp index 58f5ce4735..40d8993feb 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteBinaryDataFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteBinaryDataFilter * @brief This filter will export data as binary (either big or little endian). */ -class SIMPLNXCORE_EXPORT WriteBinaryDataFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteBinaryDataFilter : public AbstractFilter { public: WriteBinaryDataFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.hpp index 6c5cf5fd88..5087e00373 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -14,7 +14,7 @@ namespace nx::core * @brief The WriteDREAM3DFilter is an IFilter class designed to export the * DataStructure to a target HDF5 file. */ -class SIMPLNXCORE_EXPORT WriteDREAM3DFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteDREAM3DFilter : public AbstractFilter { public: WriteDREAM3DFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.cpp index 3c17af942d..96b5216eb4 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.cpp @@ -117,14 +117,14 @@ Result<> WriteFeatureDataCSVFilter::executeImpl(DataStructure& dataStructure, co } // load list of DataPaths - std::vector dataTypesToExtract; + std::vector dataTypesToExtract; if(filterArgs.value(k_WriteNeighborListData_Key)) { - dataTypesToExtract = {DataObject::Type::DataArray, DataObject::Type::StringArray, DataObject::Type::NeighborList}; + dataTypesToExtract = {IDataObject::Type::DataArray, IDataObject::Type::StringArray, IDataObject::Type::NeighborList}; } else { - dataTypesToExtract = {DataObject::Type::DataArray, DataObject::Type::StringArray}; + dataTypesToExtract = {IDataObject::Type::DataArray, IDataObject::Type::StringArray}; } std::vector arrayPaths; @@ -132,7 +132,7 @@ Result<> WriteFeatureDataCSVFilter::executeImpl(DataStructure& dataStructure, co for(const auto& element : dataTypesToExtract) { auto requestedPaths = *std::move(GetAllChildDataPaths(dataStructure, pCellFeatureAttributeMatrixPathValue, element)); - if(element == DataObject::Type::NeighborList) + if(element == IDataObject::Type::NeighborList) { neighborPaths.insert(neighborPaths.end(), std::make_move_iterator(requestedPaths.begin()), std::make_move_iterator(requestedPaths.end())); } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.hpp index ddc78766aa..e6a5b64484 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteFeatureDataCSVFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteFeatureDataCSVFilter * @brief This filter will export feature data as ASCII to a single file using choice delimiter_index */ -class SIMPLNXCORE_EXPORT WriteFeatureDataCSVFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteFeatureDataCSVFilter : public AbstractFilter { public: WriteFeatureDataCSVFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.cpp index 41ab1c96ca..9a28cf53de 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.cpp @@ -86,7 +86,7 @@ IFilter::PreflightResult WriteLAMMPSFileFilter::preflightImpl(const DataStructur auto pAtomLabelsPathValue = filterArgs.value(k_AtomLabelsPath_Key); std::vector vertsCount = dataStructure.getDataAs(pVertexGeomPathValue)->getVertices()->getTupleShape(); - std::vector atomLabelsCount = dataStructure.getDataAs(pAtomLabelsPathValue)->getTupleShape(); + std::vector atomLabelsCount = dataStructure.getDataAs(pAtomLabelsPathValue)->getTupleShape(); if(vertsCount != atomLabelsCount) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.hpp index 17e1e41e57..67111aa687 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLAMMPSFileFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteLAMMPSFileFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteLAMMPSFileFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteLAMMPSFileFilter : public AbstractFilter { public: WriteLAMMPSFileFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.cpp index 34f35ee917..9196db3689 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.cpp @@ -92,9 +92,9 @@ IFilter::PreflightResult WriteLosAlamosFFTFilter::preflightImpl(const DataStruct auto pCellEulerAnglesArrayPathValue = filterArgs.value(k_CellEulerAnglesArrayPath_Key); auto pCellPhasesArrayPathValue = filterArgs.value(k_CellPhasesArrayPath_Key); - usize fIdsTupCount = dataStructure.getDataAs(pFeatureIdsArrayPathValue)->getNumberOfTuples(); - usize eulersTupCount = dataStructure.getDataAs(pCellEulerAnglesArrayPathValue)->getNumberOfTuples(); - usize phasesTupCount = dataStructure.getDataAs(pCellPhasesArrayPathValue)->getNumberOfTuples(); + usize fIdsTupCount = dataStructure.getDataAs(pFeatureIdsArrayPathValue)->getNumberOfTuples(); + usize eulersTupCount = dataStructure.getDataAs(pCellEulerAnglesArrayPathValue)->getNumberOfTuples(); + usize phasesTupCount = dataStructure.getDataAs(pCellPhasesArrayPathValue)->getNumberOfTuples(); if(fIdsTupCount != eulersTupCount || fIdsTupCount != phasesTupCount) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.hpp index 2160c7426c..110930a8a2 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteLosAlamosFFTFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteLosAlamosFFTFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteLosAlamosFFTFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteLosAlamosFFTFilter : public AbstractFilter { public: WriteLosAlamosFFTFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.cpp index 9fcc95f131..bf4f8cd6e7 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.cpp @@ -109,7 +109,7 @@ IFilter::PreflightResult WriteNodesAndElementsFilesFilter::preflightImpl(const D "Neither 'Write Node File' nor 'Write Element/Cell File' have been chosen. Please choose at least one of these options.")}; } - auto& selectedGeometry = dataStructure.getDataRefAs(selectedGeometryPath); + auto& selectedGeometry = dataStructure.getDataRefAs(selectedGeometryPath); if(selectedGeometry.getGeomType() == IGeometry::Type::Vertex && writeElementFile) { return {MakeErrorResult( diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.hpp index d8916de437..2c435f21f0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteNodesAndElementsFilesFilter.hpp @@ -2,9 +2,9 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "simplnx/Filter/Parameters.hpp" namespace nx::core @@ -14,7 +14,7 @@ namespace nx::core * @brief The WriteNodesAndElementsFilesFilter is an IFilter class designed to export the * DataStructure to a target HDF5 file. */ -class SIMPLNXCORE_EXPORT WriteNodesAndElementsFilesFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteNodesAndElementsFilesFilter : public AbstractFilter { public: WriteNodesAndElementsFilesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.cpp index cca71dce3b..69db52c394 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.cpp @@ -85,7 +85,7 @@ IFilter::PreflightResult WriteSPParksSitesFilter::preflightImpl(const DataStruct { auto pFeatureIdsArrayPathValue = filterArgs.value(k_FeatureIdsArrayPath_Key); - usize fIdsTupCount = dataStructure.getDataAs(pFeatureIdsArrayPathValue)->getNumberOfTuples(); + usize fIdsTupCount = dataStructure.getDataAs(pFeatureIdsArrayPathValue)->getNumberOfTuples(); return {}; } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.hpp index 39c7ad69fa..e6d2e47d6d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteSPParksSitesFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteSPParksSitesFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteSPParksSitesFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteSPParksSitesFilter : public AbstractFilter { public: WriteSPParksSitesFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteStlFileFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteStlFileFilter.hpp index 69ba255577..196f492a60 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteStlFileFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteStlFileFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteStlFileFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteStlFileFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteStlFileFilter : public AbstractFilter { public: WriteStlFileFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.cpp index 8b0e0e2099..6f9d668892 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.cpp @@ -61,7 +61,8 @@ Parameters WriteVtkRectilinearGridFilter::parameters() const params.insert(std::make_unique(k_ImageGeometryPath_Key, "Image Geometry", "The path to the image geometry in which to write out to the vtk file", DataPath{}, GeometrySelectionParameter::AllowedTypes{IGeometry::Type::Image})); params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Cell Data Arrays to Write", "The paths to the cell data arrays to write out with the geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, + GetAllDataTypes())); return params; } @@ -97,7 +98,7 @@ IFilter::PreflightResult WriteVtkRectilinearGridFilter::preflightImpl(const Data return MakePreflightErrorResult(-2071, fmt::format("The following DataArrays all must have equal number of tuples but this was not satisfied.\n{}", tupleValidityCheck.error())); } - usize numTuples = dataStructure.getDataRefAs(pSelectedDataArrayPathsValue[0]).getNumberOfTuples(); + usize numTuples = dataStructure.getDataRefAs(pSelectedDataArrayPathsValue[0]).getNumberOfTuples(); usize numCells = dataStructure.getDataRefAs(pImageGeometryPathValue).getNumberOfCells(); if(numCells != numTuples) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.hpp index 5646a70d02..8ba236e764 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkRectilinearGridFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteVtkRectilinearGridFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteVtkRectilinearGridFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteVtkRectilinearGridFilter : public AbstractFilter { public: WriteVtkRectilinearGridFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.cpp index c343314c60..b4bf126dab 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.cpp @@ -60,7 +60,8 @@ Parameters WriteVtkStructuredPointsFilter::parameters() const params.insert(std::make_unique(k_ImageGeometryPath_Key, "Image Geometry", "The path to the image geometry in which to write out to the vtk file", DataPath{}, GeometrySelectionParameter::AllowedTypes{IGeometry::Type::Image})); params.insert(std::make_unique(k_SelectedDataArrayPaths_Key, "Cell Data Arrays to Write", "The paths to the cell data arrays to write out with the geometry", - MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::DataArray}, GetAllDataTypes())); + MultiArraySelectionParameter::ValueType{}, MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::DataArray}, + GetAllDataTypes())); return params; } @@ -96,7 +97,7 @@ IFilter::PreflightResult WriteVtkStructuredPointsFilter::preflightImpl(const Dat return {MakeErrorResult(-2071, fmt::format("The following DataArrays all must have equal number of tuples but this was not satisfied.\n{}", tupleValidityCheck.error()))}; } - usize numTuples = dataStructure.getDataRefAs(pSelectedDataArrayPathsValue[0]).getNumberOfTuples(); + usize numTuples = dataStructure.getDataRefAs(pSelectedDataArrayPathsValue[0]).getNumberOfTuples(); usize numCells = dataStructure.getDataRefAs(pImageGeometryPathValue).getNumberOfCells(); if(numCells != numTuples) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.hpp index 68e91c56a5..42d649e4e7 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteVtkStructuredPointsFilter.hpp @@ -2,8 +2,8 @@ #include "SimplnxCore/SimplnxCore_export.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace nx::core * @class WriteVtkStructuredPointsFilter * @brief This filter will .... */ -class SIMPLNXCORE_EXPORT WriteVtkStructuredPointsFilter : public IFilter +class SIMPLNXCORE_EXPORT WriteVtkStructuredPointsFilter : public AbstractFilter { public: WriteVtkStructuredPointsFilter() = default; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/CalculatorArray.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/CalculatorArray.hpp index 4bacfafee9..a91109e916 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/CalculatorArray.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/CalculatorArray.hpp @@ -155,7 +155,7 @@ class SIMPLNXCORE_EXPORT CalculatorArray : public ICalculatorArray } private: - std::optional m_ArrayId = {}; + std::optional m_ArrayId = {}; ValueType m_Type = Unknown; DataStructure& m_DataStructure; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/VtkUtilities.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/VtkUtilities.hpp index 6270f4c036..0ebbd9b46b 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/VtkUtilities.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/VtkUtilities.hpp @@ -261,7 +261,7 @@ inline std::string ConvertDataTypeToVtkDataType() noexcept struct WriteVtkDataFunctor { template - Result<> operator()(std::ofstream& outStrm, IDataArray& iDataArray, bool binary, const nx::core::IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) + Result<> operator()(std::ofstream& outStrm, AbstractDataArray& iDataArray, bool binary, const nx::core::IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { using DataArrayType = DataArray; diff --git a/src/Plugins/SimplnxCore/test/AlignSectionsFeatureCentroidTest.cpp b/src/Plugins/SimplnxCore/test/AlignSectionsFeatureCentroidTest.cpp index 044d8cd011..667550d2d2 100644 --- a/src/Plugins/SimplnxCore/test/AlignSectionsFeatureCentroidTest.cpp +++ b/src/Plugins/SimplnxCore/test/AlignSectionsFeatureCentroidTest.cpp @@ -98,16 +98,16 @@ TEST_CASE("SimplnxCore::AlignSectionsFeatureCentroidFilter: output test", "[Reco const DataPath alignmentAMPath = Constants::k_DataContainerPath.createChildPath(Constants::k_AlignmentAMName); const DataPath slicesPath = alignmentAMPath.createChildPath(Constants::k_SlicesArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(slicesPath), dataStructure.getDataRefAs(slicesPath)); const DataPath relativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_RelativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(relativeShiftsPath), dataStructure.getDataRefAs(relativeShiftsPath)); const DataPath cumulativeShiftsPath = alignmentAMPath.createChildPath(Constants::k_CumulativeShiftsArrayName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(cumulativeShiftsPath), dataStructure.getDataRefAs(cumulativeShiftsPath)); const DataPath centroidsPath = alignmentAMPath.createChildPath(k_CentroidsName); - UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(centroidsPath), dataStructure.getDataRefAs(centroidsPath)); + UnitTest::CompareDataArrays(exemplarDataStructure.getDataRefAs(centroidsPath), dataStructure.getDataRefAs(centroidsPath)); // Write out the .dream3d file now #ifdef SIMPLNX_WRITE_TEST_OUTPUT diff --git a/src/Plugins/SimplnxCore/test/AlignSectionsListTest.cpp b/src/Plugins/SimplnxCore/test/AlignSectionsListTest.cpp index 04c1a6d915..2d7b7e2bcf 100644 --- a/src/Plugins/SimplnxCore/test/AlignSectionsListTest.cpp +++ b/src/Plugins/SimplnxCore/test/AlignSectionsListTest.cpp @@ -20,7 +20,7 @@ const DataPath k_AlignmentAMPath = Constants::k_DataContainerPath.createChildPat struct CompareArraysFunctor { template - void operator()(const IDataArray& computedArray, const IDataArray& exemplarArray) + void operator()(const AbstractDataArray& computedArray, const AbstractDataArray& exemplarArray) { UnitTest::CompareDataArrays(computedArray, exemplarArray); } @@ -84,8 +84,8 @@ TEST_CASE("SimplnxCore::AlignSectionsListFilter: Relative Shifts execution", "[S for(const auto& path : selectedCellArrays.value()) { - const auto& computedIDataArray = dataStructure.getDataRefAs(path); - const auto& exemplarIDataArray = exemplarDataStructure.getDataRefAs(path); + const auto& computedIDataArray = dataStructure.getDataRefAs(path); + const auto& exemplarIDataArray = exemplarDataStructure.getDataRefAs(path); ExecuteDataFunction(::CompareArraysFunctor{}, computedIDataArray.getDataType(), computedIDataArray, exemplarIDataArray); } @@ -152,8 +152,8 @@ TEST_CASE("SimplnxCore::AlignSectionsListFilter: Cumulative Shifts execution", " for(const auto& path : selectedCellArrays.value()) { - const auto& computedIDataArray = dataStructure.getDataRefAs(path); - const auto& exemplarIDataArray = exemplarDataStructure.getDataRefAs(path); + const auto& computedIDataArray = dataStructure.getDataRefAs(path); + const auto& exemplarIDataArray = exemplarDataStructure.getDataRefAs(path); ExecuteDataFunction(::CompareArraysFunctor{}, computedIDataArray.getDataType(), computedIDataArray, exemplarIDataArray); } diff --git a/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp b/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp index 4a2315243a..bff7f802b3 100644 --- a/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/ApplyTransformationToGeometryTest.cpp @@ -91,8 +91,8 @@ void CompareImageGeometries(const DataStructure& dataStructure, const ImageGeom& const DataPath exemplarPath({exemplaryGeom.getName(), k_Cell_Data, exemplaryDataName}); const DataPath calculatedPath({calculatedGeom.getName(), k_Cell_Data, "Data"}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } @@ -132,8 +132,8 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Translation_Node", " { const DataPath exemplarPath({apply_transformation_to_geometry::k_TranslationNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); const DataPath calculatedPath({apply_transformation_to_geometry::k_InputNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } nx::core::HDF5::FileIO fileWriter = nx::core::HDF5::FileIO::WriteFile(fmt::format("{}/ApplyTransformationToGeometryFilter_translation.dream3d", unit_test::k_BinaryTestOutputDir)); @@ -191,8 +191,8 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Rotation_Node", "[Si { const DataPath exemplarPath({exemplaryGeomName, apply_transformation_to_geometry::k_SharedVertexListName}); const DataPath calculatedPath({apply_transformation_to_geometry::k_InputNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } nx::core::HDF5::FileIO fileWriter = nx::core::HDF5::FileIO::WriteFile(fmt::format("{}/ApplyTransformationToGeometryFilter_rotation.dream3d", unit_test::k_BinaryTestOutputDir)); @@ -239,8 +239,8 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Scale_Node", "[Simpl { const DataPath exemplarPath({apply_transformation_to_geometry::k_ScaleNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); const DataPath calculatedPath({apply_transformation_to_geometry::k_InputNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } nx::core::HDF5::FileIO fileWriter = nx::core::HDF5::FileIO::WriteFile(fmt::format("{}/ApplyTransformationToGeometryFilter_scale.dream3d", unit_test::k_BinaryTestOutputDir)); @@ -344,8 +344,8 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Manual_Node", "[Simp { const DataPath exemplarPath({apply_transformation_to_geometry::k_ManualNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); const DataPath calculatedPath({apply_transformation_to_geometry::k_InputNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } nx::core::HDF5::FileIO fileWriter = nx::core::HDF5::FileIO::WriteFile(fmt::format("{}/ApplyTransformationToGeometryFilter_manual.dream3d", unit_test::k_BinaryTestOutputDir)); @@ -394,8 +394,8 @@ TEST_CASE("SimplnxCore::ApplyTransformationToGeometryFilter:Precomputed_Node", " { const DataPath exemplarPath({apply_transformation_to_geometry::k_PrecomputedNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); const DataPath calculatedPath({apply_transformation_to_geometry::k_InputNodeGeometryName, apply_transformation_to_geometry::k_SharedVertexListName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); } nx::core::HDF5::FileIO fileWriter = nx::core::HDF5::FileIO::WriteFile(fmt::format("{}/ApplyTransformationToGeometryFilter_precomputed.dream3d", unit_test::k_BinaryTestOutputDir)); diff --git a/src/Plugins/SimplnxCore/test/ApproximatePointCloudHullTest.cpp b/src/Plugins/SimplnxCore/test/ApproximatePointCloudHullTest.cpp index 79c0de88c7..939c0456c8 100644 --- a/src/Plugins/SimplnxCore/test/ApproximatePointCloudHullTest.cpp +++ b/src/Plugins/SimplnxCore/test/ApproximatePointCloudHullTest.cpp @@ -77,7 +77,8 @@ TEST_CASE("SimplnxCore::ApproximatePointCloudHullFilter: Instantiate Filter", "[ DataArray* triangleVertices = triangleGeom.getVertices(); DataPath vertexGeomPath({"[Vertex Geometry]"}); - CreateVertexGeometryAction createVertexGeometryAction(vertexGeomPath, triangleVertices->getNumberOfTuples(), INodeGeometry0D::k_VertexAttributeMatrixName, VertexGeom::k_SharedVertexListName); + CreateVertexGeometryAction createVertexGeometryAction(vertexGeomPath, triangleVertices->getNumberOfTuples(), AbstractNodeGeometry0D::k_VertexAttributeMatrixName, + VertexGeom::k_SharedVertexListName); Result<> createVertexResult = createVertexGeometryAction.apply(dataStructure, IDataAction::Mode::Execute); REQUIRE(createVertexResult.valid()); diff --git a/src/Plugins/SimplnxCore/test/CombineNodeBasedGeometriesTest.cpp b/src/Plugins/SimplnxCore/test/CombineNodeBasedGeometriesTest.cpp index 8a557ee535..7c7cec6579 100644 --- a/src/Plugins/SimplnxCore/test/CombineNodeBasedGeometriesTest.cpp +++ b/src/Plugins/SimplnxCore/test/CombineNodeBasedGeometriesTest.cpp @@ -153,7 +153,7 @@ void CreateDataArrays(AttributeMatrix& attrMatrix, DataStructure& dataStructure) AddNeighborList(attrMatrix, dataStructure); } -AttributeMatrix* CreateNodeAttributeMatrix(IGeometry& geom, DataStructure& dataStructure, const std::string& attrMatrixName, usize numElements) +AttributeMatrix* CreateNodeAttributeMatrix(AbstractGeometry& geom, DataStructure& dataStructure, const std::string& attrMatrixName, usize numElements) { return AttributeMatrix::Create(dataStructure, attrMatrixName, {numElements}, geom.getId()); } @@ -166,7 +166,7 @@ void CreateNodeAttributeMatrix(TGeom& geom, DataStructure& dataStructure, const } template -DataArray* CreateNodeArray(IGeometry& geom, DataStructure& dataStructure, const std::string& sharedListName, usize numElements, usize numPerElement) +DataArray* CreateNodeArray(AbstractGeometry& geom, DataStructure& dataStructure, const std::string& sharedListName, usize numElements, usize numPerElement) { return DataArray::template CreateWithStore>(dataStructure, sharedListName, {numElements}, {numPerElement}, geom.getId()); } @@ -208,51 +208,51 @@ void InitializeNodeGeometry(TGeom& geom, DataStructure& dataStructure, DataInitO } } -void InitializeNode0DGeometry(INodeGeometry0D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption) +void InitializeNode0DGeometry(AbstractNodeGeometry0D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption) { usize numOfVertexComps = 3; - InitializeNodeGeometry( - geom, dataStructure, vertexDataInitOption, INodeGeometry0D::k_VertexAttributeMatrixName, INodeGeometry0D::k_SharedVertexListName, geom.getNumberOfVertices(), - [numOfVertexComps](const INodeGeometry0D& g) { return numOfVertexComps; }, [](INodeGeometry0D& g) { return g.getVertices(); }, - [](INodeGeometry0D& g, const Float32Array& da) { g.setVertices(da); }, [](INodeGeometry0D& g) { return g.getVertexAttributeMatrix(); }, - [](INodeGeometry0D& g, AttributeMatrix& m) { g.setVertexAttributeMatrix(m); }); + InitializeNodeGeometry( + geom, dataStructure, vertexDataInitOption, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, AbstractNodeGeometry0D::k_SharedVertexListName, geom.getNumberOfVertices(), + [numOfVertexComps](const AbstractNodeGeometry0D& g) { return numOfVertexComps; }, [](AbstractNodeGeometry0D& g) { return g.getVertices(); }, + [](AbstractNodeGeometry0D& g, const Float32Array& da) { g.setVertices(da); }, [](AbstractNodeGeometry0D& g) { return g.getVertexAttributeMatrix(); }, + [](AbstractNodeGeometry0D& g, AttributeMatrix& m) { g.setVertexAttributeMatrix(m); }); } -void InitializeNode1DGeometry(INodeGeometry1D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption) +void InitializeNode1DGeometry(AbstractNodeGeometry1D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption) { InitializeNode0DGeometry(geom, dataStructure, vertexDataInitOption); usize numOfEdges = geom.getNumberOfVertices() / geom.getNumberOfVerticesPerEdge(); - InitializeNodeGeometry( - geom, dataStructure, edgeDataInitOption, INodeGeometry1D::k_EdgeAttributeMatrixName, INodeGeometry1D::k_SharedEdgeListName, numOfEdges, - [](const INodeGeometry1D& g) { return g.getNumberOfVerticesPerEdge(); }, [](INodeGeometry1D& g) { return g.getEdges(); }, - [](INodeGeometry1D& g, const IGeometry::SharedEdgeList& da) { g.setEdgeList(da); }, [](INodeGeometry1D& g) { return g.getEdgeAttributeMatrix(); }, - [](INodeGeometry1D& g, AttributeMatrix& m) { g.setEdgeAttributeMatrix(m); }); + InitializeNodeGeometry( + geom, dataStructure, edgeDataInitOption, AbstractNodeGeometry1D::k_EdgeAttributeMatrixName, AbstractNodeGeometry1D::k_SharedEdgeListName, numOfEdges, + [](const AbstractNodeGeometry1D& g) { return g.getNumberOfVerticesPerEdge(); }, [](AbstractNodeGeometry1D& g) { return g.getEdges(); }, + [](AbstractNodeGeometry1D& g, const AbstractGeometry::SharedEdgeList& da) { g.setEdgeList(da); }, [](AbstractNodeGeometry1D& g) { return g.getEdgeAttributeMatrix(); }, + [](AbstractNodeGeometry1D& g, AttributeMatrix& m) { g.setEdgeAttributeMatrix(m); }); } -void InitializeNode2DGeometry(INodeGeometry2D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption, DataInitOption faceDataInitOption) +void InitializeNode2DGeometry(AbstractNodeGeometry2D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption, DataInitOption faceDataInitOption) { InitializeNode1DGeometry(geom, dataStructure, vertexDataInitOption, edgeDataInitOption); usize numOfFaces = geom.getNumberOfVertices() / geom.getNumberOfVerticesPerFace(); - InitializeNodeGeometry( - geom, dataStructure, faceDataInitOption, INodeGeometry2D::k_FaceAttributeMatrixName, INodeGeometry2D::k_SharedFacesListName, numOfFaces, - [](const INodeGeometry2D& g) { return g.getNumberOfVerticesPerFace(); }, [](INodeGeometry2D& g) { return g.getFaces(); }, - [](INodeGeometry2D& g, const IGeometry::SharedFaceList& da) { g.setFaceList(da); }, [](INodeGeometry2D& g) { return g.getFaceAttributeMatrix(); }, - [](INodeGeometry2D& g, AttributeMatrix& m) { g.setFaceAttributeMatrix(m); }); + InitializeNodeGeometry( + geom, dataStructure, faceDataInitOption, AbstractNodeGeometry2D::k_FaceAttributeMatrixName, AbstractNodeGeometry2D::k_SharedFacesListName, numOfFaces, + [](const AbstractNodeGeometry2D& g) { return g.getNumberOfVerticesPerFace(); }, [](AbstractNodeGeometry2D& g) { return g.getFaces(); }, + [](AbstractNodeGeometry2D& g, const AbstractGeometry::SharedFaceList& da) { g.setFaceList(da); }, [](AbstractNodeGeometry2D& g) { return g.getFaceAttributeMatrix(); }, + [](AbstractNodeGeometry2D& g, AttributeMatrix& m) { g.setFaceAttributeMatrix(m); }); } -void InitializeNode3DGeometry(INodeGeometry3D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption, DataInitOption faceDataInitOption, +void InitializeNode3DGeometry(AbstractNodeGeometry3D& geom, DataStructure& dataStructure, DataInitOption vertexDataInitOption, DataInitOption edgeDataInitOption, DataInitOption faceDataInitOption, DataInitOption polyDataInitOption) { InitializeNode2DGeometry(geom, dataStructure, vertexDataInitOption, edgeDataInitOption, faceDataInitOption); usize numElements = geom.getNumberOfVertices() / geom.getNumberOfVerticesPerCell(); - InitializeNodeGeometry( - geom, dataStructure, polyDataInitOption, INodeGeometry3D::k_PolyhedronDataName, INodeGeometry3D::k_SharedPolyhedronListName, numElements, - [](const INodeGeometry3D& g) { return g.getNumberOfVerticesPerCell(); }, [](INodeGeometry3D& g) { return g.getPolyhedra(); }, - [](INodeGeometry3D& g, const IGeometry::SharedFaceList& da) { g.setPolyhedraList(da); }, [](INodeGeometry3D& g) { return g.getPolyhedraAttributeMatrix(); }, - [](INodeGeometry3D& g, AttributeMatrix& m) { g.setPolyhedraAttributeMatrix(m); }); + InitializeNodeGeometry( + geom, dataStructure, polyDataInitOption, AbstractNodeGeometry3D::k_PolyhedronDataName, AbstractNodeGeometry3D::k_SharedPolyhedronListName, numElements, + [](const AbstractNodeGeometry3D& g) { return g.getNumberOfVerticesPerCell(); }, [](AbstractNodeGeometry3D& g) { return g.getPolyhedra(); }, + [](AbstractNodeGeometry3D& g, const AbstractGeometry::SharedFaceList& da) { g.setPolyhedraList(da); }, [](AbstractNodeGeometry3D& g) { return g.getPolyhedraAttributeMatrix(); }, + [](AbstractNodeGeometry3D& g, AttributeMatrix& m) { g.setPolyhedraAttributeMatrix(m); }); } struct ValidateDataArraysImpl @@ -310,14 +310,14 @@ void ValidateStringArraysImpl(const DataStructure& dataStructure, const DataPath void ValidateArrays(const DataStructure& dataStructure, const DataPath& inputArrayPath1, const DataPath& inputArrayPath2, const DataPath& combinedArrayPath) { - REQUIRE_NOTHROW(dataStructure.getDataRefAs(inputArrayPath1)); - auto& array1 = dataStructure.getDataRefAs(inputArrayPath1); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(inputArrayPath1)); + auto& array1 = dataStructure.getDataRefAs(inputArrayPath1); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(inputArrayPath2)); - auto& array2 = dataStructure.getDataRefAs(inputArrayPath2); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(inputArrayPath2)); + auto& array2 = dataStructure.getDataRefAs(inputArrayPath2); - REQUIRE_NOTHROW(dataStructure.getDataRefAs(combinedArrayPath)); - auto& combinedArray = dataStructure.getDataRefAs(combinedArrayPath); + REQUIRE_NOTHROW(dataStructure.getDataRefAs(combinedArrayPath)); + auto& combinedArray = dataStructure.getDataRefAs(combinedArrayPath); REQUIRE(combinedArray.getArrayType() == array1.getArrayType()); REQUIRE(combinedArray.getArrayType() == array2.getArrayType()); @@ -325,29 +325,29 @@ void ValidateArrays(const DataStructure& dataStructure, const DataPath& inputArr auto combinedArrayType = combinedArray.getArrayType(); switch(combinedArrayType) { - case IArray::ArrayType::DataArray: { - auto& dataArray1 = dataStructure.getDataRefAs(inputArrayPath1); - auto& dataArray2 = dataStructure.getDataRefAs(inputArrayPath2); - auto& combinedDataArray = dataStructure.getDataRefAs(combinedArrayPath); + case AbstractArray::ArrayType::DataArray: { + auto& dataArray1 = dataStructure.getDataRefAs(inputArrayPath1); + auto& dataArray2 = dataStructure.getDataRefAs(inputArrayPath2); + auto& combinedDataArray = dataStructure.getDataRefAs(combinedArrayPath); REQUIRE(combinedDataArray.getDataType() == dataArray1.getDataType()); REQUIRE(combinedDataArray.getDataType() == dataArray2.getDataType()); ExecuteDataFunction(ValidateDataArraysImpl{}, combinedDataArray.getDataType(), dataStructure, inputArrayPath1, inputArrayPath2, combinedArrayPath); break; } - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { ValidateStringArraysImpl(dataStructure, inputArrayPath1, inputArrayPath2, combinedArrayPath); break; } - case IArray::ArrayType::NeighborListArray: { - auto& nl1 = dataStructure.getDataRefAs(inputArrayPath1); - auto& nl2 = dataStructure.getDataRefAs(inputArrayPath2); - auto& combinedNL = dataStructure.getDataRefAs(combinedArrayPath); + case AbstractArray::ArrayType::NeighborListArray: { + auto& nl1 = dataStructure.getDataRefAs(inputArrayPath1); + auto& nl2 = dataStructure.getDataRefAs(inputArrayPath2); + auto& combinedNL = dataStructure.getDataRefAs(combinedArrayPath); REQUIRE(combinedNL.getDataType() == nl1.getDataType()); REQUIRE(combinedNL.getDataType() == nl2.getDataType()); ExecuteNeighborFunction(ValidateNeighborListsImpl{}, combinedNL.getDataType(), dataStructure, inputArrayPath1, inputArrayPath2, combinedArrayPath); break; } - case IArray::ArrayType::Any: { + case AbstractArray::ArrayType::Any: { // This SHOULD NOT happen REQUIRE(0 == 1); } @@ -431,7 +431,7 @@ void CombineNodeBasedGeometriesImpl(const DataPath& inputGeom1Path, const DataPa auto* inputVertices1 = inputGeom1.getVertices(); REQUIRE(inputVertices1 != nullptr); - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto* inputVertices2 = inputGeom2.getVertices(); auto* combinedVertices = combinedGeom.getVertices(); @@ -442,7 +442,7 @@ void CombineNodeBasedGeometriesImpl(const DataPath& inputGeom1Path, const DataPa auto* combinedVertexAM = combinedGeom.getVertexAttributeMatrix(); ValidateAttributeMatrixArrays(dataStructure, vertexAM1, vertexAM2, combinedVertexAM); } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto* inputEdges1 = inputGeom1.getEdges(); auto* inputEdges2 = inputGeom2.getEdges(); @@ -454,7 +454,7 @@ void CombineNodeBasedGeometriesImpl(const DataPath& inputGeom1Path, const DataPa auto* combinedEdgesAM = combinedGeom.getEdgeAttributeMatrix(); ValidateAttributeMatrixArrays(dataStructure, edgesAM1, edgesAM2, combinedEdgesAM); } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto* inputFaces1 = inputGeom1.getFaces(); auto* inputFaces2 = inputGeom2.getFaces(); @@ -466,7 +466,7 @@ void CombineNodeBasedGeometriesImpl(const DataPath& inputGeom1Path, const DataPa auto* combinedFacesAM = combinedGeom.getFaceAttributeMatrix(); ValidateAttributeMatrixArrays(dataStructure, facesAM1, facesAM2, combinedFacesAM); } - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto* inputPolyhedra1 = inputGeom1.getPolyhedra(); auto* inputPolyhedra2 = inputGeom2.getPolyhedra(); @@ -490,7 +490,7 @@ void InitializeNodeBasedGeometries(DataStructure& dataStructure) CAPTURE(opts); - if constexpr(std::is_base_of_v) + if constexpr(std::is_base_of_v) { auto& geom1 = dataStructure.getDataRefAs(k_InputGeometry1Path); auto& geom2 = dataStructure.getDataRefAs(k_InputGeometry2Path); @@ -504,7 +504,7 @@ void InitializeNodeBasedGeometries(DataStructure& dataStructure) InitializeNode3DGeometry(geom4, dataStructure, opts.vertex, opts.edge, opts.face, opts.poly); InitializeNode3DGeometry(geom5, dataStructure, opts.vertex, opts.edge, opts.face, opts.poly); } - else if constexpr(std::is_base_of_v) + else if constexpr(std::is_base_of_v) { auto& geom1 = dataStructure.getDataRefAs(k_InputGeometry1Path); auto& geom2 = dataStructure.getDataRefAs(k_InputGeometry2Path); @@ -516,7 +516,7 @@ void InitializeNodeBasedGeometries(DataStructure& dataStructure) InitializeNode2DGeometry(geom3, dataStructure, opts.vertex, opts.edge, opts.face); InitializeNode2DGeometry(geom4, dataStructure, opts.vertex, opts.edge, opts.face); } - else if constexpr(std::is_base_of_v) + else if constexpr(std::is_base_of_v) { auto& geom1 = dataStructure.getDataRefAs(k_InputGeometry1Path); auto& geom2 = dataStructure.getDataRefAs(k_InputGeometry2Path); @@ -526,7 +526,7 @@ void InitializeNodeBasedGeometries(DataStructure& dataStructure) InitializeNode1DGeometry(geom2, dataStructure, opts.vertex, opts.edge); InitializeNode1DGeometry(geom3, dataStructure, opts.vertex, opts.edge); } - else if constexpr(std::is_base_of_v) + else if constexpr(std::is_base_of_v) { auto& geom1 = dataStructure.getDataRefAs(k_InputGeometry1Path); auto& geom2 = dataStructure.getDataRefAs(k_InputGeometry2Path); @@ -705,11 +705,11 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod SECTION("Differing Geometries") { auto geom1 = VertexGeom::Create(dataStructure, k_Geometry1Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, 10, 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, 10, 3); geom1->setVertices(*vertices); auto geom2 = EdgeGeom::Create(dataStructure, k_Geometry2Name); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, 10, 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, 10, 3); geom2->setVertices(*vertices); inputPaths = std::vector{k_InputGeometry1Path, k_InputGeometry2Path}; @@ -749,12 +749,12 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = EdgeGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = EdgeGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); geom2->setVertices(*vertices); - auto edges = CreateNodeArray(*geom1, dataStructure, INodeGeometry1D::k_SharedEdgeListName, 1, geom1->getNumberOfVerticesPerEdge()); + auto edges = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry1D::k_SharedEdgeListName, 1, geom1->getNumberOfVerticesPerEdge()); geom1->setEdgeList(*edges); } SECTION("2D Geometry") @@ -762,12 +762,12 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TriangleGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TriangleGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto faces = CreateNodeArray(*geom1, dataStructure, INodeGeometry2D::k_SharedFacesListName, 1, geom1->getNumberOfVerticesPerFace()); + auto faces = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry2D::k_SharedFacesListName, 1, geom1->getNumberOfVerticesPerFace()); geom1->setFaceList(*faces); } @@ -776,12 +776,12 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = HexahedralGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = HexahedralGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); geom2->setVertices(*vertices); - auto polyhedra = CreateNodeArray(*geom1, dataStructure, INodeGeometry3D::k_SharedPolyhedronListName, 1, geom1->getNumberOfVerticesPerCell()); + auto polyhedra = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry3D::k_SharedPolyhedronListName, 1, geom1->getNumberOfVerticesPerCell()); geom1->setPolyhedraList(*polyhedra); } @@ -792,12 +792,12 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TetrahedralGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TetrahedralGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerCell()); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerCell()); geom1->setVertexAttributeMatrix(*vertexAttrMatrix); errorCode = CombineNodeBasedGeometries::ErrorCodes::InconsistentGeometryElements; @@ -809,15 +809,15 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = EdgeGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = EdgeGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerEdge()); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerEdge()); geom1->setVertexAttributeMatrix(*vertexAttrMatrix); - vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerEdge()); + vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerEdge()); geom2->setVertexAttributeMatrix(*vertexAttrMatrix); AddDataArray(*vertexAttrMatrix, dataStructure); @@ -829,17 +829,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = QuadGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = QuadGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); geom1->setVertexAttributeMatrix(*vertexAttrMatrix); CreateDataArray(*vertexAttrMatrix, dataStructure, "TestArray"); - vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); + vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); geom2->setVertexAttributeMatrix(*vertexAttrMatrix); CreateDataArray(*vertexAttrMatrix, dataStructure, "TestArray"); @@ -851,17 +851,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TriangleGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TriangleGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); geom1->setVertexAttributeMatrix(*vertexAttrMatrix); CreateDataArray(*vertexAttrMatrix, dataStructure, "TestArray"); - vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); + vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); geom2->setVertexAttributeMatrix(*vertexAttrMatrix); CreateStringArray(*vertexAttrMatrix, dataStructure, "TestArray"); @@ -873,17 +873,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TriangleGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TriangleGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom1->getNumberOfVerticesPerFace()); geom1->setVertexAttributeMatrix(*vertexAttrMatrix); CreateDataArray(*vertexAttrMatrix, dataStructure, "TestArray", {2, 3}); - vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); + vertexAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, geom2->getNumberOfVerticesPerFace()); geom2->setVertexAttributeMatrix(*vertexAttrMatrix); CreateDataArray(*vertexAttrMatrix, dataStructure, "TestArray", {4, 5}); @@ -898,15 +898,15 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = EdgeGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = EdgeGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerEdge(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerEdge(), 3); geom2->setVertices(*vertices); - auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom1->setEdgeAttributeMatrix(*cellAttrMatrix); - cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom2->setEdgeAttributeMatrix(*cellAttrMatrix); AddDataArray(*cellAttrMatrix, dataStructure); @@ -918,17 +918,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = QuadGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = QuadGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom1->setFaceAttributeMatrix(*cellAttrMatrix); CreateDataArray(*cellAttrMatrix, dataStructure, "TestArray"); - cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom2->setFaceAttributeMatrix(*cellAttrMatrix); CreateDataArray(*cellAttrMatrix, dataStructure, "TestArray"); @@ -940,17 +940,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TriangleGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TriangleGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom1->setFaceAttributeMatrix(*cellAttrMatrix); CreateDataArray(*cellAttrMatrix, dataStructure, "TestArray"); - cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom2->setFaceAttributeMatrix(*cellAttrMatrix); CreateStringArray(*cellAttrMatrix, dataStructure, "TestArray"); @@ -962,17 +962,17 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = TriangleGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = TriangleGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerFace(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerFace(), 3); geom2->setVertices(*vertices); - auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + auto cellAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom1->setFaceAttributeMatrix(*cellAttrMatrix); CreateDataArray(*cellAttrMatrix, dataStructure, "TestArray", {2, 3}); - cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + cellAttrMatrix = CreateNodeAttributeMatrix(*geom2, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom2->setFaceAttributeMatrix(*cellAttrMatrix); CreateDataArray(*cellAttrMatrix, dataStructure, "TestArray", {4, 5}); @@ -985,12 +985,12 @@ TEST_CASE("Combine Node Geometries: Error Conditions", "[SimplnxCore][CombineNod auto geom1 = HexahedralGeom::Create(dataStructure, k_Geometry1Name); auto geom2 = HexahedralGeom::Create(dataStructure, k_Geometry2Name); - auto vertices = CreateNodeArray(*geom1, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); + auto vertices = CreateNodeArray(*geom1, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom1->getNumberOfVerticesPerCell(), 3); geom1->setVertices(*vertices); - vertices = CreateNodeArray(*geom2, dataStructure, INodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); + vertices = CreateNodeArray(*geom2, dataStructure, AbstractNodeGeometry0D::k_SharedVertexListName, geom2->getNumberOfVerticesPerCell(), 3); geom2->setVertices(*vertices); - auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, 1); + auto vertexAttrMatrix = CreateNodeAttributeMatrix(*geom1, dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, 1); geom1->setPolyhedraAttributeMatrix(*vertexAttrMatrix); errorCode = CombineNodeBasedGeometries::ErrorCodes::InconsistentGeometryElements; diff --git a/src/Plugins/SimplnxCore/test/ComputeCoordinateThresholdTest.cpp b/src/Plugins/SimplnxCore/test/ComputeCoordinateThresholdTest.cpp index c291a373be..08889945c3 100644 --- a/src/Plugins/SimplnxCore/test/ComputeCoordinateThresholdTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeCoordinateThresholdTest.cpp @@ -84,7 +84,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Rectangle Preflight Er auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -128,7 +128,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Sphere Preflight Error auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -250,7 +250,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Rectangle Runtime Warn auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -312,7 +312,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Sphere Runtime Warning auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -661,7 +661,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Edge Geom Test - Recta auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* edgesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); + auto* edgesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); geom->setEdgeList(*edgesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -722,7 +722,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Edge Geom Test - Spher auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* edgesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); + auto* edgesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); geom->setEdgeList(*edgesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -782,7 +782,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Triangle Geom Test - R auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -829,7 +829,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Triangle Geom Test - S auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -875,7 +875,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Quad Geom Test - Recta auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); @@ -922,7 +922,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinateThresholdFilter: Quad Geom Test - Spher auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); geom->setFaceList(*facesArray); auto& vertices = vertexArray->getDataStoreRef(); diff --git a/src/Plugins/SimplnxCore/test/ComputeCoordinatesImageGeomTest.cpp b/src/Plugins/SimplnxCore/test/ComputeCoordinatesImageGeomTest.cpp index cffa3c61f1..2c03336066 100644 --- a/src/Plugins/SimplnxCore/test/ComputeCoordinatesImageGeomTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeCoordinatesImageGeomTest.cpp @@ -51,7 +51,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinatesImageGeom: Physical", "[SimplnxCore][C SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); } - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedCoordsPath), dataStructure.getDataRefAs(k_PhysicalArrayPath)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedCoordsPath), dataStructure.getDataRefAs(k_PhysicalArrayPath)); UnitTest::CheckArraysInheritTupleDims(dataStructure); } @@ -80,7 +80,7 @@ TEST_CASE("SimplnxCore::ComputeCoordinatesImageGeom: Indices", "[SimplnxCore][Co SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); } - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedIndicesPath), dataStructure.getDataRefAs(k_IndexArrayPath)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedIndicesPath), dataStructure.getDataRefAs(k_IndexArrayPath)); UnitTest::CheckArraysInheritTupleDims(dataStructure); } @@ -110,8 +110,8 @@ TEST_CASE("SimplnxCore::ComputeCoordinatesImageGeom: Both", "[SimplnxCore][Compu SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); } - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedCoordsPath), dataStructure.getDataRefAs(k_PhysicalArrayPath)); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedIndicesPath), dataStructure.getDataRefAs(k_IndexArrayPath)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedCoordsPath), dataStructure.getDataRefAs(k_PhysicalArrayPath)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(k_ComputedIndicesPath), dataStructure.getDataRefAs(k_IndexArrayPath)); UnitTest::CheckArraysInheritTupleDims(dataStructure); } diff --git a/src/Plugins/SimplnxCore/test/ComputeEuclideanDistMapTest.cpp b/src/Plugins/SimplnxCore/test/ComputeEuclideanDistMapTest.cpp index 173415f6bb..916d636616 100644 --- a/src/Plugins/SimplnxCore/test/ComputeEuclideanDistMapTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeEuclideanDistMapTest.cpp @@ -21,7 +21,7 @@ const std::string k_QPDistancesArrayName = "QPManhattanDistances"; bool ArrayExists(const DataStructure& dataStructure, const std::string& name) { const DataPath calculatedPath({k_DataContainer, k_CellData, std::string(k_CalculatedPrefix) + name}); - return dataStructure.getDataAs(calculatedPath) != nullptr; + return dataStructure.getDataAs(calculatedPath) != nullptr; }; } // namespace @@ -91,8 +91,8 @@ TEST_CASE("SimplnxCore::ComputeEuclideanDistMap", "[SimplnxCore][ComputeEuclidea // Check that the currently enabled array matches its exemplar const DataPath exemplarPath({k_DataContainer, k_CellData, expectedArrayName}); const DataPath calculatedPath({k_DataContainer, k_CellData, k_CalculatedPrefix + expectedArrayName}); - const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); - const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); + const auto& exemplarData = dataStructure.getDataRefAs(exemplarPath); + const auto& calculatedData = dataStructure.getDataRefAs(calculatedPath); UnitTest::CompareDataArrays(exemplarData, calculatedData); UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/ComputeFeatureBoundsTest.cpp b/src/Plugins/SimplnxCore/test/ComputeFeatureBoundsTest.cpp index 3d09017709..dfcf044e93 100644 --- a/src/Plugins/SimplnxCore/test/ComputeFeatureBoundsTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeFeatureBoundsTest.cpp @@ -433,7 +433,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Edge Geom Test - Unified", " auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* edgesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); + auto* edgesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); geom->setEdgeList(*edgesArray); const std::string k_EdgeAMName = "Edge Data"; @@ -507,7 +507,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Edge Geom Test - Split", "[S auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* edgesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); + auto* edgesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "edges", {k_TupleCount}, {2}, geom->getId()); geom->setEdgeList(*edgesArray); const std::string k_EdgeAMName = "Edge Data"; @@ -590,7 +590,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Triangle Geom Test - Unified auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; @@ -663,7 +663,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Triangle Geom Test - Split", auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; @@ -745,7 +745,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Quad Geom Test - Unified", " auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; @@ -818,7 +818,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Quad Geom Test - Split", "[S auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {k_TupleCount}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {4}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; @@ -900,7 +900,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Invalid Preflight - Unexpect auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; @@ -946,7 +946,7 @@ TEST_CASE("SimplnxCore::ComputeFeatureBoundsFilter: Invalid Execute - Feature AM auto* vertexArray = Float32Array::CreateWithStore(dataStructure, "Vertices", {6}, {3}, geom->getId()); geom->setVertices(*vertexArray); - auto* facesArray = IGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); + auto* facesArray = AbstractGeometry::MeshIndexArrayType::CreateWithStore>(dataStructure, "faces", {2}, {3}, geom->getId()); geom->setFaceList(*facesArray); const std::string k_FaceAMName = "Face Data"; diff --git a/src/Plugins/SimplnxCore/test/ComputeFeatureCentroidsTest.cpp b/src/Plugins/SimplnxCore/test/ComputeFeatureCentroidsTest.cpp index a6e2a4eb1c..dd0aaec717 100644 --- a/src/Plugins/SimplnxCore/test/ComputeFeatureCentroidsTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeFeatureCentroidsTest.cpp @@ -57,8 +57,8 @@ TEST_CASE("SimplnxCore::ComputeFeatureCentroidsFilter", "[SimplnxCore][ComputeFe const DataPath k_CentroidsArrayPath({k_DataContainer, k_CellFeatureData, k_Centroids}); const DataPath k_CentroidsNXArrayPath({k_DataContainer, k_CellFeatureData, k_CentroidsNX}); - const auto& k_CentroidsArray = dataStructure.getDataRefAs(k_CentroidsArrayPath); - const auto& k_CentroidsNXArray = dataStructure.getDataRefAs(k_CentroidsNXArrayPath); + const auto& k_CentroidsArray = dataStructure.getDataRefAs(k_CentroidsArrayPath); + const auto& k_CentroidsNXArray = dataStructure.getDataRefAs(k_CentroidsNXArrayPath); CompareDataArrays(k_CentroidsArray, k_CentroidsNXArray); } diff --git a/src/Plugins/SimplnxCore/test/ComputeSurfaceAreaToVolumeTest.cpp b/src/Plugins/SimplnxCore/test/ComputeSurfaceAreaToVolumeTest.cpp index 110bcb34cc..5a07396134 100644 --- a/src/Plugins/SimplnxCore/test/ComputeSurfaceAreaToVolumeTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeSurfaceAreaToVolumeTest.cpp @@ -64,10 +64,10 @@ TEST_CASE("SimplnxCore::ComputeSurfaceAreaToVolume", "[SimplnxCore][ComputeSurfa { DataPath exemplarPath({k_DataContainer, k_CellFeatureData, k_SurfaceAreaVolumeRationArrayName}); DataPath calculatedPath({k_DataContainer, k_CellFeatureData, k_SurfaceAreaVolumeRationArrayNameNX}); - CompareDataArrays(dataStructure.getDataRefAs(exemplarPath), dataStructure.getDataRefAs(calculatedPath)); + CompareDataArrays(dataStructure.getDataRefAs(exemplarPath), dataStructure.getDataRefAs(calculatedPath)); exemplarPath = DataPath({k_DataContainer, k_CellFeatureData, k_SphericityArrayName}); calculatedPath = DataPath({k_DataContainer, k_CellFeatureData, k_SphericityArrayNameNX}); - CompareDataArrays(dataStructure.getDataRefAs(exemplarPath), dataStructure.getDataRefAs(calculatedPath)); + CompareDataArrays(dataStructure.getDataRefAs(exemplarPath), dataStructure.getDataRefAs(calculatedPath)); } // Write the DataStructure out to the file system diff --git a/src/Plugins/SimplnxCore/test/ComputeTriangleAreasFilterTest.cpp b/src/Plugins/SimplnxCore/test/ComputeTriangleAreasFilterTest.cpp index 32b9034917..88b1d9a245 100644 --- a/src/Plugins/SimplnxCore/test/ComputeTriangleAreasFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeTriangleAreasFilterTest.cpp @@ -23,7 +23,7 @@ TEST_CASE("SimplnxCore::ComputeTriangleAreasFilter", "[SimplnxCore][ComputeTrian UnitTest::LoadPlugins(); std::string triangleGeometryName = "[Triangle Geometry]"; - std::string triangleFaceDataGroupName = INodeGeometry2D::k_FaceAttributeMatrixName; + std::string triangleFaceDataGroupName = AbstractNodeGeometry2D::k_FaceAttributeMatrixName; std::string normalsDataArrayName = "FaceNormals"; DataStructure dataStructure; diff --git a/src/Plugins/SimplnxCore/test/ComputeTriangleGeomCentroidsTest.cpp b/src/Plugins/SimplnxCore/test/ComputeTriangleGeomCentroidsTest.cpp index 485945ca1f..73cc043c0c 100644 --- a/src/Plugins/SimplnxCore/test/ComputeTriangleGeomCentroidsTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeTriangleGeomCentroidsTest.cpp @@ -64,8 +64,8 @@ TEST_CASE("SimplnxCore::ComputeTriangleGeomCentroids", "[SimplnxCore][ComputeTri const DataPath kExemplarArrayPath = k_FeatureAttributeMatrixPath.createChildPath(kExemplarArrayName); const DataPath kNxArrayPath = k_FeatureAttributeMatrixPath.createChildPath(k_CentroidsArrayName); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); CompareDataArrays(kExemplarsArray, kNxArray); } diff --git a/src/Plugins/SimplnxCore/test/ComputeTriangleGeomVolumesTest.cpp b/src/Plugins/SimplnxCore/test/ComputeTriangleGeomVolumesTest.cpp index 9167cec468..d50b54a35e 100644 --- a/src/Plugins/SimplnxCore/test/ComputeTriangleGeomVolumesTest.cpp +++ b/src/Plugins/SimplnxCore/test/ComputeTriangleGeomVolumesTest.cpp @@ -63,7 +63,7 @@ TEST_CASE("SimplnxCore::ComputeTriangleGeomSizes", "[SimplnxCore][ComputeTriangl const DataPath kExemplarArrayPath = k_FeatureAttributeMatrixPath.createChildPath(kExemplarArrayName); const DataPath kNxArrayPath = k_FeatureAttributeMatrixPath.createChildPath(k_VolumesArrayName); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); // The corrected version of the filter ensures there are no negative values. instead of // uploading a new test file, we can just safely ensure the same applies to the @@ -78,7 +78,7 @@ TEST_CASE("SimplnxCore::ComputeTriangleGeomSizes", "[SimplnxCore][ComputeTriangl valueProxy = std::abs(value); } } - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); CompareDataArrays(kExemplarsArray, kNxArray); } diff --git a/src/Plugins/SimplnxCore/test/ConditionalSetValueTest.cpp b/src/Plugins/SimplnxCore/test/ConditionalSetValueTest.cpp index 03a257ade9..524f6d9d6d 100644 --- a/src/Plugins/SimplnxCore/test/ConditionalSetValueTest.cpp +++ b/src/Plugins/SimplnxCore/test/ConditionalSetValueTest.cpp @@ -96,7 +96,7 @@ TEST_CASE("SimplnxCore::ConditionalSetValueFilter: Test Algorithm Bool", "[Condi nx::core::SizeVec3 imageGeomDims = imageGeometry->getDimensions(); DataPath ciDataPath = DataPath({k_SmallIN100, k_EbsdScanData, k_ConfidenceIndex}); - DataObject* ciDataObject = dataStructure.getData(ciDataPath); + AbstractDataObject* ciDataObject = dataStructure.getData(ciDataPath); DataArray* ciDataArray = dynamic_cast(ciDataObject); // Fill every value with 10.0 into the ciArray diff --git a/src/Plugins/SimplnxCore/test/ConvertDataTest.cpp b/src/Plugins/SimplnxCore/test/ConvertDataTest.cpp index ae8bdfccd3..14da201e5b 100644 --- a/src/Plugins/SimplnxCore/test/ConvertDataTest.cpp +++ b/src/Plugins/SimplnxCore/test/ConvertDataTest.cpp @@ -516,10 +516,10 @@ TEST_CASE("SimplnxCore::ConvertData: In Place Execution", "[SimplnxCore][Convert DataStructure dataStructure; createDataStructure(dataStructure); - REQUIRE(dataStructure.getDataAs(DataArrayPath)->getDataType() == DataType::int8); + REQUIRE(dataStructure.getDataAs(DataArrayPath)->getDataType() == DataType::int8); Arguments args = getArgs(DataArrayPath, DataType::int32, "DataArray"); args.insertOrAssign(ConvertDataFilter::k_DeleteOriginal_Key, true); auto executeResults = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResults.result); - REQUIRE(dataStructure.getDataAs(DataArrayPath)->getDataType() == DataType::int32); + REQUIRE(dataStructure.getDataAs(DataArrayPath)->getDataType() == DataType::int32); } diff --git a/src/Plugins/SimplnxCore/test/CoreFilterTest.cpp b/src/Plugins/SimplnxCore/test/CoreFilterTest.cpp index b131bdfd0c..b93fb5453c 100644 --- a/src/Plugins/SimplnxCore/test/CoreFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/CoreFilterTest.cpp @@ -144,7 +144,7 @@ TEST_CASE("CoreFilterTest:CreateDataGroupFilter") args.insert(CreateDataGroupFilter::k_DataObjectPath, path); auto result = filter.execute(dataStructure, args); REQUIRE(result.result.valid()); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); REQUIRE(object != nullptr); auto* group = dynamic_cast(object); REQUIRE(group != nullptr); diff --git a/src/Plugins/SimplnxCore/test/CreateAMScanPathsTest.cpp b/src/Plugins/SimplnxCore/test/CreateAMScanPathsTest.cpp index 9af071535b..d893660d40 100644 --- a/src/Plugins/SimplnxCore/test/CreateAMScanPathsTest.cpp +++ b/src/Plugins/SimplnxCore/test/CreateAMScanPathsTest.cpp @@ -70,8 +70,8 @@ TEST_CASE("SimplnxCore::CreateAMScanPathsFilter: Valid Filter Execution", "[Simp // Compare the exemplar and the computed outputs { - auto exemplarGeom = dataStructure.getDataAs(k_ExemplarScanVectorsPath); - auto computedGeom = dataStructure.getDataAs(k_ComputedScanVectorsPath); + auto exemplarGeom = dataStructure.getDataAs(k_ExemplarScanVectorsPath); + auto computedGeom = dataStructure.getDataAs(k_ComputedScanVectorsPath); REQUIRE(UnitTest::CompareIGeometry(exemplarGeom, computedGeom)); } diff --git a/src/Plugins/SimplnxCore/test/CreateGeometryTest.cpp b/src/Plugins/SimplnxCore/test/CreateGeometryTest.cpp index 0e68baff57..e746a31ee5 100644 --- a/src/Plugins/SimplnxCore/test/CreateGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/CreateGeometryTest.cpp @@ -17,7 +17,7 @@ using namespace nx::core; -void CreateVerticesArray(DataStructure& dataStructure, const std::string& name, DataObject::IdType parentId) +void CreateVerticesArray(DataStructure& dataStructure, const std::string& name, AbstractDataObject::IdType parentId) { Float32Array* verticesArray = UnitTest::CreateTestDataArray(dataStructure, name, {144}, {3}, parentId); (*verticesArray)[0] = -0.707107; @@ -454,9 +454,9 @@ void CreateVerticesArray(DataStructure& dataStructure, const std::string& name, (*verticesArray)[431] = 0; } -void CreateEdgesArray(DataStructure& dataStructure, const std::string& name, DataObject::IdType parentId) +void CreateEdgesArray(DataStructure& dataStructure, const std::string& name, AbstractDataObject::IdType parentId) { - IGeometry::MeshIndexArrayType* edgesListArray = UnitTest::CreateTestDataArray(dataStructure, name, {264}, {2}, parentId); + AbstractGeometry::MeshIndexArrayType* edgesListArray = UnitTest::CreateTestDataArray(dataStructure, name, {264}, {2}, parentId); (*edgesListArray)[0] = 12; (*edgesListArray)[1] = 0; (*edgesListArray)[2] = 0; @@ -987,9 +987,9 @@ void CreateEdgesArray(DataStructure& dataStructure, const std::string& name, Dat (*edgesListArray)[527] = 142; } -void CreateTrianglesArray(DataStructure& dataStructure, const std::string& name, DataObject::IdType parentId) +void CreateTrianglesArray(DataStructure& dataStructure, const std::string& name, AbstractDataObject::IdType parentId) { - IGeometry::MeshIndexArrayType* trianglesListArray = UnitTest::CreateTestDataArray(dataStructure, name, {242}, {3}, parentId); + AbstractGeometry::MeshIndexArrayType* trianglesListArray = UnitTest::CreateTestDataArray(dataStructure, name, {242}, {3}, parentId); (*trianglesListArray)[0] = 0; (*trianglesListArray)[1] = 1; (*trianglesListArray)[2] = 13; @@ -1718,9 +1718,9 @@ void CreateTrianglesArray(DataStructure& dataStructure, const std::string& name, (*trianglesListArray)[725] = 142; } -void CreateQuadsArray(DataStructure& dataStructure, const std::string& name, DataObject::IdType parentId) +void CreateQuadsArray(DataStructure& dataStructure, const std::string& name, AbstractDataObject::IdType parentId) { - IGeometry::MeshIndexArrayType* quadsListArray = UnitTest::CreateTestDataArray(dataStructure, name, {121}, {4}, parentId); + AbstractGeometry::MeshIndexArrayType* quadsListArray = UnitTest::CreateTestDataArray(dataStructure, name, {121}, {4}, parentId); (*quadsListArray)[0] = 0; (*quadsListArray)[1] = 1; (*quadsListArray)[2] = 13; @@ -2207,7 +2207,7 @@ void CreateQuadsArray(DataStructure& dataStructure, const std::string& name, Dat (*quadsListArray)[483] = 142; } -void CreateTetAndVerticesArrays(DataStructure& dataStructure, const std::string& verticesName, const std::string& tetsName, DataObject::IdType parentId) +void CreateTetAndVerticesArrays(DataStructure& dataStructure, const std::string& verticesName, const std::string& tetsName, AbstractDataObject::IdType parentId) { Float32Array* vertListArray = UnitTest::CreateTestDataArray(dataStructure, verticesName, {5}, {3}, parentId); (*vertListArray)[0] = -1; @@ -2225,7 +2225,7 @@ void CreateTetAndVerticesArrays(DataStructure& dataStructure, const std::string& (*vertListArray)[12] = 1; (*vertListArray)[13] = 0.5; (*vertListArray)[14] = 0; - IGeometry::MeshIndexArrayType* polyListArray = UnitTest::CreateTestDataArray(dataStructure, tetsName, {2}, {4}, parentId); + AbstractGeometry::MeshIndexArrayType* polyListArray = UnitTest::CreateTestDataArray(dataStructure, tetsName, {2}, {4}, parentId); (*polyListArray)[0] = 0; (*polyListArray)[1] = 1; (*polyListArray)[2] = 2; @@ -2236,7 +2236,7 @@ void CreateTetAndVerticesArrays(DataStructure& dataStructure, const std::string& (*polyListArray)[7] = 3; } -void CreateHexAndVerticesArrays(DataStructure& dataStructure, const std::string& verticesName, const std::string& hexsName, DataObject::IdType parentId) +void CreateHexAndVerticesArrays(DataStructure& dataStructure, const std::string& verticesName, const std::string& hexsName, AbstractDataObject::IdType parentId) { Float32Array* vertListArray = UnitTest::CreateTestDataArray(dataStructure, verticesName, {12}, {3}, parentId); (*vertListArray)[0] = -1; @@ -2275,7 +2275,7 @@ void CreateHexAndVerticesArrays(DataStructure& dataStructure, const std::string& (*vertListArray)[33] = 1; (*vertListArray)[34] = -1; (*vertListArray)[35] = 1; - IGeometry::MeshIndexArrayType* polyListArray = UnitTest::CreateTestDataArray(dataStructure, hexsName, {2}, {8}, parentId); + AbstractGeometry::MeshIndexArrayType* polyListArray = UnitTest::CreateTestDataArray(dataStructure, hexsName, {2}, {8}, parentId); (*polyListArray)[0] = 6; (*polyListArray)[1] = 7; (*polyListArray)[2] = 4; @@ -2294,7 +2294,7 @@ void CreateHexAndVerticesArrays(DataStructure& dataStructure, const std::string& (*polyListArray)[15] = 3; } -void CreateIncompatibleVerticesArray(DataStructure& dataStructure, const std::string& name, DataObject::IdType parentId) +void CreateIncompatibleVerticesArray(DataStructure& dataStructure, const std::string& name, AbstractDataObject::IdType parentId) { Float32Array* verticesArray = UnitTest::CreateTestDataArray(dataStructure, name, {2}, {3}, parentId); (*verticesArray)[0] = -0.707107; @@ -2317,10 +2317,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const std::string geometryName = "[Geometry Test]"; const DataPath geometryPath({geometryName}); - const std::string vertexAmName = INodeGeometry0D::k_VertexAttributeMatrixName; - const std::string edgeAmName = INodeGeometry1D::k_EdgeAttributeMatrixName; - const std::string faceAmName = INodeGeometry2D::k_FaceAttributeMatrixName; - const std::string cellAmName = IGridGeometry::k_CellAttributeMatrixName; + const std::string vertexAmName = AbstractNodeGeometry0D::k_VertexAttributeMatrixName; + const std::string edgeAmName = AbstractNodeGeometry1D::k_EdgeAttributeMatrixName; + const std::string faceAmName = AbstractNodeGeometry2D::k_FaceAttributeMatrixName; + const std::string cellAmName = AbstractGridGeometry::k_CellAttributeMatrixName; const std::string vertexListName = "Shared Vertex List"; const std::string edgeListName = "Edge List"; @@ -2623,10 +2623,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto edgeAm = dataStructure.getDataAs(geometryPath.createChildPath(edgeAmName)); REQUIRE(edgeAm != nullptr); REQUIRE(createdGeom->getEdgeAttributeMatrix() != nullptr); - const auto destEdges = dataStructure.getDataAs(geometryPath.createChildPath(edgeListName)); + const auto destEdges = dataStructure.getDataAs(geometryPath.createChildPath(edgeListName)); REQUIRE(destEdges != nullptr); REQUIRE(createdGeom->getEdges() != nullptr); - UnitTest::CompareArrays(dataStructure, srcEdgesPath, geometryPath.createChildPath(edgeListName)); + UnitTest::CompareArrays(dataStructure, srcEdgesPath, geometryPath.createChildPath(edgeListName)); } SECTION("Triangle Geometry Copy") @@ -2685,10 +2685,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto faceAm = dataStructure.getDataAs(geometryPath.createChildPath(faceAmName)); REQUIRE(faceAm != nullptr); REQUIRE(createdGeom->getFaceAttributeMatrix() != nullptr); - const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(triangleListName)); + const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(triangleListName)); REQUIRE(destFaces != nullptr); REQUIRE(createdGeom->getFaces() != nullptr); - UnitTest::CompareArrays(dataStructure, srcTrianglesPath, geometryPath.createChildPath(triangleListName)); + UnitTest::CompareArrays(dataStructure, srcTrianglesPath, geometryPath.createChildPath(triangleListName)); } SECTION("Quad Geometry Copy") @@ -2747,10 +2747,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto quadAm = dataStructure.getDataAs(geometryPath.createChildPath(faceAmName)); REQUIRE(quadAm != nullptr); REQUIRE(createdGeom->getFaceAttributeMatrix() != nullptr); - const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(quadListName)); + const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(quadListName)); REQUIRE(destFaces != nullptr); REQUIRE(createdGeom->getFaces() != nullptr); - UnitTest::CompareArrays(dataStructure, srcQuadsPath, geometryPath.createChildPath(quadListName)); + UnitTest::CompareArrays(dataStructure, srcQuadsPath, geometryPath.createChildPath(quadListName)); } SECTION("Tetrahedral Geometry Copy") @@ -2809,10 +2809,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto tetAm = dataStructure.getDataAs(geometryPath.createChildPath(cellAmName)); REQUIRE(tetAm != nullptr); REQUIRE(createdGeom->getPolyhedraAttributeMatrix() != nullptr); - const auto destCells = dataStructure.getDataAs(geometryPath.createChildPath(tetListName)); + const auto destCells = dataStructure.getDataAs(geometryPath.createChildPath(tetListName)); REQUIRE(destCells != nullptr); REQUIRE(createdGeom->getPolyhedra() != nullptr); - UnitTest::CompareArrays(dataStructure, srcTetsPath, geometryPath.createChildPath(tetListName)); + UnitTest::CompareArrays(dataStructure, srcTetsPath, geometryPath.createChildPath(tetListName)); } SECTION("Hexahedral Geometry Copy") @@ -2871,10 +2871,10 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto hexAm = dataStructure.getDataAs(geometryPath.createChildPath(cellAmName)); REQUIRE(hexAm != nullptr); REQUIRE(createdGeom->getPolyhedraAttributeMatrix() != nullptr); - const auto destCells = dataStructure.getDataAs(geometryPath.createChildPath(hexListName)); + const auto destCells = dataStructure.getDataAs(geometryPath.createChildPath(hexListName)); REQUIRE(destCells != nullptr); REQUIRE(createdGeom->getPolyhedra() != nullptr); - UnitTest::CompareArrays(dataStructure, srcHexsPath, geometryPath.createChildPath(hexListName)); + UnitTest::CompareArrays(dataStructure, srcHexsPath, geometryPath.createChildPath(hexListName)); } SECTION("Triangle Geometry Move") @@ -2932,7 +2932,7 @@ TEST_CASE("SimplnxCore::CreateGeometry: Valid Execution", "[SimplnxCore][CreateG const auto faceAm = dataStructure.getDataAs(geometryPath.createChildPath(faceAmName)); REQUIRE(faceAm != nullptr); REQUIRE(createdGeom->getFaceAttributeMatrix() != nullptr); - const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(triangleListName)); + const auto destFaces = dataStructure.getDataAs(geometryPath.createChildPath(triangleListName)); REQUIRE(destFaces != nullptr); REQUIRE(createdGeom->getFaces() != nullptr); diff --git a/src/Plugins/SimplnxCore/test/CropEdgeGeometryTest.cpp b/src/Plugins/SimplnxCore/test/CropEdgeGeometryTest.cpp index 62fe8be454..518e4f7578 100644 --- a/src/Plugins/SimplnxCore/test/CropEdgeGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/CropEdgeGeometryTest.cpp @@ -45,7 +45,7 @@ DataStructure CreateDataStructure() verticesRef[11] = 0; edgeGeom->setVertices(*vertices); - IGeometry::SharedEdgeList* edges = UnitTest::CreateTestDataArray(dataStructure, k_EdgesName, {4}, {2}, edgeGeom->getId()); + AbstractGeometry::SharedEdgeList* edges = UnitTest::CreateTestDataArray(dataStructure, k_EdgesName, {4}, {2}, edgeGeom->getId()); auto& edgesRef = edges->getDataStoreRef(); edgesRef[0] = 0; edgesRef[1] = 1; diff --git a/src/Plugins/SimplnxCore/test/CropImageGeometryTest.cpp b/src/Plugins/SimplnxCore/test/CropImageGeometryTest.cpp index 3642e8f4ef..30438bc9bd 100644 --- a/src/Plugins/SimplnxCore/test/CropImageGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/CropImageGeometryTest.cpp @@ -21,7 +21,7 @@ inline constexpr StringLiteral k_DataContainer("DataContainer2"); struct CompareDataArrayFunctor { template - void operator()(const IDataArray& left, const IDataArray& right, usize start = 0) + void operator()(const AbstractDataArray& left, const AbstractDataArray& right, usize start = 0) { UnitTest::CompareDataArrays(left, right, start); } @@ -235,8 +235,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter)", "[SimplnxCore] const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -244,8 +244,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter)", "[SimplnxCore] const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -321,8 +321,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - XY", "[Simplnx const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -330,8 +330,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - XY", "[Simplnx const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -405,8 +405,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - XZ", "[Simplnx const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -414,8 +414,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - XZ", "[Simplnx const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -489,8 +489,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - YZ", "[Simplnx const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -498,8 +498,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - YZ", "[Simplnx const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -574,8 +574,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - X", "[SimplnxC const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -583,8 +583,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - X", "[SimplnxC const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -659,8 +659,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - Y", "[SimplnxC const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -668,8 +668,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - Y", "[SimplnxC const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -744,8 +744,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - Z", "[SimplnxC const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -753,8 +753,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter(Execute_Filter) - Z", "[SimplnxC const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -826,8 +826,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Physical Bounds", "[Simpln const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -835,8 +835,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Physical Bounds", "[Simpln const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -910,8 +910,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop XY Physical Bounds", "[Sim const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -919,8 +919,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop XY Physical Bounds", "[Sim const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -998,8 +998,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop XZ Physical Bounds", "[Sim const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1007,8 +1007,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop XZ Physical Bounds", "[Sim const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1082,8 +1082,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop YZ Physical Bounds", "[Sim const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1091,8 +1091,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop YZ Physical Bounds", "[Sim const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1167,8 +1167,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop X Physical Bounds", "[Simp const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1176,8 +1176,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop X Physical Bounds", "[Simp const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1252,8 +1252,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Y Physical Bounds", "[Simp const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1261,8 +1261,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Y Physical Bounds", "[Simp const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1337,8 +1337,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Z Physical Bounds", "[Simp const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ::ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -1346,8 +1346,8 @@ TEST_CASE("SimplnxCore::CropImageGeometryFilter: Crop Z Physical Bounds", "[Simp const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, k_DestCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } diff --git a/src/Plugins/SimplnxCore/test/DeleteDataTest.cpp b/src/Plugins/SimplnxCore/test/DeleteDataTest.cpp index 89d77cfeca..a17eb79eaf 100644 --- a/src/Plugins/SimplnxCore/test/DeleteDataTest.cpp +++ b/src/Plugins/SimplnxCore/test/DeleteDataTest.cpp @@ -50,7 +50,7 @@ TEST_CASE("SimplnxCore::Delete Singular Data Array", "[SimplnxCore][DeleteDataFi auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); - DataObject* removedDataArray = dataStructure.getData(selectedDataPath1); + AbstractDataObject* removedDataArray = dataStructure.getData(selectedDataPath1); REQUIRE(removedDataArray == nullptr); REQUIRE(dataStructure.getData(selectedDataPath2) == nullptr); @@ -88,7 +88,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); - DataObject* removedDataArray = dataStructure.getData(selectedDataGroupPath); + AbstractDataObject* removedDataArray = dataStructure.getData(selectedDataGroupPath); REQUIRE(removedDataArray == nullptr); UnitTest::CheckArraysInheritTupleDims(dataStructure); @@ -102,7 +102,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // TEST_CASE("SimplnxCore::Delete Shared Node (Node removal)", "[SimplnxCore][DeleteDataFilter]") //{ -// // For this test case the goal will be to completely wipe node (DataObject) C out of the +// // For this test case the goal will be to completely wipe node (AbstractDataObject) C out of the // // graph completely. Ie clear all edges (parent and child) to node C, call the destructor // // on the node to ensure it doesn't become freehanging, and verify that the object is no longer // // in the data-lake (DataStructure) tables by ID grep. @@ -125,7 +125,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // // // Store Data prior to deletion to verify removal // // The target node here is k_GroupCName (the DataGroup named C) -// std::weak_ptr objectCPtr = dataStructure.getSharedData(selectedDataGroupPath); // convert the shared ptr to a weak ptr +// std::weak_ptr objectCPtr = dataStructure.getSharedData(selectedDataGroupPath); // convert the shared ptr to a weak ptr // auto groupCId = dataStructure.getId(selectedDataGroupPath).value(); // // DeleteDataFilter filter; @@ -231,7 +231,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // // // Store Data prior to deletion to verify removal // // The target node here is k_GroupDName (the DataGroup named D) -// std::weak_ptr objectDPtr = dataStructure.getSharedData(selectedDataGroupPath); // convert the shared ptr to a weak ptr +// std::weak_ptr objectDPtr = dataStructure.getSharedData(selectedDataGroupPath); // convert the shared ptr to a weak ptr // auto groupDId = dataStructure.getId(selectedDataGroupPath).value(); // // DeleteDataFilter filter; @@ -422,7 +422,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // // // Store Data prior to deletion to verify removal // // The target node here is k_GroupBName (the DataGroup named B) -// std::map> removedValues; +// std::map> removedValues; // std::vector pathsRemoved = {groupBPath, groupFPath, groupGPath, arrayMPath, arrayLPath}; // // for(const auto& path : pathsRemoved) @@ -430,9 +430,9 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // removedValues.emplace(dataStructure.getId(path).value(), dataStructure.getSharedData(path)); // } // -// std::weak_ptr objectEPtr = dataStructure.getSharedData(groupEPath); // convert the shared ptr to a weak ptr +// std::weak_ptr objectEPtr = dataStructure.getSharedData(groupEPath); // convert the shared ptr to a weak ptr // auto groupEId = dataStructure.getId(groupEPath).value(); -// std::weak_ptr objectKPtr = dataStructure.getSharedData(arrayKPath); // convert the shared ptr to a weak ptr +// std::weak_ptr objectKPtr = dataStructure.getSharedData(arrayKPath); // convert the shared ptr to a weak ptr // auto arrayKId = dataStructure.getId(arrayKPath).value(); // // DeleteDataFilter filter; @@ -479,7 +479,7 @@ TEST_CASE("SimplnxCore::Delete Data Object (Node removal)", "[SimplnxCore][Delet // // // Store Data prior to deletion to verify removal // // The target node here is k_GroupBName (the DataGroup named B) -// std::map> removedValues; +// std::map> removedValues; // std::vector pathsRemoved = {groupBPath, groupFPath, groupGPath, groupEPath, arrayMPath, arrayLPath, arrayKPath}; // // for(const auto& path : pathsRemoved) diff --git a/src/Plugins/SimplnxCore/test/FlyingEdges3DTest.cpp b/src/Plugins/SimplnxCore/test/FlyingEdges3DTest.cpp index 5410b0664a..6d66fe1c72 100644 --- a/src/Plugins/SimplnxCore/test/FlyingEdges3DTest.cpp +++ b/src/Plugins/SimplnxCore/test/FlyingEdges3DTest.cpp @@ -30,8 +30,8 @@ const std::string k_ExemplarTriangleContourName = "Contouring Geometry"; const DataPath k_ExemplarContourPath = DataPath({k_ExemplarTriangleContourName}); const DataPath k_NewContourPath = DataPath({k_NewTriangleContourName}); -const DataPath k_ExemplarNormals = k_ExemplarContourPath.createChildPath(INodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); -const DataPath k_NewNormals = k_NewContourPath.createChildPath(INodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); +const DataPath k_ExemplarNormals = k_ExemplarContourPath.createChildPath(AbstractNodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); +const DataPath k_NewNormals = k_NewContourPath.createChildPath(AbstractNodeGeometry0D::k_VertexAttributeMatrixName).createChildPath(k_VertexNormals); } // namespace ContourTest TEST_CASE("SimplnxCore::Image Contouring Valid Execution", "[SimplnxCore][FlyingEdges3D]") @@ -79,12 +79,12 @@ TEST_CASE("SimplnxCore::Image Contouring Valid Execution", "[SimplnxCore][Flying const auto& kNxVertArray = newContourTriGeom.getVerticesRef(); const auto& kExemplarsVertArray = exemplarContourTriGeom.getVerticesRef(); - CompareDataArrays(kExemplarsVertArray, kNxVertArray); + CompareDataArrays(kExemplarsVertArray, kNxVertArray); const auto& kNxTriArray = newContourTriGeom.getFacesRef(); const auto& kExemplarsTriArray = exemplarContourTriGeom.getFacesRef(); - CompareDataArrays(kExemplarsTriArray, kNxTriArray); + CompareDataArrays(kExemplarsTriArray, kNxTriArray); const auto& kNxNormalsArray = dataStructure.getDataRefAs(ContourTest::k_NewNormals); const auto& kExemplarsNormalsArray = dataStructure.getDataRefAs(ContourTest::k_ExemplarNormals); diff --git a/src/Plugins/SimplnxCore/test/IdentifySampleTest.cpp b/src/Plugins/SimplnxCore/test/IdentifySampleTest.cpp index 7871d98fad..aa0831ede1 100644 --- a/src/Plugins/SimplnxCore/test/IdentifySampleTest.cpp +++ b/src/Plugins/SimplnxCore/test/IdentifySampleTest.cpp @@ -2,8 +2,8 @@ #include "SimplnxCore/Filters/IdentifySampleFilter.hpp" #include "SimplnxCore/SimplnxCore_test_dirs.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" #include "simplnx/UnitTest/UnitTestCommon.hpp" @@ -66,8 +66,8 @@ TEST_CASE("SimplnxCore::IdentifySampleFilter", "[SimplnxCore][IdentifySampleFilt WriteTestDataStructure(dataStructure, fmt::format("{}/identify_sample_output_{}_{}_{}.dream3d", unit_test::k_BinaryTestOutputDir, fillHoles, sliceBySlice, sliceBySlicePlane)); #endif - const IDataArray& computedArray = dataStructure.getDataRefAs(Constants::k_MaskArrayPath); - const IDataArray& exemplarArray = dataStructure.getDataRefAs(k_ExemplarArrayPath); + const AbstractDataArray& computedArray = dataStructure.getDataRefAs(Constants::k_MaskArrayPath); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(k_ExemplarArrayPath); CompareDataArrays(computedArray, exemplarArray); UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/InitializeImageGeomCellDataTest.cpp b/src/Plugins/SimplnxCore/test/InitializeImageGeomCellDataTest.cpp index 14a72e8ee1..0ed50916a5 100644 --- a/src/Plugins/SimplnxCore/test/InitializeImageGeomCellDataTest.cpp +++ b/src/Plugins/SimplnxCore/test/InitializeImageGeomCellDataTest.cpp @@ -135,7 +135,7 @@ TEST_CASE("SimplnxCore::InitializeImageGeomCellDataFilter(Manual)", "[SimplnxCor for(const auto& path : cellArrayPaths) { - const auto& dataArray = dataStructure.getDataRefAs(path); + const auto& dataArray = dataStructure.getDataRefAs(path); const auto& dataStore = dataArray.getIDataStoreRef(); DataType type = dataStore.getDataType(); @@ -173,7 +173,7 @@ TEST_CASE("SimplnxCore::InitializeImageGeomCellDataFilter(Random)", "[SimplnxCor for(const auto& path : cellArrayPaths) { - const auto& dataArray = dataStructure.getDataRefAs(path); + const auto& dataArray = dataStructure.getDataRefAs(path); const auto& dataStore = dataArray.getIDataStoreRef(); DataType type = dataStore.getDataType(); @@ -212,7 +212,7 @@ TEST_CASE("SimplnxCore::InitializeImageGeomCellDataFilter(RandomWithRange)", "[S for(const auto& path : cellArrayPaths) { - const auto& dataArray = dataStructure.getDataRefAs(path); + const auto& dataArray = dataStructure.getDataRefAs(path); const auto& dataStore = dataArray.getIDataStoreRef(); DataType type = dataStore.getDataType(); diff --git a/src/Plugins/SimplnxCore/test/LaplacianSmoothingFilterTest.cpp b/src/Plugins/SimplnxCore/test/LaplacianSmoothingFilterTest.cpp index 2c3d4c2bc7..f89db07f41 100644 --- a/src/Plugins/SimplnxCore/test/LaplacianSmoothingFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/LaplacianSmoothingFilterTest.cpp @@ -22,9 +22,9 @@ TEST_CASE("SimplnxCore::LaplacianSmoothingFilter", "[SurfaceMeshing][LaplacianSm UnitTest::LoadPlugins(); std::string triangleGeometryName = "[Triangle Geometry]"; - std::string triangleFaceDataGroupName = INodeGeometry2D::k_FaceAttributeMatrixName; + std::string triangleFaceDataGroupName = AbstractNodeGeometry2D::k_FaceAttributeMatrixName; std::string normalsDataArrayName = "FaceNormals"; - std::string triangleVertexDataGroupName = INodeGeometry0D::k_VertexAttributeMatrixName; + std::string triangleVertexDataGroupName = AbstractNodeGeometry0D::k_VertexAttributeMatrixName; std::string nodeTypeArrayName = "Node Type"; DataStructure dataStructure; @@ -59,9 +59,9 @@ TEST_CASE("SimplnxCore::LaplacianSmoothingFilter", "[SurfaceMeshing][LaplacianSm { DataPath triangleGeometryPath({triangleGeometryName}); - DataObject::IdType triangleGeometryId = dataStructure.getId(triangleGeometryPath).value(); + AbstractDataObject::IdType triangleGeometryId = dataStructure.getId(triangleGeometryPath).value(); DataPath vertexDataGroupPath = triangleGeometryPath.createChildPath(triangleVertexDataGroupName); - DataObject::IdType vertexDataGroupId = dataStructure.getId(vertexDataGroupPath).value(); + AbstractDataObject::IdType vertexDataGroupId = dataStructure.getId(vertexDataGroupPath).value(); // Instantiate the filter, a DataStructure object and an Arguments Object LaplacianSmoothingFilter filter; diff --git a/src/Plugins/SimplnxCore/test/NearestPointFuseRegularGridsTest.cpp b/src/Plugins/SimplnxCore/test/NearestPointFuseRegularGridsTest.cpp index 6bcf489b00..1c9517ec64 100644 --- a/src/Plugins/SimplnxCore/test/NearestPointFuseRegularGridsTest.cpp +++ b/src/Plugins/SimplnxCore/test/NearestPointFuseRegularGridsTest.cpp @@ -33,7 +33,7 @@ DataStructure CreateDualImageGeomDataStructure(CreateImageGeometryAction::Dimens const CreateImageGeometryAction::SpacingType spacing = {1.0f, 1.0f, 1.0f}; const CreateImageGeometryAction::DimensionType attrMatrixDims = {dims.rbegin(), dims.rend()}; - auto sampleAction = CreateImageGeometryAction(sampleImageGeomPath, dims, origin, spacing, sampleCellDataName, IGeometry::LengthUnit::Micrometer); + auto sampleAction = CreateImageGeometryAction(sampleImageGeomPath, dims, origin, spacing, sampleCellDataName, AbstractGeometry::LengthUnit::Micrometer); Result<> sampleActionResult = sampleAction.apply(dataStructure, IDataAction::Mode::Execute); SIMPLNX_RESULT_REQUIRE_VALID(sampleActionResult); @@ -44,7 +44,7 @@ DataStructure CreateDualImageGeomDataStructure(CreateImageGeometryAction::Dimens auto* sampleDataStore = dataStructure.getDataAs(sampleDataArrayPath)->getDataStore(); std::iota(sampleDataStore->begin(), sampleDataStore->end(), 1.0); - auto refAction = CreateImageGeometryAction(refImageGeomPath, refDims, refOrigin, refSpacing, refCellDataName, IGeometry::LengthUnit::Micrometer); + auto refAction = CreateImageGeometryAction(refImageGeomPath, refDims, refOrigin, refSpacing, refCellDataName, AbstractGeometry::LengthUnit::Micrometer); Result<> refActionResult = refAction.apply(dataStructure, IDataAction::Mode::Execute); SIMPLNX_RESULT_REQUIRE_VALID(refActionResult); diff --git a/src/Plugins/SimplnxCore/test/PipelineTest.cpp b/src/Plugins/SimplnxCore/test/PipelineTest.cpp index 1fd6b13891..4d2c7d0acb 100644 --- a/src/Plugins/SimplnxCore/test/PipelineTest.cpp +++ b/src/Plugins/SimplnxCore/test/PipelineTest.cpp @@ -1,6 +1,7 @@ #include "SimplnxCore/SimplnxCore_test_dirs.hpp" #include "simplnx/Core/Application.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Filter/Actions/DeleteDataAction.hpp" #include "simplnx/Filter/Arguments.hpp" @@ -42,7 +43,7 @@ const FilterHandle k_CreateDataGroupHandle(k_CreateDataGroupId, k_CorePluginId); const DataPath k_DeferredActionPath({"foo"}); -class DeferredActionTestFilter : public IFilter +class DeferredActionTestFilter : public AbstractFilter { public: DeferredActionTestFilter() = default; @@ -377,13 +378,13 @@ TEST_CASE("PipelineTest:PipelineDeferredActionTest") REQUIRE(pipeline.preflight(dataStructure, false)); // should be deleted in preflight - DataObject* preflightObject = dataStructure.getData(k_DeferredActionPath); + AbstractDataObject* preflightObject = dataStructure.getData(k_DeferredActionPath); REQUIRE(preflightObject == nullptr); // DeferredActionTestFilter checks the k_DeferredActionPath hasn't been deleted until after execute REQUIRE(pipeline.execute(dataStructure, false)); // after execute the object will be deleted - DataObject* executeObject = dataStructure.getData(k_DeferredActionPath); + AbstractDataObject* executeObject = dataStructure.getData(k_DeferredActionPath); REQUIRE(executeObject == nullptr); } diff --git a/src/Plugins/SimplnxCore/test/PointSampleTriangleGeometryFilterTest.cpp b/src/Plugins/SimplnxCore/test/PointSampleTriangleGeometryFilterTest.cpp index 51bac5c255..21dfb0885e 100644 --- a/src/Plugins/SimplnxCore/test/PointSampleTriangleGeometryFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/PointSampleTriangleGeometryFilterTest.cpp @@ -24,7 +24,7 @@ namespace fs = std::filesystem; using namespace nx::core; using namespace nx::core::Constants; -std::array FindMinMaxCoord(IGeometry::SharedVertexList* vertices, usize numVerts) +std::array FindMinMaxCoord(AbstractGeometry::SharedVertexList* vertices, usize numVerts) { std::array minMaxVerts = {std::numeric_limits::max(), std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::min()}; @@ -73,7 +73,7 @@ TEST_CASE("SimplnxCore::PointSampleTriangleGeometryFilter", "[DREAM3DReview][Poi UnitTest::LoadPlugins(); std::string triangleGeometryName = "[Triangle Geometry]"; - std::string triangleFaceDataGroupName = INodeGeometry2D::k_FaceAttributeMatrixName; + std::string triangleFaceDataGroupName = AbstractNodeGeometry2D::k_FaceAttributeMatrixName; std::string normalsDataArrayName = "FaceNormals"; std::string triangleAreasName = "Triangle Areas"; std::string vertexGeometryName = "[Vertex Geometry]"; @@ -179,17 +179,17 @@ TEST_CASE("SimplnxCore::PointSampleTriangleGeometryFilter", "[DREAM3DReview][Poi VertexGeom& vertGeom = dataStructure.getDataRefAs(vertGeometryDataPath); usize numVerts = vertGeom.getNumberOfVertices(); - IGeometry::SharedVertexList* vertices = vertGeom.getVertices(); + AbstractGeometry::SharedVertexList* vertices = vertGeom.getVertices(); std::array minMaxVerts = FindMinMaxCoord(vertices, numVerts); TriangleGeom& triangleGeom = dataStructure.getDataRefAs(triangleGeometryPath); - IGeometry::SharedVertexList* triVerts = triangleGeom.getVertices(); + AbstractGeometry::SharedVertexList* triVerts = triangleGeom.getVertices(); usize triNumVerts = triangleGeom.getNumberOfVertices(); std::array minMaxTriVerts = FindMinMaxCoord(triVerts, triNumVerts); // We need to insert this small data set for the XDMF to work correctly. DataPath xdmfVertsDataPath = vertGeometryDataPath.createChildPath("Verts"); - DataObject::IdType parentId = dataStructure.getId(vertGeometryDataPath).value(); + AbstractDataObject::IdType parentId = dataStructure.getId(vertGeometryDataPath).value(); ShapeType tupleShape = {vertGeom.getNumberOfVertices()}; ShapeType componentShape = {1}; DataArray* vertsArray = DataArray::CreateWithStore>(dataStructure, "Verts", tupleShape, componentShape, parentId); diff --git a/src/Plugins/SimplnxCore/test/QuickSurfaceMeshFilterTest.cpp b/src/Plugins/SimplnxCore/test/QuickSurfaceMeshFilterTest.cpp index 43f901cd73..6bf9270014 100644 --- a/src/Plugins/SimplnxCore/test/QuickSurfaceMeshFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/QuickSurfaceMeshFilterTest.cpp @@ -1,8 +1,8 @@ #include "SimplnxCore/Filters/QuickSurfaceMeshFilter.hpp" #include "SimplnxCore/SimplnxCore_test_dirs.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Parameters/ArrayCreationParameter.hpp" #include "simplnx/Parameters/BoolParameter.hpp" @@ -38,8 +38,8 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter", "[SimplnxCore][QuickSurfaceMesh DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar QuickMesh"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -90,14 +90,14 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter", "[SimplnxCore][QuickSurfaceMesh } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 63440); REQUIRE(vertices->getNumberOfTuples() == 28910); // Compare the shared vertex list and shared triangle list - CompareArrays(dataStructure, exemplarSharedTriPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); + CompareArrays(dataStructure, exemplarSharedTriPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); CompareArrays(dataStructure, exemplarSharedVertexPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName)); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -132,8 +132,8 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Winding", "[SimplnxCore][QuickSu DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar QuickMesh Winding"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -184,14 +184,14 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Winding", "[SimplnxCore][QuickSu } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 63440); REQUIRE(vertices->getNumberOfTuples() == 28910); // Compare the shared vertex list and shared triangle list - CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); + CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName), exemplarSharedVertexPath); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -226,8 +226,8 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Problem Voxels", "[SimplnxCore][ DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar QuickMesh Problem Voxels"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -278,14 +278,14 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Problem Voxels", "[SimplnxCore][ } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 63440); REQUIRE(vertices->getNumberOfTuples() == 28910); // Compare the shared vertex list and shared triangle list - CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); + CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName), exemplarSharedVertexPath); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -320,8 +320,8 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Winding and Problem Voxels", "[S DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar QuickMesh Problem Voxel Winding"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -372,14 +372,14 @@ TEST_CASE("SimplnxCore::QuickSurfaceMeshFilter: Winding and Problem Voxels", "[S } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 63440); REQUIRE(vertices->getNumberOfTuples() == 28910); // Compare the shared vertex list and shared triangle list - CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); + CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName), exemplarSharedTriPath); CompareArrays(dataStructure, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName), exemplarSharedVertexPath); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); diff --git a/src/Plugins/SimplnxCore/test/ReadCSVFileTest.cpp b/src/Plugins/SimplnxCore/test/ReadCSVFileTest.cpp index b58e35e986..1667e92adf 100644 --- a/src/Plugins/SimplnxCore/test/ReadCSVFileTest.cpp +++ b/src/Plugins/SimplnxCore/test/ReadCSVFileTest.cpp @@ -288,7 +288,7 @@ TEST_CASE("SimplnxCore::ReadCSVFileFilter (Case 2): Valid filter execution - Ski SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); // Check that the array does not exist - const IDataArray* array = dataStructure.getDataAs(arrayPath); + const AbstractDataArray* array = dataStructure.getDataAs(arrayPath); REQUIRE(array == nullptr); UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/RemoveFlaggedEdgesTest.cpp b/src/Plugins/SimplnxCore/test/RemoveFlaggedEdgesTest.cpp index de23f7c17e..61262040b0 100644 --- a/src/Plugins/SimplnxCore/test/RemoveFlaggedEdgesTest.cpp +++ b/src/Plugins/SimplnxCore/test/RemoveFlaggedEdgesTest.cpp @@ -60,28 +60,28 @@ TEST_CASE("SimplnxCore::RemoveFlaggedEdgesFilter: Test Algorithm", "[SimplnxCore DataPath generated = ::k_ReducedGeomPath.createChildPath(Constants::k_Edge_Data).createChildPath(::k_RegionIdsName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(Constants::k_Edge_Data).createChildPath(::k_RegionIdsName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(Constants::k_Edge_Data).createChildPath(::k_SliceIdsName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(Constants::k_Edge_Data).createChildPath(::k_SliceIdsName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(::k_VertexListName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(::k_VertexListName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(::k_EdgeListName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(::k_EdgeListName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/RemoveFlaggedTrianglesTest.cpp b/src/Plugins/SimplnxCore/test/RemoveFlaggedTrianglesTest.cpp index 7542c8317d..d93b97f3f2 100644 --- a/src/Plugins/SimplnxCore/test/RemoveFlaggedTrianglesTest.cpp +++ b/src/Plugins/SimplnxCore/test/RemoveFlaggedTrianglesTest.cpp @@ -60,28 +60,28 @@ TEST_CASE("SimplnxCore::RemoveFlaggedTrianglesFilter: Test Algorithm", "[Simplnx DataPath generated = ::k_ReducedGeomPath.createChildPath(Constants::k_Face_Data).createChildPath(::k_RegionIdsName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(Constants::k_Face_Data).createChildPath(::k_RegionIdsName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(Constants::k_Face_Data).createChildPath(::k_FaceNormalsName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(Constants::k_Face_Data).createChildPath(::k_FaceNormalsName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(::k_VertexListName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(::k_VertexListName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(::k_TriangleListName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(::k_TriangleListName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/RemoveFlaggedVerticesTest.cpp b/src/Plugins/SimplnxCore/test/RemoveFlaggedVerticesTest.cpp index d9848adfae..5e40c5ebb8 100644 --- a/src/Plugins/SimplnxCore/test/RemoveFlaggedVerticesTest.cpp +++ b/src/Plugins/SimplnxCore/test/RemoveFlaggedVerticesTest.cpp @@ -164,21 +164,21 @@ TEST_CASE("SimplnxCore::RemoveFlaggedVerticesFilter: Test Algorithm", "[SimplnxC DataPath generated = ::k_ReducedGeomPath.createChildPath(VertexGeom::k_VertexAttributeMatrixName).createChildPath(::k_DataName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(VertexGeom::k_VertexAttributeMatrixName).createChildPath(::k_DataName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(VertexGeom::k_VertexAttributeMatrixName).createChildPath(::k_CopyTestName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(Constants::k_Vertex_Data).createChildPath(::k_CopyTestName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } { DataPath generated = ::k_ReducedGeomPath.createChildPath(VertexGeom::k_SharedVertexListName); DataPath exemplar = ::k_ExemplarReducedGeomPath.createChildPath(::k_VertexListName); - UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); + UnitTest::CompareDataArrays(dataStructure.getDataRefAs(generated), dataStructure.getDataRefAs(exemplar)); } UnitTest::CheckArraysInheritTupleDims(dataStructure); diff --git a/src/Plugins/SimplnxCore/test/RequireMinimumSizeFeaturesTest.cpp b/src/Plugins/SimplnxCore/test/RequireMinimumSizeFeaturesTest.cpp index 40f767a38f..ed1ad7a01b 100644 --- a/src/Plugins/SimplnxCore/test/RequireMinimumSizeFeaturesTest.cpp +++ b/src/Plugins/SimplnxCore/test/RequireMinimumSizeFeaturesTest.cpp @@ -78,7 +78,7 @@ TEST_CASE("SimplnxCore::RequireMinimumSizeFeatures: Small IN100 Pipeline", "[Sim for(const auto& cellArrayPath : selectedCellArrays) { - const auto& generatedDataArray = dataStructure.getDataRefAs(cellArrayPath); + const auto& generatedDataArray = dataStructure.getDataRefAs(cellArrayPath); DataType type = generatedDataArray.getDataType(); // Now generate the path to the exemplar data set in the exemplar data structure. @@ -87,12 +87,12 @@ TEST_CASE("SimplnxCore::RequireMinimumSizeFeatures: Small IN100 Pipeline", "[Sim DataPath exemplarDataArrayPath(generatedPathVector); // Check to see if there is something to compare against in the exemplar file. - if(nullptr == exemplarDataStructure.getDataAs(exemplarDataArrayPath)) + if(nullptr == exemplarDataStructure.getDataAs(exemplarDataArrayPath)) { continue; } - auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath); + auto& exemplarDataArray = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath); DataType exemplarType = exemplarDataArray.getDataType(); std::cout << "Comparing: " << cellArrayPath.toString() << " <==> " << exemplarDataArrayPath.toString() << std::endl; diff --git a/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp b/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp index e442a8645d..b92fb18487 100644 --- a/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp +++ b/src/Plugins/SimplnxCore/test/ResampleImageGeomTest.cpp @@ -25,7 +25,7 @@ const ChoicesParameter::ValueType k_ExactDimensionsModeIndex = 2; struct CompareDataArrayFunctor { template - void operator()(const IDataArray& left, const IDataArray& right, usize start = 0) + void operator()(const AbstractDataArray& left, const AbstractDataArray& right, usize start = 0) { UnitTest::CompareDataArrays(left, right, start); } @@ -194,8 +194,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D In Place", "[SimplnxCore][Resample const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -203,8 +203,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D In Place", "[SimplnxCore][Resample const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -212,8 +212,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D In Place", "[SimplnxCore][Resample const auto calculatedNewGrainDataArrays = GetAllChildArrayDataPaths(dataStructure, destNewGrainDataPath).value(); for(usize i = 0; i < srcNewGrainDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(srcNewGrainDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedNewGrainDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(srcNewGrainDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedNewGrainDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -221,8 +221,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D In Place", "[SimplnxCore][Resample const auto calculatedPhaseDataArrays = GetAllChildArrayDataPaths(dataStructure, destPhaseDataPath).value(); for(usize i = 0; i < srcPhaseDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(srcPhaseDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedPhaseDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(srcPhaseDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedPhaseDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -339,8 +339,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D Save Geometry", "[SimplnxCore][Res const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -348,8 +348,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D Save Geometry", "[SimplnxCore][Res const auto calculatedFeatureDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellFeatureDataPath).value(); for(usize i = 0; i < exemplarFeatureDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarFeatureDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedFeatureDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -357,8 +357,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D Save Geometry", "[SimplnxCore][Res const auto calculatedNewGrainDataArrays = GetAllChildArrayDataPaths(dataStructure, destNewGrainDataPath).value(); for(usize i = 0; i < srcNewGrainDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(srcNewGrainDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedNewGrainDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(srcNewGrainDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedNewGrainDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -366,8 +366,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 3D Save Geometry", "[SimplnxCore][Res const auto calculatedPhaseDataArrays = GetAllChildArrayDataPaths(dataStructure, destPhaseDataPath).value(); for(usize i = 0; i < srcPhaseDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(srcPhaseDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedPhaseDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(srcPhaseDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedPhaseDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -461,8 +461,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 2D In Place", "[SimplnxCore][Resample const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } @@ -555,8 +555,8 @@ TEST_CASE("SimplnxCore::ResampleImageGeom: 2D Save Geometry", "[SimplnxCore][Res const auto calculatedCellDataArrays = GetAllChildArrayDataPaths(dataStructure, destCellDataPath).value(); for(usize i = 0; i < exemplarCellDataArrays.size(); ++i) { - const IDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); - const IDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); + const AbstractDataArray& exemplarArray = dataStructure.getDataRefAs(exemplarCellDataArrays[i]); + const AbstractDataArray& calculatedArray = dataStructure.getDataRefAs(calculatedCellDataArrays[i]); ExecuteDataFunction(CompareDataArrayFunctor{}, exemplarArray.getDataType(), exemplarArray, calculatedArray); } diff --git a/src/Plugins/SimplnxCore/test/ResampleRectGridToImageGeomTest.cpp b/src/Plugins/SimplnxCore/test/ResampleRectGridToImageGeomTest.cpp index 4d989f20f8..5b1c407ec9 100644 --- a/src/Plugins/SimplnxCore/test/ResampleRectGridToImageGeomTest.cpp +++ b/src/Plugins/SimplnxCore/test/ResampleRectGridToImageGeomTest.cpp @@ -35,7 +35,7 @@ TEST_CASE("SimplnxCore::ResampleRectGridToImageGeomFilter: Valid Filter Executio DataStructure dataStructure = LoadDataStructure(fs::path(fmt::format("{}/6_6_resample_rect_grid_to_image_geom.dream3d", unit_test::k_TestFilesDir))); Arguments args; - // Create a neighbor list and string array for testing selected arrays with all IArray types + // Create a neighbor list and string array for testing selected arrays with all AbstractArray types { const auto& cellDataAM = dataStructure.getDataRefAs(k_RectGridCellDataPath); const usize numTuples = cellDataAM.getNumberOfTuples(); diff --git a/src/Plugins/SimplnxCore/test/SharedFeatureFaceTest.cpp b/src/Plugins/SimplnxCore/test/SharedFeatureFaceTest.cpp index 30c1499d65..04939b0227 100644 --- a/src/Plugins/SimplnxCore/test/SharedFeatureFaceTest.cpp +++ b/src/Plugins/SimplnxCore/test/SharedFeatureFaceTest.cpp @@ -71,8 +71,8 @@ TEST_CASE("SimplnxCore::SharedFeatureFaceFilter", "[SimplnxCore][SharedFeatureFa const DataPath kExemplarArrayPath = k_GeometryPath.createChildPath(k_FaceAttributeMatrixName).createChildPath(kExemplarArrayName); const DataPath kNxArrayPath = k_GeometryPath.createChildPath(k_FaceAttributeMatrixName).createChildPath(k_FeatureFaceIdsArrayName); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); UnitTest::CompareDataArrays(kExemplarsArray, kNxArray); } @@ -81,8 +81,8 @@ TEST_CASE("SimplnxCore::SharedFeatureFaceFilter", "[SimplnxCore][SharedFeatureFa const DataPath kExemplarArrayPath = k_GeometryPath.createChildPath(k_GrainBoundaryName).createChildPath(kExemplarArrayName); const DataPath kNxArrayPath = k_GeometryPath.createChildPath(k_GrainBoundaryAttributeMatrixName).createChildPath(k_FeatureFaceLabelsArrayName); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); UnitTest::CompareDataArrays(kExemplarsArray, kNxArray); } @@ -91,8 +91,8 @@ TEST_CASE("SimplnxCore::SharedFeatureFaceFilter", "[SimplnxCore][SharedFeatureFa const DataPath kExemplarArrayPath = k_GeometryPath.createChildPath(k_GrainBoundaryName).createChildPath(kExemplarArrayName); const DataPath kNxArrayPath = k_GeometryPath.createChildPath(k_GrainBoundaryAttributeMatrixName).createChildPath(k_FeatureNumTrianglesArrayName); - const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); - const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); + const auto& kExemplarsArray = dataStructure.getDataRefAs(kExemplarArrayPath); + const auto& kNxArray = dataStructure.getDataRefAs(kNxArrayPath); UnitTest::CompareDataArrays(kExemplarsArray, kNxArray); } diff --git a/src/Plugins/SimplnxCore/test/SliceTriangleGeometryTest.cpp b/src/Plugins/SimplnxCore/test/SliceTriangleGeometryTest.cpp index 544dec170a..91c18dbc34 100644 --- a/src/Plugins/SimplnxCore/test/SliceTriangleGeometryTest.cpp +++ b/src/Plugins/SimplnxCore/test/SliceTriangleGeometryTest.cpp @@ -71,8 +71,8 @@ TEST_CASE("SimplnxCore::SliceTriangleGeometryFilter: Valid Filter Execution", "[ // Compare the exemplar and the computed outputs { - auto exemplarGeom = dataStructure.getDataAs(k_ExemplarEdgeGeometryPath); - auto computedGeom = dataStructure.getDataAs(k_ComputedEdgeGeometryPath); + auto exemplarGeom = dataStructure.getDataAs(k_ExemplarEdgeGeometryPath); + auto computedGeom = dataStructure.getDataAs(k_ComputedEdgeGeometryPath); REQUIRE(UnitTest::CompareIGeometry(exemplarGeom, computedGeom)); } { diff --git a/src/Plugins/SimplnxCore/test/SplitDataArrayByTupleTest.cpp b/src/Plugins/SimplnxCore/test/SplitDataArrayByTupleTest.cpp index 45fa7a37ea..d3573b90ad 100644 --- a/src/Plugins/SimplnxCore/test/SplitDataArrayByTupleTest.cpp +++ b/src/Plugins/SimplnxCore/test/SplitDataArrayByTupleTest.cpp @@ -152,7 +152,7 @@ TEMPLATE_TEST_CASE("SimplnxCore::SplitDataArrayByTupleFilter - Valid Execution", compareSplitArray(inputArray, arr3, {7}); // Original array still present - REQUIRE(ds.getDataAs(k_InputArrayPath) != nullptr); + REQUIRE(ds.getDataAs(k_InputArrayPath) != nullptr); UnitTest::CheckArraysInheritTupleDims(ds); } @@ -220,7 +220,7 @@ TEMPLATE_TEST_CASE("SimplnxCore::SplitDataArrayByTupleFilter - Valid Execution", REQUIRE(arr3[4] == inputArrayVals[18]); REQUIRE(arr3[5] == inputArrayVals[19]); - REQUIRE(ds.getDataAs(k_InputArrayPath) == nullptr); // deleted + REQUIRE(ds.getDataAs(k_InputArrayPath) == nullptr); // deleted UnitTest::CheckArraysInheritTupleDims(ds); } diff --git a/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp b/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp index 8b8ce2d9b8..c700dd9b3e 100644 --- a/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp +++ b/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp @@ -36,8 +36,8 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Default", "[SimplnxCore][SurfaceNetsF DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar SurfaceNets"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -93,16 +93,16 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Default", "[SimplnxCore][SurfaceNetsF } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 668786); REQUIRE(vertices->getNumberOfTuples() == 319447); // Compare the shared vertex list and shared triangle list - auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); - auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); - CompareDataArrays(exemplarDataArray, computedDataArray); + auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); + auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); + CompareDataArrays(exemplarDataArray, computedDataArray); CompareArrays(dataStructure, exemplarSharedVertexPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName)); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -137,8 +137,8 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Smoothing", "[SimplnxCore][SurfaceNet DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar SurfaceNets Smoothing"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -193,16 +193,16 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Smoothing", "[SimplnxCore][SurfaceNet // Check a few things about the generated data. { TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 668786); REQUIRE(vertices->getNumberOfTuples() == 319447); } // Compare the shared vertex list and shared triangle list - auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); - auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); - CompareDataArrays(exemplarDataArray, computedDataArray); + auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); + auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); + CompareDataArrays(exemplarDataArray, computedDataArray); CompareArrays(dataStructure, exemplarSharedVertexPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName)); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -237,8 +237,8 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Winding", "[SimplnxCore][SurfaceNetsF DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar SurfaceNets Winding"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -292,16 +292,16 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Winding", "[SimplnxCore][SurfaceNetsF } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 668786); REQUIRE(vertices->getNumberOfTuples() == 319447); // Compare the shared vertex list and shared triangle list - auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); - auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); - CompareDataArrays(exemplarDataArray, computedDataArray); + auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); + auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); + CompareDataArrays(exemplarDataArray, computedDataArray); CompareArrays(dataStructure, exemplarSharedVertexPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName)); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); @@ -336,8 +336,8 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Winding Smoothing", "[SimplnxCore][Su DataPath faceLabelsDataPath = faceGroupDataPath.createChildPath(k_Face_Labels); DataPath exemplarTriangleGeomPath({"Exemplar SurfaceNets Winding Smoothing"}); - DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry2D::k_SharedFacesListName); - DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(INodeGeometry0D::k_SharedVertexListName); + DataPath exemplarSharedTriPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry2D::k_SharedFacesListName); + DataPath exemplarSharedVertexPath = exemplarTriangleGeomPath.createChildPath(AbstractNodeGeometry0D::k_SharedVertexListName); { Arguments args; @@ -391,16 +391,16 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: Winding Smoothing", "[SimplnxCore][Su } // Check a few things about the generated data. TriangleGeom& triangleGeom = dataStructure.getDataRefAs(computedTriangleGeomPath); - IGeometry::SharedTriList* triangle = triangleGeom.getFaces(); - IGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); + AbstractGeometry::SharedTriList* triangle = triangleGeom.getFaces(); + AbstractGeometry::SharedVertexList* vertices = triangleGeom.getVertices(); REQUIRE(triangle->getNumberOfTuples() == 668786); REQUIRE(vertices->getNumberOfTuples() == 319447); // Compare the shared vertex list and shared triangle list - auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); - auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); - CompareDataArrays(exemplarDataArray, computedDataArray); + auto& exemplarDataArray = dataStructure.getDataRefAs(exemplarSharedTriPath); + auto& computedDataArray = dataStructure.getDataRefAs(computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedFacesListName)); + CompareDataArrays(exemplarDataArray, computedDataArray); CompareArrays(dataStructure, exemplarSharedVertexPath, computedTriangleGeomPath.createChildPath(TriangleGeom::k_SharedVertexListName)); DataPath exemplarFaceAttrMatPath = exemplarTriangleGeomPath.createChildPath(k_FaceDataGroupName); diff --git a/src/Plugins/SimplnxCore/test/TriangleCentroidTest.cpp b/src/Plugins/SimplnxCore/test/TriangleCentroidTest.cpp index 78f4640015..0677161e03 100644 --- a/src/Plugins/SimplnxCore/test/TriangleCentroidTest.cpp +++ b/src/Plugins/SimplnxCore/test/TriangleCentroidTest.cpp @@ -24,22 +24,22 @@ constexpr usize k_FaceTupleCount = 4; constexpr usize k_FaceCompCount = 3; constexpr StringLiteral k_CentroidsName = "Centroids"; -static const IGeometry::SharedVertexList* CreateVertexList(IGeometry& geom, const DataObject::IdType parentId) +static const AbstractGeometry::SharedVertexList* CreateVertexList(AbstractGeometry& geom, const AbstractDataObject::IdType parentId) { auto dataStructure = geom.getDataStructure(); auto dataStore = std::make_unique>(std::vector{k_VertexTupleCount}, std::vector{k_VertexCompCount}, 0.0f); - auto* dataArr = IGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), parentId); + auto* dataArr = AbstractGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), parentId); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } -static const IGeometry::SharedFaceList* CreateFaceList(IGeometry& geom, const DataObject::IdType parentId) +static const AbstractGeometry::SharedFaceList* CreateFaceList(AbstractGeometry& geom, const AbstractDataObject::IdType parentId) { auto dataStructure = geom.getDataStructure(); - auto dataStore = std::make_unique>(std::vector{k_FaceTupleCount}, std::vector{k_FaceCompCount}, 0); - auto* dataArr = IGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), parentId); + auto dataStore = std::make_unique>(std::vector{k_FaceTupleCount}, std::vector{k_FaceCompCount}, 0); + auto* dataArr = AbstractGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), parentId); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } } // namespace @@ -50,9 +50,9 @@ TEST_CASE("SimplnxCore::TriangleCentroidFilter", "[SimplnxCore][TriangleCentroid DataStructure dataStructure; TriangleGeom& acuteTriangle = *TriangleGeom::Create(dataStructure, k_TriangleGeometryName); - AttributeMatrix* faceData = AttributeMatrix::Create(dataStructure, INodeGeometry2D::k_FaceAttributeMatrixName, {k_FaceTupleCount}, acuteTriangle.getId()); + AttributeMatrix* faceData = AttributeMatrix::Create(dataStructure, AbstractNodeGeometry2D::k_FaceAttributeMatrixName, {k_FaceTupleCount}, acuteTriangle.getId()); acuteTriangle.setFaceAttributeMatrix(*faceData); - AttributeMatrix* vertData = AttributeMatrix::Create(dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, {k_VertexTupleCount}, acuteTriangle.getId()); + AttributeMatrix* vertData = AttributeMatrix::Create(dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, {k_VertexTupleCount}, acuteTriangle.getId()); acuteTriangle.setVertexAttributeMatrix(*vertData); auto vertexList = CreateVertexList(acuteTriangle, vertData->getId()); auto facesList = CreateFaceList(acuteTriangle, faceData->getId()); @@ -68,7 +68,7 @@ TEST_CASE("SimplnxCore::TriangleCentroidFilter", "[SimplnxCore][TriangleCentroid underlyingStoreV->setValue(count++, element); } // load face list - std::vector faces = {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10}; + std::vector faces = {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10}; count = 0; for(auto element : faces) { @@ -81,7 +81,7 @@ TEST_CASE("SimplnxCore::TriangleCentroidFilter", "[SimplnxCore][TriangleCentroid Arguments args; DataPath geometryPath = dataStructure.getDataPathsForId(acuteTriangle.getId())[0]; - DataPath triangleCentroidsDataPath = geometryPath.createChildPath(INodeGeometry2D::k_FaceAttributeMatrixName).createChildPath(k_CentroidsName); + DataPath triangleCentroidsDataPath = geometryPath.createChildPath(AbstractNodeGeometry2D::k_FaceAttributeMatrixName).createChildPath(k_CentroidsName); // Create default Parameters for the filter. args.insertOrAssign(TriangleCentroidFilter::k_TriGeometryDataPath_Key, std::make_any(geometryPath)); diff --git a/src/Plugins/SimplnxCore/test/TriangleDihedralAngleFilterTest.cpp b/src/Plugins/SimplnxCore/test/TriangleDihedralAngleFilterTest.cpp index e6ee24f83b..bfb3f5371f 100644 --- a/src/Plugins/SimplnxCore/test/TriangleDihedralAngleFilterTest.cpp +++ b/src/Plugins/SimplnxCore/test/TriangleDihedralAngleFilterTest.cpp @@ -23,22 +23,22 @@ constexpr usize k_VertexCompCount = 3; constexpr usize k_FaceTupleCount = 4; constexpr usize k_FaceCompCount = 3; -static const IGeometry::SharedVertexList* createVertexList(IGeometry& geom, const DataObject::IdType parentId) +static const AbstractGeometry::SharedVertexList* createVertexList(AbstractGeometry& geom, const AbstractDataObject::IdType parentId) { auto dataStructure = geom.getDataStructure(); auto dataStore = std::make_unique>(std::vector{k_VertexTupleCount}, std::vector{k_VertexCompCount}, 0.0f); - auto* dataArr = IGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), parentId); + auto* dataArr = AbstractGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), parentId); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } -static const IGeometry::SharedFaceList* createFaceList(IGeometry& geom, const DataObject::IdType parentId) +static const AbstractGeometry::SharedFaceList* createFaceList(AbstractGeometry& geom, const AbstractDataObject::IdType parentId) { auto dataStructure = geom.getDataStructure(); - auto dataStore = std::make_unique>(std::vector{k_FaceTupleCount}, std::vector{k_FaceCompCount}, 0); - auto* dataArr = IGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), parentId); + auto dataStore = std::make_unique>(std::vector{k_FaceTupleCount}, std::vector{k_FaceCompCount}, 0); + auto* dataArr = AbstractGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), parentId); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } } // namespace @@ -52,9 +52,9 @@ TEST_CASE("SimplnxCore::TriangleDihedralAngleFilter[valid results]", "[SimplnxCo std::string dihedralAnglesDataArrayName = "DihedralAngles"; DataStructure dataStructure; TriangleGeom& acuteTriangle = *TriangleGeom::Create(dataStructure, triangleGeometryName); - AttributeMatrix* faceData = AttributeMatrix::Create(dataStructure, INodeGeometry2D::k_FaceAttributeMatrixName, {k_FaceTupleCount}, acuteTriangle.getId()); + AttributeMatrix* faceData = AttributeMatrix::Create(dataStructure, AbstractNodeGeometry2D::k_FaceAttributeMatrixName, {k_FaceTupleCount}, acuteTriangle.getId()); acuteTriangle.setFaceAttributeMatrix(*faceData); - AttributeMatrix* vertData = AttributeMatrix::Create(dataStructure, INodeGeometry0D::k_VertexAttributeMatrixName, {k_VertexTupleCount}, acuteTriangle.getId()); + AttributeMatrix* vertData = AttributeMatrix::Create(dataStructure, AbstractNodeGeometry0D::k_VertexAttributeMatrixName, {k_VertexTupleCount}, acuteTriangle.getId()); acuteTriangle.setVertexAttributeMatrix(*vertData); auto vertexList = createVertexList(acuteTriangle, vertData->getId()); auto facesList = createFaceList(acuteTriangle, faceData->getId()); @@ -70,7 +70,7 @@ TEST_CASE("SimplnxCore::TriangleDihedralAngleFilter[valid results]", "[SimplnxCo underlyingStoreV->setValue(count++, element); } // load face list - std::vector faces = {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10}; + std::vector faces = {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10}; count = 0; for(auto element : faces) { @@ -84,7 +84,7 @@ TEST_CASE("SimplnxCore::TriangleDihedralAngleFilter[valid results]", "[SimplnxCo std::string triangleDihedralAnglesName = "Triangle Dihedral Angles"; DataPath geometryPath = dataStructure.getDataPathsForId(acuteTriangle.getId())[0]; - DataPath triangleDihedralAnglesDataPath = geometryPath.createChildPath(INodeGeometry2D::k_FaceAttributeMatrixName).createChildPath(triangleDihedralAnglesName); + DataPath triangleDihedralAnglesDataPath = geometryPath.createChildPath(AbstractNodeGeometry2D::k_FaceAttributeMatrixName).createChildPath(triangleDihedralAnglesName); // Create default Parameters for the filter. args.insertOrAssign(TriangleDihedralAngleFilter::k_TGeometryDataPath_Key, std::make_any(geometryPath)); diff --git a/src/Plugins/SimplnxCore/test/VerifyTriangleWindingTest.cpp b/src/Plugins/SimplnxCore/test/VerifyTriangleWindingTest.cpp index 01197f2aea..b6eab4c75a 100644 --- a/src/Plugins/SimplnxCore/test/VerifyTriangleWindingTest.cpp +++ b/src/Plugins/SimplnxCore/test/VerifyTriangleWindingTest.cpp @@ -52,7 +52,7 @@ TEST_CASE("SimplnxCore::VerifyTriangleWindingFilter: Valid Face Labels Execution { if(i % 4 == 0) { - IGeometry::MeshIndexType temp = triangles[(i * 3) + 0]; + AbstractGeometry::MeshIndexType temp = triangles[(i * 3) + 0]; triangles[(i * 3) + 0] = triangles[(i * 3) + 2]; triangles[(i * 3) + 2] = temp; } @@ -174,7 +174,7 @@ TEST_CASE("SimplnxCore::VerifyTriangleWindingFilter: Valid Region Ids Execution" { if(i % 4 == 0) { - IGeometry::MeshIndexType temp = triangles[(i * 3) + 0]; + AbstractGeometry::MeshIndexType temp = triangles[(i * 3) + 0]; triangles[(i * 3) + 0] = triangles[(i * 3) + 2]; triangles[(i * 3) + 2] = temp; } diff --git a/src/Plugins/SimplnxCore/test/WriteASCIIDataTest.cpp b/src/Plugins/SimplnxCore/test/WriteASCIIDataTest.cpp index 18b50e796a..bc4a479aa4 100644 --- a/src/Plugins/SimplnxCore/test/WriteASCIIDataTest.cpp +++ b/src/Plugins/SimplnxCore/test/WriteASCIIDataTest.cpp @@ -129,7 +129,7 @@ class RunASCIIDataTest return {}; } - void CompareResults(IDataArray& selectedArray) // compare hash of both file strings + void CompareResults(AbstractDataArray& selectedArray) // compare hash of both file strings { std::hash str_hash; @@ -195,12 +195,12 @@ class RunASCIIDataTest { for(int32 i = 0; i < daps1.size(); i++) { - CompareResults(m_DataStructure.getDataRefAs(daps1[i])); + CompareResults(m_DataStructure.getDataRefAs(daps1[i])); } } else if(fileType == k_SingleFile) { - CompareResults(m_DataStructure.getDataRefAs(daps1[0])); + CompareResults(m_DataStructure.getDataRefAs(daps1[0])); } } }; diff --git a/src/Plugins/SimplnxCore/test/WriteBinaryDataTest.cpp b/src/Plugins/SimplnxCore/test/WriteBinaryDataTest.cpp index c949168c39..6fdd370a6f 100644 --- a/src/Plugins/SimplnxCore/test/WriteBinaryDataTest.cpp +++ b/src/Plugins/SimplnxCore/test/WriteBinaryDataTest.cpp @@ -1,3 +1,18 @@ +// ============================================================================ +// IMPORTANT NOTE: The WIN32 includes MUST come first because there is a clash +// with the name 'IDataObject' inside one of the Win32 includes. Ordering the +// include directives this way eliminates the issues +// ============================================================================ + +#ifdef _WIN32 +#include +#include +#include +#include +#include +#include +#endif + #include "SimplnxCore/Filters/WriteBinaryDataFilter.hpp" #include "SimplnxCore/SimplnxCore_test_dirs.hpp" @@ -13,18 +28,8 @@ #include #include -#ifdef _WIN32 -#include -#include -#include -#include -#include -#include -#endif - namespace fs = std::filesystem; using namespace nx::core; - /** * @brief The WriteASCIIDataTest class */ @@ -198,7 +203,7 @@ class RunBinaryTest return {}; } - void CompareResults(IDataArray& selectedArray) // compare hash of both file strings + void CompareResults(AbstractDataArray& selectedArray) // compare hash of both file strings { fs::path writtenFilePath = fs::path(k_TestOutput.string() + "/" + selectedArray.getName() + ".bin"); REQUIRE(fs::exists(writtenFilePath)); @@ -246,7 +251,7 @@ class RunBinaryTest // read the file(s) back in for(int32 i = 0; i < daps1.size(); i++) { - CompareResults(m_DataStructure.getDataRefAs(daps1[i])); + CompareResults(m_DataStructure.getDataRefAs(daps1[i])); } } }; diff --git a/src/Plugins/SimplnxCore/test/WriteNodesAndElementsFilesTest.cpp b/src/Plugins/SimplnxCore/test/WriteNodesAndElementsFilesTest.cpp index 4abdabedf5..5ed9d7caff 100644 --- a/src/Plugins/SimplnxCore/test/WriteNodesAndElementsFilesTest.cpp +++ b/src/Plugins/SimplnxCore/test/WriteNodesAndElementsFilesTest.cpp @@ -54,7 +54,7 @@ void CreateEdgeGeometry(DataStructure& ds) std::vector verticesVec = {1.0f, 1.5f, 1.75f, 2.0f, 3.0f, 4.0f}; std::copy(verticesVec.begin(), verticesVec.end(), vertices->begin()); geom->setVertices(*vertices); - DataArray* cells = UnitTest::CreateTestDataArray(ds, "Cells Store", {1}, {2}, geom->getId()); + DataArray* cells = UnitTest::CreateTestDataArray(ds, "Cells Store", {1}, {2}, geom->getId()); cells->setValue(0, 0ULL); cells->setValue(1, 1ULL); geom->setEdgeList(*cells); diff --git a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp index 239252013b..7dcf9c93d8 100644 --- a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp +++ b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp @@ -16,9 +16,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -82,8 +83,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -225,7 +228,7 @@ auto BindDataStore(py::handle scope, const char* name) template auto BindDataArray(py::handle scope, const char* name) { - py::class_, IDataArray, std::shared_ptr>> dataArray(scope, name); + py::class_, AbstractDataArray, std::shared_ptr>> dataArray(scope, name); dataArray.def_property_readonly_static("dtype", []([[maybe_unused]] py::object self) { return py::dtype::of(); }); dataArray.def( "npview", @@ -252,7 +255,7 @@ auto BindNeighborList(py::handle scope, const char* name) { using NeighborListType = NeighborList; - auto neighborList = py::class_>(scope, name); + auto neighborList = py::class_>(scope, name); neighborList.def_property_readonly_static("dtype", []([[maybe_unused]] py::object self) { return py::dtype::of(); }); neighborList.def("get_list", &NeighborListType::getList, "grain_id"_a); neighborList.def("set_list", py::overload_cast(&NeighborListType::setList), "grain_id"_a, "neighbor_list"_a); @@ -279,7 +282,7 @@ auto BindNeighborList(py::handle scope, const char* name) template auto BindCreateGeometry2DAction(py::handle scope, const char* name) { - auto createGeometry2DAction = py::class_(scope, name); + auto createGeometry2DAction = py::class_(scope, name); createGeometry2DAction.def(py::init(), "geometry_path"_a, "num_faces"_a, "num_vertices"_a, "vertex_attribute_matrix_name"_a, "face_attribute_matrix_name"_a, "shared_vertices_name"_a, "shared_faces_name"_a); createGeometry2DAction.def(py::init(), "geometry_path"_a, @@ -290,7 +293,7 @@ auto BindCreateGeometry2DAction(py::handle scope, const char* name) template auto BindCreateGeometry3DAction(py::handle scope, const char* name) { - auto createGeometry3DAction = py::class_(scope, name); + auto createGeometry3DAction = py::class_(scope, name); createGeometry3DAction.def(py::init(), "geometry_path"_a, "num_cells"_a, "num_vertices"_a, "vertex_data_name"_a, "cell_data_name"_a, "shared_vertices_name"_a, "shared_cells_name"_a); createGeometry3DAction.def(py::init(), "geometry_path"_a, @@ -701,7 +704,8 @@ PYBIND11_MODULE(simplnx, mod) return DataPath(pathVector); }); - py::class_> abstractPipelineNode(mod, "AbstractPipelineNode"); + py::class_> iPipelineNode(mod, "IPipelineNode"); + py::class_> abstractPipelineNode(mod, "AbstractPipelineNode"); abstractPipelineNode.def("to_json_str", [](const AbstractPipelineNode& self) { return self.toJson().dump(); }); py::class_> pipelineFilter(mod, "PipelineFilter"); @@ -783,7 +787,8 @@ PYBIND11_MODULE(simplnx, mod) readCSVData.def_readwrite("consecutive_delimiters", &ReadCSVData::consecutiveDelimiters); readCSVData.def("__repr__", [](const ReadCSVData& self) { return "ReadCSVDataParameter()"; }); - py::class_> abstractPlugin(mod, "AbstractPlugin"); + py::class_> iPlugin(mod, "IPlugin"); + py::class_> abstractPlugin(mod, "AbstractPlugin"); py::class_> pythonPlugin(mod, "PythonPlugin"); py::class_> iDataStore(mod, "IDataStore"); @@ -816,11 +821,11 @@ PYBIND11_MODULE(simplnx, mod) auto dataStoreBool = SIMPLNX_PY_BIND_DATA_STORE(mod, BoolDataStore); py::class_ dataStructure(mod, "DataStructure"); - py::class_> dataObject(mod, "DataObject"); + py::class_> dataObject(mod, "AbstractDataObject"); - dataObject.def_property_readonly("id", &DataObject::getId); - dataObject.def_property_readonly("name", &DataObject::getName); - dataObject.def_property_readonly("type", &DataObject::getDataObjectType); + dataObject.def_property_readonly("id", &AbstractDataObject::getId); + dataObject.def_property_readonly("name", &AbstractDataObject::getName); + dataObject.def_property_readonly("type", &AbstractDataObject::getDataObjectType); dataStructure.def(py::init<>()); dataStructure.def("__getitem__", py::overload_cast(&DataStructure::getSharedData)); @@ -828,7 +833,7 @@ PYBIND11_MODULE(simplnx, mod) auto pathConversionResult = DataPath::FromString(path); if(!pathConversionResult) { - return std::shared_ptr(nullptr); + return std::shared_ptr(nullptr); } return self.getSharedData(pathConversionResult.value()); }); @@ -922,38 +927,38 @@ PYBIND11_MODULE(simplnx, mod) } }); - auto dataObjectType = py::enum_(dataObject, "DataObjectType"); - dataObjectType.value("DataObject", DataObject::Type::DataObject); - dataObjectType.value("DynamicListArray", DataObject::Type::DynamicListArray); - dataObjectType.value("ScalarData", DataObject::Type::ScalarData); - dataObjectType.value("BaseGroup", DataObject::Type::BaseGroup); - dataObjectType.value("AttributeMatrix", DataObject::Type::AttributeMatrix); - dataObjectType.value("DataGroup", DataObject::Type::DataGroup); - dataObjectType.value("IDataArray", DataObject::Type::IDataArray); - dataObjectType.value("DataArray", DataObject::Type::DataArray); - dataObjectType.value("IGeometry", DataObject::Type::IGeometry); - dataObjectType.value("IGridGeometry", DataObject::Type::IGridGeometry); - dataObjectType.value("RectGridGeom", DataObject::Type::RectGridGeom); - dataObjectType.value("ImageGeom", DataObject::Type::ImageGeom); - dataObjectType.value("INodeGeometry0D", DataObject::Type::INodeGeometry0D); - dataObjectType.value("VertexGeom", DataObject::Type::VertexGeom); - dataObjectType.value("INodeGeometry1D", DataObject::Type::INodeGeometry1D); - dataObjectType.value("EdgeGeom", DataObject::Type::EdgeGeom); - dataObjectType.value("INodeGeometry2D", DataObject::Type::INodeGeometry2D); - dataObjectType.value("QuadGeom", DataObject::Type::QuadGeom); - dataObjectType.value("TriangleGeom", DataObject::Type::TriangleGeom); - dataObjectType.value("INodeGeometry3D", DataObject::Type::INodeGeometry3D); - dataObjectType.value("HexahedralGeom", DataObject::Type::HexahedralGeom); - dataObjectType.value("TetrahedralGeom", DataObject::Type::TetrahedralGeom); - dataObjectType.value("INeighborList", DataObject::Type::INeighborList); - dataObjectType.value("NeighborList", DataObject::Type::NeighborList); - dataObjectType.value("StringArray", DataObject::Type::StringArray); - dataObjectType.value("AbstractMontage", DataObject::Type::AbstractMontage); - dataObjectType.value("GridMontage", DataObject::Type::GridMontage); - dataObjectType.value("Unknown", DataObject::Type::Unknown); - dataObjectType.value("Any", DataObject::Type::Any); - - py::class_> baseGroup(mod, "BaseGroup"); + auto dataObjectType = py::enum_(dataObject, "DataObjectType"); + dataObjectType.value("AbstractDataObject", IDataObject::Type::AbstractDataObject); + dataObjectType.value("DynamicListArray", IDataObject::Type::DynamicListArray); + dataObjectType.value("ScalarData", IDataObject::Type::ScalarData); + dataObjectType.value("BaseGroup", IDataObject::Type::BaseGroup); + dataObjectType.value("AttributeMatrix", IDataObject::Type::AttributeMatrix); + dataObjectType.value("DataGroup", IDataObject::Type::DataGroup); + dataObjectType.value("AbstractDataArray", IDataObject::Type::AbstractDataArray); + dataObjectType.value("DataArray", IDataObject::Type::DataArray); + dataObjectType.value("AbstractGeometry", IDataObject::Type::AbstractGeometry); + dataObjectType.value("AbstractGridGeometry", IDataObject::Type::AbstractGridGeometry); + dataObjectType.value("RectGridGeom", IDataObject::Type::RectGridGeom); + dataObjectType.value("ImageGeom", IDataObject::Type::ImageGeom); + dataObjectType.value("AbstractNodeGeometry0D", IDataObject::Type::AbstractNodeGeometry0D); + dataObjectType.value("VertexGeom", IDataObject::Type::VertexGeom); + dataObjectType.value("AbstractNodeGeometry1D", IDataObject::Type::AbstractNodeGeometry1D); + dataObjectType.value("EdgeGeom", IDataObject::Type::EdgeGeom); + dataObjectType.value("AbstractNodeGeometry2D", IDataObject::Type::AbstractNodeGeometry2D); + dataObjectType.value("QuadGeom", IDataObject::Type::QuadGeom); + dataObjectType.value("TriangleGeom", IDataObject::Type::TriangleGeom); + dataObjectType.value("AbstractNodeGeometry3D", IDataObject::Type::AbstractNodeGeometry3D); + dataObjectType.value("HexahedralGeom", IDataObject::Type::HexahedralGeom); + dataObjectType.value("TetrahedralGeom", IDataObject::Type::TetrahedralGeom); + dataObjectType.value("AbstractNeighborList", IDataObject::Type::AbstractNeighborList); + dataObjectType.value("NeighborList", IDataObject::Type::NeighborList); + dataObjectType.value("StringArray", IDataObject::Type::StringArray); + dataObjectType.value("AbstractMontage", IDataObject::Type::AbstractMontage); + dataObjectType.value("GridMontage", IDataObject::Type::GridMontage); + dataObjectType.value("Unknown", IDataObject::Type::Unknown); + dataObjectType.value("Any", IDataObject::Type::Any); + + py::class_> baseGroup(mod, "BaseGroup"); baseGroup.def("contains", py::overload_cast(&BaseGroup::contains, py::const_)); baseGroup.def("__getitem__", py::overload_cast(&BaseGroup::at), py::return_value_policy::reference_internal); baseGroup.def("__len__", &BaseGroup::getSize); @@ -964,25 +969,25 @@ PYBIND11_MODULE(simplnx, mod) baseGroupType.value("BaseGroup", BaseGroup::GroupType::BaseGroup); baseGroupType.value("DataGroup", BaseGroup::GroupType::DataGroup); baseGroupType.value("AttributeMatrix", BaseGroup::GroupType::AttributeMatrix); - baseGroupType.value("IGeometry", BaseGroup::GroupType::IGeometry); - baseGroupType.value("IGridGeometry", BaseGroup::GroupType::IGridGeometry); + baseGroupType.value("AbstractGeometry", BaseGroup::GroupType::AbstractGeometry); + baseGroupType.value("AbstractGridGeometry", BaseGroup::GroupType::AbstractGridGeometry); baseGroupType.value("RectGridGeom", BaseGroup::GroupType::RectGridGeom); baseGroupType.value("ImageGeom", BaseGroup::GroupType::ImageGeom); - baseGroupType.value("INodeGeometry0D", BaseGroup::GroupType::INodeGeometry0D); + baseGroupType.value("AbstractNodeGeometry0D", BaseGroup::GroupType::AbstractNodeGeometry0D); baseGroupType.value("VertexGeom", BaseGroup::GroupType::VertexGeom); - baseGroupType.value("INodeGeometry1D", BaseGroup::GroupType::INodeGeometry1D); + baseGroupType.value("AbstractNodeGeometry1D", BaseGroup::GroupType::AbstractNodeGeometry1D); baseGroupType.value("EdgeGeom", BaseGroup::GroupType::EdgeGeom); - baseGroupType.value("INodeGeometry2D", BaseGroup::GroupType::INodeGeometry2D); + baseGroupType.value("AbstractNodeGeometry2D", BaseGroup::GroupType::AbstractNodeGeometry2D); baseGroupType.value("QuadGeom", BaseGroup::GroupType::QuadGeom); baseGroupType.value("TriangleGeom", BaseGroup::GroupType::TriangleGeom); - baseGroupType.value("INodeGeometry3D", BaseGroup::GroupType::INodeGeometry3D); + baseGroupType.value("AbstractNodeGeometry3D", BaseGroup::GroupType::AbstractNodeGeometry3D); baseGroupType.value("HexahedralGeom", BaseGroup::GroupType::HexahedralGeom); baseGroupType.value("TetrahedralGeom", BaseGroup::GroupType::TetrahedralGeom); baseGroupType.value("Unknown", BaseGroup::GroupType::Unknown); - py::class_> iGeometry(mod, "IGeometry"); + py::class_> iGeometry(mod, "AbstractGeometry"); - py::enum_ geomType(iGeometry, "Type"); + py::enum_ geomType(iGeometry, "Type"); geomType.value("Image", IGeometry::Type::Image); geomType.value("RectGrid", IGeometry::Type::RectGrid); geomType.value("Vertex", IGeometry::Type::Vertex); @@ -992,59 +997,59 @@ PYBIND11_MODULE(simplnx, mod) geomType.value("Tetrahedral", IGeometry::Type::Tetrahedral); geomType.value("Hexahedral", IGeometry::Type::Hexahedral); - py::class_> iGridGeometry(mod, "IGridGeometry"); - iGridGeometry.def_property_readonly("dimensions", [](const IGridGeometry& self) { return self.getDimensions().toTuple(); }); - iGridGeometry.def_property_readonly("num_x_cells", &IGridGeometry::getNumXCells); - iGridGeometry.def_property_readonly("num_y_cells", &IGridGeometry::getNumYCells); - iGridGeometry.def_property_readonly("num_z_cells", &IGridGeometry::getNumZCells); + py::class_> iGridGeometry(mod, "AbstractGridGeometry"); + iGridGeometry.def_property_readonly("dimensions", [](const AbstractGridGeometry& self) { return self.getDimensions().toTuple(); }); + iGridGeometry.def_property_readonly("num_x_cells", &AbstractGridGeometry::getNumXCells); + iGridGeometry.def_property_readonly("num_y_cells", &AbstractGridGeometry::getNumYCells); + iGridGeometry.def_property_readonly("num_z_cells", &AbstractGridGeometry::getNumZCells); - py::class_> imageGeom(mod, "ImageGeom"); + py::class_> imageGeom(mod, "ImageGeom"); imageGeom.def_property_readonly("spacing", [](const ImageGeom& self) { return self.getSpacing().toTuple(); }); imageGeom.def_property_readonly("origin", [](const ImageGeom& self) { return self.getOrigin().toTuple(); }); - py::class_> rectGridGeom(mod, "RectGridGeom"); + py::class_> rectGridGeom(mod, "RectGridGeom"); - py::class_> iNodeGeometry0D(mod, "INodeGeometry0D"); + py::class_> iNodeGeometry0D(mod, "AbstractNodeGeometry0D"); iNodeGeometry0D.def( "resize_vertices", - [](INodeGeometry0D& nodeGeometry0D, usize size) { + [](AbstractNodeGeometry0D& nodeGeometry0D, usize size) { nodeGeometry0D.resizeVertexList(size); nodeGeometry0D.getVertexAttributeMatrix()->resizeTuples({size}); }, "This will resize the shared vertex list and also resize the associated attribute matrix"); - py::class_> vertexGeom(mod, "VertexGeom"); + py::class_> vertexGeom(mod, "VertexGeom"); - py::class_> iNodeGeometry1D(mod, "INodeGeometry1D"); + py::class_> iNodeGeometry1D(mod, "AbstractNodeGeometry1D"); iNodeGeometry1D.def( "resize_edges", - [](INodeGeometry1D& nodeGeometry1D, usize size) { + [](AbstractNodeGeometry1D& nodeGeometry1D, usize size) { nodeGeometry1D.resizeEdgeList(size); nodeGeometry1D.getEdgeAttributeMatrix()->resizeTuples({size}); }, "This will resize the shared edge list and also resize the associated attribute matrix"); - py::class_> edgeGeom(mod, "EdgeGeom"); + py::class_> edgeGeom(mod, "EdgeGeom"); - py::class_> iNodeGeometry2D(mod, "INodeGeometry2D"); + py::class_> iNodeGeometry2D(mod, "AbstractNodeGeometry2D"); iNodeGeometry2D.def( "resize_faces", - [](INodeGeometry2D& nodeGeometry2D, usize size) { + [](AbstractNodeGeometry2D& nodeGeometry2D, usize size) { nodeGeometry2D.resizeFaceList(size); nodeGeometry2D.getEdgeAttributeMatrix()->resizeTuples({size}); }, "This will resize the shared triangle list and also resize the associated attribute matrix"); - py::class_> triangleGeom(mod, "TriangleGeom"); - py::class_> quadGeom(mod, "QuadGeom"); + py::class_> triangleGeom(mod, "TriangleGeom"); + py::class_> quadGeom(mod, "QuadGeom"); - py::class_> iNodeGeometry3D(mod, "INodeGeometry3D"); + py::class_> iNodeGeometry3D(mod, "AbstractNodeGeometry3D"); iNodeGeometry3D.def( "resize_polyhedra", - [](INodeGeometry3D& nodeGeometry3D, usize size) { + [](AbstractNodeGeometry3D& nodeGeometry3D, usize size) { nodeGeometry3D.resizePolyhedraList(size); nodeGeometry3D.getPolyhedraAttributeMatrix()->resizeTuples({size}); }, "This will resize the shared polyhedra list and also resize the associated attribute matrix"); - py::class_> tetrahedralGeom(mod, "TetrahedralGeom"); - py::class_> hexahedralGeom(mod, "HexahedralGeom"); + py::class_> tetrahedralGeom(mod, "TetrahedralGeom"); + py::class_> hexahedralGeom(mod, "HexahedralGeom"); py::class_> dataGroup(mod, "DataGroup"); @@ -1053,24 +1058,24 @@ PYBIND11_MODULE(simplnx, mod) attributeMatrix.def_property_readonly("tuple_shape", &AttributeMatrix::getShape, "Returns the Tuple dimensions of the AttributeMatrix"); attributeMatrix.def_property_readonly("size", &AttributeMatrix::getNumberOfTuples, "Returns the total number of tuples"); - py::class_> iArray(mod, "IArray"); - iArray.def_property_readonly("tuple_shape", &IArray::getTupleShape); - iArray.def_property_readonly("component_shape", &IArray::getComponentShape); + py::class_> iArray(mod, "AbstractArray"); + iArray.def_property_readonly("tuple_shape", &AbstractArray::getTupleShape); + iArray.def_property_readonly("component_shape", &AbstractArray::getComponentShape); - py::enum_ iArrayArrayType(iArray, "ArrayType"); - iArrayArrayType.value("StringArray", IArray::ArrayType::StringArray); - iArrayArrayType.value("DataArray", IArray::ArrayType::DataArray); - iArrayArrayType.value("NeighborListArray", IArray::ArrayType::NeighborListArray); - iArrayArrayType.value("Any", IArray::ArrayType::Any); + py::enum_ iArrayArrayType(iArray, "ArrayType"); + iArrayArrayType.value("StringArray", AbstractArray::ArrayType::StringArray); + iArrayArrayType.value("DataArray", AbstractArray::ArrayType::DataArray); + iArrayArrayType.value("NeighborListArray", AbstractArray::ArrayType::NeighborListArray); + iArrayArrayType.value("Any", AbstractArray::ArrayType::Any); - py::class_> iDataArray(mod, "IDataArray"); - iDataArray.def_property_readonly("store", py::overload_cast<>(&IDataArray::getIDataStore)); - iDataArray.def_property_readonly("tdims", &IDataArray::getTupleShape); - iDataArray.def_property_readonly("cdims", &IDataArray::getComponentShape); - iDataArray.def_property_readonly("data_type", &IDataArray::getDataType); - iDataArray.def("resize_tuples", &IDataArray::resizeTuples, "Resize the tuples with the given shape"); + py::class_> iDataArray(mod, "AbstractDataArray"); + iDataArray.def_property_readonly("store", py::overload_cast<>(&AbstractDataArray::getIDataStore)); + iDataArray.def_property_readonly("tdims", &AbstractDataArray::getTupleShape); + iDataArray.def_property_readonly("cdims", &AbstractDataArray::getComponentShape); + iDataArray.def_property_readonly("data_type", &AbstractDataArray::getDataType); + iDataArray.def("resize_tuples", &AbstractDataArray::resizeTuples, "Resize the tuples with the given shape"); - py::class_> stringArray(mod, "StringArray"); + py::class_> stringArray(mod, "StringArray"); stringArray.def( "initialize_with_list", [](StringArray& strArr, const py::list& pyList) { @@ -1110,7 +1115,7 @@ PYBIND11_MODULE(simplnx, mod) stringArray.def_property_readonly("values", &StringArray::values); stringArray.def("resize_tuples", &StringArray::resizeTuples, "Resize the tuples with the given shape"); - auto iNeighborList = py::class_>(mod, "INeighborList"); + auto iNeighborList = py::class_>(mod, "AbstractNeighborList"); auto neighborListInt8 = SIMPLNX_PY_BIND_NEIGHBOR_LIST(mod, Int8NeighborList); auto neighborListUInt8 = SIMPLNX_PY_BIND_NEIGHBOR_LIST(mod, UInt8NeighborList); @@ -1139,17 +1144,17 @@ PYBIND11_MODULE(simplnx, mod) rectGridGeom.def_property_readonly("y_bounds", py::overload_cast<>(&RectGridGeom::getYBoundsRef), py::return_value_policy::reference_internal); rectGridGeom.def_property_readonly("z_bounds", py::overload_cast<>(&RectGridGeom::getZBoundsRef), py::return_value_policy::reference_internal); - iNodeGeometry0D.def_property_readonly("vertices", py::overload_cast<>(&INodeGeometry0D::getVerticesRef), py::return_value_policy::reference_internal); - iNodeGeometry0D.def_property_readonly("vertex_data", py::overload_cast<>(&INodeGeometry0D::getVertexAttributeMatrixRef), py::return_value_policy::reference_internal); + iNodeGeometry0D.def_property_readonly("vertices", py::overload_cast<>(&AbstractNodeGeometry0D::getVerticesRef), py::return_value_policy::reference_internal); + iNodeGeometry0D.def_property_readonly("vertex_data", py::overload_cast<>(&AbstractNodeGeometry0D::getVertexAttributeMatrixRef), py::return_value_policy::reference_internal); - iNodeGeometry1D.def_property_readonly("edges", py::overload_cast<>(&INodeGeometry1D::getEdgesRef), py::return_value_policy::reference_internal); - iNodeGeometry1D.def_property_readonly("edge_data", py::overload_cast<>(&INodeGeometry1D::getEdgeAttributeMatrixRef), py::return_value_policy::reference_internal); + iNodeGeometry1D.def_property_readonly("edges", py::overload_cast<>(&AbstractNodeGeometry1D::getEdgesRef), py::return_value_policy::reference_internal); + iNodeGeometry1D.def_property_readonly("edge_data", py::overload_cast<>(&AbstractNodeGeometry1D::getEdgeAttributeMatrixRef), py::return_value_policy::reference_internal); - iNodeGeometry2D.def_property_readonly("faces", py::overload_cast<>(&INodeGeometry2D::getFacesRef), py::return_value_policy::reference_internal); - iNodeGeometry2D.def_property_readonly("face_data", py::overload_cast<>(&INodeGeometry2D::getFaceAttributeMatrixRef), py::return_value_policy::reference_internal); + iNodeGeometry2D.def_property_readonly("faces", py::overload_cast<>(&AbstractNodeGeometry2D::getFacesRef), py::return_value_policy::reference_internal); + iNodeGeometry2D.def_property_readonly("face_data", py::overload_cast<>(&AbstractNodeGeometry2D::getFaceAttributeMatrixRef), py::return_value_policy::reference_internal); - iNodeGeometry3D.def_property_readonly("polyhedra", py::overload_cast<>(&INodeGeometry3D::getPolyhedraRef), py::return_value_policy::reference_internal); - iNodeGeometry3D.def_property_readonly("polyhedra_data", py::overload_cast<>(&INodeGeometry3D::getPolyhedraAttributeMatrixRef), py::return_value_policy::reference_internal); + iNodeGeometry3D.def_property_readonly("polyhedra", py::overload_cast<>(&AbstractNodeGeometry3D::getPolyhedraRef), py::return_value_policy::reference_internal); + iNodeGeometry3D.def_property_readonly("polyhedra_data", py::overload_cast<>(&AbstractNodeGeometry3D::getPolyhedraAttributeMatrixRef), py::return_value_policy::reference_internal); auto iDataAction = py::class_(mod, "IDataAction"); @@ -1159,7 +1164,7 @@ PYBIND11_MODULE(simplnx, mod) iDataAction.def("apply", &IDataAction::apply); - auto iDataCreationAction = py::class_(mod, "IDataCreationAction"); + auto iDataCreationAction = py::class_(mod, "AbstractDataCreationAction"); // auto iDataCreationActionArrayHandlingType = py::enum_(iDataCreationAction, "ArrayHandlingType"); // iDataCreationActionArrayHandlingType.value("Copy", ArrayHandlingType::Copy); @@ -1167,23 +1172,23 @@ PYBIND11_MODULE(simplnx, mod) // iDataCreationActionArrayHandlingType.value("Reference", ArrayHandlingType::Reference); // iDataCreationActionArrayHandlingType.value("Create", ArrayHandlingType::Create); - auto copyArrayInstanceAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CopyArrayInstanceAction, IDataCreationAction); + auto copyArrayInstanceAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CopyArrayInstanceAction, AbstractDataCreationAction); copyArrayInstanceAction.def(py::init(), "input_data_array_path"_a, "output_data_array_path"_a); - auto copyDataObjectAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CopyDataObjectAction, IDataCreationAction); + auto copyDataObjectAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CopyDataObjectAction, AbstractDataCreationAction); copyDataObjectAction.def(py::init>(), "path"_a, "new_path"_a, "all_created_paths"_a); - auto createArrayAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateArrayAction, IDataCreationAction); + auto createArrayAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateArrayAction, AbstractDataCreationAction); createArrayAction.def(py::init&, const std::vector&, const DataPath&, std::string>(), "type"_a, "t_dims"_a, "c_dims"_a, "path"_a, "data_format"_a = std::string("")); - auto createAttributeMatrixAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateAttributeMatrixAction, IDataCreationAction); + auto createAttributeMatrixAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateAttributeMatrixAction, AbstractDataCreationAction); createAttributeMatrixAction.def(py::init(), "path"_a, "shape"_a); - auto createDataGroupAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateDataGroupAction, IDataCreationAction); + auto createDataGroupAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateDataGroupAction, AbstractDataCreationAction); createDataGroupAction.def(py::init(), "path"_a); - auto createEdgeGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateEdgeGeometryAction, IDataCreationAction); + auto createEdgeGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateEdgeGeometryAction, AbstractDataCreationAction); createEdgeGeometryAction.def(py::init(), "geometry_path"_a, "num_edges"_a, "num_vertices"_a, "vertex_attribute_matrix_name"_a, "edge_attribute_matrix_name"_a, "shared_vertices_name"_a, "shared_edges_name"_a); createEdgeGeometryAction.def(py::init(), "geometry_path"_a, @@ -1195,26 +1200,26 @@ PYBIND11_MODULE(simplnx, mod) auto createTetrahedralGeometryAction = SIMPLNX_PY_BIND_CREATE_GEOMETRY_3D_ACTION(mod, CreateTetrahedralGeometryAction); auto createHexahedralGeometryAction = SIMPLNX_PY_BIND_CREATE_GEOMETRY_3D_ACTION(mod, CreateHexahedralGeometryAction); - auto createImageGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateImageGeometryAction, IDataCreationAction); + auto createImageGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateImageGeometryAction, AbstractDataCreationAction); createImageGeometryAction.def( py::init(), "path"_a, "dims"_a, "origin"_a, "spacing"_a, "cell_attribute_matrix_name"_a); - auto createNeighborListAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateNeighborListAction, IDataCreationAction); + auto createNeighborListAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateNeighborListAction, AbstractDataCreationAction); createNeighborListAction.def(py::init(), "type"_a, "tuple_count"_a, "path"_a); - auto createRectGridGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateRectGridGeometryAction, IDataCreationAction); + auto createRectGridGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateRectGridGeometryAction, AbstractDataCreationAction); createRectGridGeometryAction.def(py::init(), "path"_a, "x_bounds_dim"_a, "y_bounds_dim"_a, "z_bounds_dim"_a, "cell_attribute_matrix_name"_a, "x_bounds_name"_a, "y_bounds_name"_a, "z_bounds_name"_a); createRectGridGeometryAction.def(py::init(), "path"_a, "input_x_bounds_path"_a, "input_y_bounds_path"_a, "input_z_bounds_path"_a, "cell_attribute_matrix_name"_a, "array_type"_a); - auto createStringArrayAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateStringArrayAction, IDataCreationAction); + auto createStringArrayAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateStringArrayAction, AbstractDataCreationAction); createStringArrayAction.def(py::init(), "t_dims"_a, "path"_a, "initialize_value"_a = std::string("")); - auto createVertexGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateVertexGeometryAction, IDataCreationAction); - createVertexGeometryAction.def(py::init(), "geometry_path"_a, "num_vertices"_a, "vertex_attribute_matrix_name"_a, - "shared_vertex_list_name"_a); + auto createVertexGeometryAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, CreateVertexGeometryAction, AbstractDataCreationAction); + createVertexGeometryAction.def(py::init(), "geometry_path"_a, "num_vertices"_a, + "vertex_attribute_matrix_name"_a, "shared_vertex_list_name"_a); createVertexGeometryAction.def(py::init(), "geometry_path"_a, "input_vertices_array_path"_a, "vertex_attribute_matrix_name"_a, "array_type"_a); @@ -1225,7 +1230,7 @@ PYBIND11_MODULE(simplnx, mod) deleteDataAction.def(py::init(), "path"_a, "type"_a); - auto importH5ObjectPathsAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, ImportH5ObjectPathsAction, IDataCreationAction); + auto importH5ObjectPathsAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, ImportH5ObjectPathsAction, AbstractDataCreationAction); importH5ObjectPathsAction.def(py::init(), "import_file"_a, "paths"_a); auto moveDataAction = SIMPLNX_PY_BIND_CLASS_VARIADIC(mod, MoveDataAction, IDataAction); @@ -1583,6 +1588,8 @@ PYBIND11_MODULE(simplnx, mod) }, "data_structure"_a, "Executes the filter"); + py::class_ abstractFilter(mod, "AbstractFilter"); + py::class_> pipeline(mod, "Pipeline"); pipeline.def(py::init(), "name"_a = std::string("Untitled Pipeline")); pipeline.def_static( @@ -1662,7 +1669,7 @@ PYBIND11_MODULE(simplnx, mod) "Returns the human facing name of the filter"); pipelineFilter.def_property("comments", &PipelineFilter::getComments, &PipelineFilter::setComments); - py::class_ pyFilter(mod, "PyFilter"); + py::class_ pyFilter(mod, "PyFilter"); pyFilter.def(py::init<>([](py::object object) { return std::make_unique(std::move(object)); })); // Parameter value types conversions must be registered after the value types are bound @@ -1936,4 +1943,11 @@ PYBIND11_MODULE(simplnx, mod) "array_handling"_a = ArrayHandlingType::Copy); mod.def("append_to_dream3d_file", &DREAM3D::AppendFile, "path"_a, "data_structure"_a, "data_path"_a); + + // Backwards-compatible aliases for classes renamed in Phases 6-15 + mod.attr("DataObject") = mod.attr("AbstractDataObject"); + mod.attr("IArray") = mod.attr("AbstractArray"); + mod.attr("IDataArray") = mod.attr("AbstractDataArray"); + mod.attr("INeighborList") = mod.attr("AbstractNeighborList"); + mod.attr("IDataCreationAction") = mod.attr("AbstractDataCreationAction"); } diff --git a/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp index 0e0985e3d4..a4c1d2f41e 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core { -class TESTONE_EXPORT CreateOutOfCoreArray : public IFilter +class TESTONE_EXPORT CreateOutOfCoreArray : public AbstractFilter { public: CreateOutOfCoreArray() = default; diff --git a/src/Plugins/TestOne/src/TestOne/Filters/DynamicTableExampleFilter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/DynamicTableExampleFilter.hpp index a470206752..cdac6912e9 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/DynamicTableExampleFilter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/DynamicTableExampleFilter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core { -class TESTONE_EXPORT DynamicTableExampleFilter : public IFilter +class TESTONE_EXPORT DynamicTableExampleFilter : public AbstractFilter { public: DynamicTableExampleFilter() = default; diff --git a/src/Plugins/TestOne/src/TestOne/Filters/ErrorWarningFilter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/ErrorWarningFilter.hpp index 0553cdaf67..8a2210a537 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/ErrorWarningFilter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/ErrorWarningFilter.hpp @@ -1,8 +1,8 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterHandle.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core @@ -10,7 +10,7 @@ namespace nx::core /** * @brief The ErrorWarningFilter class. See [Filter documentation](@ref ErrorWarningFilter) for details. */ -class TESTONE_EXPORT ErrorWarningFilter : public nx::core::IFilter +class TESTONE_EXPORT ErrorWarningFilter : public nx::core::AbstractFilter { public: ErrorWarningFilter() = default; diff --git a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1Filter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1Filter.hpp index 656c82f344..c242de1724 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1Filter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1Filter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core { -class TESTONE_EXPORT ExampleFilter1Filter : public IFilter +class TESTONE_EXPORT ExampleFilter1Filter : public AbstractFilter { public: ExampleFilter1Filter() = default; diff --git a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.cpp b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.cpp index 939cc8a117..b650470e43 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.cpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.cpp @@ -102,7 +102,7 @@ Parameters ExampleFilter2Filter::parameters() const params.insert( std::make_unique(k_Param11, "Geometry Selection Parameter", "Example geometry selection help text", DataPath{}, GeometrySelectionParameter::AllowedTypes{})); params.insert(std::make_unique(k_Param12, "MultiArray Selection Parameter", "Example multiarray selection help text", MultiArraySelectionParameter::ValueType{}, - MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::Any}, nx::core::GetAllDataTypes())); + MultiArraySelectionParameter::AllowedTypes{AbstractArray::ArrayType::Any}, nx::core::GetAllDataTypes())); params.insert(std::make_unique(k_Param30, "Attribute Matrix Selection", "Example Help Text", DataPath{})); params.linkParameters(k_Param7, k_Param9, std::make_any(true)); diff --git a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.hpp index 6ef77e6b00..407e375cb4 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core { -class TESTONE_EXPORT ExampleFilter2Filter : public IFilter +class TESTONE_EXPORT ExampleFilter2Filter : public AbstractFilter { public: ExampleFilter2Filter() = default; diff --git a/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.hpp index 72a1c4a76c..e8b9a220a4 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.hpp @@ -1,13 +1,13 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterHandle.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestOne/TestOne_export.hpp" namespace nx::core { -class TESTONE_EXPORT TestFilter : public nx::core::IFilter +class TESTONE_EXPORT TestFilter : public nx::core::AbstractFilter { public: TestFilter(); diff --git a/src/Plugins/TestTwo/src/TestTwo/Filters/Test2Filter.hpp b/src/Plugins/TestTwo/src/TestTwo/Filters/Test2Filter.hpp index 077804ea87..70f3990c7f 100644 --- a/src/Plugins/TestTwo/src/TestTwo/Filters/Test2Filter.hpp +++ b/src/Plugins/TestTwo/src/TestTwo/Filters/Test2Filter.hpp @@ -1,12 +1,12 @@ #pragma once +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Filter/FilterTraits.hpp" -#include "simplnx/Filter/IFilter.hpp" #include "TestTwo/TestTwo_export.hpp" namespace nx::core { -class TESTTWO_EXPORT Test2Filter : public nx::core::IFilter +class TESTTWO_EXPORT Test2Filter : public nx::core::AbstractFilter { public: Test2Filter(); diff --git a/src/simplnx/Common/Types.hpp b/src/simplnx/Common/Types.hpp index 2300a89106..48512f1305 100644 --- a/src/simplnx/Common/Types.hpp +++ b/src/simplnx/Common/Types.hpp @@ -10,17 +10,17 @@ namespace types template struct ArrayTypeOptions { - static inline constexpr bool UsingBoolean = UseBoolean; - static inline constexpr bool UsingInt8 = UseInt8V; - static inline constexpr bool UsingUInt8 = UseUInt8V; - static inline constexpr bool UsingInt16 = UseInt16V; - static inline constexpr bool UsingUInt16 = UseUInt16V; - static inline constexpr bool UsingInt32 = UseInt32V; - static inline constexpr bool UsingUInt32 = UseUInt32V; - static inline constexpr bool UsingInt64 = UseInt64V; - static inline constexpr bool UsingUInt64 = UseUInt64V; - static inline constexpr bool UsingFloat32 = UseFloat32V; - static inline constexpr bool UsingFloat64 = UseFloat64V; + static constexpr bool UsingBoolean = UseBoolean; + static constexpr bool UsingInt8 = UseInt8V; + static constexpr bool UsingUInt8 = UseUInt8V; + static constexpr bool UsingInt16 = UseInt16V; + static constexpr bool UsingUInt16 = UseUInt16V; + static constexpr bool UsingInt32 = UseInt32V; + static constexpr bool UsingUInt32 = UseUInt32V; + static constexpr bool UsingInt64 = UseInt64V; + static constexpr bool UsingUInt64 = UseUInt64V; + static constexpr bool UsingFloat32 = UseFloat32V; + static constexpr bool UsingFloat64 = UseFloat64V; }; using ArrayUseAllTypes = ArrayTypeOptions; diff --git a/src/simplnx/Common/Uuid.hpp b/src/simplnx/Common/Uuid.hpp index 2cda96aac9..e77f085d28 100644 --- a/src/simplnx/Common/Uuid.hpp +++ b/src/simplnx/Common/Uuid.hpp @@ -80,7 +80,7 @@ inline constexpr usize String2Bytes(std::string_view string, usize offset, usize */ struct SIMPLNX_EXPORT Uuid { - static inline constexpr usize k_Size = 16; + static constexpr usize k_Size = 16; /** * @brief Parses a uuid string into a Uuid. @@ -88,7 +88,7 @@ struct SIMPLNX_EXPORT Uuid * Must have both braces or none. Must have all dashes or none. * @return Parsed uuid if successful. Otherwise, empty optional. */ - static inline constexpr std::optional FromString(std::string_view string) + static constexpr std::optional FromString(std::string_view string) { if(string.empty()) { diff --git a/src/simplnx/Core/Application.cpp b/src/simplnx/Core/Application.cpp index ebd49eab85..6ccd083fdd 100644 --- a/src/simplnx/Core/Application.cpp +++ b/src/simplnx/Core/Application.cpp @@ -24,8 +24,8 @@ #include #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp" #include "simplnx/DataStructure/IO/Generic/DataIOCollection.hpp" -#include "simplnx/DataStructure/IO/Generic/IDataIOManager.hpp" #include "simplnx/Filter/FilterList.hpp" #include "simplnx/Plugin/AbstractPlugin.hpp" #include "simplnx/Plugin/PluginLoader.hpp" @@ -125,21 +125,21 @@ Result<> Application::initialize() void Application::initDefaultDataTypes() { - addDataType(DataObject::Type::DynamicListArray, "DynamicListArray"); - addDataType(DataObject::Type::ScalarData, "ScalarData"); - addDataType(DataObject::Type::DataGroup, "DataGroup"); - addDataType(DataObject::Type::AttributeMatrix, "AttributeMatrix"); - addDataType(DataObject::Type::DataArray, "Data Array"); - addDataType(DataObject::Type::RectGridGeom, "Rect Grid Geom"); - addDataType(DataObject::Type::ImageGeom, "Image Geom"); - addDataType(DataObject::Type::VertexGeom, "Vertex Geom"); - addDataType(DataObject::Type::EdgeGeom, "Edge Geom"); - addDataType(DataObject::Type::QuadGeom, "Quad Geom"); - addDataType(DataObject::Type::TriangleGeom, "Triangle Geom"); - addDataType(DataObject::Type::HexahedralGeom, "Hexahedral Geom"); - addDataType(DataObject::Type::TetrahedralGeom, "Tetrahedral Geom"); - addDataType(DataObject::Type::NeighborList, "NeighborList"); - addDataType(DataObject::Type::StringArray, "String Array"); + addDataType(IDataObject::Type::DynamicListArray, "DynamicListArray"); + addDataType(IDataObject::Type::ScalarData, "ScalarData"); + addDataType(IDataObject::Type::DataGroup, "DataGroup"); + addDataType(IDataObject::Type::AttributeMatrix, "AttributeMatrix"); + addDataType(IDataObject::Type::DataArray, "Data Array"); + addDataType(IDataObject::Type::RectGridGeom, "Rect Grid Geom"); + addDataType(IDataObject::Type::ImageGeom, "Image Geom"); + addDataType(IDataObject::Type::VertexGeom, "Vertex Geom"); + addDataType(IDataObject::Type::EdgeGeom, "Edge Geom"); + addDataType(IDataObject::Type::QuadGeom, "Quad Geom"); + addDataType(IDataObject::Type::TriangleGeom, "Triangle Geom"); + addDataType(IDataObject::Type::HexahedralGeom, "Hexahedral Geom"); + addDataType(IDataObject::Type::TetrahedralGeom, "Tetrahedral Geom"); + addDataType(IDataObject::Type::NeighborList, "NeighborList"); + addDataType(IDataObject::Type::StringArray, "String Array"); } Application::~Application() @@ -343,7 +343,7 @@ std::shared_ptr Application::getIOCollection() const return m_DataIOCollection; } -std::shared_ptr Application::getIOManager(const std::string& formatName) const +std::shared_ptr Application::getIOManager(const std::string& formatName) const { return m_DataIOCollection->getManager(formatName); } @@ -396,16 +396,16 @@ Result<> Application::loadPlugin(const std::filesystem::path& path, bool verbose return {}; } -void Application::addDataType(DataObject::Type type, const std::string& name) +void Application::addDataType(AbstractDataObject::Type type, const std::string& name) { m_NamedTypesMap[name] = type; } -DataObject::Type Application::getDataType(const std::string& name) const +AbstractDataObject::Type Application::getDataType(const std::string& name) const { if(m_NamedTypesMap.find(name) == m_NamedTypesMap.end()) { - return DataObject::Type::DataObject; + return IDataObject::Type::AbstractDataObject; } return m_NamedTypesMap.at(name); } diff --git a/src/simplnx/Core/Application.hpp b/src/simplnx/Core/Application.hpp index c5d5b98d64..10a94b2f75 100644 --- a/src/simplnx/Core/Application.hpp +++ b/src/simplnx/Core/Application.hpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Result.hpp" #include "simplnx/Core/Preferences.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/Filter/FilterList.hpp" #include "simplnx/Plugin/AbstractPlugin.hpp" #include "simplnx/simplnx_export.hpp" @@ -15,7 +15,7 @@ namespace nx::core { class DataIOCollection; -class IDataIOManager; +class AbstractDataIOManager; class JsonPipelineBuilder; /** @@ -32,7 +32,7 @@ class JsonPipelineBuilder; class SIMPLNX_EXPORT Application { public: - using name_type_map = std::map; + using name_type_map = std::map; /** * @brief Destroys the Application. If the destroyed Application matches the @@ -114,7 +114,7 @@ class SIMPLNX_EXPORT Application std::shared_ptr getIOCollection() const; - std::shared_ptr getIOManager(const std::string& formatName) const; + std::shared_ptr getIOManager(const std::string& formatName) const; template std::shared_ptr getIOManagerAs(const std::string& formatName) const @@ -146,9 +146,9 @@ class SIMPLNX_EXPORT Application */ std::vector getSimplUuid(const Uuid& simplnxUuid); - void addDataType(DataObject::Type type, const std::string& name); + void addDataType(AbstractDataObject::Type type, const std::string& name); - DataObject::Type getDataType(const std::string& name) const; + AbstractDataObject::Type getDataType(const std::string& name) const; std::vector getDataStoreFormats() const; diff --git a/src/simplnx/Core/Preferences.hpp b/src/simplnx/Core/Preferences.hpp index 53f22d03ec..0796f09f55 100644 --- a/src/simplnx/Core/Preferences.hpp +++ b/src/simplnx/Core/Preferences.hpp @@ -19,11 +19,11 @@ class SIMPLNX_EXPORT Preferences friend class AbstractPlugin; public: - static inline constexpr StringLiteral k_LargeDataSize_Key = "large_data_size"; // bytes - static inline constexpr StringLiteral k_PreferredLargeDataFormat_Key = "large_data_format"; // string - static inline constexpr StringLiteral k_LargeDataStructureSize_Key = "large_datastructure_size"; // bytes - static inline constexpr StringLiteral k_ForceOocData_Key = "force_ooc_data"; // boolean - static inline constexpr nx::core::StringLiteral k_OoCTempDirectory_ID = "ooc_temp_directory"; // Out-of-Core temp directory + static constexpr StringLiteral k_LargeDataSize_Key = "large_data_size"; // bytes + static constexpr StringLiteral k_PreferredLargeDataFormat_Key = "large_data_format"; // string + static constexpr StringLiteral k_LargeDataStructureSize_Key = "large_datastructure_size"; // bytes + static constexpr StringLiteral k_ForceOocData_Key = "force_ooc_data"; // boolean + static constexpr nx::core::StringLiteral k_OoCTempDirectory_ID = "ooc_temp_directory"; // Out-of-Core temp directory static std::filesystem::path DefaultFilePath(const std::string& applicationName); diff --git a/src/simplnx/DataStructure/IArray.hpp b/src/simplnx/DataStructure/AbstractArray.hpp similarity index 84% rename from src/simplnx/DataStructure/IArray.hpp rename to src/simplnx/DataStructure/AbstractArray.hpp index 44a73f8a10..c34fa39c80 100644 --- a/src/simplnx/DataStructure/IArray.hpp +++ b/src/simplnx/DataStructure/AbstractArray.hpp @@ -1,14 +1,14 @@ #pragma once #include "simplnx/Common/Aliases.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" namespace nx::core { -class SIMPLNX_EXPORT IArray : public DataObject +class SIMPLNX_EXPORT AbstractArray : public AbstractDataObject { public: - static inline constexpr StringLiteral k_TypeName = "IArray"; + static constexpr StringLiteral k_TypeName = "IArray"; enum class ArrayType : EnumType { @@ -18,14 +18,14 @@ class SIMPLNX_EXPORT IArray : public DataObject Any }; - ~IArray() override = default; + ~AbstractArray() override = default; - IArray() = delete; - IArray(const IArray&) = default; - IArray(IArray&&) = default; + AbstractArray() = delete; + AbstractArray(const AbstractArray&) = default; + AbstractArray(AbstractArray&&) = default; - IArray& operator=(const IArray&) = delete; - IArray& operator=(IArray&&) noexcept = delete; + AbstractArray& operator=(const AbstractArray&) = delete; + AbstractArray& operator=(AbstractArray&&) noexcept = delete; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction @@ -137,13 +137,13 @@ class SIMPLNX_EXPORT IArray : public DataObject } protected: - IArray(DataStructure& dataStructure, std::string name) - : DataObject(dataStructure, std::move(name)) + AbstractArray(DataStructure& dataStructure, std::string name) + : AbstractDataObject(dataStructure, std::move(name)) { } - IArray(DataStructure& dataStructure, std::string name, IdType importId) - : DataObject(dataStructure, std::move(name), importId) + AbstractArray(DataStructure& dataStructure, std::string name, IdType importId) + : AbstractDataObject(dataStructure, std::move(name), importId) { } }; diff --git a/src/simplnx/DataStructure/IDataArray.hpp b/src/simplnx/DataStructure/AbstractDataArray.hpp similarity index 82% rename from src/simplnx/DataStructure/IDataArray.hpp rename to src/simplnx/DataStructure/AbstractDataArray.hpp index 377e6e5fca..142cf9aa17 100644 --- a/src/simplnx/DataStructure/IDataArray.hpp +++ b/src/simplnx/DataStructure/AbstractDataArray.hpp @@ -1,20 +1,20 @@ #pragma once -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/DataStructure/IDataStore.hpp" namespace nx::core { /** - * @class IDataArray - * @brief The IDataArray class is a typeless interface for the templated DataArray class. + * @class AbstractDataArray + * @brief The AbstractDataArray class is a typeless interface for the templated DataArray class. */ -class SIMPLNX_EXPORT IDataArray : public IArray +class SIMPLNX_EXPORT AbstractDataArray : public AbstractArray { public: - static inline constexpr StringLiteral k_TypeName = "IDataArray"; + static constexpr StringLiteral k_TypeName = "IDataArray"; - ~IDataArray() override = default; + ~AbstractDataArray() override = default; /** * @brief Returns the tuple shape. @@ -62,7 +62,7 @@ class SIMPLNX_EXPORT IDataArray : public IArray IDataStore* store = getIDataStore(); if(store == nullptr) { - throw std::runtime_error("IDataArray: Null IDataStore"); + throw std::runtime_error("AbstractDataArray: Null IDataStore"); } return *store; } @@ -76,7 +76,7 @@ class SIMPLNX_EXPORT IDataArray : public IArray const IDataStore* store = getIDataStore(); if(store == nullptr) { - throw std::runtime_error("IDataArray: Null IDataStore"); + throw std::runtime_error("AbstractDataArray: Null IDataStore"); } return *store; } @@ -159,12 +159,12 @@ class SIMPLNX_EXPORT IDataArray : public IArray virtual std::string getDataFormat() const = 0; protected: - IDataArray(DataStructure& dataStructure, std::string name) - : IArray(dataStructure, std::move(name)) + AbstractDataArray(DataStructure& dataStructure, std::string name) + : AbstractArray(dataStructure, std::move(name)) { } - IDataArray(DataStructure& dataStructure, std::string name, IdType importId) - : IArray(dataStructure, std::move(name), importId) + AbstractDataArray(DataStructure& dataStructure, std::string name, IdType importId) + : AbstractArray(dataStructure, std::move(name), importId) { } }; diff --git a/src/simplnx/DataStructure/DataObject.cpp b/src/simplnx/DataStructure/AbstractDataObject.cpp similarity index 66% rename from src/simplnx/DataStructure/DataObject.cpp rename to src/simplnx/DataStructure/AbstractDataObject.cpp index d52f530536..f584bd8d3b 100644 --- a/src/simplnx/DataStructure/DataObject.cpp +++ b/src/simplnx/DataStructure/AbstractDataObject.cpp @@ -1,4 +1,4 @@ -#include "DataObject.hpp" +#include "AbstractDataObject.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataStructure.hpp" @@ -11,28 +11,28 @@ using namespace nx::core; namespace nx::core { -bool DataObject::IsValidName(std::string_view name) +bool AbstractDataObject::IsValidName(std::string_view name) { return !name.empty() && name.find('/') == std::string_view::npos; } -DataObject::DataObject(DataStructure& dataStructure, std::string name) -: DataObject(dataStructure, std::move(name), dataStructure.generateId()) +AbstractDataObject::AbstractDataObject(DataStructure& dataStructure, std::string name) +: AbstractDataObject(dataStructure, std::move(name), dataStructure.generateId()) { } -DataObject::DataObject(DataStructure& dataStructure, std::string name, IdType importId) +AbstractDataObject::AbstractDataObject(DataStructure& dataStructure, std::string name, IdType importId) : m_DataStructure(&dataStructure) , m_Id(importId) , m_Name(std::move(name)) { if(!IsValidName(m_Name)) { - throw std::invalid_argument("DataObject names cannot contain \"/\""); + throw std::invalid_argument("AbstractDataObject names cannot contain \"/\""); } } -DataObject::DataObject(const DataObject& rhs) +AbstractDataObject::AbstractDataObject(const AbstractDataObject& rhs) : m_DataStructure(rhs.m_DataStructure) , m_ParentList(rhs.m_ParentList) , m_Id(rhs.m_Id) @@ -41,7 +41,7 @@ DataObject::DataObject(const DataObject& rhs) { } -DataObject::DataObject(DataObject&& rhs) +AbstractDataObject::AbstractDataObject(AbstractDataObject&& rhs) : m_DataStructure(rhs.m_DataStructure) , m_ParentList(std::move(rhs.m_ParentList)) , m_Id(rhs.m_Id) @@ -50,7 +50,7 @@ DataObject::DataObject(DataObject&& rhs) { } -DataObject& DataObject::operator=(const DataObject& rhs) +AbstractDataObject& AbstractDataObject::operator=(const AbstractDataObject& rhs) { if(this == &rhs) { @@ -64,7 +64,7 @@ DataObject& DataObject::operator=(const DataObject& rhs) return *this; } -DataObject& DataObject::operator=(DataObject&& rhs) noexcept +AbstractDataObject& AbstractDataObject::operator=(AbstractDataObject&& rhs) noexcept { m_DataStructure = rhs.m_DataStructure; m_ParentList = std::move(rhs.m_ParentList); @@ -74,7 +74,7 @@ DataObject& DataObject::operator=(DataObject&& rhs) noexcept return *this; } -DataObject::~DataObject() noexcept +AbstractDataObject::~AbstractDataObject() noexcept { if(m_DataStructure == nullptr) { @@ -86,22 +86,22 @@ DataObject::~DataObject() noexcept } } -DataObject::Type DataObject::getDataObjectType() const +AbstractDataObject::Type AbstractDataObject::getDataObjectType() const { - return Type::DataObject; + return Type::AbstractDataObject; } -bool DataObject::isGroup() const +bool AbstractDataObject::isGroup() const { return false; } -void DataObject::setId(IdType newId) +void AbstractDataObject::setId(IdType newId) { m_Id = newId; } -void DataObject::checkUpdatedIds(const std::unordered_map& updatedIdsMap) +void AbstractDataObject::checkUpdatedIds(const std::unordered_map& updatedIdsMap) { // Use std::transform to map IDs ParentCollectionType newParentList; @@ -116,61 +116,61 @@ void DataObject::checkUpdatedIds(const std::unordered_map& updatedIdsMap) +void AbstractDataObject::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) { } -bool DataObject::AttemptToAddObject(DataStructure& dataStructure, const std::shared_ptr& data, const OptionalId& parentId) +bool AbstractDataObject::AttemptToAddObject(DataStructure& dataStructure, const std::shared_ptr& data, const OptionalId& parentId) { return dataStructure.finishAddingObject(data, parentId); } -DataObject::IdType DataObject::getId() const +AbstractDataObject::IdType AbstractDataObject::getId() const { return m_Id; } -DataStructure* DataObject::getDataStructure() +DataStructure* AbstractDataObject::getDataStructure() { return m_DataStructure; } -const DataStructure* DataObject::getDataStructure() const +const DataStructure* AbstractDataObject::getDataStructure() const { return m_DataStructure; } -DataStructure& DataObject::getDataStructureRef() +DataStructure& AbstractDataObject::getDataStructureRef() { if(m_DataStructure == nullptr) { - throw std::runtime_error("DataObject's DataStructure is null"); + throw std::runtime_error("AbstractDataObject's DataStructure is null"); } return *m_DataStructure; } -const DataStructure& DataObject::getDataStructureRef() const +const DataStructure& AbstractDataObject::getDataStructureRef() const { if(m_DataStructure == nullptr) { - throw std::runtime_error("DataObject's DataStructure is null"); + throw std::runtime_error("AbstractDataObject's DataStructure is null"); } return *m_DataStructure; } -void DataObject::setDataStructure(DataStructure* dataStructure) +void AbstractDataObject::setDataStructure(DataStructure* dataStructure) { m_DataStructure = dataStructure; } -std::string DataObject::getName() const +std::string AbstractDataObject::getName() const { return m_Name; } -bool DataObject::canRename(const std::string& name) const +bool AbstractDataObject::canRename(const std::string& name) const { if(name == getName()) @@ -193,13 +193,13 @@ bool DataObject::canRename(const std::string& name) const const auto* baseGroupPtr = dataStructPtr->getDataAs(parentId); if(baseGroupPtr == nullptr) { - std::cout << "DataObject::canRename(name=" << name << ") cannot get baseGroup from parentId = " << parentId << std::endl; + std::cout << "AbstractDataObject::canRename(name=" << name << ") cannot get baseGroup from parentId = " << parentId << std::endl; } return baseGroupPtr != nullptr && baseGroupPtr->contains(name); }); } -bool DataObject::rename(const std::string& name) +bool AbstractDataObject::rename(const std::string& name) { if(!canRename(name)) { @@ -210,27 +210,27 @@ bool DataObject::rename(const std::string& name) return true; } -DataObject::ParentCollectionType DataObject::getParentIds() const +AbstractDataObject::ParentCollectionType AbstractDataObject::getParentIds() const { return m_ParentList; } -void DataObject::clearParents() +void AbstractDataObject::clearParents() { m_ParentList.clear(); } -Metadata& DataObject::getMetadata() +Metadata& AbstractDataObject::getMetadata() { return m_Metadata; } -const Metadata& DataObject::getMetadata() const +const Metadata& AbstractDataObject::getMetadata() const { return m_Metadata; } -bool DataObject::hasParent(const DataPath& parentPath) const +bool AbstractDataObject::hasParent(const DataPath& parentPath) const { const auto dataPaths = getDataPaths(); const auto originalCellDataPathIt = std::find_if(dataPaths.begin(), dataPaths.end(), [parentPath](const DataPath& path) { @@ -248,32 +248,32 @@ bool DataObject::hasParent(const DataPath& parentPath) const return originalCellDataPathIt != dataPaths.end(); } -std::set DataObject::StringListFromDataObjectType(const std::set& dataObjectTypes) +std::set AbstractDataObject::StringListFromDataObjectType(const std::set& dataObjectTypes) { - static const std::map k_TypeToStringMap = {{Type::DataObject, "DataObject"}, + static const std::map k_TypeToStringMap = {{Type::AbstractDataObject, "AbstractDataObject"}, {Type::DynamicListArray, "DynamicListArray"}, {Type::ScalarData, "ScalarData"}, {Type::BaseGroup, "BaseGroup"}, {Type::AbstractMontage, "AbstractMontage"}, {Type::DataGroup, "DataGroup"}, {Type::AttributeMatrix, "AttributeMatrix"}, - {Type::IDataArray, "IDataArray"}, + {Type::AbstractDataArray, "AbstractDataArray"}, {Type::DataArray, "DataArray"}, - {Type::IGeometry, "IGeometry"}, - {Type::IGridGeometry, "IGridGeometry"}, + {Type::AbstractGeometry, "AbstractGeometry"}, + {Type::AbstractGridGeometry, "AbstractGridGeometry"}, {Type::RectGridGeom, "RectGridGeom"}, {Type::ImageGeom, "ImageGeom"}, - {Type::INodeGeometry0D, "INodeGeometry0D"}, + {Type::AbstractNodeGeometry0D, "AbstractNodeGeometry0D"}, {Type::VertexGeom, "VertexGeom"}, - {Type::INodeGeometry1D, "INodeGeometry1D"}, + {Type::AbstractNodeGeometry1D, "AbstractNodeGeometry1D"}, {Type::EdgeGeom, "EdgeGeom"}, - {Type::INodeGeometry2D, "INodeGeometry2D"}, + {Type::AbstractNodeGeometry2D, "AbstractNodeGeometry2D"}, {Type::QuadGeom, "QuadGeom"}, {Type::TriangleGeom, "TriangleGeom"}, - {Type::INodeGeometry3D, "INodeGeometry3D"}, + {Type::AbstractNodeGeometry3D, "AbstractNodeGeometry3D"}, {Type::HexahedralGeom, "HexahedralGeom"}, {Type::TetrahedralGeom, "TetrahedralGeom"}, - {Type::INeighborList, "INeighborList"}, + {Type::AbstractNeighborList, "AbstractNeighborList"}, {Type::NeighborList, "NeighborList"}, {Type::StringArray, "StringArray"}, {Type::Unknown, "Unknown"}, @@ -287,7 +287,7 @@ std::set DataObject::StringListFromDataObjectType(const std::setgetId(); if(std::find(m_ParentList.cbegin(), m_ParentList.cend(), identifier) != m_ParentList.cend()) @@ -297,17 +297,17 @@ void DataObject::addParent(BaseGroup* parent) m_ParentList.push_back(identifier); } -void DataObject::removeParent(BaseGroup* parent) +void AbstractDataObject::removeParent(BaseGroup* parent) { m_ParentList.remove(parent->getId()); } -void DataObject::replaceParent(BaseGroup* oldParent, BaseGroup* newParent) +void AbstractDataObject::replaceParent(BaseGroup* oldParent, BaseGroup* newParent) { std::replace(m_ParentList.begin(), m_ParentList.end(), oldParent->getId(), newParent->getId()); } -std::vector DataObject::getDataPaths() const +std::vector AbstractDataObject::getDataPaths() const { if(getDataStructure() == nullptr) { @@ -337,11 +337,11 @@ std::vector DataObject::getDataPaths() const return paths; } -void DataObject::flush() const +void AbstractDataObject::flush() const { } -uint64 DataObject::memoryUsage() const +uint64 AbstractDataObject::memoryUsage() const { return 0; } diff --git a/src/simplnx/DataStructure/AbstractDataObject.hpp b/src/simplnx/DataStructure/AbstractDataObject.hpp new file mode 100644 index 0000000000..1ec9d7a325 --- /dev/null +++ b/src/simplnx/DataStructure/AbstractDataObject.hpp @@ -0,0 +1,286 @@ +#pragma once + +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/IDataObject.hpp" +#include "simplnx/DataStructure/Metadata.hpp" +#include "simplnx/simplnx_export.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace nx::core +{ +class BaseGroup; +class DataPath; +class DataStructure; + +/** + * @class AbstractDataObject + * @brief The AbstractDataObject class is the abstract base class for all items stored in the + * DataStructure. AbstractDataObjects have a name and ID value for looking them up. + * Concrete implementations need to implement shallowCopy, deepCopy, and getTypeName. + * AbstractDataObjects can have multiple parents and are deleted when they are removed + * from their last remaining parent. + */ +class SIMPLNX_EXPORT AbstractDataObject : public IDataObject +{ +public: + using IDataObject::EnumType; + using IDataObject::IdType; + using IDataObject::OptionalId; + using IDataObject::ParentCollectionType; + using IDataObject::Type; + + friend class BaseGroup; + friend class DataMap; + friend class DataStructure; + + /** + * @brief Returns true if the given string is a valid name for an AbstractDataObject. + * @param name + * @return + */ + static bool IsValidName(std::string_view name); + + static std::set StringListFromDataObjectType(const std::set& dataObjectTypes); + + /** + * @brief Copy constructor. + * @param rhs + */ + AbstractDataObject(const AbstractDataObject& rhs); + + /** + * @brief Move constructor. + * @param rhs + */ + AbstractDataObject(AbstractDataObject&& rhs); + + /** + * @brief Copy assignment. + * @param rhs + * @return + */ + AbstractDataObject& operator=(const AbstractDataObject& rhs); + + /** + * @brief Move assignment. + * @param rhs + * @return + */ + AbstractDataObject& operator=(AbstractDataObject&& rhs) noexcept; + + /** + * @brief Destructor. + */ + ~AbstractDataObject() noexcept override; + + /** + * @brief Returns a deep copy of the AbstractDataObject. + * @return AbstractDataObject* + */ + virtual std::shared_ptr deepCopy(const DataPath& copyPath) = 0; + + /** + * @brief Returns a shallow copy of the AbstractDataObject. + * @return AbstractDataObject* + */ + virtual AbstractDataObject* shallowCopy() = 0; + + /** + * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction + * @return + */ + Type getDataObjectType() const override; + + /** + * @brief Returns true if this object is derived from BaseGroup. + * @return bool + */ + bool isGroup() const override; + + /** + * @brief Returns the AbstractDataObject's ID value. + * @return IdType + */ + IdType getId() const override; + + /** + * @brief Returns a pointer to the DataStructure this AbstractDataObject belongs to. + * @return DataStructure* + */ + DataStructure* getDataStructure() override; + + /** + * @brief Returns a read-only pointer to the DataStructure this AbstractDataObject + * belongs to. + * @return const DataStructure* + */ + const DataStructure* getDataStructure() const override; + + /** + * @brief Returns a reference to the DataStructure this AbstractDataObject belongs to. + * @return DataStructure& + */ + DataStructure& getDataStructureRef() override; + + /** + * @brief Returns a read-only reference to the DataStructure this AbstractDataObject + * belongs to. + * @return const DataStructure& + */ + const DataStructure& getDataStructureRef() const override; + + /** + * @brief Returns the AbstractDataObject's name. + * @return std::string + */ + std::string getName() const override; + + /** + * @brief Checks and returns if the AbstractDataObject can be renamed to the provided + * value. + * @param name + * @return bool + */ + bool canRename(const std::string& name) const override; + + /** + * @brief Attempts to rename the AbstractDataObject to the provided value. + * @param name + * @return bool + */ + bool rename(const std::string& name) override; + + /** + * @brief Returns a collection of the parent containers that store the AbstractDataObject. + * @return ParentCollectionType + */ + ParentCollectionType getParentIds() const override; + + /** + * @brief Clears the list of parent IDs. + */ + void clearParents() override; + + /** + * @brief Returns a vector of DataPaths to the object. + * @return std::vector + */ + std::vector getDataPaths() const override; + + /** + * @brief Returns a reference to the object's Metadata. + * @return Metadata& + */ + Metadata& getMetadata() override; + + /** + * @brief Returns a reference to the object's Metadata. + * @return const Metadata& + */ + const Metadata& getMetadata() const override; + + bool hasParent(const DataPath& parentPath) const override; + + /** + * @brief Flushes the AbstractDataObject to its respective target. + * In-memory AbstractDataObjects are not affected. + */ + void flush() const override; + + uint64 memoryUsage() const override; + +protected: + /** + * @brief AbstractDataObject constructor takes a reference to the DataStructure and + * object name. + * @param dataStructure + * @param name + */ + AbstractDataObject(DataStructure& dataStructure, std::string name); + + /** + * @brief AbstractDataObject constructor takes a reference to the DataStructure, + * object name, and object ID. + * @param dataStructure + * @param name + * @param importId + */ + AbstractDataObject(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief Updates the data ID for lookup within the DataStructure. + * This method should only be called from within the DataStructure. + * @param newId + */ + void setId(IdType newId); + + /** + * @brief Notifies the AbstractDataObject of IDs that have been changed by the DataStructure. + * @param updatedIdsMap std::unordered_map containing the mappings between the old IDs and the new IDs + */ + void checkUpdatedIds(const std::unordered_map& updatedIdsMap); + + /** + * @brief Calls specialized checks for derived classes. Should only be called by checkUpdatedIds. + * @param updatedIds + */ + virtual void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap); + + /** + * @brief Attempts to add the specified AbstractDataObject to the target DataStructure. + * If a parentId is provided, then the AbstractDataObject will be added as a child to + * the target AbstractDataObject. Otherwise, the AbstractDataObject will be added directly + * under the DataStructure. If the AbstractDataObject is added successfully, the + * target parent will take ownership of the added AbstractDataObject. + * + * Returns true if the operation succeeds. Returns false otherwise. + * @param dataStructure + * @param data + * @param parentId + * @return bool + */ + static bool AttemptToAddObject(DataStructure& ds, const std::shared_ptr& data, const OptionalId& parentId); + + /** + * @brief Marks the specified BaseGroup as a parent. + * If this object is already parented to the given group, this function does nothing. + * @param parent + */ + void addParent(BaseGroup* parent); + + /** + * @brief Removes the specified parent. + * @param parent + */ + void removeParent(BaseGroup* parent); + + /** + * @brief Replaces the specified parent with another BaseGroup. + * @param oldParent + * @param newParent + */ + void replaceParent(BaseGroup* oldParent, BaseGroup* newParent); + + /** + * @brief Sets a new DataStructure for the AbstractDataObject. + * @param dataStructure + */ + virtual void setDataStructure(DataStructure* dataStructure); + +private: + DataStructure* m_DataStructure = nullptr; + ParentCollectionType m_ParentList; + IdType m_Id = 0; + std::string m_Name; + Metadata m_Metadata; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/AbstractDataStore.hpp b/src/simplnx/DataStructure/AbstractDataStore.hpp index 7605771b09..0c02b22574 100644 --- a/src/simplnx/DataStructure/AbstractDataStore.hpp +++ b/src/simplnx/DataStructure/AbstractDataStore.hpp @@ -395,6 +395,33 @@ class AbstractDataStore : public IDataStore ~AbstractDataStore() override = default; + /** + * @brief Returns the number of values stored within the DataStore. + * @return usize + */ + usize getSize() const override + { + return getNumberOfTuples() * getNumberOfComponents(); + } + + /** + * @brief Returns the number of values stored within the DataStore. + * @return usize + */ + usize size() const override + { + return getSize(); + } + + /** + * @brief Returns if there are any elements in the array object + * @return bool, true if the DataStore has a size() == 0 + */ + bool empty() const override + { + return getNumberOfTuples() == 0; + } + /** * @brief Returns the value found at the specified index of the DataStore. * This cannot be used to edit the value found at the specified index. diff --git a/src/simplnx/DataStructure/AbstractListStore.hpp b/src/simplnx/DataStructure/AbstractListStore.hpp index f9c23f8b6c..28d111cc57 100644 --- a/src/simplnx/DataStructure/AbstractListStore.hpp +++ b/src/simplnx/DataStructure/AbstractListStore.hpp @@ -537,6 +537,11 @@ class AbstractListStore : public IListStore ~AbstractListStore() override = default; + uint64 size() const override + { + return getNumberOfLists(); + } + virtual std::unique_ptr deepCopy() const = 0; /** diff --git a/src/simplnx/DataStructure/AbstractNeighborList.cpp b/src/simplnx/DataStructure/AbstractNeighborList.cpp new file mode 100644 index 0000000000..f860b9c275 --- /dev/null +++ b/src/simplnx/DataStructure/AbstractNeighborList.cpp @@ -0,0 +1,87 @@ +#include "AbstractNeighborList.hpp" + +namespace nx::core +{ +AbstractNeighborList::AbstractNeighborList(DataStructure& dataStructure, const std::string& name) +: AbstractArray(dataStructure, name) +{ +} + +AbstractNeighborList::AbstractNeighborList(DataStructure& dataStructure, const std::string& name, IdType importId) +: AbstractArray(dataStructure, name, importId) +{ +} + +AbstractNeighborList::~AbstractNeighborList() noexcept = default; + +std::string AbstractNeighborList::getTypeName() const +{ + return NeighborListConstants::k_TypeName; +} + +AbstractDataObject::Type AbstractNeighborList::getDataObjectType() const +{ + return Type::AbstractNeighborList; +} + +void AbstractNeighborList::setNumNeighborsArrayName(const std::string& name) +{ + m_NumNeighborsArrayName = name; +} + +std::string AbstractNeighborList::getNumNeighborsArrayName() const +{ + std::string arrayName = m_NumNeighborsArrayName; + if(arrayName.empty()) + { + return getName() + "_NumNeighbors"; + } + return arrayName; +} + +IListStore& AbstractNeighborList::getIListStoreRef() +{ + IListStore* store = getIListStore(); + if(store == nullptr) + { + throw std::runtime_error("AbstractNeighborList: Null IListStore"); + } + return *store; +} + +const IListStore& AbstractNeighborList::getIListStoreRef() const +{ + const IListStore* store = getIListStore(); + if(store == nullptr) + { + throw std::runtime_error("AbstractNeighborList: Null IListStore"); + } + return *store; +} + +usize AbstractNeighborList::getNumberOfTuples() const +{ + return getIListStoreRef().getNumberOfTuples(); +} + +void AbstractNeighborList::resizeTuples(const ShapeType& tupleShape) +{ + getIListStoreRef().resizeTuples(tupleShape); +} + +usize AbstractNeighborList::getNumberOfComponents() const +{ + return 1; +} + +ShapeType AbstractNeighborList::getTupleShape() const +{ + return getIListStoreRef().getTupleShape(); +} + +ShapeType AbstractNeighborList::getComponentShape() const +{ + return {1}; +} + +} // namespace nx::core diff --git a/src/simplnx/DataStructure/INeighborList.hpp b/src/simplnx/DataStructure/AbstractNeighborList.hpp similarity index 86% rename from src/simplnx/DataStructure/INeighborList.hpp rename to src/simplnx/DataStructure/AbstractNeighborList.hpp index 674b95fd6a..ff94e7ae13 100644 --- a/src/simplnx/DataStructure/INeighborList.hpp +++ b/src/simplnx/DataStructure/AbstractNeighborList.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Aliases.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/DataStructure/IListStore.hpp" namespace nx::core @@ -14,12 +14,12 @@ inline constexpr StringLiteral k_TypeName = "NeighborList"; /** * @brief Non-templated base class for NeighborList class. */ -class SIMPLNX_EXPORT INeighborList : public IArray +class SIMPLNX_EXPORT AbstractNeighborList : public AbstractArray { public: - static inline constexpr StringLiteral k_TypeName = "INeighborList"; + static constexpr StringLiteral k_TypeName = "INeighborList"; - ~INeighborList() noexcept override; + ~AbstractNeighborList() noexcept override; /** * @brief Returns a pointer to the array's IListStore. @@ -90,7 +90,7 @@ class SIMPLNX_EXPORT INeighborList : public IArray } /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; @@ -148,7 +148,7 @@ class SIMPLNX_EXPORT INeighborList : public IArray * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Resizes the internal array to accommodate @@ -157,12 +157,12 @@ class SIMPLNX_EXPORT INeighborList : public IArray protected: /** - * @brief Constructs a new INeighborList + * @brief Constructs a new AbstractNeighborList * @param dataStructure * @param name * @param numTuples */ - INeighborList(DataStructure& dataStructure, const std::string& name); + AbstractNeighborList(DataStructure& dataStructure, const std::string& name); /** * @brief Constructor for use when importing INeighborLists @@ -171,7 +171,7 @@ class SIMPLNX_EXPORT INeighborList : public IArray * @param numTuples * @param importId */ - INeighborList(DataStructure& dataStructure, const std::string& name, IdType importId); + AbstractNeighborList(DataStructure& dataStructure, const std::string& name, IdType importId); private: std::string m_NumNeighborsArrayName; diff --git a/src/simplnx/DataStructure/AbstractStringStore.cpp b/src/simplnx/DataStructure/AbstractStringStore.cpp deleted file mode 100644 index 14eb18c3cf..0000000000 --- a/src/simplnx/DataStructure/AbstractStringStore.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "AbstractStringStore.hpp" - -namespace nx::core -{ -AbstractStringStore::iterator AbstractStringStore::begin() -{ - return Iterator(*this, 0); -} - -AbstractStringStore::iterator AbstractStringStore::end() -{ - return Iterator(*this, size()); -} - -AbstractStringStore::const_iterator AbstractStringStore::begin() const -{ - return ConstIterator(*this, 0); -} - -AbstractStringStore::const_iterator AbstractStringStore::end() const -{ - return ConstIterator(*this, size()); -} - -AbstractStringStore::const_iterator AbstractStringStore::cbegin() const -{ - return ConstIterator(*this, 0); -} - -AbstractStringStore::const_iterator AbstractStringStore::cend() const -{ - return ConstIterator(*this, size()); -} - -bool AbstractStringStore::operator==(const std::vector& values) const -{ - usize count = size(); - if(values.size() != count) - { - return false; - } - for(usize i = 0; i < count; i++) - { - if(values[i] != getValue(i)) - { - return false; - } - } - return true; -} -bool AbstractStringStore::operator!=(const std::vector& values) const -{ - bool equals = (*this) == values; - return !equals; -} -} // namespace nx::core diff --git a/src/simplnx/DataStructure/AttributeMatrix.cpp b/src/simplnx/DataStructure/AttributeMatrix.cpp index 4433e502c1..c504e0cb01 100644 --- a/src/simplnx/DataStructure/AttributeMatrix.cpp +++ b/src/simplnx/DataStructure/AttributeMatrix.cpp @@ -1,8 +1,8 @@ #include "AttributeMatrix.hpp" #include "simplnx/Common/Aliases.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IArray.hpp" #include @@ -26,7 +26,7 @@ AttributeMatrix::AttributeMatrix(AttributeMatrix&&) = default; AttributeMatrix::~AttributeMatrix() noexcept = default; -DataObject::Type AttributeMatrix::getDataObjectType() const +AbstractDataObject::Type AttributeMatrix::getDataObjectType() const { return Type::AttributeMatrix; } @@ -56,7 +56,7 @@ AttributeMatrix* AttributeMatrix::Import(DataStructure& dataStructure, std::stri return data.get(); } -std::shared_ptr AttributeMatrix::deepCopy(const DataPath& copyPath) +std::shared_ptr AttributeMatrix::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -69,7 +69,7 @@ std::shared_ptr AttributeMatrix::deepCopy(const DataPath& copyPath) return nullptr; } -DataObject* AttributeMatrix::shallowCopy() +AbstractDataObject* AttributeMatrix::shallowCopy() { return new AttributeMatrix(*this); } @@ -79,14 +79,14 @@ std::string AttributeMatrix::getTypeName() const return k_TypeName; } -bool AttributeMatrix::canInsert(const DataObject* obj) const +bool AttributeMatrix::canInsert(const AbstractDataObject* obj) const { if(!BaseGroup::canInsert(obj)) { return false; } - const auto* arrayObjectPtr = dynamic_cast(obj); + const auto* arrayObjectPtr = dynamic_cast(obj); if(arrayObjectPtr == nullptr) { @@ -114,7 +114,7 @@ usize AttributeMatrix::getNumberOfTuples() const void AttributeMatrix::resizeTuples(ShapeType tupleShape) { m_TupleShape = std::move(tupleShape); - auto childArrays = findAllChildrenOfType(); + auto childArrays = findAllChildrenOfType(); for(const auto& array : childArrays) { array->resizeTuples(m_TupleShape); @@ -124,13 +124,13 @@ void AttributeMatrix::resizeTuples(ShapeType tupleShape) Result<> AttributeMatrix::validate() const { Result<> result; - auto childArrays = findAllChildrenOfType(); + auto childArrays = findAllChildrenOfType(); usize numTuples = getNumberOfTuples(); for(const auto& array : childArrays) { if(array->getNumberOfTuples() != numTuples) { - result = MergeResults(result, MakeErrorResult(-4701, fmt::format("AttributeMatrix '{}' has {} tuples but the contained IArray object '{}' has {} total tuples.", getName(), numTuples, + result = MergeResults(result, MakeErrorResult(-4701, fmt::format("AttributeMatrix '{}' has {} tuples but the contained AbstractArray object '{}' has {} total tuples.", getName(), numTuples, array->getName(), array->getNumberOfTuples()))); } } diff --git a/src/simplnx/DataStructure/AttributeMatrix.hpp b/src/simplnx/DataStructure/AttributeMatrix.hpp index 78bbb3de80..969e53b634 100644 --- a/src/simplnx/DataStructure/AttributeMatrix.hpp +++ b/src/simplnx/DataStructure/AttributeMatrix.hpp @@ -14,7 +14,7 @@ namespace nx::core class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup { public: - static inline constexpr StringLiteral k_TypeName = "AttributeMatrix"; + static constexpr StringLiteral k_TypeName = "AttributeMatrix"; /** * @brief Attempts to construct and insert a AttributeMatrix into the DataStructure. @@ -40,7 +40,7 @@ class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup * used as the parent object. In either case, the DataStructure will take * ownership of the AttributeMatrix. * - * Unlike Create, Import allows setting the DataObject ID for use in + * Unlike Create, Import allows setting the AbstractDataObject ID for use in * importing data. * * Returns a pointer to the AttributeMatrix if the process succeeds. Returns @@ -76,7 +76,7 @@ class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -87,21 +87,21 @@ class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup /** * @brief Creates and returns a deep copy of the AttributeMatrix. The caller is * responsible for deleting the returned pointer when it is no longer needed. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief Creates and returns a shallow copy of the AttributeMatrix. The caller is * responsible for deleting the returned pointer when it is no longer needed * as a copy cannot be added to the DataStructure anywhere the original * exists without changing its name. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; @@ -136,7 +136,7 @@ class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup void resizeTuples(ShapeType tupleShape); /** - * @brief Validates that every IArray held by this attribute matrix have the same number + * @brief Validates that every AbstractArray held by this attribute matrix have the same number * of tuples that the attribute matrix requires. * @return Result<> object. */ @@ -163,13 +163,13 @@ class SIMPLNX_EXPORT AttributeMatrix : public BaseGroup AttributeMatrix(DataStructure& dataStructure, std::string name, ShapeType tupleShape, IdType importId); /** - * @brief Checks if the provided DataObject can be added to the container. - * Returns true if the DataObject can be added to the container. Otherwise, + * @brief Checks if the provided AbstractDataObject can be added to the container. + * Returns true if the AbstractDataObject can be added to the container. Otherwise, * returns false. * @param obj * @return bool */ - bool canInsert(const DataObject* obj) const override; + bool canInsert(const AbstractDataObject* obj) const override; private: ShapeType m_TupleShape; diff --git a/src/simplnx/DataStructure/BaseGroup.cpp b/src/simplnx/DataStructure/BaseGroup.cpp index a19058b4db..686535d22d 100644 --- a/src/simplnx/DataStructure/BaseGroup.cpp +++ b/src/simplnx/DataStructure/BaseGroup.cpp @@ -6,23 +6,23 @@ using namespace nx::core; BaseGroup::BaseGroup(DataStructure& dataStructure, std::string name) -: DataObject(dataStructure, std::move(name)) +: AbstractDataObject(dataStructure, std::move(name)) { } BaseGroup::BaseGroup(DataStructure& dataStructure, std::string name, IdType importId) -: DataObject(dataStructure, std::move(name), importId) +: AbstractDataObject(dataStructure, std::move(name), importId) { } BaseGroup::BaseGroup(const BaseGroup& other) -: DataObject(other) +: AbstractDataObject(other) , m_DataMap(other.m_DataMap) { } BaseGroup::BaseGroup(BaseGroup&& other) -: DataObject(std::move(other)) +: AbstractDataObject(std::move(other)) , m_DataMap(std::move(other.m_DataMap)) { auto keys = m_DataMap.getKeys(); @@ -34,7 +34,7 @@ BaseGroup::BaseGroup(BaseGroup&& other) BaseGroup::~BaseGroup() = default; -DataObject::Type BaseGroup::getDataObjectType() const +AbstractDataObject::Type BaseGroup::getDataObjectType() const { return Type::BaseGroup; } @@ -74,32 +74,32 @@ bool BaseGroup::contains(const std::string& name) const return m_DataMap.contains(name); } -bool BaseGroup::contains(const DataObject* obj) const +bool BaseGroup::contains(const AbstractDataObject* obj) const { return m_DataMap.contains(obj); } -DataObject* BaseGroup::operator[](const std::string& name) +AbstractDataObject* BaseGroup::operator[](const std::string& name) { return m_DataMap[name]; } -const DataObject* BaseGroup::operator[](const std::string& name) const +const AbstractDataObject* BaseGroup::operator[](const std::string& name) const { return m_DataMap[name]; } -DataObject& BaseGroup::at(const std::string& name) +AbstractDataObject& BaseGroup::at(const std::string& name) { return m_DataMap.at(name); } -const DataObject& BaseGroup::at(const std::string& name) const +const AbstractDataObject& BaseGroup::at(const std::string& name) const { return m_DataMap.at(name); } -bool BaseGroup::canInsert(const DataObject* obj) const +bool BaseGroup::canInsert(const AbstractDataObject* obj) const { if(obj == nullptr) { @@ -118,7 +118,7 @@ bool BaseGroup::canInsert(const DataObject* obj) const void BaseGroup::setDataStructure(DataStructure* dataStructure) { - DataObject::setDataStructure(dataStructure); + AbstractDataObject::setDataStructure(dataStructure); m_DataMap.setDataStructure(dataStructure); } @@ -132,13 +132,13 @@ BaseGroup::ConstIterator BaseGroup::find(const std::string& name) const return m_DataMap.find(name); } -bool BaseGroup::isParentOf(const DataObject* dataObj) const +bool BaseGroup::isParentOf(const AbstractDataObject* dataObj) const { const std::vector origDataPaths = getDataPaths(); return std::find_if(origDataPaths.begin(), origDataPaths.end(), [dataObj](const DataPath& path) { return dataObj->hasParent(path); }) != origDataPaths.end(); } -bool BaseGroup::insert(const std::weak_ptr& obj) +bool BaseGroup::insert(const std::weak_ptr& obj) { auto ptr = obj.lock(); if(!canInsert(ptr.get())) @@ -153,7 +153,7 @@ bool BaseGroup::insert(const std::weak_ptr& obj) return false; } -bool BaseGroup::remove(DataObject* obj) +bool BaseGroup::remove(AbstractDataObject* obj) { if(obj == nullptr) { @@ -218,18 +218,18 @@ std::set BaseGroup::StringListFromGroupType(const std::set k_TypeToStringMap = {{GroupType::BaseGroup, "BaseGroup"}, {GroupType::DataGroup, "DataGroup"}, {GroupType::AttributeMatrix, "AttributeMatrix"}, - {GroupType::IGeometry, "IGeometry"}, - {GroupType::IGridGeometry, "IGridGeometry"}, + {GroupType::AbstractGeometry, "AbstractGeometry"}, + {GroupType::AbstractGridGeometry, "AbstractGridGeometry"}, {GroupType::RectGridGeom, "RectGridGeom"}, {GroupType::ImageGeom, "ImageGeom"}, - {GroupType::INodeGeometry0D, "INodeGeometry0D"}, + {GroupType::AbstractNodeGeometry0D, "AbstractNodeGeometry0D"}, {GroupType::VertexGeom, "VertexGeom"}, - {GroupType::INodeGeometry1D, "INodeGeometry1D"}, + {GroupType::AbstractNodeGeometry1D, "AbstractNodeGeometry1D"}, {GroupType::EdgeGeom, "EdgeGeom"}, - {GroupType::INodeGeometry2D, "INodeGeometry2D"}, + {GroupType::AbstractNodeGeometry2D, "AbstractNodeGeometry2D"}, {GroupType::QuadGeom, "QuadGeom"}, {GroupType::TriangleGeom, "TriangleGeom"}, - {GroupType::INodeGeometry3D, "INodeGeometry3D"}, + {GroupType::AbstractNodeGeometry3D, "AbstractNodeGeometry3D"}, {GroupType::HexahedralGeom, "HexahedralGeom"}, {GroupType::TetrahedralGeom, "TetrahedralGeom"}, {GroupType::Unknown, "Unknown"}}; @@ -247,12 +247,12 @@ std::vector BaseGroup::GetChildrenNames() return m_DataMap.getNames(); } -void BaseGroup::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +void BaseGroup::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) { m_DataMap.updateIds(updatedIdsMap); } -std::vector BaseGroup::GetChildrenIds() +std::vector BaseGroup::GetChildrenIds() { return m_DataMap.getKeys(); } \ No newline at end of file diff --git a/src/simplnx/DataStructure/BaseGroup.hpp b/src/simplnx/DataStructure/BaseGroup.hpp index d676f1b7be..402bd5b650 100644 --- a/src/simplnx/DataStructure/BaseGroup.hpp +++ b/src/simplnx/DataStructure/BaseGroup.hpp @@ -1,7 +1,7 @@ #pragma once +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataMap.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -13,43 +13,43 @@ namespace nx::core { /** * @class BaseGroup - * @brief The BaseGroup class is the base class for all DataObject containers + * @brief The BaseGroup class is the base class for all AbstractDataObject containers * in the DataStructure. This is not an abstract class as all core functionality * is provided by this class, but for type-checking purposes, this cannot not be * the specified type when creating objects directly. Use DataGroup when a normal * group of DataObjects is desired. * - * Child classes should override 'bool canInsert(const DataObject*) const' + * Child classes should override 'bool canInsert(const AbstractDataObject*) const' * to determine which DataObjects can be added to the group and which cannot. * By default, an object cannot be added if another object with the same name * already exists in the group. Additional rules can be added in derived * classes. */ -class SIMPLNX_EXPORT BaseGroup : public DataObject +class SIMPLNX_EXPORT BaseGroup : public AbstractDataObject { public: using Iterator = typename DataMap::Iterator; using ConstIterator = typename DataMap::ConstIterator; - static inline constexpr StringLiteral k_TypeName = "BaseGroup"; + static constexpr StringLiteral k_TypeName = "BaseGroup"; enum class GroupType : uint32 { BaseGroup, DataGroup, AttributeMatrix, - IGeometry, - IGridGeometry, + AbstractGeometry, + AbstractGridGeometry, RectGridGeom, ImageGeom, - INodeGeometry0D, + AbstractNodeGeometry0D, VertexGeom, - INodeGeometry1D, + AbstractNodeGeometry1D, EdgeGeom, - INodeGeometry2D, + AbstractNodeGeometry2D, QuadGeom, TriangleGeom, - INodeGeometry3D, + AbstractNodeGeometry3D, HexahedralGeom, TetrahedralGeom, Unknown @@ -72,7 +72,7 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject /** * @brief Destroys the BaseGroup and removes it from the list of it's * children's known parents. If a child no longer has any parents, the - * DataObject is destroyed. + * AbstractDataObject is destroyed. */ ~BaseGroup() override; @@ -80,7 +80,7 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns true if this object is derived from BaseGroup. @@ -131,7 +131,7 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject bool contains(const std::string& name) const; /** - * @brief Returns true if the specified DataObject is found among the + * @brief Returns true if the specified AbstractDataObject is found among the * container's children. Returns false otherwise. * * BaseGroups found among the container's children are not expanded during @@ -139,51 +139,51 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject * @param obj * @return bool */ - bool contains(const DataObject* obj) const; + bool contains(const AbstractDataObject* obj) const; /** - * Returns a pointer to the DataObject child with the specified name. Returns + * Returns a pointer to the AbstractDataObject child with the specified name. Returns * nullptr if no child exists with the specified name exists. * * BaseGroups found among the container's children are not expanded during * the operation. * @param name - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* operator[](const std::string& name); + AbstractDataObject* operator[](const std::string& name); /** - * Returns a pointer to the DataObject child with the specified name. Returns + * Returns a pointer to the AbstractDataObject child with the specified name. Returns * nullptr if no child exists with the specified name exists. * * BaseGroups found among the container's children are not expanded during * the operation. * @param name - * @return DataObject* + * @return AbstractDataObject* */ - const DataObject* operator[](const std::string& name) const; + const AbstractDataObject* operator[](const std::string& name) const; /** - * Returns a pointer to the DataObject child with the specified name. + * Returns a pointer to the AbstractDataObject child with the specified name. * Throws if no child exists with the specified name exists. * * BaseGroups found among the container's children are not expanded during * the operation. * @param name - * @return DataObject& + * @return AbstractDataObject& */ - DataObject& at(const std::string& name); + AbstractDataObject& at(const std::string& name); /** - * Returns a pointer to the DataObject child with the specified name. + * Returns a pointer to the AbstractDataObject child with the specified name. * Throws if no child exists with the specified name exists. * * BaseGroups found among the container's children are not expanded during * the operation. * @param name - * @return const DataObject& + * @return const AbstractDataObject& */ - const DataObject& at(const std::string& name) const; + const AbstractDataObject& at(const std::string& name) const; /** * @brief Returns an iterator to the child with the specified name. If no @@ -238,23 +238,23 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject } /** - * @brief Returns true if this group is a parent of the given DataObject + * @brief Returns true if this group is a parent of the given AbstractDataObject * @return bool */ - bool isParentOf(const DataObject* dataObj) const; + bool isParentOf(const AbstractDataObject* dataObj) const; /** - * @brief Attempts to insert the specified DataObject into the container. If the - * DataObject passes 'canInsert(obj: weak_ptr): bool', the DataObject + * @brief Attempts to insert the specified AbstractDataObject into the container. If the + * AbstractDataObject passes 'canInsert(obj: weak_ptr): bool', the AbstractDataObject * will be inserted into the container and the method returns true. Otherwise, * returns false. * @param obj * @return bool */ - bool insert(const std::weak_ptr& obj); + bool insert(const std::weak_ptr& obj); /** - * Attempts to remove the specified DataObject from the container. Returns + * Attempts to remove the specified AbstractDataObject from the container. Returns * true if it succeeded. Returns false otherwise. * * BaseGroups found among the container's children are not expanded during @@ -262,10 +262,10 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject * @param obj * @return bool */ - bool remove(DataObject* obj); + bool remove(AbstractDataObject* obj); /** - * Attempts to remove a DataObject with the specified name from the container. + * Attempts to remove a AbstractDataObject with the specified name from the container. * Returns true if it succeeded. Returns false otherwise. * * BaseGroups found among the container's children are not expanded during @@ -337,7 +337,7 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject /** * @brief Querys the DataMap for the object ids in m_DataMap */ - std::vector GetChildrenIds(); + std::vector GetChildrenIds(); protected: /** @@ -356,24 +356,24 @@ class SIMPLNX_EXPORT BaseGroup : public DataObject BaseGroup(DataStructure& dataStructure, std::string name, IdType importId); /** - * @brief Updates the DataMap IDs. Should only be called by DataObject::checkUpdatedIds. + * @brief Updates the DataMap IDs. Should only be called by AbstractDataObject::checkUpdatedIds. * @param updatedIdsMap */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; /** - * @brief Checks if the provided DataObject can be added to the container. + * @brief Checks if the provided AbstractDataObject can be added to the container. * This is a virtual method so that derived classes can modify what can or - * cannot be added to the container. Returns true if the DataObject can be + * cannot be added to the container. Returns true if the AbstractDataObject can be * added to the container. Otherwise, returns false. * - * By default, a DataObject cannot be added to the BaseContainer if an object + * By default, a AbstractDataObject cannot be added to the BaseContainer if an object * with that name is already in the container. No BaseGroup children are * expanded during this operation. * @param obj * @return bool */ - virtual bool canInsert(const DataObject* obj) const; + virtual bool canInsert(const AbstractDataObject* obj) const; /** * @brief Sets a new DataStructure for the BaseGroup. Updates the DataMap diff --git a/src/simplnx/DataStructure/DataArray.hpp b/src/simplnx/DataStructure/DataArray.hpp index 043fb58a2d..d10faeddb1 100644 --- a/src/simplnx/DataStructure/DataArray.hpp +++ b/src/simplnx/DataStructure/DataArray.hpp @@ -2,11 +2,11 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/EmptyDataStore.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include @@ -22,13 +22,13 @@ constexpr StringLiteral k_TypeName = "DataArray"; /** * @class DataArray - * @brief The DataArray class is a type of DataObject that exists to store and + * @brief The DataArray class is a type of AbstractDataObject that exists to store and * retrieve array data within the DataStructure. The DataArray is designed to * allow expandability into multiple sources of data, including out-of-core data, * through the use of derived DataStore classes. */ template -class DataArray : public IDataArray +class DataArray : public AbstractDataArray { friend class NeighborList; @@ -43,7 +43,7 @@ class DataArray : public IDataArray /** * @brief Attempts to create a DataArray with the specified values and add * it to the DataStructure. If a parentId is provided, then the DataArray - * is created with the target DataObject as its parent. Otherwise, the + * is created with the target AbstractDataObject as its parent. Otherwise, the * created DataArray is nested directly within the DataStructure. * * In either case, the DataArray is then owned by the DataStructure and will @@ -81,7 +81,7 @@ class DataArray : public IDataArray * @param tupleShape The tuple dimensions of the data. If you want to mimic an image then your shape should be {height, width} slowest to fastest dimension * @param componentShape The component dimensions of the data. If you want to mimic an RGB image then your component would be {3}, * if you want to store a 3Rx4C matrix then it would be {3, 4}. - * @param parentId The DataObject that will own the DataArray instance. + * @param parentId The AbstractDataObject that will own the DataArray instance. * @return DataArray* Instance of the DataArray object that is owned and managed by the DataStructure */ template @@ -111,7 +111,7 @@ class DataArray : public IDataArray /** * @brief Attempts to create a DataArray with the specified values and add * it to the DataStructure. If a parentId is provided, then the DataArray - * is created with the target DataObject as its parent. Otherwise, the + * is created with the target AbstractDataObject as its parent. Otherwise, the * created DataArray is nested directly within the DataStructure. * * In either case, the DataArray is then owned by the DataStructure and will @@ -120,7 +120,7 @@ class DataArray : public IDataArray * in which it is created. Use the object's ID or DataPath to retrieve the * DataArray if it is needed after the program has left the current scope. * - * Unlike Create, Import allows the DataObject ID to be set for use in + * Unlike Create, Import allows the AbstractDataObject ID to be set for use in * importing data. * * Returns a pointer to the created DataArray if the process succeeds. @@ -150,7 +150,7 @@ class DataArray : public IDataArray * @param other */ DataArray(const DataArray& other) - : IDataArray(other) + : AbstractDataArray(other) , m_DataStore(other.m_DataStore) { } @@ -160,7 +160,7 @@ class DataArray : public IDataArray * @param other */ DataArray(DataArray&& other) - : IDataArray(std::move(other)) + : AbstractDataArray(std::move(other)) , m_DataStore(std::move(other.m_DataStore)) { } @@ -174,7 +174,7 @@ class DataArray : public IDataArray * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override + AbstractDataObject::Type getDataObjectType() const override { return Type::DataArray; } @@ -191,9 +191,9 @@ class DataArray : public IDataArray /** * @brief Returns a shallow copy of the DataArray without copying data. THE CALLING CODE * MUST DISPOSE OF THE RETURNED OBJECT. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override + AbstractDataObject* shallowCopy() override { return new DataArray(*this); } @@ -201,9 +201,9 @@ class DataArray : public IDataArray /** * @brief Returns a deep copy of the DataArray including a deep copy of the * data store. The object will be owned by the DataStructure. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override + std::shared_ptr deepCopy(const DataPath& copyPath) override { DataStructure& dataStruct = getDataStructureRef(); if(dataStruct.containsData(copyPath)) @@ -730,7 +730,7 @@ class DataArray : public IDataArray } /** - * @brief Flushes the DataObject to its respective target. + * @brief Flushes the AbstractDataObject to its respective target. * In-memory DataObjects are not affected. */ void flush() const override @@ -754,7 +754,7 @@ class DataArray : public IDataArray * @param store */ DataArray(DataStructure& dataStructure, std::string name, std::shared_ptr store = nullptr) - : IDataArray(dataStructure, std::move(name)) + : AbstractDataArray(dataStructure, std::move(name)) { setDataStore(std::move(store)); } @@ -770,7 +770,7 @@ class DataArray : public IDataArray * @param store */ DataArray(DataStructure& dataStructure, std::string name, IdType importId, std::shared_ptr store = nullptr) - : IDataArray(dataStructure, std::move(name), importId) + : AbstractDataArray(dataStructure, std::move(name), importId) { setDataStore(std::move(store)); } diff --git a/src/simplnx/DataStructure/DataGroup.cpp b/src/simplnx/DataStructure/DataGroup.cpp index 64a5d50fa4..2ca5e6cac0 100644 --- a/src/simplnx/DataStructure/DataGroup.cpp +++ b/src/simplnx/DataStructure/DataGroup.cpp @@ -25,7 +25,7 @@ DataGroup::DataGroup(DataGroup&& other) DataGroup::~DataGroup() = default; -DataObject::Type DataGroup::getDataObjectType() const +AbstractDataObject::Type DataGroup::getDataObjectType() const { return Type::DataGroup; } @@ -55,7 +55,7 @@ DataGroup* DataGroup::Import(DataStructure& dataStructure, std::string name, IdT return data.get(); } -std::shared_ptr DataGroup::deepCopy(const DataPath& copyPath) +std::shared_ptr DataGroup::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -69,7 +69,7 @@ std::shared_ptr DataGroup::deepCopy(const DataPath& copyPath) return nullptr; } -DataObject* DataGroup::shallowCopy() +AbstractDataObject* DataGroup::shallowCopy() { return new DataGroup(*this); } @@ -79,7 +79,7 @@ std::string DataGroup::getTypeName() const return k_TypeName; } -bool DataGroup::canInsert(const DataObject* obj) const +bool DataGroup::canInsert(const AbstractDataObject* obj) const { return BaseGroup::canInsert(obj); } diff --git a/src/simplnx/DataStructure/DataGroup.hpp b/src/simplnx/DataStructure/DataGroup.hpp index 8c144097ab..9a358a7308 100644 --- a/src/simplnx/DataStructure/DataGroup.hpp +++ b/src/simplnx/DataStructure/DataGroup.hpp @@ -9,7 +9,7 @@ namespace nx::core * @class DataGroup * @brief The DataGroup class is an instantiable implementation of BaseGroup. * The DataGroup class does not impose restrictions on which types of - * DataObject can be inserted. + * AbstractDataObject can be inserted. */ class SIMPLNX_EXPORT DataGroup : public BaseGroup { @@ -39,7 +39,7 @@ class SIMPLNX_EXPORT DataGroup : public BaseGroup * used as the parent object. In either case, the DataStructure will take * ownership of the DataGroup. * - * Unlike Create, Import allows setting the DataObject ID for use in + * Unlike Create, Import allows setting the AbstractDataObject ID for use in * importing data. * * Returns a pointer to the DataGroup if the process succeeds. Returns @@ -71,7 +71,7 @@ class SIMPLNX_EXPORT DataGroup : public BaseGroup * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -82,21 +82,21 @@ class SIMPLNX_EXPORT DataGroup : public BaseGroup /** * @brief Creates and returns a deep copy of the DataGroup. The caller is * responsible for deleting the returned pointer when it is no longer needed. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief Creates and returns a shallow copy of the DataGroup. The caller is * responsible for deleting the returned pointer when it is no longer needed * as a copy cannot be added to the DataStructure anywhere the original * exists without changing its name. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; @@ -120,12 +120,12 @@ class SIMPLNX_EXPORT DataGroup : public BaseGroup DataGroup(DataStructure& dataStructure, std::string name, IdType importId); /** - * @brief Checks if the provided DataObject can be added to the container. - * Returns true if the DataObject can be added to the container. Otherwise, + * @brief Checks if the provided AbstractDataObject can be added to the container. + * Returns true if the AbstractDataObject can be added to the container. Otherwise, * returns false. * @param obj * @return bool */ - bool canInsert(const DataObject* obj) const override; + bool canInsert(const AbstractDataObject* obj) const override; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/DataMap.cpp b/src/simplnx/DataStructure/DataMap.cpp index c92feaf715..c6e0ca9d32 100644 --- a/src/simplnx/DataStructure/DataMap.cpp +++ b/src/simplnx/DataStructure/DataMap.cpp @@ -45,7 +45,7 @@ bool DataMap::empty() const return m_Map.empty(); } -bool DataMap::insert(const std::shared_ptr& obj) +bool DataMap::insert(const std::shared_ptr& obj) { if(obj == nullptr) { @@ -56,7 +56,7 @@ bool DataMap::insert(const std::shared_ptr& obj) return true; } -bool DataMap::remove(DataObject* obj) +bool DataMap::remove(AbstractDataObject* obj) { if(obj == nullptr) { @@ -114,9 +114,9 @@ std::vector DataMap::getAllKeys() const return keys; } -std::map> DataMap::getAllItems() const +std::map> DataMap::getAllItems() const { - std::map> map; + std::map> map; for(auto& pair : m_Map) { map[pair.first] = pair.second; @@ -155,7 +155,7 @@ bool DataMap::contains(const std::string& name) const return false; } -bool DataMap::contains(const DataObject* obj) const +bool DataMap::contains(const AbstractDataObject* obj) const { if(obj == nullptr) { @@ -169,7 +169,7 @@ bool DataMap::contains(IdType identifier) const return m_Map.find(identifier) != m_Map.end(); } -DataObject* DataMap::operator[](IdType key) +AbstractDataObject* DataMap::operator[](IdType key) { if(contains(key)) { @@ -178,7 +178,7 @@ DataObject* DataMap::operator[](IdType key) return nullptr; } -const DataObject* DataMap::operator[](IdType key) const +const AbstractDataObject* DataMap::operator[](IdType key) const { if(contains(key)) { @@ -187,7 +187,7 @@ const DataObject* DataMap::operator[](IdType key) const return nullptr; } -DataObject* DataMap::operator[](const std::string& name) +AbstractDataObject* DataMap::operator[](const std::string& name) { for(auto& iter : m_Map) { @@ -199,7 +199,7 @@ DataObject* DataMap::operator[](const std::string& name) return nullptr; } -const DataObject* DataMap::operator[](const std::string& name) const +const AbstractDataObject* DataMap::operator[](const std::string& name) const { for(auto& iter : m_Map) { @@ -211,9 +211,9 @@ const DataObject* DataMap::operator[](const std::string& name) const return nullptr; } -DataObject& DataMap::at(const std::string& name) +AbstractDataObject& DataMap::at(const std::string& name) { - DataObject* object = (*this)[name]; + AbstractDataObject* object = (*this)[name]; if(object == nullptr) { throw std::invalid_argument(fmt::format("DataMap::at: unable to find object with name '{}'", name)); @@ -221,9 +221,9 @@ DataObject& DataMap::at(const std::string& name) return *object; } -const DataObject& DataMap::at(const std::string& name) const +const AbstractDataObject& DataMap::at(const std::string& name) const { - const DataObject* object = (*this)[name]; + const AbstractDataObject* object = (*this)[name]; if(object == nullptr) { throw std::invalid_argument(fmt::format("DataMap::at: unable to find object with name '{}'", name)); @@ -309,8 +309,8 @@ DataMap& DataMap::operator=(const DataMap& rhs) auto keys = rhs.getKeys(); for(auto& key : keys) { - DataObject* copy = rhs.m_Map.at(key)->shallowCopy(); - m_Map[key] = std::shared_ptr(copy); + AbstractDataObject* copy = rhs.m_Map.at(key)->shallowCopy(); + m_Map[key] = std::shared_ptr(copy); } return *this; @@ -322,9 +322,9 @@ DataMap& DataMap::operator=(DataMap&& rhs) noexcept return *this; } -void DataMap::updateIds(const std::unordered_map& updatedIds) +void DataMap::updateIds(const std::unordered_map& updatedIds) { - using UpdatedValueType = std::pair>; + using UpdatedValueType = std::pair>; std::list movedValues; for(const auto& updatedId : updatedIds) diff --git a/src/simplnx/DataStructure/DataMap.hpp b/src/simplnx/DataStructure/DataMap.hpp index afdedf2239..e13981c131 100644 --- a/src/simplnx/DataStructure/DataMap.hpp +++ b/src/simplnx/DataStructure/DataMap.hpp @@ -13,7 +13,7 @@ namespace nx::core { class DataStructure; -class DataObject; +class AbstractDataObject; class DataPath; /** @@ -26,7 +26,7 @@ class SIMPLNX_EXPORT DataMap { public: using IdType = uint64; - using MapType = std::map>; + using MapType = std::map>; using Iterator = typename MapType::iterator; using ConstIterator = typename MapType::const_iterator; @@ -49,7 +49,7 @@ class SIMPLNX_EXPORT DataMap /** * @brief Destroys the DataMap, deleting the std::shared_ptrs that make up - * the map. If the map had the last reference to a DataObject, that object + * the map. If the map had the last reference to a AbstractDataObject, that object * is destroyed. */ ~DataMap(); @@ -72,23 +72,23 @@ class SIMPLNX_EXPORT DataMap bool empty() const; /** - * @brief Attempts to insert the target DataObject into the map. + * @brief Attempts to insert the target AbstractDataObject into the map. * Returns true if it succeeded. Returns false otherwise. * @param obj * @return bool */ - bool insert(const std::shared_ptr& obj); + bool insert(const std::shared_ptr& obj); /** - * @brief Attempts to remove the target DataObject from the map. + * @brief Attempts to remove the target AbstractDataObject from the map. * Returns true if it succeeded. Returns false otherwise. * @param obj * @return bool */ - bool remove(DataObject* obj); + bool remove(AbstractDataObject* obj); /** - * @brief Attempts to remove a DataObject with the target IdType from the map. + * @brief Attempts to remove a AbstractDataObject with the target IdType from the map. * Returns true if it succeeded. Returns false otherwise. * @param identifier * @return bool @@ -96,7 +96,7 @@ class SIMPLNX_EXPORT DataMap bool remove(IdType identifier); /** - * @brief Attempts to remove a DataObject from the map using the target + * @brief Attempts to remove a AbstractDataObject from the map using the target * iterator. Returns true if it succeeded. Returns false otherwise. * @param iter * @return bool @@ -124,63 +124,63 @@ class SIMPLNX_EXPORT DataMap /** * @brief Returns a map of Id and DataObjects in the map and its contained * groups. - * @return std::map> + * @return std::map> */ - std::map> getAllItems() const; + std::map> getAllItems() const; /** - * @brief Returns a vector of the contained DataObject names. + * @brief Returns a vector of the contained AbstractDataObject names. * @return std::vector */ std::vector getNames() const; /** - * @brief Returns a pointer to the DataObject with the specified IdType. - * Returns nullptr if no DataObject is found. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. + * Returns nullptr if no AbstractDataObject is found. * @param key - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* operator[](IdType key); + AbstractDataObject* operator[](IdType key); /** - * @brief Returns a const pointer to the DataObject with the specified IdType. - * Returns nullptr if no DataObject is found. + * @brief Returns a const pointer to the AbstractDataObject with the specified IdType. + * Returns nullptr if no AbstractDataObject is found. * @param key - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* operator[](IdType key) const; + const AbstractDataObject* operator[](IdType key) const; /** - * @brief Returns a pointer to the DataObject with the specified name. - * Returns nullptr if no DataObject is found. + * @brief Returns a pointer to the AbstractDataObject with the specified name. + * Returns nullptr if no AbstractDataObject is found. * @param name - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* operator[](const std::string& name); + AbstractDataObject* operator[](const std::string& name); /** - * @brief Returns a const pointer to the DataObject with the specified name. - * Returns nullptr if no DataObject is found. + * @brief Returns a const pointer to the AbstractDataObject with the specified name. + * Returns nullptr if no AbstractDataObject is found. * @param name - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* operator[](const std::string& name) const; + const AbstractDataObject* operator[](const std::string& name) const; /** - * @brief Returns a reference to the DataObject with the specified name. - * Throws if no DataObject is found. + * @brief Returns a reference to the AbstractDataObject with the specified name. + * Throws if no AbstractDataObject is found. * @param name - * @return DataObject& + * @return AbstractDataObject& */ - DataObject& at(const std::string& name); + AbstractDataObject& at(const std::string& name); /** - * @brief Returns a const reference to the DataObject with the specified name. - * Throws if no DataObject is found. + * @brief Returns a const reference to the AbstractDataObject with the specified name. + * Throws if no AbstractDataObject is found. * @param name - * @return const DataObject& + * @return const AbstractDataObject& */ - const DataObject& at(const std::string& name) const; + const AbstractDataObject& at(const std::string& name) const; /** * @brief Checks if the DataMap contains the specified IdType. @@ -190,14 +190,14 @@ class SIMPLNX_EXPORT DataMap bool contains(IdType identifier) const; /** - * @brief Checks if the DataMap contains the specified DataObject. + * @brief Checks if the DataMap contains the specified AbstractDataObject. * @param obj * @return bool */ - bool contains(const DataObject* obj) const; + bool contains(const AbstractDataObject* obj) const; /** - * @brief Checks if the DataMap contains a DataObject with the specified name. + * @brief Checks if the DataMap contains a AbstractDataObject with the specified name. * @param name * @return bool */ diff --git a/src/simplnx/DataStructure/DataObject.hpp b/src/simplnx/DataStructure/DataObject.hpp deleted file mode 100644 index 86a24ec3fc..0000000000 --- a/src/simplnx/DataStructure/DataObject.hpp +++ /dev/null @@ -1,351 +0,0 @@ -#pragma once - -#include "simplnx/Common/StringLiteral.hpp" -#include "simplnx/Common/Types.hpp" -#include "simplnx/DataStructure/Metadata.hpp" -#include "simplnx/simplnx_export.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace nx::core -{ -class BaseGroup; -class DataPath; -class DataStructure; - -/** - * @class DataObject - * @brief The DataObject class is the base class for all items stored in the - * DataStructure. DataObjects have a name and ID value for looking them up. - * Concrete implementations need to implement shallowCopy, deepCopy, - * generateXdmfText, and readFromXdmfText. - * DataObjects can have multiple parents and are deleted when they are removed - * from their last remaining parent. - */ -class SIMPLNX_EXPORT DataObject -{ -public: - using EnumType = uint32; - enum class Type : EnumType - { - DataObject = 0, - - DynamicListArray = 1, - ScalarData = 2, - - BaseGroup = 3, - - AttributeMatrix = 4, - DataGroup = 5, - - IDataArray = 6, - DataArray = 7, - - IGeometry = 8, - - IGridGeometry = 9, - RectGridGeom = 10, - ImageGeom = 11, - - INodeGeometry0D = 12, - VertexGeom = 13, - - INodeGeometry1D = 14, - EdgeGeom = 15, - - INodeGeometry2D = 16, - QuadGeom = 17, - TriangleGeom = 18, - - INodeGeometry3D = 19, - HexahedralGeom = 20, - TetrahedralGeom = 21, - - INeighborList = 22, - NeighborList = 23, - - StringArray = 24, - - AbstractMontage = 25, - GridMontage = 26, - - Unknown = 999, - Any = 4294967295U - }; - - /** - * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction - * @return - */ - virtual Type getDataObjectType() const; - - /** - * @brief Returns true if this object is derived from BaseGroup. - * @return bool - */ - virtual bool isGroup() const; - - /** - * @brief The IdType alias serves as an ID type for DataObjects within their - * respective DataStructure. - */ - using IdType = types::uint64; - - /** - * @brief The OptionalId alias specifies that the target DataObject is not required. - */ - using OptionalId = std::optional; - - /** - * @brief The ParentCollectionType alias describes the format by which parent - * collections are returned via public API. - */ - using ParentCollectionType = std::list; - - friend class BaseGroup; - friend class DataMap; - friend class DataStructure; - - /** - * @brief Returns true if the given string is a valid name for a DataObject. - * @param name - * @return - */ - static bool IsValidName(std::string_view name); - - static std::set StringListFromDataObjectType(const std::set& dataObjectTypes); - - /** - * @brief Copy constructor. - * @param rhs - */ - DataObject(const DataObject& rhs); - - /** - * @brief Move constructor. - * @param rhs - */ - DataObject(DataObject&& rhs); - - /** - * @brief Copy assignment. - * @param rhs - * @return - */ - DataObject& operator=(const DataObject& rhs); - - /** - * @brief Move assignment. - * @param rhs - * @return - */ - DataObject& operator=(DataObject&& rhs) noexcept; - - /** - * @brief Destructor. - */ - virtual ~DataObject() noexcept; - - /** - * @brief Returns a deep copy of the DataObject. - * @return DataObject* - */ - virtual std::shared_ptr deepCopy(const DataPath& copyPath) = 0; - - /** - * @brief Returns a shallow copy of the DataObject. - * @return DataObject* - */ - virtual DataObject* shallowCopy() = 0; - - /** - * @brief Returns typename of the DataObject as a std::string. - * @return std::string - */ - virtual std::string getTypeName() const = 0; - - /** - * @brief Returns the DataObject's ID value. - * @return IdType - */ - IdType getId() const; - - /** - * @brief Returns a pointer to the DataStructure this DataObject belongs to. - * @return DataStructure* - */ - DataStructure* getDataStructure(); - - /** - * @brief Returns a read-only pointer to the DataStructure this DataObject - * belongs to. - * @return const DataStructure* - */ - const DataStructure* getDataStructure() const; - - /** - * @brief Returns a pointer to the DataStructure this DataObject belongs to. - * @return DataStructure& - */ - DataStructure& getDataStructureRef(); - - /** - * @brief Returns a read-only pointer to the DataStructure this DataObject - * belongs to. - * @return const DataStructure& - */ - const DataStructure& getDataStructureRef() const; - - /** - * @brief Returns the DataObject's name. - * @return std::string - */ - std::string getName() const; - - /** - * @brief Checks and returns if the DataObject can be renamed to the provided - * value. - * @param name - * @return bool - */ - bool canRename(const std::string& name) const; - - /** - * @brief Attempts to rename the DataObject to the provided value. - * @param name - * @return bool - */ - bool rename(const std::string& name); - - /** - * @brief Returns a collection of the parent containers that store the DataObject. - * @return ParentCollectionType - */ - ParentCollectionType getParentIds() const; - - /** - * @brief Clears the list of parent IDs. - */ - void clearParents(); - - /** - * @brief Returns a vector of DataPaths to the object. - * @return std::vector - */ - std::vector getDataPaths() const; - - /** - * @brief Returns a reference to the object's Metadata. - * @return Metadata& - */ - Metadata& getMetadata(); - - /** - * @brief Returns a reference to the object's Metadata. - * @return const Metadata& - */ - const Metadata& getMetadata() const; - - bool hasParent(const DataPath& parentPath) const; - - /** - * @brief Flushes the DataObject to its respective target. - * In-memory DataObjects are not affected. - */ - virtual void flush() const; - - virtual uint64 memoryUsage() const; - -protected: - /** - * @brief DataObject constructor takes a reference to the DataStructure and - * object name. - * @param dataStructure - * @param name - */ - DataObject(DataStructure& dataStructure, std::string name); - - /** - * @brief DataObject constructor takes a reference to the DataStructure, - * object name, and object ID. - * @param dataStructure - * @param name - * @param importId - */ - DataObject(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief Updates the data ID for lookup within the DataStructure. - * This method should only be called from within the DataStructure. - * @param newId - */ - void setId(IdType newId); - - /** - * @brief Notifies the DataObject of DataObject IDs that have been changed by the DataStructure. - * @param updatedIdsMap std::unordered_map containing the mappings between the old IDs and the new IDs - */ - void checkUpdatedIds(const std::unordered_map& updatedIdsMap); - - /** - * @brief Calls specialized checks for derived classes. Should only be called by checkUpdatedIds. - * @param updatedIds - */ - virtual void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap); - - /** - * @brief Attempts to add the specified DataObject to the target DataStructure. - * If a parentId is provided, then the DataObject will be added as a child to - * the target DataObject. Otherwise, the DataObject will be added directly - * under the DataStructure. If the DataObject is added successfully, the - * target parent will take ownership of the added DataObject. - * - * Returns true if the operation succeeds. Returns false otherwise. - * @param dataStructure - * @param data - * @param parentId - * @return bool - */ - static bool AttemptToAddObject(DataStructure& ds, const std::shared_ptr& data, const OptionalId& parentId); - - /** - * @brief Marks the specified BaseGroup as a parent. - * If this object is already parented to the given group, this function does nothing. - * @param parent - */ - void addParent(BaseGroup* parent); - - /** - * @brief Removes the specified parent. - * @param parent - */ - void removeParent(BaseGroup* parent); - - /** - * @brief Replaces the specified parent with another BaseGroup. - * @param oldParent - * @param newParent - */ - void replaceParent(BaseGroup* oldParent, BaseGroup* newParent); - - /** - * @brief Sets a new DataStructure for the DataObject. - * @param dataStructure - */ - virtual void setDataStructure(DataStructure* dataStructure); - -private: - DataStructure* m_DataStructure = nullptr; - ParentCollectionType m_ParentList; - IdType m_Id = 0; - std::string m_Name; - Metadata m_Metadata; -}; -} // namespace nx::core diff --git a/src/simplnx/DataStructure/DataPath.cpp b/src/simplnx/DataStructure/DataPath.cpp index c5a7981c3c..3dc86bb243 100644 --- a/src/simplnx/DataStructure/DataPath.cpp +++ b/src/simplnx/DataStructure/DataPath.cpp @@ -1,7 +1,7 @@ #include "DataPath.hpp" #include "simplnx/Common/Types.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/Utilities/StringUtilities.hpp" #include @@ -23,7 +23,7 @@ DataPath::DataPath(std::vector path) { continue; } - if(!DataObject::IsValidName(item)) + if(!AbstractDataObject::IsValidName(item)) { throw std::invalid_argument(fmt::format("DataPath: Invalid DataObject name - [{}]. One of the DataObject names contains the '/' character.", fmt::join(path, ","))); } diff --git a/src/simplnx/DataStructure/DataPath.hpp b/src/simplnx/DataStructure/DataPath.hpp index cf2e460c1e..0986c67709 100644 --- a/src/simplnx/DataStructure/DataPath.hpp +++ b/src/simplnx/DataStructure/DataPath.hpp @@ -13,8 +13,8 @@ namespace nx::core /** * @class DataPath * @brief The DataPath class is designed to store a path through the - * DataStructure to reach a specific DataObject. There may be multiple paths - * to a DataObject, but by providing a path, it is possible to extrapolate + * DataStructure to reach a specific AbstractDataObject. There may be multiple paths + * to a AbstractDataObject, but by providing a path, it is possible to extrapolate * which set of siblings a user may be interested in or iterate over a data * group with common children names. */ @@ -35,7 +35,7 @@ class SIMPLNX_EXPORT DataPath DataPath(); /** - * @brief Creates a DataPath using a vector of DataObject names. + * @brief Creates a DataPath using a vector of AbstractDataObject names. * @param path */ DataPath(std::vector path); diff --git a/src/simplnx/DataStructure/DataStructure.cpp b/src/simplnx/DataStructure/DataStructure.cpp index 3127121bae..d79707962f 100644 --- a/src/simplnx/DataStructure/DataStructure.cpp +++ b/src/simplnx/DataStructure/DataStructure.cpp @@ -1,11 +1,11 @@ #include "DataStructure.hpp" #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/LinkedPath.hpp" #include "simplnx/DataStructure/Messaging/DataAddedMessage.hpp" #include "simplnx/DataStructure/Messaging/DataRemovedMessage.hpp" @@ -41,13 +41,13 @@ DataStructure::DataStructure(const DataStructure& dataStructure) { // Hold a shared_ptr copy of the DataObjects long enough for // m_RootGroup.setDataStructure(this) to operate. - std::map> sharedData; + std::map> sharedData; for(const auto& [identifier, dataWkPtr] : dataStructure.m_DataObjects) { auto dataPtr = dataWkPtr.lock(); if(dataPtr != nullptr) { - auto copy = std::shared_ptr(dataPtr->shallowCopy()); + auto copy = std::shared_ptr(dataPtr->shallowCopy()); sharedData[identifier] = copy; m_DataObjects[identifier] = copy; } @@ -81,12 +81,12 @@ DataStructure::~DataStructure() } } -DataObject::IdType DataStructure::generateId() +AbstractDataObject::IdType DataStructure::generateId() { return m_NextId++; } -void DataStructure::setNextId(DataObject::IdType nextDataId) +void DataStructure::setNextId(AbstractDataObject::IdType nextDataId) { m_NextId = nextDataId; } @@ -106,13 +106,13 @@ void DataStructure::clear() m_DataObjects.clear(); } -std::optional DataStructure::getId(const DataPath& path) const +std::optional DataStructure::getId(const DataPath& path) const { if(path.empty()) { return {0}; } - const DataObject* dataObject = getData(path); + const AbstractDataObject* dataObject = getData(path); if(nullptr == dataObject) { return std::nullopt; @@ -124,8 +124,8 @@ LinkedPath DataStructure::getLinkedPath(const DataPath& path) const { try { - std::vector pathIds; - const DataObject* data = m_RootGroup[path[0]]; + std::vector pathIds; + const AbstractDataObject* data = m_RootGroup[path[0]]; const BaseGroup* parent = dynamic_cast(data); pathIds.push_back(data->getId()); @@ -145,7 +145,7 @@ LinkedPath DataStructure::getLinkedPath(const DataPath& path) const } } -bool DataStructure::containsData(DataObject::IdType identifier) const +bool DataStructure::containsData(AbstractDataObject::IdType identifier) const { return getData(identifier) != nullptr; } @@ -157,13 +157,13 @@ bool DataStructure::containsData(const DataPath& path) const Result DataStructure::makePath(const DataPath& path) { - std::vector createdIds; + std::vector createdIds; try { - std::vector pathIds; + std::vector pathIds; std::string name = path[0]; - const DataObject* data = m_RootGroup[name]; + const AbstractDataObject* data = m_RootGroup[name]; if(data == nullptr) { data = nx::core::DataGroup::Create(*this, name); @@ -203,7 +203,7 @@ Result DataStructure::makePath(const DataPath& path) } } -std::vector DataStructure::getDataPathsForId(DataObject::IdType identifier) const +std::vector DataStructure::getDataPathsForId(AbstractDataObject::IdType identifier) const { auto* dataObject = getData(identifier); if(dataObject == nullptr) @@ -230,9 +230,9 @@ std::vector DataStructure::getAllDataPaths() const return dataPaths; } -std::vector DataStructure::getAllDataObjectIds() const +std::vector DataStructure::getAllDataObjectIds() const { - std::vector dataIds; + std::vector dataIds; dataIds.reserve(m_DataObjects.size()); for(const auto& [identifier, weakPtr] : m_DataObjects) { @@ -241,7 +241,7 @@ std::vector DataStructure::getAllDataObjectIds() const return dataIds; } -DataObject* DataStructure::getData(DataObject::IdType identifier) +AbstractDataObject* DataStructure::getData(AbstractDataObject::IdType identifier) { auto iter = m_DataObjects.find(identifier); if(m_DataObjects.end() == iter) @@ -251,7 +251,7 @@ DataObject* DataStructure::getData(DataObject::IdType identifier) return iter->second.lock().get(); } -DataObject* DataStructure::getData(const std::optional& identifier) +AbstractDataObject* DataStructure::getData(const std::optional& identifier) { if(!identifier) { @@ -266,13 +266,13 @@ DataObject* DataStructure::getData(const std::optional& iden return iter->second.lock().get(); } -DataObject* DataStructure::getData(const DataPath& path) +AbstractDataObject* DataStructure::getData(const DataPath& path) { if(path.empty()) { return nullptr; } - DataObject* targetObject = m_RootGroup[path[0]]; + AbstractDataObject* targetObject = m_RootGroup[path[0]]; for(usize index = 1; index < path.getLength(); index++) { if(targetObject == nullptr) @@ -284,7 +284,7 @@ DataObject* DataStructure::getData(const DataPath& path) return nullptr; } auto* groupObject = static_cast(targetObject); - DataObject* childObject = (*groupObject)[path[index]]; + AbstractDataObject* childObject = (*groupObject)[path[index]]; if(childObject == nullptr) { return nullptr; @@ -295,9 +295,9 @@ DataObject* DataStructure::getData(const DataPath& path) return targetObject; } -DataObject& DataStructure::getDataRef(const DataPath& path) +AbstractDataObject& DataStructure::getDataRef(const DataPath& path) { - DataObject* object = getData(path); + AbstractDataObject* object = getData(path); if(object == nullptr) { throw std::out_of_range(fmt::format("DataStructure::getDataRef(): Input Path '{}' does not exist", path.toString())); @@ -305,9 +305,9 @@ DataObject& DataStructure::getDataRef(const DataPath& path) return *object; } -DataObject& DataStructure::getDataRef(DataObject::IdType identifier) +AbstractDataObject& DataStructure::getDataRef(AbstractDataObject::IdType identifier) { - DataObject* object = getData(identifier); + AbstractDataObject* object = getData(identifier); if(object == nullptr) { throw std::out_of_range(fmt::format("DataStructure::getDataRef(): Id '{}' does not exist", identifier)); @@ -315,12 +315,12 @@ DataObject& DataStructure::getDataRef(DataObject::IdType identifier) return *object; } -DataObject* DataStructure::getData(const LinkedPath& path) +AbstractDataObject* DataStructure::getData(const LinkedPath& path) { return getData(path.getId()); } -const DataObject* DataStructure::getData(DataObject::IdType identifier) const +const AbstractDataObject* DataStructure::getData(AbstractDataObject::IdType identifier) const { auto iter = m_DataObjects.find(identifier); if(m_DataObjects.end() == iter) @@ -330,7 +330,7 @@ const DataObject* DataStructure::getData(DataObject::IdType identifier) const return iter->second.lock().get(); } -const DataObject* DataStructure::getData(const std::optional& identifier) const +const AbstractDataObject* DataStructure::getData(const std::optional& identifier) const { if(!identifier) { @@ -345,13 +345,13 @@ const DataObject* DataStructure::getData(const std::optional return iter->second.lock().get(); } -const DataObject* DataStructure::getData(const DataPath& path) const +const AbstractDataObject* DataStructure::getData(const DataPath& path) const { if(path.empty()) { return nullptr; } - const DataObject* targetObject = m_RootGroup[path[0]]; + const AbstractDataObject* targetObject = m_RootGroup[path[0]]; for(usize index = 1; index < path.getLength(); index++) { if(targetObject == nullptr) @@ -363,7 +363,7 @@ const DataObject* DataStructure::getData(const DataPath& path) const return nullptr; } const auto* groupObject = static_cast(targetObject); - const DataObject* childObject = (*groupObject)[path[index]]; + const AbstractDataObject* childObject = (*groupObject)[path[index]]; if(childObject == nullptr) { return nullptr; @@ -374,9 +374,9 @@ const DataObject* DataStructure::getData(const DataPath& path) const return targetObject; } -const DataObject& DataStructure::getDataRef(const DataPath& path) const +const AbstractDataObject& DataStructure::getDataRef(const DataPath& path) const { - const DataObject* object = getData(path); + const AbstractDataObject* object = getData(path); if(object == nullptr) { throw std::out_of_range(fmt::format("DataStructure::getDataRef(): Input Path '{}' does not exist", path.toString())); @@ -384,9 +384,9 @@ const DataObject& DataStructure::getDataRef(const DataPath& path) const return *object; } -const DataObject& DataStructure::getDataRef(DataObject::IdType identifier) const +const AbstractDataObject& DataStructure::getDataRef(AbstractDataObject::IdType identifier) const { - const DataObject* object = getData(identifier); + const AbstractDataObject* object = getData(identifier); if(object == nullptr) { throw std::out_of_range(fmt::format("DataStructure::getDataRef(): Id '{}' does not exist", identifier)); @@ -394,12 +394,12 @@ const DataObject& DataStructure::getDataRef(DataObject::IdType identifier) const return *object; } -const DataObject* DataStructure::getData(const LinkedPath& path) const +const AbstractDataObject* DataStructure::getData(const LinkedPath& path) const { return path.getData(); } -std::shared_ptr DataStructure::getSharedData(DataObject::IdType id) +std::shared_ptr DataStructure::getSharedData(AbstractDataObject::IdType id) { if(m_DataObjects.find(id) == m_DataObjects.end()) { @@ -408,7 +408,7 @@ std::shared_ptr DataStructure::getSharedData(DataObject::IdType id) return m_DataObjects.at(id).lock(); } -std::shared_ptr DataStructure::getSharedData(DataObject::IdType id) const +std::shared_ptr DataStructure::getSharedData(AbstractDataObject::IdType id) const { if(m_DataObjects.find(id) == m_DataObjects.end()) { @@ -417,7 +417,7 @@ std::shared_ptr DataStructure::getSharedData(DataObject::IdTyp return m_DataObjects.at(id).lock(); } -std::shared_ptr DataStructure::getSharedData(const DataPath& path) +std::shared_ptr DataStructure::getSharedData(const DataPath& path) { auto dataObject = getData(path); if(dataObject == nullptr) @@ -427,7 +427,7 @@ std::shared_ptr DataStructure::getSharedData(const DataPath& path) return m_DataObjects.at(dataObject->getId()).lock(); } -std::shared_ptr DataStructure::getSharedData(const DataPath& path) const +std::shared_ptr DataStructure::getSharedData(const DataPath& path) const { auto dataObject = getData(path); if(dataObject == nullptr) @@ -437,13 +437,13 @@ std::shared_ptr DataStructure::getSharedData(const DataPath& p return m_DataObjects.at(dataObject->getId()).lock(); } -bool DataStructure::removeData(DataObject::IdType identifier) +bool DataStructure::removeData(AbstractDataObject::IdType identifier) { - DataObject* data = getData(identifier); + AbstractDataObject* data = getData(identifier); return removeData(data); } -void DataStructure::setData(DataObject::IdType identifier, std::shared_ptr dataObject) +void DataStructure::setData(AbstractDataObject::IdType identifier, std::shared_ptr dataObject) { if(dataObject == nullptr) { @@ -454,7 +454,7 @@ void DataStructure::setData(DataObject::IdType identifier, std::shared_ptr& identifier) +bool DataStructure::removeData(const std::optional& identifier) { if(!identifier) { @@ -468,11 +468,11 @@ bool DataStructure::removeData(const std::optional& identifi bool DataStructure::removeData(const DataPath& path) { - DataObject* data = getData(path); + AbstractDataObject* data = getData(path); return removeData(data); } -bool DataStructure::removeData(DataObject* data) +bool DataStructure::removeData(AbstractDataObject* data) { if(data == nullptr) { @@ -485,7 +485,7 @@ bool DataStructure::removeData(DataObject* data) { return removeTopLevel(data); } - for(DataObject::IdType parentId : parentIds) + for(AbstractDataObject::IdType parentId : parentIds) { auto parent = getDataAs(parentId); if(!parent->remove(data)) @@ -497,7 +497,7 @@ bool DataStructure::removeData(DataObject* data) return true; } -void DataStructure::dataDeleted(DataObject::IdType identifier, const std::string& name) +void DataStructure::dataDeleted(AbstractDataObject::IdType identifier, const std::string& name) { if(!m_IsValid) { @@ -508,9 +508,9 @@ void DataStructure::dataDeleted(DataObject::IdType identifier, const std::string notify(msg); } -std::vector DataStructure::getTopLevelData() const +std::vector DataStructure::getTopLevelData() const { - std::vector topLevel(m_RootGroup.getSize(), nullptr); + std::vector topLevel(m_RootGroup.getSize(), nullptr); usize index = 0; for(auto& iter : m_RootGroup) { @@ -530,7 +530,7 @@ DataMap& DataStructure::getRootGroup() return m_RootGroup; } -bool DataStructure::insertTopLevel(const std::shared_ptr& obj) +bool DataStructure::insertTopLevel(const std::shared_ptr& obj) { if(obj == nullptr) { @@ -545,7 +545,7 @@ bool DataStructure::insertTopLevel(const std::shared_ptr& obj) return m_RootGroup.insert(obj); } -bool DataStructure::removeTopLevel(DataObject* data) +bool DataStructure::removeTopLevel(AbstractDataObject* data) { std::string name = data->getName(); if(!m_RootGroup.remove(data)) @@ -558,7 +558,7 @@ bool DataStructure::removeTopLevel(DataObject* data) return true; } -bool DataStructure::finishAddingObject(const std::shared_ptr& dataObject, const std::optional& parent) +bool DataStructure::finishAddingObject(const std::shared_ptr& dataObject, const std::optional& parent) { if(parent.has_value() && containsData(*parent)) { @@ -603,7 +603,7 @@ DataStructure::ConstIterator DataStructure::end() const return m_RootGroup.end(); } -bool DataStructure::insert(const std::shared_ptr& dataObject, const DataPath& dataPath) +bool DataStructure::insert(const std::shared_ptr& dataObject, const DataPath& dataPath) { if(dataObject == nullptr) { @@ -620,7 +620,7 @@ bool DataStructure::insert(const std::shared_ptr& dataObject, const dataObject->setId(generateId()); } - // Clears the DataObject's parent IDs to avoid clashes. + // Clears the AbstractDataObject's parent IDs to avoid clashes. dataObject->clearParents(); if(dataPath.empty()) @@ -632,12 +632,12 @@ bool DataStructure::insert(const std::shared_ptr& dataObject, const return insertIntoParent(dataObject, parentGroup); } -DataObject::IdType DataStructure::getNextId() const +AbstractDataObject::IdType DataStructure::getNextId() const { return m_NextId; } -bool DataStructure::insertIntoRoot(const std::shared_ptr& dataObject) +bool DataStructure::insertIntoRoot(const std::shared_ptr& dataObject) { if(dataObject == nullptr) { @@ -651,7 +651,7 @@ bool DataStructure::insertIntoRoot(const std::shared_ptr& dataObject trackDataObject(dataObject); return true; } -bool DataStructure::insertIntoParent(const std::shared_ptr& dataObject, BaseGroup* parentGroup) +bool DataStructure::insertIntoParent(const std::shared_ptr& dataObject, BaseGroup* parentGroup) { if(parentGroup == nullptr) { @@ -666,7 +666,7 @@ bool DataStructure::insertIntoParent(const std::shared_ptr& dataObje return true; } -void DataStructure::trackDataObject(const std::shared_ptr& dataObject) +void DataStructure::trackDataObject(const std::shared_ptr& dataObject) { if(dataObject == nullptr) { @@ -683,7 +683,7 @@ void DataStructure::trackDataObject(const std::shared_ptr& dataObjec dataObject->setDataStructure(this); } -bool DataStructure::setAdditionalParent(DataObject::IdType targetId, DataObject::IdType newParentId) +bool DataStructure::setAdditionalParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType newParentId) { auto& target = m_DataObjects[targetId]; auto newParent = dynamic_cast(getData(newParentId)); @@ -701,7 +701,7 @@ bool DataStructure::setAdditionalParent(DataObject::IdType targetId, DataObject: return true; } -bool DataStructure::removeParent(DataObject::IdType targetId, DataObject::IdType parentId) +bool DataStructure::removeParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType parentId) { const auto& target = m_DataObjects[targetId]; const auto parent = dynamic_cast(getData(parentId)); @@ -740,13 +740,13 @@ DataStructure& DataStructure::operator=(const DataStructure& rhs) // Hold a shared_ptr copy of the DataObjects long enough for // m_RootGroup.setDataStructure(this) to operate. - std::map> sharedData; + std::map> sharedData; for(auto& [identifier, dataWkPtr] : rhs.m_DataObjects) { auto dataPtr = dataWkPtr.lock(); if(dataPtr != nullptr) { - auto copy = std::shared_ptr(dataPtr->shallowCopy()); + auto copy = std::shared_ptr(dataPtr->shallowCopy()); sharedData[identifier] = copy; m_DataObjects[identifier] = copy; } @@ -787,14 +787,14 @@ nonstd::expected DataStructure::validateNumberOfTuples(const { auto* dataObject = getData(dataPath); - const DataObject::Type dataObjectType = dataObject->getDataObjectType(); + const AbstractDataObject::Type dataObjectType = dataObject->getDataObjectType(); size_t numTuples = 0; - if(dataObjectType == DataObject::Type::NeighborList || dataObjectType == DataObject::Type::StringArray || dataObjectType == DataObject::Type::DataArray) + if(dataObjectType == IDataObject::Type::NeighborList || dataObjectType == IDataObject::Type::StringArray || dataObjectType == IDataObject::Type::DataArray) { - const auto* dataArrayPtr = getDataAs(dataPath); + const auto* dataArrayPtr = getDataAs(dataPath); numTuples = dataArrayPtr->getNumberOfTuples(); } - else // We can only check DataObject subclasses that hold items that can be expressed as getNumberOfTuples(); + else // We can only check AbstractDataObject subclasses that hold items that can be expressed as getNumberOfTuples(); { message << "Only NeighborList, StringArray and DataArray can be validated for tuple counts\n"; return {nonstd::make_unexpected(message.str())}; @@ -819,7 +819,7 @@ nonstd::expected DataStructure::validateNumberOfTuples(const return {}; } -void DataStructure::resetIds(DataObject::IdType startingId) +void DataStructure::resetIds(AbstractDataObject::IdType startingId) { // 0 is reserved if(startingId == 0) @@ -829,9 +829,9 @@ void DataStructure::resetIds(DataObject::IdType startingId) m_NextId = startingId; - // Update DataObject IDs and track changes + // Update AbstractDataObject IDs and track changes WeakCollectionType newCollection; - std::unordered_map updatedIdsMap; + std::unordered_map updatedIdsMap; for(auto& dataObjectIter : m_DataObjects) { auto dataObjectPtr = dataObjectIter.second.lock(); @@ -957,7 +957,7 @@ void DataStructure::flush() const { for(const auto& weakPtr : m_DataObjects) { - std::shared_ptr sharedObj = weakPtr.second.lock(); + std::shared_ptr sharedObj = weakPtr.second.lock(); if(sharedObj == nullptr) { continue; @@ -994,7 +994,7 @@ Result<> DataStructure::transferDataArraysOoc() for(const auto& dataIter : m_DataObjects) { auto dataPtr = dataIter.second.lock(); - auto dataArrayPtr = std::dynamic_pointer_cast(dataPtr); + auto dataArrayPtr = std::dynamic_pointer_cast(dataPtr); if(dataArrayPtr == nullptr) { continue; @@ -1010,7 +1010,7 @@ Result<> DataStructure::transferDataArraysOoc() Result<> DataStructure::validateGeometries() const { - /** There is an assumption about the range of the DataObject::Type enumeration. That assumption + /** There is an assumption about the range of the AbstractDataObject::Type enumeration. That assumption * is backed up by a static_assert test case for the unit tests. If the enumeration is changed * the compile will fail if the unit tests are enabled. Which they are on all the CI machines. */ @@ -1018,9 +1018,9 @@ Result<> DataStructure::validateGeometries() const for(const auto& dataObject : m_RootGroup) { auto dataObjectType = dataObject.second->getDataObjectType(); - if(dataObjectType >= DataObject::Type::IGeometry && dataObjectType <= DataObject::Type::TetrahedralGeom) + if(dataObjectType >= IDataObject::Type::AbstractGeometry && dataObjectType <= IDataObject::Type::TetrahedralGeom) { - auto* geomPtr = dynamic_cast(dataObject.second.get()); + auto* geomPtr = dynamic_cast(dataObject.second.get()); result = MergeResults(geomPtr->validate(), result); } } @@ -1036,7 +1036,7 @@ Result<> DataStructure::validateAttributeMatrices() const if(dataObjectSharedPtr.get() != nullptr) { auto dataObjectType = dataObjectSharedPtr->getDataObjectType(); - if(dataObjectType == DataObject::Type::AttributeMatrix) + if(dataObjectType == IDataObject::Type::AttributeMatrix) { auto* attrMatPtr = dynamic_cast(dataObject.second.lock().get()); if(nullptr != attrMatPtr) diff --git a/src/simplnx/DataStructure/DataStructure.hpp b/src/simplnx/DataStructure/DataStructure.hpp index 10197d7d29..05b1bb39ea 100644 --- a/src/simplnx/DataStructure/DataStructure.hpp +++ b/src/simplnx/DataStructure/DataStructure.hpp @@ -1,8 +1,9 @@ #pragma once #include "simplnx/Common/Result.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataMap.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/IDataStructure.hpp" #include "simplnx/DataStructure/LinkedPath.hpp" #include "simplnx/simplnx_export.hpp" @@ -40,20 +41,20 @@ inline const std::string k_ImportableTag = "Importable"; * geometries, and scalars are added to the structure. The DataStructure allows * parents to be added to or removed from DataObjects. */ -class SIMPLNX_EXPORT DataStructure +class SIMPLNX_EXPORT DataStructure : public IDataStructure { - using WeakCollectionType = std::map>; + using WeakCollectionType = std::map>; protected: /** - * @brief Finalizes adding a DataObject to the DataStructure. This should + * @brief Finalizes adding a AbstractDataObject to the DataStructure. This should * be called by the create* methods to prevent duplicating code. Returns * true if the data was successfully added. Returns false otherwise. * @param obj * @param parent = {} * @return bool */ - bool finishAddingObject(const std::shared_ptr& obj, const std::optional& parent = {}); + bool finishAddingObject(const std::shared_ptr& obj, const std::optional& parent = {}); public: using SignalType = nod::signal&)>; @@ -61,7 +62,7 @@ class SIMPLNX_EXPORT DataStructure using ConstIterator = DataMap::ConstIterator; friend class DataMap; - friend class DataObject; + friend class AbstractDataObject; /** * @brief Default constructor @@ -83,69 +84,69 @@ class SIMPLNX_EXPORT DataStructure /** * @brief */ - ~DataStructure(); + ~DataStructure() override; /** * @brief Returns the number of unique DataObjects in the DataStructure. * @return usize */ - usize getSize() const; + usize getSize() const override; /** * @brief Clears the DataStructure by removing all DataObjects. The next - * DataObject ID remains unchanged after the operation. + * AbstractDataObject ID remains unchanged after the operation. */ - void clear(); + void clear() override; /** - * @brief Returns the IdType for the DataObject found at the specified DataPath. The + * @brief Returns the IdType for the AbstractDataObject found at the specified DataPath. The * return type is optional for cases where the DataPath does not point to a - * DataObject. If no DataObject is found at the path, an empty optional object is + * AbstractDataObject. If no AbstractDataObject is found at the path, an empty optional object is * returned. * @param path * @return std::optional */ - std::optional getId(const DataPath& path) const; + std::optional getId(const DataPath& path) const override; /** - * @brief Returns true if the DataStructure contains a DataObject with the + * @brief Returns true if the DataStructure contains a AbstractDataObject with the * given key. Returns false otherwise. * @param identifier * @return bool */ - bool containsData(DataObject::IdType identifier) const; + bool containsData(AbstractDataObject::IdType identifier) const override; /** - * @brief Returns true if the DataStructure contains a DataObject with the + * @brief Returns true if the DataStructure contains a AbstractDataObject with the * given path. Returns false otherwise. - * @param path The DataPath to the DataObject + * @param path The DataPath to the AbstractDataObject * @return bool */ - bool containsData(const DataPath& path) const; + bool containsData(const DataPath& path) const override; /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * @param identifier - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* getData(DataObject::IdType identifier); + AbstractDataObject* getData(AbstractDataObject::IdType identifier) override; /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * @param identifier * @return T* */ template - inline T* getDataAs(DataObject::IdType identifier) + inline T* getDataAs(AbstractDataObject::IdType identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T @@ -153,36 +154,36 @@ class SIMPLNX_EXPORT DataStructure * @return T* */ template - T* getDataAsUnsafe(DataObject::IdType identifier) + T* getDataAsUnsafe(AbstractDataObject::IdType identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * @param identifier - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* getData(const std::optional& identifier); + AbstractDataObject* getData(const std::optional& identifier) override; /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * @param identifier * @return T* */ template - inline T* getDataAs(const std::optional& identifier) + inline T* getDataAs(const std::optional& identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); auto* object = getData(identifier); return dynamic_cast(object); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T @@ -190,53 +191,53 @@ class SIMPLNX_EXPORT DataStructure * @return T* */ template - T* getDataAsUnsafe(const std::optional& identifier) + T* getDataAsUnsafe(const std::optional& identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); auto* object = getData(identifier); return static_cast(object); } /** - * @brief Returns a pointer to the DataObject at the given DataPath. If no - * DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method returns nullptr. * @param path - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* getData(const DataPath& path); + AbstractDataObject* getData(const DataPath& path) override; /** - * @brief Returns a reference to the DataObject at the given DataPath. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param path - * @return DataObject& + * @return AbstractDataObject& */ - DataObject& getDataRef(const DataPath& path); + AbstractDataObject& getDataRef(const DataPath& path) override; /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param identifier - * @return DataObject& + * @return AbstractDataObject& */ - DataObject& getDataRef(DataObject::IdType identifier); + AbstractDataObject& getDataRef(AbstractDataObject::IdType identifier) override; /** - * @brief Returns a pointer to the DataObject at the given DataPath. If no - * DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method returns nullptr. * @param path * @return T* */ template inline T* getDataAs(const DataPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(path)); } /** - * @brief Returns a pointer to the DataObject at the given DataPath. If no - * DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param path @@ -245,26 +246,26 @@ class SIMPLNX_EXPORT DataStructure template T* getDataAsUnsafe(const DataPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(path)); } /** - * @brief Returns a reference to the DataObject at the given DataPath. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param path * @return T& */ template inline T& getDataRefAs(const DataPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getDataRef(path)); } /** - * @brief Returns a reference to the DataObject at the given DataPath. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method throws std::out_of_range. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param path @@ -273,62 +274,62 @@ class SIMPLNX_EXPORT DataStructure template T& getDataRefAsUnsafe(const DataPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getDataRef(path)); } /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param identifier * @return T& */ template - T& getDataRefAs(DataObject::IdType identifier) + T& getDataRefAs(AbstractDataObject::IdType identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getDataRef(identifier)); } /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param identifier * @return T& */ template - T& getDataRefAsUnsafe(DataObject::IdType identifier) + T& getDataRefAsUnsafe(AbstractDataObject::IdType identifier) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getDataRef(identifier)); } /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * @param path - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* getData(const LinkedPath& path); + AbstractDataObject* getData(const LinkedPath& path) override; /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * @param path * @return T* */ template inline T* getDataAs(const LinkedPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(path)); } /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param path @@ -337,33 +338,33 @@ class SIMPLNX_EXPORT DataStructure template T* getDataAsUnsafe(const LinkedPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(path)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * @param identifier - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* getData(DataObject::IdType identifier) const; + const AbstractDataObject* getData(AbstractDataObject::IdType identifier) const override; /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * @param identifier * @return const T* */ template - inline const T* getDataAs(DataObject::IdType identifier) const + inline const T* getDataAs(AbstractDataObject::IdType identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T @@ -371,35 +372,35 @@ class SIMPLNX_EXPORT DataStructure * @return const T* */ template - const T* getDataAsUnsafe(DataObject::IdType identifier) const + const T* getDataAsUnsafe(AbstractDataObject::IdType identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * @param identifier - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* getData(const std::optional& identifier) const; + const AbstractDataObject* getData(const std::optional& identifier) const override; /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * @param identifier * @return const T* */ template - inline const T* getDataAs(const std::optional& identifier) const + inline const T* getDataAs(const std::optional& identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject with the specified IdType. + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. * If no such object exists, or no ID is provided, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T @@ -407,38 +408,38 @@ class SIMPLNX_EXPORT DataStructure * @return const T* */ template - const T* getDataAsUnsafe(const std::optional& identifier) const + const T* getDataAsUnsafe(const std::optional& identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(identifier)); } /** - * @brief Returns a pointer to the DataObject at the given DataPath. If no - * DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method returns nullptr. * @param path - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* getData(const DataPath& path) const; + const AbstractDataObject* getData(const DataPath& path) const override; /** - * @brief Returns a reference to the DataObject at the given DataPath. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param path - * @return const DataObject& + * @return const AbstractDataObject& */ - const DataObject& getDataRef(const DataPath& path) const; + const AbstractDataObject& getDataRef(const DataPath& path) const override; /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param identifier - * @return const DataObject& + * @return const AbstractDataObject& */ - const DataObject& getDataRef(DataObject::IdType identifier) const; + const AbstractDataObject& getDataRef(AbstractDataObject::IdType identifier) const override; /** - * @brief Returns a pointer to the DataObject at the given DataPath. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. * * @throws std::out_of_range if path does not exist * @throws std::bad_cast If the object at path cannnot be dynamic_cast<> to the input type @@ -449,12 +450,12 @@ class SIMPLNX_EXPORT DataStructure template inline const T* getDataAs(const DataPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(path)); } /** - * @brief Returns a pointer to the DataObject at the given DataPath. + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param path @@ -463,12 +464,12 @@ class SIMPLNX_EXPORT DataStructure template const T* getDataAsUnsafe(const DataPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(path)); } /** - * @brief Returns a reference to the DataObject at the given DataPath. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. * * @throws std::out_of_range if path does not exist * @throws std::bad_cast If the object at path cannnot be dynamic_cast<> to the input type @@ -479,12 +480,12 @@ class SIMPLNX_EXPORT DataStructure template inline const T& getDataRefAs(const DataPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getDataRef(path)); } /** - * @brief Returns a reference to the DataObject at the given DataPath. + * @brief Returns a reference to the AbstractDataObject at the given DataPath. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @throws std::out_of_range if path does not exist @@ -494,62 +495,62 @@ class SIMPLNX_EXPORT DataStructure template const T& getDataRefAsUnsafe(const DataPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getDataRef(path)); } /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * @param identifier * @return T& */ template - const T& getDataRefAs(DataObject::IdType identifier) const + const T& getDataRefAs(AbstractDataObject::IdType identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getDataRef(identifier)); } /** - * @brief Returns a reference to the DataObject with the given identifier. If no - * DataObject is found, this method throws std::out_of_range. + * @brief Returns a reference to the AbstractDataObject with the given identifier. If no + * AbstractDataObject is found, this method throws std::out_of_range. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param identifier * @return T& */ template - const T& getDataRefAsUnsafe(DataObject::IdType identifier) const + const T& getDataRefAsUnsafe(AbstractDataObject::IdType identifier) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getDataRef(identifier)); } /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * @param path - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* getData(const LinkedPath& path) const; + const AbstractDataObject* getData(const LinkedPath& path) const override; /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * @param path * @return const T* */ template inline const T* getDataAs(const LinkedPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return dynamic_cast(getData(path)); } /** - * @brief Returns a pointer to the DataObject found at the specified - * LinkedPath. If no such DataObject is found, this method returns nullptr. + * @brief Returns a pointer to the AbstractDataObject found at the specified + * LinkedPath. If no such AbstractDataObject is found, this method returns nullptr. * PERFORMS NO CHECKS ON THE TYPE OF DATAOBJECT RETURNED * ONLY USE WHEN THE TYPE IS ALREADY GUARENTEED TO BE T * @param path @@ -558,158 +559,158 @@ class SIMPLNX_EXPORT DataStructure template const T* getDataAsUnsafe(const LinkedPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return static_cast(getData(path)); } /** - * @brief Returns the shared pointer for the specified DataObject. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the specified AbstractDataObject. + * Returns nullptr if no AbstractDataObject is found. * - * Use getData(DataObject::IdType) instead. This was only made public for + * Use getData(AbstractDataObject::IdType) instead. This was only made public for * use in visualization where select data might need to be preserved beyond * the rest of the DataStructure. * @param identifier - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getSharedData(DataObject::IdType id); + std::shared_ptr getSharedData(AbstractDataObject::IdType id) override; /** - * @brief Returns the shared pointer for the specified DataObject. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the specified AbstractDataObject. + * Returns nullptr if no AbstractDataObject is found. * - * Use getData(DataObject::IdType) instead. This was only made public for + * Use getData(AbstractDataObject::IdType) instead. This was only made public for * use in visualization where select data might need to be preserved beyond * the rest of the DataStructure. * @param id - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getSharedData(DataObject::IdType id) const; + std::shared_ptr getSharedData(AbstractDataObject::IdType id) const override; /** - * @brief Returns the shared pointer for the specified DataObject. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the specified AbstractDataObject. + * Returns nullptr if no AbstractDataObject is found. * - * Use getData(DataObject::IdType) instead. This was only made public for + * Use getData(AbstractDataObject::IdType) instead. This was only made public for * use in visualization where select data might need to be preserved beyond * the rest of the DataStructure. * @param id - * @return std::shared_ptr + * @return std::shared_ptr */ template - std::shared_ptr getSharedDataAs(DataObject::IdType id) + std::shared_ptr getSharedDataAs(AbstractDataObject::IdType id) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return std::dynamic_pointer_cast(getSharedData(id)); } /** - * @brief Returns the shared pointer for the specified DataObject. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the specified AbstractDataObject. + * Returns nullptr if no AbstractDataObject is found. * - * Use getData(DataObject::IdType) instead. This was only made public for + * Use getData(AbstractDataObject::IdType) instead. This was only made public for * use in visualization where select data might need to be preserved beyond * the rest of the DataStructure. * @param id - * @return std::shared_ptr + * @return std::shared_ptr */ template - std::shared_ptr getSharedDataAs(DataObject::IdType id) const + std::shared_ptr getSharedDataAs(AbstractDataObject::IdType id) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return std::dynamic_pointer_cast(getSharedData(id)); } /** - * @brief Returns the shared pointer for the DataObject at the target path. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * Returns nullptr if no AbstractDataObject is found. * * Use getData(const DataPath&) instead. This was only made public for - * use in importing a DataObject from another DataStructure when select data + * use in importing a AbstractDataObject from another DataStructure when select data * needs to be preserved beyond the imported DataStructure. * @param path - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getSharedData(const DataPath& path); + std::shared_ptr getSharedData(const DataPath& path) override; /** - * @brief Returns the shared pointer for the DataObject at the target path. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * Returns nullptr if no AbstractDataObject is found. * * Use getData(const DataPath&) instead. This was only made public for - * use in importing a DataObject from another DataStructure when select data + * use in importing a AbstractDataObject from another DataStructure when select data * needs to be preserved beyond the imported DataStructure. * @param path - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getSharedData(const DataPath& path) const; + std::shared_ptr getSharedData(const DataPath& path) const override; /** - * @brief Returns the shared pointer for the DataObject at the target path. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * Returns nullptr if no AbstractDataObject is found. * * Use getData(const DataPath&) instead. This was only made public for - * use in importing a DataObject from another DataStructure when select data + * use in importing a AbstractDataObject from another DataStructure when select data * needs to be preserved beyond the imported DataStructure. * @param path - * @return std::shared_ptr + * @return std::shared_ptr */ template std::shared_ptr getSharedDataAs(const DataPath& path) { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return std::dynamic_pointer_cast(getSharedData(path)); } /** - * @brief Returns the shared pointer for the DataObject at the target path. - * Returns nullptr if no DataObject is found. + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * Returns nullptr if no AbstractDataObject is found. * * Use getData(const DataPath&) instead. This was only made public for - * use in importing a DataObject from another DataStructure when select data + * use in importing a AbstractDataObject from another DataStructure when select data * needs to be preserved beyond the imported DataStructure. * @param path - * @return std::shared_ptr + * @return std::shared_ptr */ template std::shared_ptr getSharedDataAs(const DataPath& path) const { - static_assert(std::is_base_of_v); + static_assert(std::is_base_of_v); return std::dynamic_pointer_cast(getSharedData(path)); } /** - * @brief Removes the DataObject using the specified IdType. Returns true + * @brief Removes the AbstractDataObject using the specified IdType. Returns true * if an object was found. Otherwise, returns false. * @param identifier * @return bool */ - bool removeData(DataObject::IdType identifier); + bool removeData(AbstractDataObject::IdType identifier) override; /** - * @brief Removes the DataObject using the specified IdType. Returns true + * @brief Removes the AbstractDataObject using the specified IdType. Returns true * if an object was found. Otherwise, returns false. If no ID is provided, * this returns false. * @param identifier * @return bool */ - bool removeData(const std::optional& identifier); + bool removeData(const std::optional& identifier) override; /** - * @brief Removes the DataObject using the specified DataPath. Returns true + * @brief Removes the AbstractDataObject using the specified DataPath. Returns true * if an object * was found. Otherwise, returns false. * @param path * @return bool */ - bool removeData(const DataPath& path); + bool removeData(const DataPath& path) override; /** * @brief Returns a LinkedPath based on the specified DataPath. * @param path * @return LinkedPath */ - LinkedPath getLinkedPath(const DataPath& path) const; + LinkedPath getLinkedPath(const DataPath& path) const override; /** * @brief Creates the path in the data structure as a series of DataObjects. This method will @@ -717,53 +718,53 @@ class SIMPLNX_EXPORT DataStructure * @param path The path to create. * @return Result object. */ - Result makePath(const DataPath& path); + Result makePath(const DataPath& path) override; /** - * @brief Returns a vector of DataPaths for the DataObject with the specified ID. - * If no DataObject is found with the given ID, an empty vector is returned. + * @brief Returns a vector of DataPaths for the AbstractDataObject with the specified ID. + * If no AbstractDataObject is found with the given ID, an empty vector is returned. * @param identifier * @return std::vector */ - std::vector getDataPathsForId(DataObject::IdType identifier) const; + std::vector getDataPathsForId(AbstractDataObject::IdType identifier) const override; /** * @brief Returns a collection of all DataPaths within the structure. * @return std::vector */ - std::vector getAllDataPaths() const; + std::vector getAllDataPaths() const override; /** - * @brief Returns a collection of all DataObject ids within the structure. - * @return std::vector + * @brief Returns a collection of all AbstractDataObject ids within the structure. + * @return std::vector */ - std::vector getAllDataObjectIds() const; + std::vector getAllDataObjectIds() const override; /** * @brief Returns the top-level of the DataStructure. - * @return std::vector + * @return std::vector */ - std::vector getTopLevelData() const; + std::vector getTopLevelData() const override; /** * @brief Returns a reference to the DataMap backing the top level of the DataStructure. * @return const DataMap& */ - const DataMap& getDataMap() const; + const DataMap& getDataMap() const override; /** - * @brief Inserts a new DataObject into the DataStructure nested under the given - * DataPath. If the DataPath is empty, the DataObject is added directly to - * the DataStructure. The provided DataObject can exist outside of the DataStructure, - * but calling this method with a DataObject already contained within the DataStructure + * @brief Inserts a new AbstractDataObject into the DataStructure nested under the given + * DataPath. If the DataPath is empty, the AbstractDataObject is added directly to + * the DataStructure. The provided AbstractDataObject can exist outside of the DataStructure, + * but calling this method with a AbstractDataObject already contained within the DataStructure * is undefined behavior. * * This method is a purely for inserting DataObjects new to the DataStructure. * - * This method is not meant to add additional parents to a DataObject already + * This method is not meant to add additional parents to a AbstractDataObject already * existing in the DataStructure. Use addAdditionalParent for that purpose. * - * This method is not meant to replace the DataObject at a given DataPath. + * This method is not meant to replace the AbstractDataObject at a given DataPath. * Using it as such is undefined behavior within the DataStructure. * * Returns true if the process succeeds. Returns false otherwise. Returns false if dataObject is null. @@ -771,53 +772,53 @@ class SIMPLNX_EXPORT DataStructure * @param dataPath * @return bool */ - bool insert(const std::shared_ptr& dataObject, const DataPath& dataPath); + bool insert(const std::shared_ptr& dataObject, const DataPath& dataPath) override; /** * @brief Returns the next ID value to use in the DataStructure - * @return DataObject::IdType + * @return AbstractDataObject::IdType */ - DataObject::IdType getNextId() const; + AbstractDataObject::IdType getNextId() const override; /** - * @brief Adds an additional parent to the target DataObject. + * @brief Adds an additional parent to the target AbstractDataObject. * @param targetId * @param newParent * @return bool */ - bool setAdditionalParent(DataObject::IdType targetId, DataObject::IdType newParent); + bool setAdditionalParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType newParent) override; /** - * @brief Removes a parent from the target DataObject. + * @brief Removes a parent from the target AbstractDataObject. * @param targetId * @param parent * @return bool */ - bool removeParent(DataObject::IdType targetId, DataObject::IdType parent); + bool removeParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType parent) override; /** * @brief Returns an iterator for the the beginning of the top-level DataMap. * @return iterator */ - Iterator begin(); + Iterator begin() override; /** * @brief Returns an iterator for the the end of the top-level DataMap. * @return iterator */ - Iterator end(); + Iterator end() override; /** * @brief Returns an iterator for the the beginning of the top-level DataMap. * @return */ - ConstIterator begin() const; + ConstIterator begin() const override; /** * @brief Returns an iterator for the the end of the top-level DataMap. * @return */ - ConstIterator end() const; + ConstIterator end() const override; /** * @brief Returns a reference the nod signal used to notify observers. @@ -827,32 +828,32 @@ class SIMPLNX_EXPORT DataStructure /** * @brief Checks if all IDataArrays at the target paths have the same tuple count. - * Returns false if any of the paths are not derived from IDataArray. + * Returns false if any of the paths are not derived from AbstractDataArray. * @param dataPaths * @return bool */ - nonstd::expected validateNumberOfTuples(const std::vector& dataPaths) const; + nonstd::expected validateNumberOfTuples(const std::vector& dataPaths) const override; /** - * @brief Resets DataObject IDs starting at the provided value. + * @brief Resets AbstractDataObject IDs starting at the provided value. * Because 0 is a reserved value, if the starting value is set to 0, this method will use 1 instead. * @param startingId */ - void resetIds(DataObject::IdType startingId); + void resetIds(AbstractDataObject::IdType startingId) override; /** * @brief Outputs data graph in .dot file format * @param outputStream the child class of ostream to output dot syntax to * @return */ - void exportHierarchyAsGraphViz(std::ostream& outputStream) const; + void exportHierarchyAsGraphViz(std::ostream& outputStream) const override; /** * @brief Outputs data graph in console readable format * @param outputStream the child class of ostream to output to * @return */ - void exportHierarchyAsText(std::ostream& outputStream) const; + void exportHierarchyAsText(std::ostream& outputStream) const override; /** * @brief Copy assignment operator. The copied DataStructure's observers are not retained. @@ -869,33 +870,33 @@ class SIMPLNX_EXPORT DataStructure DataStructure& operator=(DataStructure&& rhs) noexcept; /** - * @brief Sets the next ID to use when constructing a DataObject. + * @brief Sets the next ID to use when constructing a AbstractDataObject. * Because IDs are created to be unique, this should only be called when * importing data instead of on an existing DataStructure to avoid * overlapping values. * @param nextDataId */ - void setNextId(DataObject::IdType nextDataId); + void setNextId(AbstractDataObject::IdType nextDataId) override; /** * @brief Returns a reference to the root DataMap. * @return DataMap& */ - DataMap& getRootGroup(); + DataMap& getRootGroup() override; /** * @brief Flushes all DataObjects to their respective target by calling their respective flush() method. * In-memory DataObjects are not affected. */ - void flush() const; + void flush() const override; - uint64 memoryUsage() const; + uint64 memoryUsage() const override; /** * @brief Transfers array data to OOC if available. * @return Result with Warnings and errors */ - Result<> transferDataArraysOoc(); + Result<> transferDataArraysOoc() override; /** * @brief This method will validate that each Geometry is valid based on a specific set of criteria @@ -907,87 +908,87 @@ class SIMPLNX_EXPORT DataStructure * * @return Result<> object */ - Result<> validateGeometries() const; + Result<> validateGeometries() const override; /** * @brief This method will validate that each AttributeMatrix is valid. * - * The validation criteria is that for the Attribute Matrix itself: Every contained IArray - * object must have the same number of Tuples as every other IArray object and the + * The validation criteria is that for the Attribute Matrix itself: Every contained AbstractArray + * object must have the same number of Tuples as every other AbstractArray object and the * AttributeMatrix itself must also have the same total number of tuples. * * @return Result<> object */ - Result<> validateAttributeMatrices() const; + Result<> validateAttributeMatrices() const override; protected: /** - * @brief Returns a new ID for use constructing a DataObject. - * IDs created are unique to the DataStructure, not the DataObject. Creating + * @brief Returns a new ID for use constructing a AbstractDataObject. + * IDs created are unique to the DataStructure, not the AbstractDataObject. Creating * a copy of the DataStructure will result in the same ID being used for the - * next added DataObject to both structures. - * @return DataObject::IdType + * next added AbstractDataObject to both structures. + * @return AbstractDataObject::IdType */ - DataObject::IdType generateId(); + AbstractDataObject::IdType generateId(); /** - * @brief Adds the DataObject to the list of known DataObjects if it is missing. + * @brief Adds the AbstractDataObject to the list of known DataObjects if it is missing. * @param dataObject */ - void trackDataObject(const std::shared_ptr& dataObject); + void trackDataObject(const std::shared_ptr& dataObject); /** - * @brief Inserts the provided DataObject into the root DataMap. + * @brief Inserts the provided AbstractDataObject into the root DataMap. * @param dataObject * @return bool */ - bool insertIntoRoot(const std::shared_ptr& dataObject); + bool insertIntoRoot(const std::shared_ptr& dataObject); /** - * @brief Inserts the provided DataObject under the target parent group. + * @brief Inserts the provided AbstractDataObject under the target parent group. * @param dataObject * @param parentGroup * @return bool */ - bool insertIntoParent(const std::shared_ptr& dataObject, BaseGroup* parentGroup); + bool insertIntoParent(const std::shared_ptr& dataObject, BaseGroup* parentGroup); /** - * @brief Applies a new pointer to the DataObject at a specified ID. Removes - * the data from the DataMap if no DataObject was provided. + * @brief Applies a new pointer to the AbstractDataObject at a specified ID. Removes + * the data from the DataMap if no AbstractDataObject was provided. * @param identifier * @param dataObject */ - void setData(DataObject::IdType identifier, std::shared_ptr dataObject); + void setData(AbstractDataObject::IdType identifier, std::shared_ptr dataObject); private: /** - * @brief Inserts the target DataObject to the top of the DataStructure. + * @brief Inserts the target AbstractDataObject to the top of the DataStructure. * @param obj * @return */ - bool insertTopLevel(const std::shared_ptr& obj); + bool insertTopLevel(const std::shared_ptr& obj); /** - * @brief Removes the specified DataObject from the top of the DataStructure. + * @brief Removes the specified AbstractDataObject from the top of the DataStructure. * @param data * @return */ - bool removeTopLevel(DataObject* data); + bool removeTopLevel(AbstractDataObject* data); /** - * @brief Removes the specified DataObject from the entire DataStructure. + * @brief Removes the specified AbstractDataObject from the entire DataStructure. * @param data * @return bool */ - bool removeData(DataObject* data); + bool removeData(AbstractDataObject* data); /** - * @brief Called when a DataObject is deleted from the DataStructure. This + * @brief Called when a AbstractDataObject is deleted from the DataStructure. This * notifies observers to the change. * @param identifier * @param name */ - void dataDeleted(DataObject::IdType identifier, const std::string& name); + void dataDeleted(AbstractDataObject::IdType identifier, const std::string& name); /** * @brief Resets the DataStructure for all known DataObjecs in the DataStructure. @@ -1027,6 +1028,6 @@ class SIMPLNX_EXPORT DataStructure WeakCollectionType m_DataObjects; DataMap m_RootGroup; bool m_IsValid = false; - DataObject::IdType m_NextId = 1; + AbstractDataObject::IdType m_NextId = 1; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/DynamicListArray.hpp b/src/simplnx/DataStructure/DynamicListArray.hpp index d9c3b3ae29..4209e41e16 100644 --- a/src/simplnx/DataStructure/DynamicListArray.hpp +++ b/src/simplnx/DataStructure/DynamicListArray.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/StringLiteral.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include #include @@ -17,7 +17,7 @@ inline constexpr StringLiteral k_TypeName = "DynamicListArray"; } template -class DynamicListArray : public DataObject +class DynamicListArray : public AbstractDataObject { public: friend class DataStructure; @@ -33,7 +33,7 @@ class DynamicListArray : public DataObject /** * @brief Attempts to create a new DynamicListArray and insert it into the * DataStructure. If a parentId is provided, the created DynamicListArray - * will be nested under the target DataObject. Otherwise, it will be placed + * will be nested under the target AbstractDataObject. Otherwise, it will be placed * directly under the DataStructure. * * Returns a pointer to the created DynamicListArray if the operation succeeded. @@ -56,7 +56,7 @@ class DynamicListArray : public DataObject /** * @brief Attempts to create a new DynamicListArray and insert it into the * DataStructure. If a parentId is provided, the created DynamicListArray - * will be nested under the target DataObject. Otherwise, it will be placed + * will be nested under the target AbstractDataObject. Otherwise, it will be placed * directly under the DataStructure. * * Returns a pointer to the created DynamicListArray if the operation succeeded. @@ -84,7 +84,7 @@ class DynamicListArray : public DataObject * @param other */ DynamicListArray(const DynamicListArray& other) - : DataObject(other) + : AbstractDataObject(other) , m_Size(other.m_Size) { allocate(other.m_Size); @@ -101,7 +101,7 @@ class DynamicListArray : public DataObject * @param other */ DynamicListArray(DynamicListArray&& other) - : DataObject(std::move(other)) + : AbstractDataObject(std::move(other)) , m_Array(std::move(other.m_Array)) , m_Size(std::move(other.m_Size)) { @@ -127,13 +127,13 @@ class DynamicListArray : public DataObject } } - DataObject::Type getDataObjectType() const override + AbstractDataObject::Type getDataObjectType() const override { return Type::DynamicListArray; } /** - * @brief Returns the typename of the DataObject as a std::string. + * @brief Returns the typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override @@ -153,9 +153,9 @@ class DynamicListArray : public DataObject /** * @brief Creates a copy of the object. The caller is responsible for * deleting the returned value. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override + std::shared_ptr deepCopy(const DataPath& copyPath) override { auto& dataStruct = getDataStructureRef(); if(dataStruct.containsData(copyPath)) @@ -188,9 +188,9 @@ class DynamicListArray : public DataObject /** * @brief The DynamicListArray cannot be shallow copied. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override + AbstractDataObject* shallowCopy() override { return new DynamicListArray(*this); } @@ -339,7 +339,7 @@ class DynamicListArray : public DataObject * @param name */ DynamicListArray(DataStructure& dataStructure, std::string name) - : DataObject(dataStructure, std::move(name)) + : AbstractDataObject(dataStructure, std::move(name)) { } @@ -350,7 +350,7 @@ class DynamicListArray : public DataObject * @param importId */ DynamicListArray(DataStructure& dataStructure, std::string name, IdType importId) - : DataObject(dataStructure, std::move(name), importId) + : AbstractDataObject(dataStructure, std::move(name), importId) { } diff --git a/src/simplnx/DataStructure/Geometry/AbstractGeometry.cpp b/src/simplnx/DataStructure/Geometry/AbstractGeometry.cpp new file mode 100644 index 0000000000..6d809b681f --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractGeometry.cpp @@ -0,0 +1,209 @@ +#include "AbstractGeometry.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractGeometry::AbstractGeometry(DataStructure& dataStructure, std::string name) +: BaseGroup(dataStructure, std::move(name)) +{ +} + +AbstractGeometry::AbstractGeometry(DataStructure& dataStructure, std::string name, IdType importId) +: BaseGroup(dataStructure, std::move(name), importId) +{ +} + +const Float32Array* AbstractGeometry::getElementSizes() const +{ + return getDataStructureRef().getDataAs(m_ElementSizesId); +} + +AbstractDataObject::OptionalId AbstractGeometry::getElementSizesId() const +{ + return m_ElementSizesId; +} + +void AbstractGeometry::setElementSizesId(const OptionalId& sizesId) +{ + m_ElementSizesId = sizesId; +} + +void AbstractGeometry::deleteElementSizes() +{ + getDataStructureRef().removeData(m_ElementSizesId); + m_ElementSizesId.reset(); +} + +uint32 AbstractGeometry::getUnitDimensionality() const +{ + return m_UnitDimensionality; +} + +void AbstractGeometry::setUnitDimensionality(uint32 value) +{ + m_UnitDimensionality = value; +} + +uint32 AbstractGeometry::getSpatialDimensionality() const +{ + return m_SpacialDimensionality; +} + +void AbstractGeometry::setSpatialDimensionality(uint32 value) +{ + m_SpacialDimensionality = value; +} + +std::set AbstractGeometry::StringListFromGeometryType(const std::set& geomTypes) +{ + std::set stringValues; + for(auto geomType : geomTypes) + { + stringValues.insert(AbstractGeometry::k_GeomTypeStrings[to_underlying(geomType)]); + } + return stringValues; +} + +const std::set& AbstractGeometry::GetAllGeomTypes() +{ + static const std::set types = {Type::Image, Type::RectGrid, Type::Vertex, Type::Edge, Type::Triangle, Type::Quad, Type::Tetrahedral, Type::Hexahedral}; + return types; +} + +const std::vector& AbstractGeometry::GetAllLengthUnitStrings() +{ + static const std::vector lengthUnitStrs = { + LengthUnitToString(LengthUnit::Yoctometer), LengthUnitToString(LengthUnit::Zeptometer), LengthUnitToString(LengthUnit::Attometer), LengthUnitToString(LengthUnit::Femtometer), + LengthUnitToString(LengthUnit::Picometer), LengthUnitToString(LengthUnit::Nanometer), LengthUnitToString(LengthUnit::Micrometer), LengthUnitToString(LengthUnit::Millimeter), + LengthUnitToString(LengthUnit::Centimeter), LengthUnitToString(LengthUnit::Decimeter), LengthUnitToString(LengthUnit::Meter), LengthUnitToString(LengthUnit::Decameter), + LengthUnitToString(LengthUnit::Hectometer), LengthUnitToString(LengthUnit::Kilometer), LengthUnitToString(LengthUnit::Megameter), LengthUnitToString(LengthUnit::Gigameter), + LengthUnitToString(LengthUnit::Terameter), LengthUnitToString(LengthUnit::Petameter), LengthUnitToString(LengthUnit::Exameter), LengthUnitToString(LengthUnit::Zettameter), + LengthUnitToString(LengthUnit::Yottameter), LengthUnitToString(LengthUnit::Angstrom), LengthUnitToString(LengthUnit::Mil), LengthUnitToString(LengthUnit::Inch), + LengthUnitToString(LengthUnit::Foot), LengthUnitToString(LengthUnit::Mile), LengthUnitToString(LengthUnit::Fathom), LengthUnitToString(LengthUnit::Unspecified), + LengthUnitToString(LengthUnit::Unknown)}; + return lengthUnitStrs; +} + +AbstractGeometry::LengthUnit AbstractGeometry::getUnits() const +{ + return m_Units; +} + +void AbstractGeometry::setUnits(LengthUnit units) +{ + m_Units = units; +} + +std::string AbstractGeometry::GeomTypeToString(AbstractGeometry::Type geomType) +{ + return AbstractGeometry::k_GeomTypeStrings[to_underlying(geomType)]; +} + +std::string AbstractGeometry::LengthUnitToString(LengthUnit unit) +{ + switch(unit) + { + case LengthUnit::Yoctometer: { + return "Yoctometer"; + } + case LengthUnit::Zeptometer: { + return "Zeptometer"; + } + case LengthUnit::Attometer: { + return "Attometer"; + } + case LengthUnit::Femtometer: { + return "Femtometer"; + } + case LengthUnit::Picometer: { + return "Picometer"; + } + case LengthUnit::Nanometer: { + return "Nanometer"; + } + case LengthUnit::Micrometer: { + return "Micrometer"; + } + case LengthUnit::Millimeter: { + return "Millimeter"; + } + case LengthUnit::Centimeter: { + return "Centimeter"; + } + case LengthUnit::Decimeter: { + return "Decimeter"; + } + case LengthUnit::Meter: { + return "Meter"; + } + case LengthUnit::Decameter: { + return "Decameter"; + } + case LengthUnit::Hectometer: { + return "Hectometer"; + } + case LengthUnit::Kilometer: { + return "Kilometer"; + } + case LengthUnit::Megameter: { + return "Megameter"; + } + case LengthUnit::Gigameter: { + return "Gigameter"; + } + case LengthUnit::Terameter: { + return "Terameter"; + } + case LengthUnit::Petameter: { + return "Petameter"; + } + case LengthUnit::Exameter: { + return "Exameter"; + } + case LengthUnit::Zettameter: { + return "Zettameter"; + } + case LengthUnit::Yottameter: { + return "Yottameter"; + } + case LengthUnit::Angstrom: { + return "Angstrom"; + } + case LengthUnit::Mil: { + return "Mil"; + } + case LengthUnit::Inch: { + return "Inch"; + } + case LengthUnit::Foot: { + return "Foot"; + } + case LengthUnit::Mile: { + return "Mile"; + } + case LengthUnit::Fathom: { + return "Fathom"; + } + case LengthUnit::Unspecified: { + return "Unspecified"; + } + case LengthUnit::Unknown: { + return "Unknown"; + } + } + return "Unknown"; +} + +void AbstractGeometry::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + BaseGroup::checkUpdatedIdsImpl(updatedIdsMap); + + std::vector visited(1, false); + + for(const auto& updatedId : updatedIdsMap) + { + m_ElementSizesId = nx::core::VisitDataStructureId(m_ElementSizesId, updatedId, visited, 0); + } +} +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractGeometry.hpp b/src/simplnx/DataStructure/Geometry/AbstractGeometry.hpp new file mode 100644 index 0000000000..d8bd29ed00 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractGeometry.hpp @@ -0,0 +1,168 @@ +#pragma once + +#include "simplnx/Common/Array.hpp" +#include "simplnx/DataStructure/BaseGroup.hpp" +#include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/DynamicListArray.hpp" +#include "simplnx/DataStructure/Geometry/IGeometry.hpp" + +namespace nx::core +{ +class SIMPLNX_EXPORT AbstractGeometry : public BaseGroup, public IGeometry +{ +public: + friend class DataStructure; + + // Bring IGeometry nested types into scope to resolve ambiguity with AbstractDataObject::Type + using IGeometry::ElementDynamicList; + using IGeometry::LengthUnit; + using IGeometry::MeshIndexArrayType; + using IGeometry::MeshIndexType; + using IGeometry::SharedEdgeList; + using IGeometry::SharedFaceList; + using IGeometry::SharedHexList; + using IGeometry::SharedQuadList; + using IGeometry::SharedTetList; + using IGeometry::SharedTriList; + using IGeometry::SharedVertexList; + using IGeometry::Type; + + static constexpr StringLiteral k_TypeName = "IGeometry"; + + AbstractGeometry() = delete; + + AbstractGeometry(const AbstractGeometry&) = default; + AbstractGeometry(AbstractGeometry&&) = default; + + AbstractGeometry& operator=(const AbstractGeometry&) = delete; + AbstractGeometry& operator=(AbstractGeometry&&) noexcept = delete; + + ~AbstractGeometry() noexcept override = default; + + /** + * @brief Returns the type of geometry. + * @return + */ + IGeometry::Type getGeomType() const override = 0; + + /** + * @brief Returns the number of Cells (NOT POINTS) of a Geometry + * @return usize + */ + usize getNumberOfCells() const override = 0; + + /** + * @brief + * @return Result<> + */ + Result<> findElementSizes(bool recalculate) override = 0; + + /** + * @brief + * @return const Float32Array* + */ + const Float32Array* getElementSizes() const; + + OptionalId getElementSizesId() const; + + void setElementSizesId(const OptionalId& sizesId); + + /** + * @brief + */ + void deleteElementSizes(); + + /** + * @brief + * @return Point3D + */ + Point3D getParametricCenter() const override = 0; + + /** + * @brief + * @param pCoords + * @param shape + */ + void getShapeFunctions(const Point3D& pCoords, float64* shape) const override = 0; + + /** + * @brief + * @return uint32 + */ + uint32 getUnitDimensionality() const; + + /** + * @brief + * @param value + */ + void setUnitDimensionality(uint32 value); + + /** + * @brief + * @return uint32 + */ + uint32 getSpatialDimensionality() const; + + /** + * @brief + * @param value + */ + void setSpatialDimensionality(uint32 value); + + static std::set StringListFromGeometryType(const std::set& geomTypes); + + static const std::set& GetAllGeomTypes(); + + static const std::vector& GetAllLengthUnitStrings(); + + /** + * @brief Returns the length units used by the geometry. + * @return LengthUnit + */ + LengthUnit getUnits() const; + + /** + * @brief Sets the length units used by the geometry. + * @param units + */ + void setUnits(LengthUnit units); + + /** + * @brief + * @param geomType + * @return std::string + */ + static std::string GeomTypeToString(Type geomType); + + /** + * @brief + * @param unit + * @return std::string + */ + static std::string LengthUnitToString(LengthUnit unit); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override = 0; + +protected: + AbstractGeometry(DataStructure& dataStructure, std::string name); + + AbstractGeometry(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + std::optional m_ElementSizesId; + + LengthUnit m_Units = LengthUnit::Meter; + uint32 m_UnitDimensionality = 3; + uint32 m_SpacialDimensionality = 3; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.cpp b/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.cpp new file mode 100644 index 0000000000..6561c89db6 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.cpp @@ -0,0 +1,114 @@ +#include "AbstractGridGeometry.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractGridGeometry::AbstractGridGeometry(DataStructure& dataStructure, std::string name) +: AbstractGeometry(dataStructure, std::move(name)) +{ +} + +AbstractGridGeometry::AbstractGridGeometry(DataStructure& dataStructure, std::string name, IdType importId) +: AbstractGeometry(dataStructure, std::move(name), importId) +{ +} + +const std::optional& AbstractGridGeometry::getCellDataId() const +{ + return m_CellDataId; +} + +AttributeMatrix* AbstractGridGeometry::getCellData() +{ + if(!m_CellDataId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_CellDataId); +} + +const AttributeMatrix* AbstractGridGeometry::getCellData() const +{ + if(!m_CellDataId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_CellDataId); +} + +AttributeMatrix& AbstractGridGeometry::getCellDataRef() +{ + if(!m_CellDataId.has_value()) + { + throw std::runtime_error( + fmt::format("AttributeMatrix& AbstractGridGeometry::getCellDataRef()::{} threw runtime exception. The geometry with name '{}' does not have a cell attribute matrix assigned.\n {}:{}", + __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_CellDataId.value()); +} + +const AttributeMatrix& AbstractGridGeometry::getCellDataRef() const +{ + if(!m_CellDataId.has_value()) + { + throw std::runtime_error( + fmt::format("AttributeMatrix& AbstractGridGeometry::getCellDataRef()::{} threw runtime exception. The geometry with name '{}' does not have a cell attribute matrix assigned.\n {}:{}", + __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_CellDataId.value()); +} + +DataPath AbstractGridGeometry::getCellDataPath() const +{ + return getCellDataRef().getDataPaths().at(0); +} + +void AbstractGridGeometry::setCellData(const AttributeMatrix& attributeMatrix) +{ + m_CellDataId = attributeMatrix.getId(); +} + +void AbstractGridGeometry::setCellData(OptionalId id) +{ + m_CellDataId = id; +} + +void AbstractGridGeometry::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + AbstractGeometry::checkUpdatedIdsImpl(updatedIdsMap); + + std::vector visited(1, false); + + for(const auto& updatedId : updatedIdsMap) + { + m_CellDataId = nx::core::VisitDataStructureId(m_CellDataId, updatedId, visited, 0); + if(visited[0]) + { + break; + } + } +} + +Result<> AbstractGridGeometry::validate() const +{ + // Validate the next lower dimension geometry + Result<> result; + + usize numTuples = getNumberOfCells(); + const AttributeMatrix* amPtr = getCellData(); + if(nullptr == amPtr) + { + return result; + } + usize amNumTuples = amPtr->getNumberOfTuples(); + + if(numTuples != amNumTuples) + { + return MergeResults( + result, MakeErrorResult(-4501, fmt::format("Grid Geometry '{}' has {} cells but the cell Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); + } + return result; +} + +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp b/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp new file mode 100644 index 0000000000..1e497f1d3c --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp @@ -0,0 +1,232 @@ +#pragma once + +#include "simplnx/Common/Array.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/DataStructure/AttributeMatrix.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" + +namespace nx::core +{ +class SIMPLNX_EXPORT AbstractGridGeometry : public AbstractGeometry, public IGridGeometry +{ +public: + static constexpr StringLiteral k_TypeName = "IGridGeometry"; + + AbstractGridGeometry() = delete; + AbstractGridGeometry(const AbstractGridGeometry&) = default; + AbstractGridGeometry(AbstractGridGeometry&&) = default; + + AbstractGridGeometry& operator=(const AbstractGridGeometry&) = delete; + AbstractGridGeometry& operator=(AbstractGridGeometry&&) noexcept = delete; + + ~AbstractGridGeometry() noexcept override = default; + + /** + * @brief + * @return SizeVec3 + */ + SizeVec3 getDimensions() const override = 0; + + /** + * @brief + * @param dims + */ + void setDimensions(const SizeVec3& dims) override = 0; + + /** + * @brief + * @return usize + */ + usize getNumXCells() const override = 0; + + /** + * @brief + * @return usize + */ + usize getNumYCells() const override = 0; + + /** + * @brief + * @return usize + */ + usize getNumZCells() const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getPlaneCoordsf(usize idx[3]) const override = 0; + + /** + * @brief + * @param x + * @param y + * @param z + * @return Point3D + */ + Point3D getPlaneCoordsf(usize x, usize y, usize z) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getPlaneCoordsf(usize idx) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getPlaneCoords(usize idx[3]) const override = 0; + + /** + * @brief + * @param x + * @param y + * @param z + * @return Point3D + */ + Point3D getPlaneCoords(usize x, usize y, usize z) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getPlaneCoords(usize idx) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getCoordsf(usize idx[3]) const override = 0; + + /** + * @brief + * @param x + * @param y + * @param z + * @return Point3D + */ + Point3D getCoordsf(usize x, usize y, usize z) const override = 0; + + /** + * @brief + * @param idx + * @return + */ + Point3D getCoordsf(usize idx) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getCoords(usize idx[3]) const override = 0; + + /** + * @brief + * @param x + * @param y + * @param z + * @return Point3D + */ + Point3D getCoords(usize x, usize y, usize z) const override = 0; + + /** + * @brief + * @param idx + * @return Point3D + */ + Point3D getCoords(usize idx) const override = 0; + + /** + * @brief + * @param xCoord + * @param yCoord + * @param zCoord + * @return std::optional + */ + std::optional getIndex(float32 xCoord, float32 yCoord, float32 zCoord) const override = 0; + + /** + * @brief + * @param xCoord + * @param yCoord + * @param zCoord + * @return std::optional + */ + std::optional getIndex(float64 xCoord, float64 yCoord, float64 zCoord) const override = 0; + + /** + * @brief + * @return + */ + const std::optional& getCellDataId() const; + + /** + * @brief + * @return + */ + AttributeMatrix* getCellData(); + + /** + * @brief + * @return + */ + const AttributeMatrix* getCellData() const; + + /** + * @brief + * @return + */ + AttributeMatrix& getCellDataRef(); + + /** + * @brief + * @return + */ + const AttributeMatrix& getCellDataRef() const; + + /** + * @brief + * @return + */ + DataPath getCellDataPath() const; + + /** + * @brief + * @param attributeMatrix + */ + void setCellData(const AttributeMatrix& attributeMatrix); + + /** + * @brief + * @param id + */ + void setCellData(OptionalId id); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override; + +protected: + AbstractGridGeometry(DataStructure& dataStructure, std::string name); + + AbstractGridGeometry(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + std::optional m_CellDataId; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.cpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.cpp new file mode 100644 index 0000000000..76a9d5efcc --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.cpp @@ -0,0 +1,274 @@ +#include "AbstractNodeGeometry0D.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractNodeGeometry0D::AbstractNodeGeometry0D(DataStructure& dataStructure, std::string name) +: AbstractGeometry(dataStructure, std::move(name)) +{ +} + +AbstractNodeGeometry0D::AbstractNodeGeometry0D(DataStructure& dataStructure, std::string name, IdType importId) +: AbstractGeometry(dataStructure, std::move(name), importId) +{ +} + +const std::optional& AbstractNodeGeometry0D::getSharedVertexDataArrayId() const +{ + return m_VertexDataArrayId; +} + +AbstractNodeGeometry0D::SharedVertexList* AbstractNodeGeometry0D::getVertices() +{ + if(!m_VertexDataArrayId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_VertexDataArrayId); +} + +const AbstractNodeGeometry0D::SharedVertexList* AbstractNodeGeometry0D::getVertices() const +{ + if(!m_VertexDataArrayId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_VertexDataArrayId); +} + +AbstractNodeGeometry0D::SharedVertexList& AbstractNodeGeometry0D::getVerticesRef() +{ + if(!m_VertexDataArrayId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a shared vertex list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_VertexDataArrayId.value()); +} + +const AbstractNodeGeometry0D::SharedVertexList& AbstractNodeGeometry0D::getVerticesRef() const +{ + if(!m_VertexDataArrayId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a shared vertex list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_VertexDataArrayId.value()); +} + +void AbstractNodeGeometry0D::setVertices(const AbstractNodeGeometry0D::SharedVertexList& vertices) +{ + m_VertexDataArrayId = vertices.getId(); +} + +std::optional AbstractNodeGeometry0D::getVertexListId() const +{ + return m_VertexDataArrayId; +} + +void AbstractNodeGeometry0D::setVertexListId(const std::optional& vertices) +{ + m_VertexDataArrayId = vertices; +} + +void AbstractNodeGeometry0D::resizeVertexList(usize size) +{ + getVerticesRef().getIDataStoreRef().resizeTuples({size}); +} + +usize AbstractNodeGeometry0D::getNumberOfVertices() const +{ + const auto* verticesPtr = getVertices(); + return verticesPtr == nullptr ? 0 : verticesPtr->getNumberOfTuples(); +} + +usize AbstractNodeGeometry0D::getNumberOfCells() const +{ + return getNumberOfVertices(); +} + +BoundingBox3Df AbstractNodeGeometry0D::getBoundingBox() const +{ + FloatVec3 ll = {std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()}; + FloatVec3 ur = {std::numeric_limits::min(), std::numeric_limits::min(), std::numeric_limits::min()}; + + const AbstractGeometry::SharedVertexList& vertexList = getVerticesRef(); + if(vertexList.getDataType() != DataType::float32) + { + return {ll, ur}; // will be invalid + } + + try + { + auto& vertexListStore = vertexList.getDataStoreRef(); + + for(size_t tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++) + { + float x = vertexListStore.getComponentValue(tuple, 0); + ll[0] = (x < ll[0]) ? x : ll[0]; + ur[0] = (x > ur[0]) ? x : ur[0]; + + float y = vertexListStore.getComponentValue(tuple, 1); + ll[1] = (y < ll[1]) ? y : ll[1]; + ur[1] = (y > ur[1]) ? y : ur[1]; + + float z = vertexListStore.getComponentValue(tuple, 2); + ll[2] = (z < ll[2]) ? z : ll[2]; + ur[2] = (z > ur[2]) ? z : ur[2]; + } + } catch(const std::bad_cast& ex) + { + return {ll, ur}; // will be invalid + } + + return {ll, ur}; // should be valid +} + +Result AbstractNodeGeometry0D::isPlane(usize dimensionIndex) const +{ + try + { + const AbstractGeometry::SharedVertexList& vertexList = getVerticesRef(); + auto& vertexListStore = vertexList.getDataStoreRef(); + + std::set pointSet; + for(usize tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++) + { + pointSet.insert(vertexListStore.getComponentValue(tuple, dimensionIndex)); + } + + return {(pointSet.size() == 1)}; + } catch(const std::bad_cast& exception) + { + return MakeErrorResult(-3000, fmt::format("Could not determine whether the geometry is a plane because an exception was thrown: {}", exception.what())); + } +} + +Result AbstractNodeGeometry0D::isYZPlane() const +{ + return isPlane(0); +} + +Result AbstractNodeGeometry0D::isXYPlane() const +{ + return isPlane(2); +} + +Result AbstractNodeGeometry0D::isXZPlane() const +{ + return isPlane(1); +} + +void AbstractNodeGeometry0D::setVertexCoordinate(usize vertId, const Point3D& coordinate) +{ + auto& vertices = getVerticesRef(); + const usize offset = vertId * 3; + for(usize i = 0; i < 3; i++) + { + vertices[offset + i] = coordinate[i]; + } +} + +Point3D AbstractNodeGeometry0D::getVertexCoordinate(usize vertId) const +{ + auto& vertices = getVerticesRef(); + const usize offset = vertId * 3; + Point3D coordinate; + for(usize i = 0; i < 3; i++) + { + coordinate[i] = vertices.at(offset + i); + } + return coordinate; +} + +const std::optional& AbstractNodeGeometry0D::getVertexAttributeMatrixId() const +{ + return m_VertexAttributeMatrixId; +} + +void AbstractNodeGeometry0D::setVertexDataId(const OptionalId& vertexDataId) +{ + m_VertexAttributeMatrixId = vertexDataId; +} + +AttributeMatrix* AbstractNodeGeometry0D::getVertexAttributeMatrix() +{ + if(!m_VertexAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_VertexAttributeMatrixId); +} + +const AttributeMatrix* AbstractNodeGeometry0D::getVertexAttributeMatrix() const +{ + if(!m_VertexAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_VertexAttributeMatrixId); +} + +AttributeMatrix& AbstractNodeGeometry0D::getVertexAttributeMatrixRef() +{ + if(!m_VertexAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a vertex attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_VertexAttributeMatrixId.value()); +} + +const AttributeMatrix& AbstractNodeGeometry0D::getVertexAttributeMatrixRef() const +{ + if(!m_VertexAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a vertex attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_VertexAttributeMatrixId.value()); +} + +DataPath AbstractNodeGeometry0D::getVertexAttributeMatrixDataPath() const +{ + return getVertexAttributeMatrixRef().getDataPaths().at(0); +} + +void AbstractNodeGeometry0D::setVertexAttributeMatrix(const AttributeMatrix& attributeMatrix) +{ + m_VertexAttributeMatrixId = attributeMatrix.getId(); +} + +void AbstractNodeGeometry0D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + AbstractGeometry::checkUpdatedIdsImpl(updatedIdsMap); + + std::vector visited(2, false); + + for(const auto& updatedId : updatedIdsMap) + { + m_VertexDataArrayId = nx::core::VisitDataStructureId(m_VertexDataArrayId, updatedId, visited, 0); + m_VertexAttributeMatrixId = nx::core::VisitDataStructureId(m_VertexAttributeMatrixId, updatedId, visited, 1); + } +} + +Result<> AbstractNodeGeometry0D::validate() const +{ + Result<> result; + usize numVerts = getNumberOfVertices(); + const AttributeMatrix* amPtr = getVertexAttributeMatrix(); + if(nullptr == amPtr) + { + return result; + } + usize amNumTuples = amPtr->getNumberOfTuples(); + if(numVerts != amNumTuples) + { + return MakeErrorResult( + -4500, fmt::format("Vertex Geometry '{}' has {} vertices but the vertex Attribute Matrix '{}' has {} total tuples.", getName(), numVerts, getVertexAttributeMatrix()->getName(), amNumTuples)); + } + return result; +} + +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp new file mode 100644 index 0000000000..3e32c2e481 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp @@ -0,0 +1,211 @@ +#pragma once + +#include "simplnx/Common/Array.hpp" +#include "simplnx/Common/BoundingBox.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/DataStructure/AttributeMatrix.hpp" +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" + +#include + +namespace nx::core +{ +class SIMPLNX_EXPORT AbstractNodeGeometry0D : public AbstractGeometry, public INodeGeometry0D +{ +public: + static constexpr StringLiteral k_TypeName = "INodeGeometry0D"; + + AbstractNodeGeometry0D() = delete; + AbstractNodeGeometry0D(const AbstractNodeGeometry0D&) = default; + AbstractNodeGeometry0D(AbstractNodeGeometry0D&&) = default; + + AbstractNodeGeometry0D& operator=(const AbstractNodeGeometry0D&) = delete; + AbstractNodeGeometry0D& operator=(AbstractNodeGeometry0D&&) noexcept = delete; + + ~AbstractNodeGeometry0D() noexcept override = default; + + /** + * @brief Returns a shared pointer to the vertex coordinates array + * @return + */ + SharedVertexList* getVertices(); + + /** + * @brief Returns a shared pointer to the vertex coordinates array + * @return + */ + const SharedVertexList* getVertices() const; + + /** + * @brief Returns a reference to the vertex coordinates array + * @return + */ + SharedVertexList& getVerticesRef(); + + /** + * @brief Returns a reference to the vertex coordinates array + * @return + */ + const SharedVertexList& getVerticesRef() const; + + /** + * @brief Sets the internal reference to vertex coordinates to vertices + * @param vertices The coordinate array that will now be used for the vertex coordinates + */ + void setVertices(const SharedVertexList& vertices); + + std::optional getVertexListId() const; + void setVertexListId(const std::optional& vertices); + + /** + * @brief Resizes the vertex list to the target size. + * @param size + */ + void resizeVertexList(usize size); + + /** + * @brief Returns the number of vertices in the geometry. + * @return usize + */ + usize getNumberOfVertices() const; + + /** + * @brief Returns the number of vertices for this geometry + * @return + */ + usize getNumberOfCells() const override; + + /** + * @brief Calculates and returns the bounding box for this geometry + * @return + */ + BoundingBox3Df getBoundingBox() const; + + /** + * @brief Returns whether or not this geometry is in a YZ plane. + * Returns empty if the vertex list does not exist. + * @return + */ + Result isYZPlane() const; + + /** + * @brief Returns whether or not this geometry is in a XY plane + * Returns empty if the vertex list does not exist. + * @return + */ + Result isXYPlane() const; + + /** + * @brief Returns whether or not this geometry is in a XZ plane + * Returns empty if the vertex list does not exist. + * @return + */ + Result isXZPlane() const; + + /** + * @brief Gets the coordinates at the target vertex ID. + * @param vertId + * @return + */ + Point3D getVertexCoordinate(usize vertId) const; + + /** + * @brief Sets the coordinates for the specified vertex ID. + * @param vertId + * @param coords + */ + void setVertexCoordinate(usize vertId, const Point3D& coords); + + /**************************************************************************** + * These functions get values related to where the Vertex Coordinates are + * stored in the DataStructure + */ + + /** + * @brief Returns the DataStructure unique ID of the vertex coordinate array + * @return + */ + const std::optional& getSharedVertexDataArrayId() const; + + /** + * @brief Returns the DataStructure unique ID of the Attribute Matrix that holds data assigned to each vertex coordinate + * @return + */ + const std::optional& getVertexAttributeMatrixId() const; + + void setVertexDataId(const OptionalId& vertexDataId); + + /** + * @brief Returns pointer to the Attribute Matrix that holds data assigned to each vertex coordinate + * @return + */ + AttributeMatrix* getVertexAttributeMatrix(); + + /** + * @brief Returns pointer to the Attribute Matrix that holds data assigned to each vertex coordinate + * @return + */ + const AttributeMatrix* getVertexAttributeMatrix() const; + + /** + * @brief Returns reference to the Attribute Matrix that holds data assigned to each vertex coordinate + * @return + */ + AttributeMatrix& getVertexAttributeMatrixRef(); + + /** + * @brief Returns reference to the Attribute Matrix that holds data assigned to each vertex coordinate + * @return + */ + const AttributeMatrix& getVertexAttributeMatrixRef() const; + + /** + * @brief Returns the DataPath to the AttributeMatrix for the vertex data + * @return + */ + DataPath getVertexAttributeMatrixDataPath() const; + + /** + * @brief Sets the Attribute Matrix for the data assigned to the vertex coordinates + * @param attributeMatrix + */ + void setVertexAttributeMatrix(const AttributeMatrix& attributeMatrix); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override; + +protected: + AbstractNodeGeometry0D(DataStructure& dataStructure, std::string name); + + AbstractNodeGeometry0D(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + /* *************************************************************************** + * These variables are the Ids of the arrays from the DataStructure object. + */ + std::optional m_VertexDataArrayId; + std::optional m_VertexAttributeMatrixId; + +private: + /** + * @brief Helper function that returns whether or not this geometry is in a plane + * Returns empty if the vertex list or data store does not exist. + * @param dimensionIndex The dimensional index to check for equality. + * YZ plane --> dimensionIndex = 0 + * XZ plane --> dimensionIndex = 1 + * XY plane --> dimensionIndex = 2 + * @return + */ + Result isPlane(usize dimensionIndex) const; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.cpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.cpp new file mode 100644 index 0000000000..6e1889bf6b --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.cpp @@ -0,0 +1,299 @@ +#include "AbstractNodeGeometry1D.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractNodeGeometry1D::AbstractNodeGeometry1D(DataStructure& dataStructure, std::string name) +: AbstractNodeGeometry0D(dataStructure, std::move(name)) +{ +} + +AbstractNodeGeometry1D::AbstractNodeGeometry1D(DataStructure& dataStructure, std::string name, IdType importId) +: AbstractNodeGeometry0D(dataStructure, std::move(name), importId) +{ +} + +const std::optional& AbstractNodeGeometry1D::getEdgeListDataArrayId() const +{ + return m_EdgeDataArrayId; +} + +AbstractNodeGeometry1D::SharedEdgeList* AbstractNodeGeometry1D::getEdges() +{ + if(!m_EdgeDataArrayId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_EdgeDataArrayId); +} + +const AbstractNodeGeometry1D::SharedEdgeList* AbstractNodeGeometry1D::getEdges() const +{ + if(!m_EdgeDataArrayId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_EdgeDataArrayId); +} + +AbstractNodeGeometry1D::SharedEdgeList& AbstractNodeGeometry1D::getEdgesRef() +{ + if(!m_EdgeDataArrayId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared edge list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_EdgeDataArrayId.value()); +} + +const AbstractNodeGeometry1D::SharedEdgeList& AbstractNodeGeometry1D::getEdgesRef() const +{ + if(!m_EdgeDataArrayId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared edge list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_EdgeDataArrayId.value()); +} + +void AbstractNodeGeometry1D::setEdgeList(const SharedEdgeList& edges) +{ + m_EdgeDataArrayId = edges.getId(); +} + +std::optional AbstractNodeGeometry1D::getEdgeListId() const +{ + return m_EdgeDataArrayId; +} + +void AbstractNodeGeometry1D::setEdgeListId(const std::optional& edgeList) +{ + m_EdgeDataArrayId = edgeList; +} + +void AbstractNodeGeometry1D::resizeEdgeList(usize size) +{ + getEdgesRef().getIDataStoreRef().resizeTuples({size}); +} + +usize AbstractNodeGeometry1D::getNumberOfCells() const +{ + return getNumberOfEdges(); +} + +usize AbstractNodeGeometry1D::getNumberOfEdges() const +{ + const auto* edgesPtr = getEdges(); + return edgesPtr == nullptr ? 0 : edgesPtr->getNumberOfTuples(); +} + +void AbstractNodeGeometry1D::setEdgePointIds(usize edgeId, nonstd::span vertexIds) +{ + auto& edges = getEdgesRef(); + const usize offset = edgeId * k_NumEdgeVerts; + if(offset + k_NumEdgeVerts > edges.getSize()) + { + return; + } + for(usize i = 0; i < k_NumEdgeVerts; i++) + { + edges[offset + i] = vertexIds[i]; + } +} + +void AbstractNodeGeometry1D::getEdgePointIds(usize edgeId, nonstd::span vertexIds) const +{ + auto& cells = getEdgesRef(); + const usize offset = edgeId * k_NumEdgeVerts; + if(offset + k_NumEdgeVerts > cells.getSize()) + { + return; + } + for(usize i = 0; i < k_NumEdgeVerts; i++) + { + vertexIds[i] = cells.at(offset + i); + } +} + +void AbstractNodeGeometry1D::getEdgeCoordinates(usize edgeId, nonstd::span coords) const +{ + std::array verts = {0, 0}; + getEdgePointIds(edgeId, verts); + coords[0] = getVertexCoordinate(verts[0]); + coords[1] = getVertexCoordinate(verts[1]); +} + +const AbstractNodeGeometry1D::ElementDynamicList* AbstractNodeGeometry1D::getElementsContainingVert() const +{ + return getDataStructureRef().getDataAs(m_CellContainingVertDataArrayId); +} + +void AbstractNodeGeometry1D::deleteElementsContainingVert() +{ + getDataStructureRef().removeData(m_CellContainingVertDataArrayId); + m_CellContainingVertDataArrayId.reset(); +} + +const AbstractNodeGeometry1D::ElementDynamicList* AbstractNodeGeometry1D::getElementNeighbors() const +{ + return getDataStructureRef().getDataAs(m_CellNeighborsDataArrayId); +} + +void AbstractNodeGeometry1D::deleteElementNeighbors() +{ + if(!getDataStructureRef().removeData(m_CellNeighborsDataArrayId)) + { + throw std::runtime_error(fmt::format("{}({}): Function {}: Unable to remove Element Neighbors", "deleteElementNeighbors()", __FILE__, __LINE__)); + } + m_CellNeighborsDataArrayId.reset(); +} + +const Float32Array* AbstractNodeGeometry1D::getElementCentroids() const +{ + return getDataStructureRef().getDataAs(m_CellCentroidsDataArrayId); +} + +void AbstractNodeGeometry1D::deleteElementCentroids() +{ + getDataStructureRef().removeData(m_CellCentroidsDataArrayId); + m_CellCentroidsDataArrayId.reset(); +} + +const std::optional& AbstractNodeGeometry1D::getEdgeAttributeMatrixId() const +{ + return m_EdgeAttributeMatrixId; +} + +AttributeMatrix* AbstractNodeGeometry1D::getEdgeAttributeMatrix() +{ + if(!m_EdgeAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_EdgeAttributeMatrixId); +} + +const AttributeMatrix* AbstractNodeGeometry1D::getEdgeAttributeMatrix() const +{ + if(!m_EdgeAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_EdgeAttributeMatrixId); +} + +AttributeMatrix& AbstractNodeGeometry1D::getEdgeAttributeMatrixRef() +{ + if(!m_EdgeAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have an edge attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_EdgeAttributeMatrixId.value()); +} + +const AttributeMatrix& AbstractNodeGeometry1D::getEdgeAttributeMatrixRef() const +{ + if(!m_EdgeAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have an edge attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_EdgeAttributeMatrixId.value()); +} + +DataPath AbstractNodeGeometry1D::getEdgeAttributeMatrixDataPath() const +{ + return getEdgeAttributeMatrixRef().getDataPaths().at(0); +} + +void AbstractNodeGeometry1D::setEdgeAttributeMatrix(const AttributeMatrix& attributeMatrix) +{ + m_EdgeAttributeMatrixId = attributeMatrix.getId(); +} + +void AbstractNodeGeometry1D::setEdgeDataId(const std::optional& edgeDataId) +{ + m_EdgeAttributeMatrixId = edgeDataId; +} + +std::optional AbstractNodeGeometry1D::getElementContainingVertId() const +{ + return m_CellContainingVertDataArrayId; +} + +std::optional AbstractNodeGeometry1D::getElementNeighborsId() const +{ + return m_CellNeighborsDataArrayId; +} + +std::optional AbstractNodeGeometry1D::getElementCentroidsId() const +{ + return m_CellCentroidsDataArrayId; +} + +std::optional AbstractNodeGeometry1D::getElementSizesId() const +{ + return m_ElementSizesId; +} + +void AbstractNodeGeometry1D::setElementContainingVertId(const std::optional& elementsContainingVertId) +{ + m_CellContainingVertDataArrayId = elementsContainingVertId; +} + +void AbstractNodeGeometry1D::setElementNeighborsId(const std::optional& elementNeighborsId) +{ + m_CellNeighborsDataArrayId = elementNeighborsId; +} + +void AbstractNodeGeometry1D::setElementCentroidsId(const std::optional& centroidsId) +{ + m_CellCentroidsDataArrayId = centroidsId; +} + +void AbstractNodeGeometry1D::setElementSizesId(const std::optional& sizesId) +{ + m_ElementSizesId = sizesId; +} + +void AbstractNodeGeometry1D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + AbstractNodeGeometry0D::checkUpdatedIdsImpl(updatedIdsMap); + + std::vector visited(7, false); + + for(const auto& updatedId : updatedIdsMap) + { + m_EdgeAttributeMatrixId = nx::core::VisitDataStructureId(m_EdgeAttributeMatrixId, updatedId, visited, 0); + m_EdgeDataArrayId = nx::core::VisitDataStructureId(m_EdgeDataArrayId, updatedId, visited, 1); + m_CellContainingVertDataArrayId = nx::core::VisitDataStructureId(m_CellContainingVertDataArrayId, updatedId, visited, 2); + m_CellNeighborsDataArrayId = nx::core::VisitDataStructureId(m_CellNeighborsDataArrayId, updatedId, visited, 3); + m_CellCentroidsDataArrayId = nx::core::VisitDataStructureId(m_CellCentroidsDataArrayId, updatedId, visited, 4); + m_ElementSizesId = nx::core::VisitDataStructureId(m_ElementSizesId, updatedId, visited, 5); + } +} + +Result<> AbstractNodeGeometry1D::validate() const +{ + // Validate the next lower dimension geometry + Result<> result = AbstractNodeGeometry0D::validate(); + + usize numTuples = getNumberOfEdges(); + const AttributeMatrix* amPtr = getEdgeAttributeMatrix(); + if(nullptr == amPtr) + { + return result; + } + usize amNumTuples = amPtr->getNumberOfTuples(); + + if(numTuples != amNumTuples) + { + return MergeResults( + result, MakeErrorResult(-4501, fmt::format("Edge Geometry '{}' has {} edges but the edge Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); + } + return result; +} + +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp new file mode 100644 index 0000000000..6dd415586e --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp @@ -0,0 +1,236 @@ +#pragma once + +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" + +namespace nx::core +{ +class SIMPLNX_EXPORT AbstractNodeGeometry1D : public AbstractNodeGeometry0D, public INodeGeometry1D +{ +public: + static constexpr StringLiteral k_TypeName = "INodeGeometry1D"; + + ~AbstractNodeGeometry1D() noexcept override = default; + + /** + * @brief + * @return + */ + SharedEdgeList* getEdges(); + + /** + * @brief + * @return + */ + const SharedEdgeList* getEdges() const; + + /** + * @brief + * @return + */ + SharedEdgeList& getEdgesRef(); + + /** + * @brief + * @return + */ + const SharedEdgeList& getEdgesRef() const; + + /** + * @brief + * @return + */ + void setEdgeList(const SharedEdgeList& edges); + + std::optional getEdgeListId() const; + void setEdgeListId(const std::optional& edgeList); + + /** + * @brief Resizes the edge list to the target size. + * @param size + */ + void resizeEdgeList(usize size); + + /** + * @brief Returns the number of edges in the geometry. + * @return usize + */ + usize getNumberOfCells() const override; + + /** + * @brief returns the number of edges in the geometry + * @return + */ + usize getNumberOfEdges() const; + + /** + * @brief + * @return + */ + usize getNumberOfVerticesPerEdge() const override = 0; + + /** + * @brief Sets the vertex IDs making up the specified edge. This method does + * nothing if the edge list could not be found. + * @param edgeId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void setEdgePointIds(usize edgeId, nonstd::span vertexIds); + + /** + * @brief Returns the vertices that make up the specified edge by reference. + * This method does nothing if the edge list could not be found. + * @param edgeId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void getEdgePointIds(usize edgeId, nonstd::span vertexIds) const; + + /** + * @brief Returns the vertex coordinates for a specified edge by reference. + * This method does nothing if the edge list could not be found. + * @param edgeId + * @param vert1 + * @param vert2 + */ + void getEdgeCoordinates(usize edgeId, nonstd::span coords) const; + + /** + * @brief + * recalculate If true, this function will recalculate the array. Otherwise, it will leave the array as is. + * @return Result<> + */ + Result<> findElementsContainingVert(bool recalculate) override = 0; + + /** + * @brief + * @return const ElementDynamicList* + */ + const ElementDynamicList* getElementsContainingVert() const; + + /** + * @brief + */ + void deleteElementsContainingVert(); + + /** + * @brief + * @return Result<> + */ + Result<> findElementNeighbors(bool recalculate) override = 0; + + /** + * @brief + * @return const ElementDynamicList* + */ + const ElementDynamicList* getElementNeighbors() const; + + /** + * @brief + */ + void deleteElementNeighbors(); + + /** + * @brief + * @return Result<> + */ + Result<> findElementCentroids(bool recalculate) override = 0; + + /** + * @brief + * @return const Float32Array* + */ + const Float32Array* getElementCentroids() const; + + /** + * @brief + */ + void deleteElementCentroids(); + + /**************************************************************************** + * These functions get values related to where the Vertex Coordinates are + * stored in the DataStructure + */ + + const std::optional& getEdgeListDataArrayId() const; + + /** + * @brief + * @return + */ + const std::optional& getEdgeAttributeMatrixId() const; + + /** + * @brief Returns pointer to the Attribute Matrix that holds data assigned to each edge + * @return + */ + AttributeMatrix* getEdgeAttributeMatrix(); + + /** + * @brief Returns pointer to the Attribute Matrix that holds data assigned to each edge + * @return + */ + const AttributeMatrix* getEdgeAttributeMatrix() const; + + /** + * @brief Returns reference to the Attribute Matrix that holds data assigned to each edge + * @return + */ + AttributeMatrix& getEdgeAttributeMatrixRef(); + + /** + * @brief Returns reference to the Attribute Matrix that holds data assigned to each edge + * @return + */ + const AttributeMatrix& getEdgeAttributeMatrixRef() const; + + /** + * @brief Returns the DataPath to the AttributeMatrix for the edge data + * @return + */ + DataPath getEdgeAttributeMatrixDataPath() const; + + /** + * @brief Sets the Attribute Matrix for the data assigned to the edges + * @param attributeMatrix + */ + void setEdgeAttributeMatrix(const AttributeMatrix& attributeMatrix); + + void setEdgeDataId(const std::optional& edgeDataId); + + std::optional getElementContainingVertId() const; + std::optional getElementNeighborsId() const; + std::optional getElementCentroidsId() const; + std::optional getElementSizesId() const; + + void setElementContainingVertId(const std::optional& elementsContainingVertId); + void setElementNeighborsId(const std::optional& elementNeighborsId); + void setElementCentroidsId(const std::optional& centroidsId); + void setElementSizesId(const std::optional& sizesId); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override; + +protected: + AbstractNodeGeometry1D(DataStructure& dataStructure, std::string name); + + AbstractNodeGeometry1D(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + /* *************************************************************************** + * These variables are the Ids of the arrays from the DataStructure object. + */ + std::optional m_EdgeDataArrayId; + std::optional m_EdgeAttributeMatrixId; + std::optional m_CellContainingVertDataArrayId; + std::optional m_CellNeighborsDataArrayId; + std::optional m_CellCentroidsDataArrayId; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.cpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.cpp new file mode 100644 index 0000000000..47e02a96b9 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.cpp @@ -0,0 +1,248 @@ +#include "AbstractNodeGeometry2D.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractNodeGeometry2D::AbstractNodeGeometry2D(DataStructure& dataStructure, std::string name) +: AbstractNodeGeometry1D(dataStructure, std::move(name)) +{ +} + +AbstractNodeGeometry2D::AbstractNodeGeometry2D(DataStructure& dataStructure, std::string name, IdType importId) +: AbstractNodeGeometry1D(dataStructure, std::move(name), importId) +{ +} + +const std::optional& AbstractNodeGeometry2D::getFaceListDataArrayId() const +{ + return m_FaceListId; +} + +AbstractNodeGeometry2D::OptionalId AbstractNodeGeometry2D::getFaceListId() const +{ + return m_FaceListId; +} + +void AbstractNodeGeometry2D::setFaceListId(const OptionalId& facesId) +{ + m_FaceListId = facesId; +} + +AbstractNodeGeometry2D::SharedFaceList* AbstractNodeGeometry2D::getFaces() +{ + if(!m_FaceListId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_FaceListId); +} + +const AbstractNodeGeometry2D::SharedFaceList* AbstractNodeGeometry2D::getFaces() const +{ + if(!m_FaceListId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_FaceListId); +} + +AbstractNodeGeometry2D::SharedFaceList& AbstractNodeGeometry2D::getFacesRef() +{ + if(!m_FaceListId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared face list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_FaceListId.value()); +} + +const AbstractNodeGeometry2D::SharedFaceList& AbstractNodeGeometry2D::getFacesRef() const +{ + if(!m_FaceListId.has_value()) + { + throw std::runtime_error( + fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared face list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_FaceListId.value()); +} + +void AbstractNodeGeometry2D::setFaceList(const SharedFaceList& faces) +{ + m_FaceListId = faces.getId(); +} + +void AbstractNodeGeometry2D::resizeFaceList(usize size) +{ + getFacesRef().getIDataStoreRef().resizeTuples({size}); +} + +usize AbstractNodeGeometry2D::getNumberOfFaces() const +{ + const auto* facesPtr = getFaces(); + return facesPtr == nullptr ? 0 : facesPtr->getNumberOfTuples(); +} + +void AbstractNodeGeometry2D::setFacePointIds(usize faceId, nonstd::span vertexIds) +{ + auto& faces = getFacesRef(); + const usize offset = faceId * getNumberOfVerticesPerFace(); + if(offset + getNumberOfVerticesPerFace() > faces.getSize()) + { + return; + } + for(usize i = 0; i < getNumberOfVerticesPerFace(); i++) + { + faces[offset + i] = vertexIds[i]; + } +} + +void AbstractNodeGeometry2D::getFacePointIds(usize faceId, nonstd::span vertexIds) const +{ + auto& cells = getFacesRef(); + const usize offset = faceId * getNumberOfVerticesPerFace(); + if(offset + getNumberOfVerticesPerFace() > cells.getSize()) + { + return; + } + for(usize i = 0; i < getNumberOfVerticesPerFace(); i++) + { + vertexIds[i] = cells.at(offset + i); + } +} + +void AbstractNodeGeometry2D::getFaceCoordinates(usize faceId, nonstd::span coords) const +{ + std::vector verts(getNumberOfVerticesPerFace()); + getFacePointIds(faceId, verts); + for(usize index = 0; index < verts.size(); index++) + { + coords[index] = getVertexCoordinate(verts[index]); + } +} + +void AbstractNodeGeometry2D::deleteEdges() +{ + getDataStructureRef().removeData(m_EdgeDataArrayId); + m_EdgeDataArrayId.reset(); +} + +const std::optional& AbstractNodeGeometry2D::getUnsharedEdgesId() const +{ + return m_UnsharedEdgeListId; +} + +void AbstractNodeGeometry2D::setUnsharedEdgesId(const OptionalId& unsharedEdgesId) +{ + m_UnsharedEdgeListId = unsharedEdgesId; +} + +const AbstractNodeGeometry2D::SharedEdgeList* AbstractNodeGeometry2D::getUnsharedEdges() const +{ + return getDataStructureRef().getDataAs(m_UnsharedEdgeListId); +} + +void AbstractNodeGeometry2D::deleteUnsharedEdges() +{ + getDataStructureRef().removeData(m_UnsharedEdgeListId); + m_UnsharedEdgeListId.reset(); +} + +const std::optional& AbstractNodeGeometry2D::getFaceAttributeMatrixId() const +{ + return m_FaceAttributeMatrixId; +} + +void AbstractNodeGeometry2D::setFaceDataId(const OptionalId& faceDataId) +{ + m_FaceAttributeMatrixId = faceDataId; +} + +AttributeMatrix* AbstractNodeGeometry2D::getFaceAttributeMatrix() +{ + if(!m_FaceAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_FaceAttributeMatrixId); +} + +const AttributeMatrix* AbstractNodeGeometry2D::getFaceAttributeMatrix() const +{ + if(!m_FaceAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_FaceAttributeMatrixId); +} + +AttributeMatrix& AbstractNodeGeometry2D::getFaceAttributeMatrixRef() +{ + if(!m_FaceAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry2D::{} threw runtime exception. The geometry with name '{}' does not have a face attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_FaceAttributeMatrixId.value()); +} + +const AttributeMatrix& AbstractNodeGeometry2D::getFaceAttributeMatrixRef() const +{ + if(!m_FaceAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry2D::{} threw runtime exception. The geometry with name '{}' does not have a face attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_FaceAttributeMatrixId.value()); +} + +DataPath AbstractNodeGeometry2D::getFaceAttributeMatrixDataPath() const +{ + return getFaceAttributeMatrixRef().getDataPaths().at(0); +} + +void AbstractNodeGeometry2D::setFaceAttributeMatrix(const AttributeMatrix& attributeMatrix) +{ + m_FaceAttributeMatrixId = attributeMatrix.getId(); +} +AbstractNodeGeometry2D::SharedEdgeList* AbstractNodeGeometry2D::createSharedEdgeList(usize numEdges) +{ + auto dataStore = std::make_unique>(std::vector{numEdges}, std::vector{2}, 0); + SharedEdgeList* edges = DataArray::Create(*getDataStructure(), k_SharedEdgeListName, std::move(dataStore), getId()); + return edges; +} + +void AbstractNodeGeometry2D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + AbstractNodeGeometry1D::checkUpdatedIdsImpl(updatedIdsMap); + std::vector visited(3, false); + for(const auto& updatedId : updatedIdsMap) + { + m_FaceListId = nx::core::VisitDataStructureId(m_FaceListId, updatedId, visited, 0); + m_FaceAttributeMatrixId = nx::core::VisitDataStructureId(m_FaceAttributeMatrixId, updatedId, visited, 1); + m_UnsharedEdgeListId = nx::core::VisitDataStructureId(m_UnsharedEdgeListId, updatedId, visited, 2); + } +} + +Result<> AbstractNodeGeometry2D::validate() const +{ + // Validate the next lower dimension geometry + Result<> result = AbstractNodeGeometry1D::validate(); + + usize numTuples = getNumberOfFaces(); + const AttributeMatrix* amPtr = getFaceAttributeMatrix(); + if(nullptr == amPtr) + { + return result; + } + usize amNumTuples = amPtr->getNumberOfTuples(); + + if(numTuples != amNumTuples) + { + return MergeResults(result, MakeErrorResult(-4501, fmt::format("Triangle/Quad Geometry '{}' has {} faces but the face Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, + amPtr->getName(), amNumTuples))); + } + return result; +} + +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp new file mode 100644 index 0000000000..f121f9f658 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp @@ -0,0 +1,224 @@ +#pragma once + +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" + +namespace nx::core +{ +namespace NodeType +{ +inline constexpr int8_t Unused = 0; +inline constexpr int8_t Default = 2; +inline constexpr int8_t TriplePoint = 3; +inline constexpr int8_t QuadPoint = 4; +inline constexpr int8_t SurfaceDefault = 12; +inline constexpr int8_t SurfaceTriplePoint = 13; +inline constexpr int8_t SurfaceQuadPoint = 14; +} // namespace NodeType + +class SIMPLNX_EXPORT AbstractNodeGeometry2D : public AbstractNodeGeometry1D, public INodeGeometry2D +{ +public: + static constexpr StringLiteral k_TypeName = "INodeGeometry2D"; + + AbstractNodeGeometry2D() = delete; + AbstractNodeGeometry2D(const AbstractNodeGeometry2D&) = default; + AbstractNodeGeometry2D(AbstractNodeGeometry2D&&) = default; + + AbstractNodeGeometry2D& operator=(const AbstractNodeGeometry2D&) = delete; + AbstractNodeGeometry2D& operator=(AbstractNodeGeometry2D&&) noexcept = delete; + + ~AbstractNodeGeometry2D() noexcept override = default; + + /** + * @brief Returns a pointer to the Face List + * @return + */ + SharedFaceList* getFaces(); + + /** + * @brief Returns a pointer to the Face List + * @return + */ + const SharedFaceList* getFaces() const; + + /** + * @brief Returns a reference to the Face List + * @return + */ + SharedFaceList& getFacesRef(); + + /** + * @brief Returns a reference to the Face List + * @return + */ + const SharedFaceList& getFacesRef() const; + + /** + * @brief Sets the list of Faces for this geometry + * @param faces The new list of faces + */ + void setFaceList(const SharedFaceList& faces); + + OptionalId getFaceListId() const; + void setFaceListId(const OptionalId& facesId); + + /** + * @brief Resizes the face list to the target size. + * @param size + */ + void resizeFaceList(usize size); + + /** + * @brief Returns the number of faces in the geometry. + * @return usize + */ + usize getNumberOfFaces() const; + + /** + * @brief + * @return + */ + usize getNumberOfVerticesPerFace() const override = 0; + + /** + * @brief + * @param triId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void setFacePointIds(usize triId, nonstd::span vertexIds); + + /** + * @brief + * @param faceId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void getFacePointIds(usize faceId, nonstd::span vertexIds) const; + + /** + * @brief + * @param faceId + * @param coords The coordinates of each vertex + */ + void getFaceCoordinates(usize faceId, nonstd::span coords) const; + + /** + * @brief + * @return Result<> + */ + Result<> findEdges(bool recalculate) override = 0; + + /** + * @brief Deletes the shared edge list and removes it from the DataStructure. + */ + void deleteEdges(); + + /** + * @brief + * @return + */ + const std::optional& getUnsharedEdgesId() const; + + void setUnsharedEdgesId(const OptionalId& unsharedEdgesId); + + /** + * @brief + * @return Result<> + */ + Result<> findUnsharedEdges(bool recalculate) override = 0; + + /** + * @brief Returns a const pointer to the unshared edge list. Returns nullptr + * if no unshared edge list could be found. + * @return const SharedEdgeList* + */ + const SharedEdgeList* getUnsharedEdges() const; + + /** + * @brief Deletes the unshared edge list and removes it from the DataStructure. + */ + void deleteUnsharedEdges(); + + /**************************************************************************** + * These functions get values related to where the Vertex Coordinates are + * stored in the DataStructure + */ + + const std::optional& getFaceListDataArrayId() const; + + /** + * @brief + * @return + */ + const std::optional& getFaceAttributeMatrixId() const; + + void setFaceDataId(const OptionalId& faceDataId); + + /** + * @brief + * @return + */ + AttributeMatrix* getFaceAttributeMatrix(); + + /** + * @brief + * @return + */ + const AttributeMatrix* getFaceAttributeMatrix() const; + + /** + * @brief + * @return + */ + AttributeMatrix& getFaceAttributeMatrixRef(); + + /** + * @brief + * @return + */ + const AttributeMatrix& getFaceAttributeMatrixRef() const; + + /** + * @brief + * @return + */ + DataPath getFaceAttributeMatrixDataPath() const; + + /** + * @brief + * @param attributeMatrix + */ + void setFaceAttributeMatrix(const AttributeMatrix& attributeMatrix); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override; + +protected: + AbstractNodeGeometry2D(DataStructure& dataStructure, std::string name); + + AbstractNodeGeometry2D(DataStructure& dataStructure, std::string name, IdType importId); + + /** + * @brief + * @param numEdges + * @return SharedEdgeList* + */ + SharedEdgeList* createSharedEdgeList(usize numEdges); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + /* *************************************************************************** + * These variables are the Ids of the arrays from the DataStructure object. + */ + std::optional m_FaceListId; + std::optional m_FaceAttributeMatrixId; + std::optional m_UnsharedEdgeListId; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.cpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.cpp new file mode 100644 index 0000000000..bbf2cc995b --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.cpp @@ -0,0 +1,258 @@ +#include "AbstractNodeGeometry3D.hpp" + +#include "simplnx/Utilities/DataObjectUtilities.hpp" + +namespace nx::core +{ +AbstractNodeGeometry3D::AbstractNodeGeometry3D(DataStructure& dataStructure, std::string name) +: AbstractNodeGeometry2D(dataStructure, std::move(name)) +{ +} + +AbstractNodeGeometry3D::AbstractNodeGeometry3D(DataStructure& dataStructure, std::string name, IdType importId) +: AbstractNodeGeometry2D(dataStructure, std::move(name), importId) +{ +} + +const std::optional& AbstractNodeGeometry3D::getPolyhedronListId() const +{ + return m_PolyhedronListId; +} + +void AbstractNodeGeometry3D::setPolyhedronListId(const OptionalId& polyListId) +{ + m_PolyhedronListId = polyListId; +} + +AbstractNodeGeometry3D::SharedFaceList* AbstractNodeGeometry3D::getPolyhedra() +{ + if(!m_PolyhedronListId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_PolyhedronListId); +} + +const AbstractNodeGeometry3D::SharedFaceList* AbstractNodeGeometry3D::getPolyhedra() const +{ + if(!m_PolyhedronListId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_PolyhedronListId); +} + +AbstractNodeGeometry3D::SharedFaceList& AbstractNodeGeometry3D::getPolyhedraRef() +{ + if(!m_PolyhedronListId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared polyhedra list assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_PolyhedronListId.value()); +} + +const AbstractNodeGeometry3D::SharedFaceList& AbstractNodeGeometry3D::getPolyhedraRef() const +{ + if(!m_PolyhedronListId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared polyhedra list assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_PolyhedronListId.value()); +} + +AbstractNodeGeometry3D::OptionalId AbstractNodeGeometry3D::getPolyhedraDataId() const +{ + return m_PolyhedronAttributeMatrixId; +} + +void AbstractNodeGeometry3D::setPolyhedraList(const SharedFaceList& polyhedra) +{ + m_PolyhedronListId = polyhedra.getId(); +} + +void AbstractNodeGeometry3D::resizePolyhedraList(usize size) +{ + getPolyhedraRef().getIDataStoreRef().resizeTuples({size}); +} + +usize AbstractNodeGeometry3D::getNumberOfPolyhedra() const +{ + const auto* polyhedraPtr = getPolyhedra(); + return polyhedraPtr == nullptr ? 0 : polyhedraPtr->getNumberOfTuples(); +} + +void AbstractNodeGeometry3D::setCellPointIds(usize polyhedraId, nonstd::span vertexIds) +{ + auto& polyhedra = getPolyhedraRef(); + usize numVerts = getNumberOfVerticesPerCell(); + const usize offset = polyhedraId * numVerts; + if(offset + numVerts > polyhedra.getSize()) + { + return; + } + for(usize i = 0; i < numVerts; i++) + { + polyhedra[polyhedraId * numVerts + i] = vertexIds[i]; + } +} + +void AbstractNodeGeometry3D::getCellPointIds(usize polyhedraId, nonstd::span vertexIds) const +{ + auto& polyhedra = getPolyhedraRef(); + usize numVerts = getNumberOfVerticesPerCell(); + const usize offset = polyhedraId * numVerts; + if(offset + numVerts > polyhedra.getSize()) + { + return; + } + for(usize i = 0; i < numVerts; i++) + { + vertexIds[i] = polyhedra[offset + i]; + } +} + +void AbstractNodeGeometry3D::getCellCoordinates(usize hexId, nonstd::span coords) const +{ + usize numVerts = getNumberOfVerticesPerCell(); + std::vector vertIds(numVerts, 0); + getCellPointIds(hexId, vertIds); + for(usize index = 0; index < numVerts; index++) + { + coords[index] = getVertexCoordinate(vertIds[index]); + } +} + +void AbstractNodeGeometry3D::deleteFaces() +{ + getDataStructureRef().removeData(m_FaceListId); + m_FaceListId.reset(); +} + +const std::optional& AbstractNodeGeometry3D::getUnsharedFacesId() const +{ + return m_UnsharedFaceListId; +} + +void AbstractNodeGeometry3D::setUnsharedFacedId(const OptionalId& id) +{ + m_UnsharedFaceListId = id; +} + +const AbstractNodeGeometry3D::SharedFaceList* AbstractNodeGeometry3D::getUnsharedFaces() const +{ + return getDataStructureRef().getDataAs(m_UnsharedFaceListId); +} + +void AbstractNodeGeometry3D::deleteUnsharedFaces() +{ + getDataStructureRef().removeData(m_UnsharedFaceListId); + m_UnsharedFaceListId.reset(); +} + +const std::optional& AbstractNodeGeometry3D::getPolyhedraAttributeMatrixId() const +{ + return m_PolyhedronAttributeMatrixId; +} + +void AbstractNodeGeometry3D::setPolyhedraDataId(const OptionalId& polyDataId) +{ + m_PolyhedronAttributeMatrixId = polyDataId; +} + +AttributeMatrix* AbstractNodeGeometry3D::getPolyhedraAttributeMatrix() +{ + if(!m_PolyhedronAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_PolyhedronAttributeMatrixId); +} + +const AttributeMatrix* AbstractNodeGeometry3D::getPolyhedraAttributeMatrix() const +{ + if(!m_PolyhedronAttributeMatrixId.has_value()) + { + return nullptr; + } + return getDataStructureRef().getDataAs(m_PolyhedronAttributeMatrixId); +} + +AttributeMatrix& AbstractNodeGeometry3D::getPolyhedraAttributeMatrixRef() +{ + if(!m_PolyhedronAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a polyhedra attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_PolyhedronAttributeMatrixId.value()); +} + +const AttributeMatrix& AbstractNodeGeometry3D::getPolyhedraAttributeMatrixRef() const +{ + if(!m_PolyhedronAttributeMatrixId.has_value()) + { + throw std::runtime_error(fmt::format("AbstractNodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a polyhedra attribute matrix assigned.\n {}:{}", __func__, + getName(), __FILE__, __LINE__)); + } + return getDataStructureRef().getDataRefAs(m_PolyhedronAttributeMatrixId.value()); +} + +DataPath AbstractNodeGeometry3D::getPolyhedronAttributeMatrixDataPath() const +{ + return getPolyhedraAttributeMatrixRef().getDataPaths().at(0); +} + +void AbstractNodeGeometry3D::setPolyhedraAttributeMatrix(const AttributeMatrix& attributeMatrix) +{ + m_PolyhedronAttributeMatrixId = attributeMatrix.getId(); +} +AbstractNodeGeometry3D::SharedQuadList* AbstractNodeGeometry3D::createSharedQuadList(usize numQuads) +{ + auto dataStore = std::make_unique>(std::vector{numQuads}, std::vector{4}, 0); + SharedQuadList* quads = DataArray::Create(*getDataStructure(), k_SharedFacesListName, std::move(dataStore), getId()); + return quads; +} + +AbstractNodeGeometry3D::SharedTriList* AbstractNodeGeometry3D::createSharedTriList(usize numTris) +{ + auto dataStore = std::make_unique>(std::vector{numTris}, std::vector{3}, 0); + SharedTriList* triangles = DataArray::Create(*getDataStructure(), k_SharedFacesListName, std::move(dataStore), getId()); + return triangles; +} + +void AbstractNodeGeometry3D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +{ + AbstractNodeGeometry2D::checkUpdatedIdsImpl(updatedIdsMap); + std::vector visited(3, false); + + for(const auto& updatedId : updatedIdsMap) + { + m_PolyhedronListId = nx::core::VisitDataStructureId(m_PolyhedronListId, updatedId, visited, 0); + m_PolyhedronAttributeMatrixId = nx::core::VisitDataStructureId(m_PolyhedronAttributeMatrixId, updatedId, visited, 1); + m_UnsharedFaceListId = nx::core::VisitDataStructureId(m_UnsharedFaceListId, updatedId, visited, 2); + } +} + +Result<> AbstractNodeGeometry3D::validate() const +{ + // Validate the next lower dimension geometry + Result<> result = AbstractNodeGeometry2D::validate(); + + usize numTuples = getNumberOfPolyhedra(); + const AttributeMatrix* amPtr = getPolyhedraAttributeMatrix(); + if(nullptr == amPtr) + { + return result; + } + usize amNumTuples = amPtr->getNumberOfTuples(); + + if(numTuples != amNumTuples) + { + return MergeResults( + result, MakeErrorResult(-4501, fmt::format("Hex/Tet Geometry '{}' has {} cells but the cell Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); + } + return result; +} +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp new file mode 100644 index 0000000000..5e4f64aa53 --- /dev/null +++ b/src/simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp @@ -0,0 +1,217 @@ +#pragma once + +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" + +namespace nx::core +{ +class SIMPLNX_EXPORT AbstractNodeGeometry3D : public AbstractNodeGeometry2D, public INodeGeometry3D +{ +public: + static constexpr StringLiteral k_TypeName = "INodeGeometry3D"; + + AbstractNodeGeometry3D() = delete; + AbstractNodeGeometry3D(const AbstractNodeGeometry3D&) = default; + AbstractNodeGeometry3D(AbstractNodeGeometry3D&&) = default; + + AbstractNodeGeometry3D& operator=(const AbstractNodeGeometry3D&) = delete; + AbstractNodeGeometry3D& operator=(AbstractNodeGeometry3D&&) noexcept = delete; + + ~AbstractNodeGeometry3D() noexcept override = default; + + void setPolyhedronListId(const OptionalId& polyListId); + + /** + * @brief + * @return + */ + SharedFaceList* getPolyhedra(); + + /** + * @brief + * @return + */ + const SharedFaceList* getPolyhedra() const; + + /** + * @brief + * @return + */ + SharedFaceList& getPolyhedraRef(); + + /** + * @brief + * @return + */ + const SharedFaceList& getPolyhedraRef() const; + + /** + * @brief + * @param polyhedra + */ + void setPolyhedraList(const SharedFaceList& polyhedra); + + /** + * @brief Resizes the polyhedra list to the target size. + * @param size + */ + void resizePolyhedraList(usize size); + + OptionalId getPolyhedraDataId() const; + + /** + * @brief Returns the number of polyhedra in the geometry. + * @return usize + */ + usize getNumberOfPolyhedra() const; + + /** + * @brief Creates and assigns the face list array for the current values. + * @return Result<> + */ + Result<> findFaces(bool recalculate) override = 0; + + /** + * @brief Deletes the current face list array. + */ + void deleteFaces(); + + /** + * @brief + * @return + */ + const std::optional& getUnsharedFacesId() const; + + /** + * @brief + * @return + */ + void setUnsharedFacedId(const OptionalId& id); + + /** + * @brief Creates and assigns the unshared face list array for the current values. + */ + Result<> findUnsharedFaces(bool recalculate) override = 0; + + /** + * @brief Returns a pointer to the unshared face list array. + * @return + */ + const SharedFaceList* getUnsharedFaces() const; + + /** + * @brief Deletes the current unshared face list array. + */ + void deleteUnsharedFaces(); + + /** + * @brief Returns the number of vertices in the cell. + * @return + */ + usize getNumberOfVerticesPerCell() const override = 0; + + /** + * @brief + * @param tetId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void setCellPointIds(usize tetId, nonstd::span vertexIds); + + /** + * @brief + * @param tetId + * @param vertexIds The index into the shared vertex list of each vertex + */ + void getCellPointIds(usize tetId, nonstd::span vertexIds) const; + + /** + * @brief + * @param tetId + * @param coords The coordinates of each vertex + */ + void getCellCoordinates(usize tetId, nonstd::span coords) const; + + /**************************************************************************** + * These functions get values related to where the Vertex Coordinates are + * stored in the DataStructure + */ + + /** + * @brief + * @return + */ + const std::optional& getPolyhedronListId() const; + + void setPolyhedraDataId(const OptionalId& polyDataId); + + /** + * @brief + * @return + */ + const std::optional& getPolyhedraAttributeMatrixId() const; + + /** + * @brief + * @return + */ + AttributeMatrix* getPolyhedraAttributeMatrix(); + + /** + * @brief + * @return + */ + const AttributeMatrix* getPolyhedraAttributeMatrix() const; + + /** + * @brief + * @return + */ + AttributeMatrix& getPolyhedraAttributeMatrixRef(); + + /** + * @brief + * @return + */ + const AttributeMatrix& getPolyhedraAttributeMatrixRef() const; + + /** + * @brief + * @return + */ + DataPath getPolyhedronAttributeMatrixDataPath() const; + + /** + * @brief + * @param attributeMatrix + */ + void setPolyhedraAttributeMatrix(const AttributeMatrix& attributeMatrix); + + /** + * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. + * @return A Result<> object possibly with error code and message. + */ + Result<> validate() const override; + +protected: + AbstractNodeGeometry3D(DataStructure& dataStructure, std::string name); + + AbstractNodeGeometry3D(DataStructure& dataStructure, std::string name, IdType importId); + + SharedQuadList* createSharedQuadList(usize numQuads); + + SharedTriList* createSharedTriList(usize numTris); + + /** + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. + * @param updatedIdsMap + */ + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + + /* *************************************************************************** + * These variables are the Ids of the arrays from the DataStructure object. + */ + std::optional m_PolyhedronListId; + std::optional m_PolyhedronAttributeMatrixId; + std::optional m_UnsharedFaceListId; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/EdgeGeom.cpp b/src/simplnx/DataStructure/Geometry/EdgeGeom.cpp index 502ef4164a..1c09b5b5cf 100644 --- a/src/simplnx/DataStructure/Geometry/EdgeGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/EdgeGeom.cpp @@ -7,20 +7,20 @@ using namespace nx::core; EdgeGeom::EdgeGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry1D(dataStructure, std::move(name)) +: AbstractNodeGeometry1D(dataStructure, std::move(name)) { m_UnitDimensionality = 1; } EdgeGeom::EdgeGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry1D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry1D(dataStructure, std::move(name), importId) { m_UnitDimensionality = 1; } -DataObject::Type EdgeGeom::getDataObjectType() const +AbstractDataObject::Type EdgeGeom::getDataObjectType() const { - return DataObject::Type::EdgeGeom; + return IDataObject::Type::EdgeGeom; } EdgeGeom* EdgeGeom::Create(DataStructure& dataStructure, std::string name, const std::optional& parentId) @@ -43,7 +43,7 @@ EdgeGeom* EdgeGeom::Import(DataStructure& dataStructure, std::string name, IdTyp return data.get(); } -IGeometry::Type EdgeGeom::getGeomType() const +AbstractGeometry::Type EdgeGeom::getGeomType() const { return IGeometry::Type::Edge; } @@ -58,12 +58,12 @@ std::string EdgeGeom::getTypeName() const return k_TypeName; } -DataObject* EdgeGeom::shallowCopy() +AbstractDataObject* EdgeGeom::shallowCopy() { return new EdgeGeom(*this); } -std::shared_ptr EdgeGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr EdgeGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -161,7 +161,7 @@ Result<> EdgeGeom::findElementSizes(bool recalculate) std::array verts = {Point3Df(0.0f, 0.0f, 0.0f), Point3Df(0.0f, 0.0f, 0.0f)}; - for(usize i = 0; i < INodeGeometry1D::getNumberOfCells(); i++) + for(usize i = 0; i < AbstractNodeGeometry1D::getNumberOfCells(); i++) { getEdgeCoordinates(i, verts); float32 length = 0.0f; diff --git a/src/simplnx/DataStructure/Geometry/EdgeGeom.hpp b/src/simplnx/DataStructure/Geometry/EdgeGeom.hpp index 7c2b9659df..098dadbe7a 100644 --- a/src/simplnx/DataStructure/Geometry/EdgeGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/EdgeGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" #include "simplnx/simplnx_export.hpp" namespace nx::core @@ -9,18 +9,18 @@ namespace nx::core * @class EdgeGeom * @brief */ -class SIMPLNX_EXPORT EdgeGeom : public INodeGeometry1D +class SIMPLNX_EXPORT EdgeGeom : public AbstractNodeGeometry1D { public: friend class DataStructure; - static inline constexpr usize k_NumVerts = 2; - static inline constexpr usize k_NumEdgeVerts = 2; - static inline constexpr StringLiteral k_VoxelSizes = "Edge Lengths"; - static inline constexpr StringLiteral k_EltsContainingVert = "Edges Containing Vert"; - static inline constexpr StringLiteral k_EltNeighbors = "Edge Neighbors"; - static inline constexpr StringLiteral k_EltCentroids = "Edge Centroids"; - static inline constexpr StringLiteral k_TypeName = "EdgeGeom"; + static constexpr usize k_NumVerts = 2; + static constexpr usize k_NumEdgeVerts = 2; + static constexpr StringLiteral k_VoxelSizes = "Edge Lengths"; + static constexpr StringLiteral k_EltsContainingVert = "Edges Containing Vert"; + static constexpr StringLiteral k_EltNeighbors = "Edge Neighbors"; + static constexpr StringLiteral k_EltCentroids = "Edge Centroids"; + static constexpr StringLiteral k_TypeName = "EdgeGeom"; /** * @brief @@ -62,13 +62,13 @@ class SIMPLNX_EXPORT EdgeGeom : public INodeGeometry1D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -77,22 +77,22 @@ class SIMPLNX_EXPORT EdgeGeom : public INodeGeometry1D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * diff --git a/src/simplnx/DataStructure/Geometry/HexahedralGeom.cpp b/src/simplnx/DataStructure/Geometry/HexahedralGeom.cpp index cb1f9121cd..0ac3a0d28d 100644 --- a/src/simplnx/DataStructure/Geometry/HexahedralGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/HexahedralGeom.cpp @@ -9,18 +9,18 @@ using namespace nx::core; HexahedralGeom::HexahedralGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry3D(dataStructure, std::move(name)) +: AbstractNodeGeometry3D(dataStructure, std::move(name)) { } HexahedralGeom::HexahedralGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry3D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry3D(dataStructure, std::move(name), importId) { } -DataObject::Type HexahedralGeom::getDataObjectType() const +AbstractDataObject::Type HexahedralGeom::getDataObjectType() const { - return DataObject::Type::HexahedralGeom; + return AbstractDataObject::Type::HexahedralGeom; } usize HexahedralGeom::getNumberOfVerticesPerEdge() const @@ -63,12 +63,12 @@ std::string HexahedralGeom::getTypeName() const return k_TypeName; } -DataObject* HexahedralGeom::shallowCopy() +AbstractDataObject* HexahedralGeom::shallowCopy() { return new HexahedralGeom(*this); } -std::shared_ptr HexahedralGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr HexahedralGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -163,7 +163,7 @@ std::shared_ptr HexahedralGeom::deepCopy(const DataPath& copyPath) { copy->m_UnsharedEdgeListId = unsharedEdgesCopy->getId(); } - if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry2D::k_SharedEdgeListName)); edgesCopy != nullptr) + if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry1D::k_SharedEdgeListName)); edgesCopy != nullptr) { copy->m_EdgeDataArrayId = edgesCopy->getId(); } @@ -171,7 +171,7 @@ std::shared_ptr HexahedralGeom::deepCopy(const DataPath& copyPath) { copy->m_UnsharedFaceListId = unsharedFacesCopy->getId(); } - if(const auto facesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry3D::k_SharedFacesListName)); facesCopy != nullptr) + if(const auto facesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry2D::k_SharedFacesListName)); facesCopy != nullptr) { copy->m_FaceListId = facesCopy->getId(); } diff --git a/src/simplnx/DataStructure/Geometry/HexahedralGeom.hpp b/src/simplnx/DataStructure/Geometry/HexahedralGeom.hpp index c84c2276c7..5cab2e0fdd 100644 --- a/src/simplnx/DataStructure/Geometry/HexahedralGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/HexahedralGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/simplnx_export.hpp" namespace nx::core @@ -9,19 +9,19 @@ namespace nx::core * @class HexahedralGeom * @brief */ -class SIMPLNX_EXPORT HexahedralGeom : public INodeGeometry3D +class SIMPLNX_EXPORT HexahedralGeom : public AbstractNodeGeometry3D { public: friend class DataStructure; - static inline constexpr usize k_NumEdgeVerts = 2; - static inline constexpr usize k_NumFaceVerts = 4; - static inline constexpr usize k_NumVerts = 8; - static inline constexpr StringLiteral k_VoxelSizes = "Hex Volumes"; - static inline constexpr StringLiteral k_EltsContainingVert = "Hex Containing Vertices"; - static inline constexpr StringLiteral k_EltNeighbors = "Hex Neighbors"; - static inline constexpr StringLiteral k_EltCentroids = "Hex Centroids"; - static inline constexpr StringLiteral k_TypeName = "HexahedralGeom"; + static constexpr usize k_NumEdgeVerts = 2; + static constexpr usize k_NumFaceVerts = 4; + static constexpr usize k_NumVerts = 8; + static constexpr StringLiteral k_VoxelSizes = "Hex Volumes"; + static constexpr StringLiteral k_EltsContainingVert = "Hex Containing Vertices"; + static constexpr StringLiteral k_EltNeighbors = "Hex Neighbors"; + static constexpr StringLiteral k_EltCentroids = "Hex Centroids"; + static constexpr StringLiteral k_TypeName = "HexahedralGeom"; /** * @brief @@ -63,13 +63,13 @@ class SIMPLNX_EXPORT HexahedralGeom : public INodeGeometry3D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -78,22 +78,22 @@ class SIMPLNX_EXPORT HexahedralGeom : public INodeGeometry3D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * diff --git a/src/simplnx/DataStructure/Geometry/IGeometry.cpp b/src/simplnx/DataStructure/Geometry/IGeometry.cpp index 12caf3880e..b8a82bb8af 100644 --- a/src/simplnx/DataStructure/Geometry/IGeometry.cpp +++ b/src/simplnx/DataStructure/Geometry/IGeometry.cpp @@ -1,209 +1 @@ -#include "IGeometry.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -IGeometry::IGeometry(DataStructure& dataStructure, std::string name) -: BaseGroup(dataStructure, std::move(name)) -{ -} - -IGeometry::IGeometry(DataStructure& dataStructure, std::string name, IdType importId) -: BaseGroup(dataStructure, std::move(name), importId) -{ -} - -const Float32Array* IGeometry::getElementSizes() const -{ - return getDataStructureRef().getDataAs(m_ElementSizesId); -} - -DataObject::OptionalId IGeometry::getElementSizesId() const -{ - return m_ElementSizesId; -} - -void IGeometry::setElementSizesId(const OptionalId& sizesId) -{ - m_ElementSizesId = sizesId; -} - -void IGeometry::deleteElementSizes() -{ - getDataStructureRef().removeData(m_ElementSizesId); - m_ElementSizesId.reset(); -} - -uint32 IGeometry::getUnitDimensionality() const -{ - return m_UnitDimensionality; -} - -void IGeometry::setUnitDimensionality(uint32 value) -{ - m_UnitDimensionality = value; -} - -uint32 IGeometry::getSpatialDimensionality() const -{ - return m_SpacialDimensionality; -} - -void IGeometry::setSpatialDimensionality(uint32 value) -{ - m_SpacialDimensionality = value; -} - -std::set IGeometry::StringListFromGeometryType(const std::set& geomTypes) -{ - std::set stringValues; - for(auto geomType : geomTypes) - { - stringValues.insert(IGeometry::k_GeomTypeStrings[to_underlying(geomType)]); - } - return stringValues; -} - -const std::set& IGeometry::GetAllGeomTypes() -{ - static const std::set types = {Type::Image, Type::RectGrid, Type::Vertex, Type::Edge, Type::Triangle, Type::Quad, Type::Tetrahedral, Type::Hexahedral}; - return types; -} - -const std::vector& IGeometry::GetAllLengthUnitStrings() -{ - static const std::vector lengthUnitStrs = { - LengthUnitToString(LengthUnit::Yoctometer), LengthUnitToString(LengthUnit::Zeptometer), LengthUnitToString(LengthUnit::Attometer), LengthUnitToString(LengthUnit::Femtometer), - LengthUnitToString(LengthUnit::Picometer), LengthUnitToString(LengthUnit::Nanometer), LengthUnitToString(LengthUnit::Micrometer), LengthUnitToString(LengthUnit::Millimeter), - LengthUnitToString(LengthUnit::Centimeter), LengthUnitToString(LengthUnit::Decimeter), LengthUnitToString(LengthUnit::Meter), LengthUnitToString(LengthUnit::Decameter), - LengthUnitToString(LengthUnit::Hectometer), LengthUnitToString(LengthUnit::Kilometer), LengthUnitToString(LengthUnit::Megameter), LengthUnitToString(LengthUnit::Gigameter), - LengthUnitToString(LengthUnit::Terameter), LengthUnitToString(LengthUnit::Petameter), LengthUnitToString(LengthUnit::Exameter), LengthUnitToString(LengthUnit::Zettameter), - LengthUnitToString(LengthUnit::Yottameter), LengthUnitToString(LengthUnit::Angstrom), LengthUnitToString(LengthUnit::Mil), LengthUnitToString(LengthUnit::Inch), - LengthUnitToString(LengthUnit::Foot), LengthUnitToString(LengthUnit::Mile), LengthUnitToString(LengthUnit::Fathom), LengthUnitToString(LengthUnit::Unspecified), - LengthUnitToString(LengthUnit::Unknown)}; - return lengthUnitStrs; -} - -IGeometry::LengthUnit IGeometry::getUnits() const -{ - return m_Units; -} - -void IGeometry::setUnits(LengthUnit units) -{ - m_Units = units; -} - -std::string IGeometry::GeomTypeToString(IGeometry::Type geomType) -{ - return IGeometry::k_GeomTypeStrings[to_underlying(geomType)]; -} - -std::string IGeometry::LengthUnitToString(LengthUnit unit) -{ - switch(unit) - { - case LengthUnit::Yoctometer: { - return "Yoctometer"; - } - case LengthUnit::Zeptometer: { - return "Zeptometer"; - } - case LengthUnit::Attometer: { - return "Attometer"; - } - case LengthUnit::Femtometer: { - return "Femtometer"; - } - case LengthUnit::Picometer: { - return "Picometer"; - } - case LengthUnit::Nanometer: { - return "Nanometer"; - } - case LengthUnit::Micrometer: { - return "Micrometer"; - } - case LengthUnit::Millimeter: { - return "Millimeter"; - } - case LengthUnit::Centimeter: { - return "Centimeter"; - } - case LengthUnit::Decimeter: { - return "Decimeter"; - } - case LengthUnit::Meter: { - return "Meter"; - } - case LengthUnit::Decameter: { - return "Decameter"; - } - case LengthUnit::Hectometer: { - return "Hectometer"; - } - case LengthUnit::Kilometer: { - return "Kilometer"; - } - case LengthUnit::Megameter: { - return "Megameter"; - } - case LengthUnit::Gigameter: { - return "Gigameter"; - } - case LengthUnit::Terameter: { - return "Terameter"; - } - case LengthUnit::Petameter: { - return "Petameter"; - } - case LengthUnit::Exameter: { - return "Exameter"; - } - case LengthUnit::Zettameter: { - return "Zettameter"; - } - case LengthUnit::Yottameter: { - return "Yottameter"; - } - case LengthUnit::Angstrom: { - return "Angstrom"; - } - case LengthUnit::Mil: { - return "Mil"; - } - case LengthUnit::Inch: { - return "Inch"; - } - case LengthUnit::Foot: { - return "Foot"; - } - case LengthUnit::Mile: { - return "Mile"; - } - case LengthUnit::Fathom: { - return "Fathom"; - } - case LengthUnit::Unspecified: { - return "Unspecified"; - } - case LengthUnit::Unknown: { - return "Unknown"; - } - } - return "Unknown"; -} - -void IGeometry::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - BaseGroup::checkUpdatedIdsImpl(updatedIdsMap); - - std::vector visited(1, false); - - for(const auto& updatedId : updatedIdsMap) - { - m_ElementSizesId = nx::core::VisitDataStructureId(m_ElementSizesId, updatedId, visited, 0); - } -} -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/IGeometry.hpp" diff --git a/src/simplnx/DataStructure/Geometry/IGeometry.hpp b/src/simplnx/DataStructure/Geometry/IGeometry.hpp index 2f81e58d40..237916b76b 100644 --- a/src/simplnx/DataStructure/Geometry/IGeometry.hpp +++ b/src/simplnx/DataStructure/Geometry/IGeometry.hpp @@ -2,14 +2,23 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/Common/Result.hpp" +#include "simplnx/Common/Types.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/DynamicListArray.hpp" +#include "simplnx/simplnx_export.hpp" namespace nx::core { -class SIMPLNX_EXPORT IGeometry : public BaseGroup +/** + * @class IGeometry + * @brief Pure virtual interface for all geometry types. + * + * This interface defines the common contract that all geometries must satisfy. + * Type aliases, enums, and string constants live here so that scope-resolution + * references such as IGeometry::Type continue to compile unchanged. + */ +class SIMPLNX_EXPORT IGeometry { public: friend class DataStructure; @@ -25,8 +34,7 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup using SharedHexList = MeshIndexArrayType; using ElementDynamicList = DynamicListArray; - static inline constexpr StringLiteral k_VoxelSizes = "Voxel Sizes"; - static inline constexpr StringLiteral k_TypeName = "IGeometry"; + static constexpr StringLiteral k_VoxelSizes = "Voxel Sizes"; /* We are leveraging the bounded nature of the following enum to expedite processing * @@ -50,7 +58,7 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup inline static constexpr std::array k_GeomTypeStrings = {"Image", "RectGrid", "Vertex", "Edge", "Triangle", "Quad", "Tetrahedral", "Hexahedral"}; - enum class LengthUnit : EnumType + enum class LengthUnit : uint32 { Yoctometer, Zeptometer, @@ -83,15 +91,7 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup Unknown = 101U }; - IGeometry() = delete; - - IGeometry(const IGeometry&) = default; - IGeometry(IGeometry&&) = default; - - IGeometry& operator=(const IGeometry&) = delete; - IGeometry& operator=(IGeometry&&) noexcept = delete; - - ~IGeometry() noexcept override = default; + virtual ~IGeometry() noexcept = default; /** * @brief Returns the type of geometry. @@ -114,21 +114,6 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup */ virtual Result<> findElementSizes(bool recalculate) = 0; - /** - * @brief - * @return const Float32Array* - */ - const Float32Array* getElementSizes() const; - - OptionalId getElementSizesId() const; - - void setElementSizesId(const OptionalId& sizesId); - - /** - * @brief - */ - void deleteElementSizes(); - /** * @brief * @return Point3D @@ -142,62 +127,6 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup */ virtual void getShapeFunctions(const Point3D& pCoords, float64* shape) const = 0; - /** - * @brief - * @return uint32 - */ - uint32 getUnitDimensionality() const; - - /** - * @brief - * @param value - */ - void setUnitDimensionality(uint32 value); - - /** - * @brief - * @return uint32 - */ - uint32 getSpatialDimensionality() const; - - /** - * @brief - * @param value - */ - void setSpatialDimensionality(uint32 value); - - static std::set StringListFromGeometryType(const std::set& geomTypes); - - static const std::set& GetAllGeomTypes(); - - static const std::vector& GetAllLengthUnitStrings(); - - /** - * @brief Returns the length units used by the geometry. - * @return LengthUnit - */ - LengthUnit getUnits() const; - - /** - * @brief Sets the length units used by the geometry. - * @param units - */ - void setUnits(LengthUnit units); - - /** - * @brief - * @param geomType - * @return std::string - */ - static std::string GeomTypeToString(Type geomType); - - /** - * @brief - * @param unit - * @return std::string - */ - static std::string LengthUnitToString(LengthUnit unit); - /** * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. * @return A Result<> object possibly with error code and message. @@ -205,20 +134,10 @@ class SIMPLNX_EXPORT IGeometry : public BaseGroup virtual Result<> validate() const = 0; protected: - IGeometry(DataStructure& dataStructure, std::string name); - - IGeometry(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - std::optional m_ElementSizesId; - - LengthUnit m_Units = LengthUnit::Meter; - uint32 m_UnitDimensionality = 3; - uint32 m_SpacialDimensionality = 3; + IGeometry() = default; + IGeometry(const IGeometry&) = default; + IGeometry(IGeometry&&) = default; + IGeometry& operator=(const IGeometry&) = default; + IGeometry& operator=(IGeometry&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/IGridGeometry.cpp b/src/simplnx/DataStructure/Geometry/IGridGeometry.cpp index 33d6110794..9b6c200960 100644 --- a/src/simplnx/DataStructure/Geometry/IGridGeometry.cpp +++ b/src/simplnx/DataStructure/Geometry/IGridGeometry.cpp @@ -1,114 +1 @@ -#include "IGridGeometry.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -IGridGeometry::IGridGeometry(DataStructure& dataStructure, std::string name) -: IGeometry(dataStructure, std::move(name)) -{ -} - -IGridGeometry::IGridGeometry(DataStructure& dataStructure, std::string name, IdType importId) -: IGeometry(dataStructure, std::move(name), importId) -{ -} - -const std::optional& IGridGeometry::getCellDataId() const -{ - return m_CellDataId; -} - -AttributeMatrix* IGridGeometry::getCellData() -{ - if(!m_CellDataId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_CellDataId); -} - -const AttributeMatrix* IGridGeometry::getCellData() const -{ - if(!m_CellDataId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_CellDataId); -} - -AttributeMatrix& IGridGeometry::getCellDataRef() -{ - if(!m_CellDataId.has_value()) - { - throw std::runtime_error( - fmt::format("AttributeMatrix& IGridGeometry::getCellDataRef()::{} threw runtime exception. The geometry with name '{}' does not have a cell attribute matrix assigned.\n {}:{}", __func__, - getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_CellDataId.value()); -} - -const AttributeMatrix& IGridGeometry::getCellDataRef() const -{ - if(!m_CellDataId.has_value()) - { - throw std::runtime_error( - fmt::format("AttributeMatrix& IGridGeometry::getCellDataRef()::{} threw runtime exception. The geometry with name '{}' does not have a cell attribute matrix assigned.\n {}:{}", __func__, - getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_CellDataId.value()); -} - -DataPath IGridGeometry::getCellDataPath() const -{ - return getCellDataRef().getDataPaths().at(0); -} - -void IGridGeometry::setCellData(const AttributeMatrix& attributeMatrix) -{ - m_CellDataId = attributeMatrix.getId(); -} - -void IGridGeometry::setCellData(OptionalId id) -{ - m_CellDataId = id; -} - -void IGridGeometry::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - IGeometry::checkUpdatedIdsImpl(updatedIdsMap); - - std::vector visited(1, false); - - for(const auto& updatedId : updatedIdsMap) - { - m_CellDataId = nx::core::VisitDataStructureId(m_CellDataId, updatedId, visited, 0); - if(visited[0]) - { - break; - } - } -} - -Result<> IGridGeometry::validate() const -{ - // Validate the next lower dimension geometry - Result<> result; - - usize numTuples = getNumberOfCells(); - const AttributeMatrix* amPtr = getCellData(); - if(nullptr == amPtr) - { - return result; - } - usize amNumTuples = amPtr->getNumberOfTuples(); - - if(numTuples != amNumTuples) - { - return MergeResults( - result, MakeErrorResult(-4501, fmt::format("Grid Geometry '{}' has {} cells but the cell Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); - } - return result; -} - -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" diff --git a/src/simplnx/DataStructure/Geometry/IGridGeometry.hpp b/src/simplnx/DataStructure/Geometry/IGridGeometry.hpp index 15504f0fcf..ffb45a7015 100644 --- a/src/simplnx/DataStructure/Geometry/IGridGeometry.hpp +++ b/src/simplnx/DataStructure/Geometry/IGridGeometry.hpp @@ -2,27 +2,27 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/Common/StringLiteral.hpp" -#include "simplnx/DataStructure/AttributeMatrix.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/simplnx_export.hpp" -#include "simplnx/Common/StringLiteral.hpp" +#include namespace nx::core { -class SIMPLNX_EXPORT IGridGeometry : public IGeometry +/** + * @class IGridGeometry + * @brief Pure virtual interface for grid-based geometries (ImageGeom, RectGridGeom). + * + * Contains the string constants and pure virtual methods that form the + * public contract for grid geometries. + */ +class SIMPLNX_EXPORT IGridGeometry { public: static constexpr StringLiteral k_CellAttributeMatrixName = "Cell Data"; static constexpr StringLiteral k_TypeName = "IGridGeometry"; - IGridGeometry() = delete; - IGridGeometry(const IGridGeometry&) = default; - IGridGeometry(IGridGeometry&&) = default; - - IGridGeometry& operator=(const IGridGeometry&) = delete; - IGridGeometry& operator=(IGridGeometry&&) noexcept = delete; - - ~IGridGeometry() noexcept override = default; + virtual ~IGridGeometry() noexcept = default; /** * @brief @@ -112,7 +112,7 @@ class SIMPLNX_EXPORT IGridGeometry : public IGeometry * @param x * @param y * @param z - * @preturn Point3D + * @return Point3D */ virtual Point3D getCoordsf(usize x, usize y, usize z) const = 0; @@ -164,71 +164,11 @@ class SIMPLNX_EXPORT IGridGeometry : public IGeometry */ virtual std::optional getIndex(float64 xCoord, float64 yCoord, float64 zCoord) const = 0; - /** - * @brief - * @return - */ - const std::optional& getCellDataId() const; - - /** - * @brief - * @return - */ - AttributeMatrix* getCellData(); - - /** - * @brief - * @return - */ - const AttributeMatrix* getCellData() const; - - /** - * @brief - * @return - */ - AttributeMatrix& getCellDataRef(); - - /** - * @brief - * @return - */ - const AttributeMatrix& getCellDataRef() const; - - /** - * @brief - * @return - */ - DataPath getCellDataPath() const; - - /** - * @brief - * @param attributeMatrix - */ - void setCellData(const AttributeMatrix& attributeMatrix); - - /** - * @brief - * @param id - */ - void setCellData(OptionalId id); - - /** - * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. - * @return A Result<> object possibly with error code and message. - */ - Result<> validate() const override; - protected: - IGridGeometry(DataStructure& dataStructure, std::string name); - - IGridGeometry(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - std::optional m_CellDataId; + IGridGeometry() = default; + IGridGeometry(const IGridGeometry&) = default; + IGridGeometry(IGridGeometry&&) = default; + IGridGeometry& operator=(const IGridGeometry&) = default; + IGridGeometry& operator=(IGridGeometry&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry0D.cpp b/src/simplnx/DataStructure/Geometry/INodeGeometry0D.cpp index 8060305385..c1330fcce5 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry0D.cpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry0D.cpp @@ -1,274 +1 @@ -#include "INodeGeometry0D.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -INodeGeometry0D::INodeGeometry0D(DataStructure& dataStructure, std::string name) -: IGeometry(dataStructure, std::move(name)) -{ -} - -INodeGeometry0D::INodeGeometry0D(DataStructure& dataStructure, std::string name, IdType importId) -: IGeometry(dataStructure, std::move(name), importId) -{ -} - -const std::optional& INodeGeometry0D::getSharedVertexDataArrayId() const -{ - return m_VertexDataArrayId; -} - -INodeGeometry0D::SharedVertexList* INodeGeometry0D::getVertices() -{ - if(!m_VertexDataArrayId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_VertexDataArrayId); -} - -const INodeGeometry0D::SharedVertexList* INodeGeometry0D::getVertices() const -{ - if(!m_VertexDataArrayId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_VertexDataArrayId); -} - -INodeGeometry0D::SharedVertexList& INodeGeometry0D::getVerticesRef() -{ - if(!m_VertexDataArrayId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a shared vertex list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_VertexDataArrayId.value()); -} - -const INodeGeometry0D::SharedVertexList& INodeGeometry0D::getVerticesRef() const -{ - if(!m_VertexDataArrayId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a shared vertex list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_VertexDataArrayId.value()); -} - -void INodeGeometry0D::setVertices(const INodeGeometry0D::SharedVertexList& vertices) -{ - m_VertexDataArrayId = vertices.getId(); -} - -std::optional INodeGeometry0D::getVertexListId() const -{ - return m_VertexDataArrayId; -} - -void INodeGeometry0D::setVertexListId(const std::optional& vertices) -{ - m_VertexDataArrayId = vertices; -} - -void INodeGeometry0D::resizeVertexList(usize size) -{ - getVerticesRef().getIDataStoreRef().resizeTuples({size}); -} - -usize INodeGeometry0D::getNumberOfVertices() const -{ - const auto* verticesPtr = getVertices(); - return verticesPtr == nullptr ? 0 : verticesPtr->getNumberOfTuples(); -} - -usize INodeGeometry0D::getNumberOfCells() const -{ - return getNumberOfVertices(); -} - -BoundingBox3Df INodeGeometry0D::getBoundingBox() const -{ - FloatVec3 ll = {std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()}; - FloatVec3 ur = {std::numeric_limits::min(), std::numeric_limits::min(), std::numeric_limits::min()}; - - const IGeometry::SharedVertexList& vertexList = getVerticesRef(); - if(vertexList.getDataType() != DataType::float32) - { - return {ll, ur}; // will be invalid - } - - try - { - auto& vertexListStore = vertexList.getDataStoreRef(); - - for(size_t tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++) - { - float x = vertexListStore.getComponentValue(tuple, 0); - ll[0] = (x < ll[0]) ? x : ll[0]; - ur[0] = (x > ur[0]) ? x : ur[0]; - - float y = vertexListStore.getComponentValue(tuple, 1); - ll[1] = (y < ll[1]) ? y : ll[1]; - ur[1] = (y > ur[1]) ? y : ur[1]; - - float z = vertexListStore.getComponentValue(tuple, 2); - ll[2] = (z < ll[2]) ? z : ll[2]; - ur[2] = (z > ur[2]) ? z : ur[2]; - } - } catch(const std::bad_cast& ex) - { - return {ll, ur}; // will be invalid - } - - return {ll, ur}; // should be valid -} - -Result INodeGeometry0D::isPlane(usize dimensionIndex) const -{ - try - { - const IGeometry::SharedVertexList& vertexList = getVerticesRef(); - auto& vertexListStore = vertexList.getDataStoreRef(); - - std::set pointSet; - for(usize tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++) - { - pointSet.insert(vertexListStore.getComponentValue(tuple, dimensionIndex)); - } - - return {(pointSet.size() == 1)}; - } catch(const std::bad_cast& exception) - { - return MakeErrorResult(-3000, fmt::format("Could not determine whether the geometry is a plane because an exception was thrown: {}", exception.what())); - } -} - -Result INodeGeometry0D::isYZPlane() const -{ - return isPlane(0); -} - -Result INodeGeometry0D::isXYPlane() const -{ - return isPlane(2); -} - -Result INodeGeometry0D::isXZPlane() const -{ - return isPlane(1); -} - -void INodeGeometry0D::setVertexCoordinate(usize vertId, const Point3D& coordinate) -{ - auto& vertices = getVerticesRef(); - const usize offset = vertId * 3; - for(usize i = 0; i < 3; i++) - { - vertices[offset + i] = coordinate[i]; - } -} - -Point3D INodeGeometry0D::getVertexCoordinate(usize vertId) const -{ - auto& vertices = getVerticesRef(); - const usize offset = vertId * 3; - Point3D coordinate; - for(usize i = 0; i < 3; i++) - { - coordinate[i] = vertices.at(offset + i); - } - return coordinate; -} - -const std::optional& INodeGeometry0D::getVertexAttributeMatrixId() const -{ - return m_VertexAttributeMatrixId; -} - -void INodeGeometry0D::setVertexDataId(const OptionalId& vertexDataId) -{ - m_VertexAttributeMatrixId = vertexDataId; -} - -AttributeMatrix* INodeGeometry0D::getVertexAttributeMatrix() -{ - if(!m_VertexAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_VertexAttributeMatrixId); -} - -const AttributeMatrix* INodeGeometry0D::getVertexAttributeMatrix() const -{ - if(!m_VertexAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_VertexAttributeMatrixId); -} - -AttributeMatrix& INodeGeometry0D::getVertexAttributeMatrixRef() -{ - if(!m_VertexAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a vertex attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_VertexAttributeMatrixId.value()); -} - -const AttributeMatrix& INodeGeometry0D::getVertexAttributeMatrixRef() const -{ - if(!m_VertexAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry0D::{} threw runtime exception. The geometry with name '{}' does not have a vertex attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_VertexAttributeMatrixId.value()); -} - -DataPath INodeGeometry0D::getVertexAttributeMatrixDataPath() const -{ - return getVertexAttributeMatrixRef().getDataPaths().at(0); -} - -void INodeGeometry0D::setVertexAttributeMatrix(const AttributeMatrix& attributeMatrix) -{ - m_VertexAttributeMatrixId = attributeMatrix.getId(); -} - -void INodeGeometry0D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - IGeometry::checkUpdatedIdsImpl(updatedIdsMap); - - std::vector visited(2, false); - - for(const auto& updatedId : updatedIdsMap) - { - m_VertexDataArrayId = nx::core::VisitDataStructureId(m_VertexDataArrayId, updatedId, visited, 0); - m_VertexAttributeMatrixId = nx::core::VisitDataStructureId(m_VertexAttributeMatrixId, updatedId, visited, 1); - } -} - -Result<> INodeGeometry0D::validate() const -{ - Result<> result; - usize numVerts = getNumberOfVertices(); - const AttributeMatrix* amPtr = getVertexAttributeMatrix(); - if(nullptr == amPtr) - { - return result; - } - usize amNumTuples = amPtr->getNumberOfTuples(); - if(numVerts != amNumTuples) - { - return MakeErrorResult( - -4500, fmt::format("Vertex Geometry '{}' has {} vertices but the vertex Attribute Matrix '{}' has {} total tuples.", getName(), numVerts, getVertexAttributeMatrix()->getName(), amNumTuples)); - } - return result; -} - -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp b/src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp index 3ac75fdc9c..9cd1eac002 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry0D.hpp @@ -1,212 +1,30 @@ #pragma once -#include "simplnx/Common/Array.hpp" -#include "simplnx/Common/BoundingBox.hpp" #include "simplnx/Common/StringLiteral.hpp" -#include "simplnx/DataStructure/AttributeMatrix.hpp" -#include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" - -#include +#include "simplnx/Common/Types.hpp" +#include "simplnx/simplnx_export.hpp" namespace nx::core { -class SIMPLNX_EXPORT INodeGeometry0D : public IGeometry +/** + * @class INodeGeometry0D + * @brief Pure virtual interface for node-based geometries with vertices. + * + * Contains the string constants that form the public contract for 0D node geometries. + */ +class SIMPLNX_EXPORT INodeGeometry0D { public: - static constexpr StringLiteral k_TypeName = "INodeGeometry0D"; static constexpr StringLiteral k_SharedVertexListName = "Shared Vertex List"; static constexpr StringLiteral k_VertexAttributeMatrixName = "Vertex Data"; - INodeGeometry0D() = delete; - INodeGeometry0D(const INodeGeometry0D&) = default; - INodeGeometry0D(INodeGeometry0D&&) = default; - - INodeGeometry0D& operator=(const INodeGeometry0D&) = delete; - INodeGeometry0D& operator=(INodeGeometry0D&&) noexcept = delete; - - ~INodeGeometry0D() noexcept override = default; - - /** - * @brief Returns a shared pointer to the vertex coordinates array - * @return - */ - SharedVertexList* getVertices(); - - /** - * @brief Returns a shared pointer to the vertex coordinates array - * @return - */ - const SharedVertexList* getVertices() const; - - /** - * @brief Returns a reference to the vertex coordinates array - * @return - */ - SharedVertexList& getVerticesRef(); - - /** - * @brief Returns a reference to the vertex coordinates array - * @return - */ - const SharedVertexList& getVerticesRef() const; - - /** - * @brief Sets the internal reference to vertex coordinates to vertices - * @param vertices The coordinate array that will now be used for the vertex coordinates - */ - void setVertices(const SharedVertexList& vertices); - - std::optional getVertexListId() const; - void setVertexListId(const std::optional& vertices); - - /** - * @brief Resizes the vertex list to the target size. - * @param size - */ - void resizeVertexList(usize size); - - /** - * @brief Returns the number of vertices in the geometry. - * @return usize - */ - usize getNumberOfVertices() const; - - /** - * @brief Returns the number of vertices for this geometry - * @return - */ - usize getNumberOfCells() const override; - - /** - * @brief Calculates and returns the bounding box for this geometry - * @return - */ - BoundingBox3Df getBoundingBox() const; - - /** - * @brief Returns whether this geometry is in a YZ plane. - * Returns empty if the vertex list does not exist. - * @return - */ - Result isYZPlane() const; - - /** - * @brief Returns whether this geometry is in a XY plane - * Returns empty if the vertex list does not exist. - * @return - */ - Result isXYPlane() const; - - /** - * @brief Returns whether this geometry is in a XZ plane - * Returns empty if the vertex list does not exist. - * @return - */ - Result isXZPlane() const; - - /** - * @brief Gets the coordinates at the target vertex ID. - * @param vertId - * @return - */ - Point3D getVertexCoordinate(usize vertId) const; - - /** - * @brief Sets the coordinates for the specified vertex ID. - * @param vertId - * @param coords - */ - void setVertexCoordinate(usize vertId, const Point3D& coords); - - /**************************************************************************** - * These functions get values related to where the Vertex Coordinates are - * stored in the DataStructure - */ - - /** - * @brief Returns the DataStructure unique ID of the vertex coordinate array - * @return - */ - const std::optional& getSharedVertexDataArrayId() const; - - /** - * @brief Returns the DataStructure unique ID of the Attribute Matrix that holds data assigned to each vertex coordinate - * @return - */ - const std::optional& getVertexAttributeMatrixId() const; - - void setVertexDataId(const OptionalId& vertexDataId); - - /** - * @brief Returns pointer to the Attribute Matrix that holds data assigned to each vertex coordinate - * @return - */ - AttributeMatrix* getVertexAttributeMatrix(); - - /** - * @brief Returns pointer to the Attribute Matrix that holds data assigned to each vertex coordinate - * @return - */ - const AttributeMatrix* getVertexAttributeMatrix() const; - - /** - * @brief Returns reference to the Attribute Matrix that holds data assigned to each vertex coordinate - * @return - */ - AttributeMatrix& getVertexAttributeMatrixRef(); - - /** - * @brief Returns reference to the Attribute Matrix that holds data assigned to each vertex coordinate - * @return - */ - const AttributeMatrix& getVertexAttributeMatrixRef() const; - - /** - * @brief Returns the DataPath to the AttributeMatrix for the vertex data - * @return - */ - DataPath getVertexAttributeMatrixDataPath() const; - - /** - * @brief Sets the Attribute Matrix for the data assigned to the vertex coordinates - * @param attributeMatrix - */ - void setVertexAttributeMatrix(const AttributeMatrix& attributeMatrix); - - /** - * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. - * @return A Result<> object possibly with error code and message. - */ - Result<> validate() const override; + virtual ~INodeGeometry0D() noexcept = default; protected: - INodeGeometry0D(DataStructure& dataStructure, std::string name); - - INodeGeometry0D(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - /* *************************************************************************** - * These variables are the Ids of the arrays from the DataStructure object. - */ - std::optional m_VertexDataArrayId; - std::optional m_VertexAttributeMatrixId; - -private: - /** - * @brief Helper function that returns whether or not this geometry is in a plane - * Returns empty if the vertex list or data store does not exist. - * @param dimensionIndex The dimensional index to check for equality. - * YZ plane --> dimensionIndex = 0 - * XZ plane --> dimensionIndex = 1 - * XY plane --> dimensionIndex = 2 - * @return - */ - Result isPlane(usize dimensionIndex) const; + INodeGeometry0D() = default; + INodeGeometry0D(const INodeGeometry0D&) = default; + INodeGeometry0D(INodeGeometry0D&&) = default; + INodeGeometry0D& operator=(const INodeGeometry0D&) = default; + INodeGeometry0D& operator=(INodeGeometry0D&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry1D.cpp b/src/simplnx/DataStructure/Geometry/INodeGeometry1D.cpp index 7b026b2073..b9688b6290 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry1D.cpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry1D.cpp @@ -1,289 +1 @@ -#include "INodeGeometry1D.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -INodeGeometry1D::INodeGeometry1D(DataStructure& dataStructure, std::string name) -: INodeGeometry0D(dataStructure, std::move(name)) -{ -} - -INodeGeometry1D::INodeGeometry1D(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry0D(dataStructure, std::move(name), importId) -{ -} - -const std::optional& INodeGeometry1D::getEdgeListDataArrayId() const -{ - return m_EdgeDataArrayId; -} - -INodeGeometry1D::SharedEdgeList* INodeGeometry1D::getEdges() -{ - if(!m_EdgeDataArrayId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_EdgeDataArrayId); -} - -const INodeGeometry1D::SharedEdgeList* INodeGeometry1D::getEdges() const -{ - if(!m_EdgeDataArrayId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_EdgeDataArrayId); -} - -INodeGeometry1D::SharedEdgeList& INodeGeometry1D::getEdgesRef() -{ - if(!m_EdgeDataArrayId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared edge list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_EdgeDataArrayId.value()); -} - -const INodeGeometry1D::SharedEdgeList& INodeGeometry1D::getEdgesRef() const -{ - if(!m_EdgeDataArrayId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared edge list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_EdgeDataArrayId.value()); -} - -void INodeGeometry1D::setEdgeList(const SharedEdgeList& edges) -{ - m_EdgeDataArrayId = edges.getId(); -} - -std::optional INodeGeometry1D::getEdgeListId() const -{ - return m_EdgeDataArrayId; -} - -void INodeGeometry1D::setEdgeListId(const std::optional& edgeList) -{ - m_EdgeDataArrayId = edgeList; -} - -void INodeGeometry1D::resizeEdgeList(usize size) -{ - getEdgesRef().getIDataStoreRef().resizeTuples({size}); -} - -usize INodeGeometry1D::getNumberOfCells() const -{ - return getNumberOfEdges(); -} - -usize INodeGeometry1D::getNumberOfEdges() const -{ - const auto* edgesPtr = getEdges(); - return edgesPtr == nullptr ? 0 : edgesPtr->getNumberOfTuples(); -} - -void INodeGeometry1D::setEdgePointIds(usize edgeId, nonstd::span vertexIds) -{ - auto& edges = getEdgesRef(); - const usize offset = edgeId * k_NumEdgeVerts; - if(offset + k_NumEdgeVerts > edges.getSize()) - { - return; - } - for(usize i = 0; i < k_NumEdgeVerts; i++) - { - edges[offset + i] = vertexIds[i]; - } -} - -void INodeGeometry1D::getEdgePointIds(usize edgeId, nonstd::span vertexIds) const -{ - auto& cells = getEdgesRef(); - const usize offset = edgeId * k_NumEdgeVerts; - if(offset + k_NumEdgeVerts > cells.getSize()) - { - return; - } - for(usize i = 0; i < k_NumEdgeVerts; i++) - { - vertexIds[i] = cells.at(offset + i); - } -} - -void INodeGeometry1D::getEdgeCoordinates(usize edgeId, nonstd::span coords) const -{ - std::array verts = {0, 0}; - getEdgePointIds(edgeId, verts); - coords[0] = getVertexCoordinate(verts[0]); - coords[1] = getVertexCoordinate(verts[1]); -} - -const INodeGeometry1D::ElementDynamicList* INodeGeometry1D::getElementsContainingVert() const -{ - return getDataStructureRef().getDataAs(m_CellContainingVertDataArrayId); -} - -void INodeGeometry1D::deleteElementsContainingVert() -{ - getDataStructureRef().removeData(m_CellContainingVertDataArrayId); - m_CellContainingVertDataArrayId.reset(); -} - -const INodeGeometry1D::ElementDynamicList* INodeGeometry1D::getElementNeighbors() const -{ - return getDataStructureRef().getDataAs(m_CellNeighborsDataArrayId); -} - -void INodeGeometry1D::deleteElementNeighbors() -{ - if(!getDataStructureRef().removeData(m_CellNeighborsDataArrayId)) - { - throw std::runtime_error(fmt::format("{}({}): Function {}: Unable to remove Element Neighbors", "deleteElementNeighbors()", __FILE__, __LINE__)); - } - m_CellNeighborsDataArrayId.reset(); -} - -const Float32Array* INodeGeometry1D::getElementCentroids() const -{ - return getDataStructureRef().getDataAs(m_CellCentroidsDataArrayId); -} - -void INodeGeometry1D::deleteElementCentroids() -{ - getDataStructureRef().removeData(m_CellCentroidsDataArrayId); - m_CellCentroidsDataArrayId.reset(); -} - -const std::optional& INodeGeometry1D::getEdgeAttributeMatrixId() const -{ - return m_EdgeAttributeMatrixId; -} - -AttributeMatrix* INodeGeometry1D::getEdgeAttributeMatrix() -{ - if(!m_EdgeAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_EdgeAttributeMatrixId); -} - -const AttributeMatrix* INodeGeometry1D::getEdgeAttributeMatrix() const -{ - if(!m_EdgeAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_EdgeAttributeMatrixId); -} - -AttributeMatrix& INodeGeometry1D::getEdgeAttributeMatrixRef() -{ - if(!m_EdgeAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have an edge attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_EdgeAttributeMatrixId.value()); -} - -const AttributeMatrix& INodeGeometry1D::getEdgeAttributeMatrixRef() const -{ - if(!m_EdgeAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have an edge attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_EdgeAttributeMatrixId.value()); -} - -DataPath INodeGeometry1D::getEdgeAttributeMatrixDataPath() const -{ - return getEdgeAttributeMatrixRef().getDataPaths().at(0); -} - -void INodeGeometry1D::setEdgeAttributeMatrix(const AttributeMatrix& attributeMatrix) -{ - m_EdgeAttributeMatrixId = attributeMatrix.getId(); -} - -void INodeGeometry1D::setEdgeDataId(const std::optional& edgeDataId) -{ - m_EdgeAttributeMatrixId = edgeDataId; -} - -std::optional INodeGeometry1D::getElementContainingVertId() const -{ - return m_CellContainingVertDataArrayId; -} - -std::optional INodeGeometry1D::getElementNeighborsId() const -{ - return m_CellNeighborsDataArrayId; -} - -std::optional INodeGeometry1D::getElementCentroidsId() const -{ - return m_CellCentroidsDataArrayId; -} - -void INodeGeometry1D::setElementContainingVertId(const std::optional& elementsContainingVertId) -{ - m_CellContainingVertDataArrayId = elementsContainingVertId; -} - -void INodeGeometry1D::setElementNeighborsId(const std::optional& elementNeighborsId) -{ - m_CellNeighborsDataArrayId = elementNeighborsId; -} - -void INodeGeometry1D::setElementCentroidsId(const std::optional& centroidsId) -{ - m_CellCentroidsDataArrayId = centroidsId; -} - -void INodeGeometry1D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - INodeGeometry0D::checkUpdatedIdsImpl(updatedIdsMap); - - std::vector visited(7, false); - - for(const auto& updatedId : updatedIdsMap) - { - m_EdgeAttributeMatrixId = nx::core::VisitDataStructureId(m_EdgeAttributeMatrixId, updatedId, visited, 0); - m_EdgeDataArrayId = nx::core::VisitDataStructureId(m_EdgeDataArrayId, updatedId, visited, 1); - m_CellContainingVertDataArrayId = nx::core::VisitDataStructureId(m_CellContainingVertDataArrayId, updatedId, visited, 2); - m_CellNeighborsDataArrayId = nx::core::VisitDataStructureId(m_CellNeighborsDataArrayId, updatedId, visited, 3); - m_CellCentroidsDataArrayId = nx::core::VisitDataStructureId(m_CellCentroidsDataArrayId, updatedId, visited, 4); - m_ElementSizesId = nx::core::VisitDataStructureId(m_ElementSizesId, updatedId, visited, 5); - } -} - -Result<> INodeGeometry1D::validate() const -{ - // Validate the next lower dimension geometry - Result<> result = INodeGeometry0D::validate(); - - usize numTuples = getNumberOfEdges(); - const AttributeMatrix* amPtr = getEdgeAttributeMatrix(); - if(nullptr == amPtr) - { - return result; - } - usize amNumTuples = amPtr->getNumberOfTuples(); - - if(numTuples != amNumTuples) - { - return MergeResults( - result, MakeErrorResult(-4501, fmt::format("Edge Geometry '{}' has {} edges but the edge Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); - } - return result; -} - -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp b/src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp index 80c1a62a47..360f421c41 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry1D.hpp @@ -1,10 +1,20 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/simplnx_export.hpp" namespace nx::core { -class SIMPLNX_EXPORT INodeGeometry1D : public INodeGeometry0D +/** + * @class INodeGeometry1D + * @brief Pure virtual interface for node-based geometries with edges. + * + * Contains the string constants and pure virtual methods that form the + * public contract for 1D node geometries. + */ +class SIMPLNX_EXPORT INodeGeometry1D { public: static constexpr StringLiteral k_EdgeAttributeMatrixName = "Edge Data"; @@ -13,62 +23,9 @@ class SIMPLNX_EXPORT INodeGeometry1D : public INodeGeometry0D static constexpr StringLiteral k_UnsharedEdgesListName = "Unshared Edge List"; static constexpr StringLiteral k_UnsharedFacesListName = "Unshared Face List"; - static constexpr StringLiteral k_TypeName = "INodeGeometry1D"; - static constexpr usize k_NumEdgeVerts = 2; - ~INodeGeometry1D() noexcept override = default; - - /** - * @brief - * @return - */ - SharedEdgeList* getEdges(); - - /** - * @brief - * @return - */ - const SharedEdgeList* getEdges() const; - - /** - * @brief - * @return - */ - SharedEdgeList& getEdgesRef(); - - /** - * @brief - * @return - */ - const SharedEdgeList& getEdgesRef() const; - - /** - * @brief - * @return - */ - void setEdgeList(const SharedEdgeList& edges); - - std::optional getEdgeListId() const; - void setEdgeListId(const std::optional& edgeList); - - /** - * @brief Resizes the edge list to the target size. - * @param size - */ - void resizeEdgeList(usize size); - - /** - * @brief Returns the number of edges in the geometry. - * @return usize - */ - usize getNumberOfCells() const override; - - /** - * @brief returns the number of edges in the geometry - * @return - */ - usize getNumberOfEdges() const; + virtual ~INodeGeometry1D() noexcept = default; /** * @brief @@ -76,173 +33,29 @@ class SIMPLNX_EXPORT INodeGeometry1D : public INodeGeometry0D */ virtual usize getNumberOfVerticesPerEdge() const = 0; - /** - * @brief Sets the vertex IDs making up the specified edge. This method does - * nothing if the edge list could not be found. - * @param edgeId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void setEdgePointIds(usize edgeId, nonstd::span vertexIds); - - /** - * @brief Returns the vertices that make up the specified edge by reference. - * This method does nothing if the edge list could not be found. - * @param edgeId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void getEdgePointIds(usize edgeId, nonstd::span vertexIds) const; - - /** - * @brief Returns the vertex coordinates for a specified edge by reference. - * This method does nothing if the edge list could not be found. - * @param edgeId - * @param vert1 - * @param vert2 - */ - void getEdgeCoordinates(usize edgeId, nonstd::span coords) const; - - /** - * @brief Pure-Virtual - * @param recalculate This will allow for skipping execution when an - * `ElementDynamicList` exists and recalculate is `false` - * @return Result<> - */ - virtual Result<> findElementsContainingVert(bool recalculate) = 0; - /** * @brief - * @return const ElementDynamicList* + * @return IGeometry::StatusCode */ - const ElementDynamicList* getElementsContainingVert() const; + virtual Result<> findElementsContainingVert(bool recalculate) = 0; /** * @brief - */ - void deleteElementsContainingVert(); - - /** - * @brief Pure-Virtual intended to find the neighbors of each element - * in the geometry and store it in a new or existing array in the datastructure - * @param recalculate This will allow for skipping execution when an - * `ElementDynamicList` exists and recalculate is `false` - * @return Result<> + * @return IGeometry::StatusCode */ virtual Result<> findElementNeighbors(bool recalculate) = 0; /** * @brief - * @return const ElementDynamicList* - */ - const ElementDynamicList* getElementNeighbors() const; - - /** - * @brief - */ - void deleteElementNeighbors(); - - /** - * @brief Pure-Virtual intended to calculate the centroids of each element - * in the geometry and store it in a new or existing array in the datastructure - * @param recalculate This will allow for skipping execution when an Element Centroids - * Array exists and recalculate is `false` - * @return Result<> + * @return IGeometry::StatusCode */ virtual Result<> findElementCentroids(bool recalculate) = 0; - /** - * @brief - * @return const Float32Array* - */ - const Float32Array* getElementCentroids() const; - - /** - * @brief - */ - void deleteElementCentroids(); - - /**************************************************************************** - * These functions get values related to where the Vertex Coordinates are - * stored in the DataStructure - */ - - const std::optional& getEdgeListDataArrayId() const; - - /** - * @brief - * @return - */ - const std::optional& getEdgeAttributeMatrixId() const; - - /** - * @brief Returns pointer to the Attribute Matrix that holds data assigned to each edge - * @return - */ - AttributeMatrix* getEdgeAttributeMatrix(); - - /** - * @brief Returns pointer to the Attribute Matrix that holds data assigned to each edge - * @return - */ - const AttributeMatrix* getEdgeAttributeMatrix() const; - - /** - * @brief Returns reference to the Attribute Matrix that holds data assigned to each edge - * @return - */ - AttributeMatrix& getEdgeAttributeMatrixRef(); - - /** - * @brief Returns reference to the Attribute Matrix that holds data assigned to each edge - * @return - */ - const AttributeMatrix& getEdgeAttributeMatrixRef() const; - - /** - * @brief Returns the DataPath to the AttributeMatrix for the edge data - * @return - */ - DataPath getEdgeAttributeMatrixDataPath() const; - - /** - * @brief Sets the Attribute Matrix for the data assigned to the edges - * @param attributeMatrix - */ - void setEdgeAttributeMatrix(const AttributeMatrix& attributeMatrix); - - void setEdgeDataId(const std::optional& edgeDataId); - - std::optional getElementContainingVertId() const; - std::optional getElementNeighborsId() const; - std::optional getElementCentroidsId() const; - - void setElementContainingVertId(const std::optional& elementsContainingVertId); - void setElementNeighborsId(const std::optional& elementNeighborsId); - void setElementCentroidsId(const std::optional& centroidsId); - - /** - * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. - * @return A Result<> object possibly with error code and message. - */ - Result<> validate() const override; - protected: - INodeGeometry1D(DataStructure& dataStructure, std::string name); - - INodeGeometry1D(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - /* *************************************************************************** - * These variables are the Ids of the arrays from the DataStructure object. - */ - std::optional m_EdgeDataArrayId; - std::optional m_EdgeAttributeMatrixId; - std::optional m_CellContainingVertDataArrayId; - std::optional m_CellNeighborsDataArrayId; - std::optional m_CellCentroidsDataArrayId; + INodeGeometry1D() = default; + INodeGeometry1D(const INodeGeometry1D&) = default; + INodeGeometry1D(INodeGeometry1D&&) = default; + INodeGeometry1D& operator=(const INodeGeometry1D&) = default; + INodeGeometry1D& operator=(INodeGeometry1D&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry2D.cpp b/src/simplnx/DataStructure/Geometry/INodeGeometry2D.cpp index 58f39db7cf..23c793d283 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry2D.cpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry2D.cpp @@ -1,248 +1 @@ -#include "INodeGeometry2D.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -INodeGeometry2D::INodeGeometry2D(DataStructure& dataStructure, std::string name) -: INodeGeometry1D(dataStructure, std::move(name)) -{ -} - -INodeGeometry2D::INodeGeometry2D(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry1D(dataStructure, std::move(name), importId) -{ -} - -const std::optional& INodeGeometry2D::getFaceListDataArrayId() const -{ - return m_FaceListId; -} - -INodeGeometry2D::OptionalId INodeGeometry2D::getFaceListId() const -{ - return m_FaceListId; -} - -void INodeGeometry2D::setFaceListId(const OptionalId& facesId) -{ - m_FaceListId = facesId; -} - -INodeGeometry2D::SharedFaceList* INodeGeometry2D::getFaces() -{ - if(!m_FaceListId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_FaceListId); -} - -const INodeGeometry2D::SharedFaceList* INodeGeometry2D::getFaces() const -{ - if(!m_FaceListId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_FaceListId); -} - -INodeGeometry2D::SharedFaceList& INodeGeometry2D::getFacesRef() -{ - if(!m_FaceListId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared face list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_FaceListId.value()); -} - -const INodeGeometry2D::SharedFaceList& INodeGeometry2D::getFacesRef() const -{ - if(!m_FaceListId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared face list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_FaceListId.value()); -} - -void INodeGeometry2D::setFaceList(const SharedFaceList& faces) -{ - m_FaceListId = faces.getId(); -} - -void INodeGeometry2D::resizeFaceList(usize size) -{ - getFacesRef().getIDataStoreRef().resizeTuples({size}); -} - -usize INodeGeometry2D::getNumberOfFaces() const -{ - const auto* facesPtr = getFaces(); - return facesPtr == nullptr ? 0 : facesPtr->getNumberOfTuples(); -} - -void INodeGeometry2D::setFacePointIds(usize faceId, nonstd::span vertexIds) -{ - auto& faces = getFacesRef(); - const usize offset = faceId * getNumberOfVerticesPerFace(); - if(offset + getNumberOfVerticesPerFace() > faces.getSize()) - { - return; - } - for(usize i = 0; i < getNumberOfVerticesPerFace(); i++) - { - faces[offset + i] = vertexIds[i]; - } -} - -void INodeGeometry2D::getFacePointIds(usize faceId, nonstd::span vertexIds) const -{ - auto& cells = getFacesRef(); - const usize offset = faceId * getNumberOfVerticesPerFace(); - if(offset + getNumberOfVerticesPerFace() > cells.getSize()) - { - return; - } - for(usize i = 0; i < getNumberOfVerticesPerFace(); i++) - { - vertexIds[i] = cells.at(offset + i); - } -} - -void INodeGeometry2D::getFaceCoordinates(usize faceId, nonstd::span coords) const -{ - std::vector verts(getNumberOfVerticesPerFace()); - getFacePointIds(faceId, verts); - for(usize index = 0; index < verts.size(); index++) - { - coords[index] = getVertexCoordinate(verts[index]); - } -} - -void INodeGeometry2D::deleteEdges() -{ - getDataStructureRef().removeData(m_EdgeDataArrayId); - m_EdgeDataArrayId.reset(); -} - -const std::optional& INodeGeometry2D::getUnsharedEdgesId() const -{ - return m_UnsharedEdgeListId; -} - -void INodeGeometry2D::setUnsharedEdgesId(const OptionalId& unsharedEdgesId) -{ - m_UnsharedEdgeListId = unsharedEdgesId; -} - -const INodeGeometry2D::SharedEdgeList* INodeGeometry2D::getUnsharedEdges() const -{ - return getDataStructureRef().getDataAs(m_UnsharedEdgeListId); -} - -void INodeGeometry2D::deleteUnsharedEdges() -{ - getDataStructureRef().removeData(m_UnsharedEdgeListId); - m_UnsharedEdgeListId.reset(); -} - -const std::optional& INodeGeometry2D::getFaceAttributeMatrixId() const -{ - return m_FaceAttributeMatrixId; -} - -void INodeGeometry2D::setFaceDataId(const OptionalId& faceDataId) -{ - m_FaceAttributeMatrixId = faceDataId; -} - -AttributeMatrix* INodeGeometry2D::getFaceAttributeMatrix() -{ - if(!m_FaceAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_FaceAttributeMatrixId); -} - -const AttributeMatrix* INodeGeometry2D::getFaceAttributeMatrix() const -{ - if(!m_FaceAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_FaceAttributeMatrixId); -} - -AttributeMatrix& INodeGeometry2D::getFaceAttributeMatrixRef() -{ - if(!m_FaceAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry2D::{} threw runtime exception. The geometry with name '{}' does not have a face attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_FaceAttributeMatrixId.value()); -} - -const AttributeMatrix& INodeGeometry2D::getFaceAttributeMatrixRef() const -{ - if(!m_FaceAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry2D::{} threw runtime exception. The geometry with name '{}' does not have a face attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_FaceAttributeMatrixId.value()); -} - -DataPath INodeGeometry2D::getFaceAttributeMatrixDataPath() const -{ - return getFaceAttributeMatrixRef().getDataPaths().at(0); -} - -void INodeGeometry2D::setFaceAttributeMatrix(const AttributeMatrix& attributeMatrix) -{ - m_FaceAttributeMatrixId = attributeMatrix.getId(); -} -INodeGeometry2D::SharedEdgeList* INodeGeometry2D::createSharedEdgeList(usize numEdges) -{ - auto dataStore = std::make_unique>(std::vector{numEdges}, std::vector{2}, 0); - SharedEdgeList* edges = DataArray::Create(*getDataStructure(), k_SharedEdgeListName, std::move(dataStore), getId()); - return edges; -} - -void INodeGeometry2D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - INodeGeometry1D::checkUpdatedIdsImpl(updatedIdsMap); - std::vector visited(3, false); - for(const auto& updatedId : updatedIdsMap) - { - m_FaceListId = nx::core::VisitDataStructureId(m_FaceListId, updatedId, visited, 0); - m_FaceAttributeMatrixId = nx::core::VisitDataStructureId(m_FaceAttributeMatrixId, updatedId, visited, 1); - m_UnsharedEdgeListId = nx::core::VisitDataStructureId(m_UnsharedEdgeListId, updatedId, visited, 2); - } -} - -Result<> INodeGeometry2D::validate() const -{ - // Validate the next lower dimension geometry - Result<> result = INodeGeometry1D::validate(); - - usize numTuples = getNumberOfFaces(); - const AttributeMatrix* amPtr = getFaceAttributeMatrix(); - if(nullptr == amPtr) - { - return result; - } - usize amNumTuples = amPtr->getNumberOfTuples(); - - if(numTuples != amNumTuples) - { - return MergeResults(result, MakeErrorResult(-4501, fmt::format("Triangle/Quad Geometry '{}' has {} faces but the face Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, - amPtr->getName(), amNumTuples))); - } - return result; -} - -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp b/src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp index 06e507baaa..2e45e641a9 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry2D.hpp @@ -1,81 +1,27 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/simplnx_export.hpp" namespace nx::core { -namespace NodeType -{ -inline constexpr int8_t Unused = 0; -inline constexpr int8_t Default = 2; -inline constexpr int8_t TriplePoint = 3; -inline constexpr int8_t QuadPoint = 4; -inline constexpr int8_t SurfaceDefault = 12; -inline constexpr int8_t SurfaceTriplePoint = 13; -inline constexpr int8_t SurfaceQuadPoint = 14; -} // namespace NodeType - -class SIMPLNX_EXPORT INodeGeometry2D : public INodeGeometry1D +/** + * @class INodeGeometry2D + * @brief Pure virtual interface for node-based geometries with faces. + * + * Contains the string constants and pure virtual methods that form the + * public contract for 2D node geometries. + */ +class SIMPLNX_EXPORT INodeGeometry2D { public: static inline constexpr StringLiteral k_FaceAttributeMatrixName = "Face Data"; static inline constexpr StringLiteral k_FaceFeatureAttributeMatrixName = "Face Feature Data"; static inline constexpr StringLiteral k_SharedFacesListName = "Shared Faces List"; - static inline constexpr StringLiteral k_TypeName = "INodeGeometry2D"; - - INodeGeometry2D() = delete; - INodeGeometry2D(const INodeGeometry2D&) = default; - INodeGeometry2D(INodeGeometry2D&&) = default; - - INodeGeometry2D& operator=(const INodeGeometry2D&) = delete; - INodeGeometry2D& operator=(INodeGeometry2D&&) noexcept = delete; - - ~INodeGeometry2D() noexcept override = default; - - /** - * @brief Returns a pointer to the Face List - * @return - */ - SharedFaceList* getFaces(); - - /** - * @brief Returns a pointer to the Face List - * @return - */ - const SharedFaceList* getFaces() const; - - /** - * @brief Returns a reference to the Face List - * @return - */ - SharedFaceList& getFacesRef(); - - /** - * @brief Returns a reference to the Face List - * @return - */ - const SharedFaceList& getFacesRef() const; - /** - * @brief Sets the list of Faces for this geometry - * @param faces The new list of faces - */ - void setFaceList(const SharedFaceList& faces); - - OptionalId getFaceListId() const; - void setFaceListId(const OptionalId& facesId); - - /** - * @brief Resizes the face list to the target size. - * @param size - */ - void resizeFaceList(usize size); - - /** - * @brief Returns the number of faces in the geometry. - * @return usize - */ - usize getNumberOfFaces() const; + virtual ~INodeGeometry2D() noexcept = default; /** * @brief @@ -85,148 +31,21 @@ class SIMPLNX_EXPORT INodeGeometry2D : public INodeGeometry1D /** * @brief - * @param triId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void setFacePointIds(usize triId, nonstd::span vertexIds); - - /** - * @brief - * @param faceId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void getFacePointIds(usize faceId, nonstd::span vertexIds) const; - - /** - * @brief - * @param faceId - * @param coords The coordinates of each vertex - */ - void getFaceCoordinates(usize faceId, nonstd::span coords) const; - - /** - * @brief Pure-Virtual intended to find the shared edges of each element - * in the geometry and store it in a new or existing array in the DataStructure - * @param recalculate This will allow for skipping execution when an Edge - * Array exists and recalculate is `false` - * @return Result<> + * @return IGeometry::StatusCode */ virtual Result<> findEdges(bool recalculate) = 0; - /** - * @brief Deletes the shared edge list and removes it from the DataStructure. - */ - void deleteEdges(); - /** * @brief - * @return - */ - const std::optional& getUnsharedEdgesId() const; - - void setUnsharedEdgesId(const OptionalId& unsharedEdgesId); - - /** - * @brief Pure-Virtual intended to find the unshared edges of each element - * in the geometry and store it in a new or existing array in the DataStructure - * @param recalculate This will allow for skipping execution when an Unshared Edge - * Array exists and recalculate is `false` - * @return Result<> + * @return IGeometry::StatusCode */ virtual Result<> findUnsharedEdges(bool recalculate) = 0; - /** - * @brief Returns a const pointer to the unshared edge list. Returns nullptr - * if no unshared edge list could be found. - * @return const SharedEdgeList* - */ - const SharedEdgeList* getUnsharedEdges() const; - - /** - * @brief Deletes the unshared edge list and removes it from the DataStructure. - */ - void deleteUnsharedEdges(); - - /**************************************************************************** - * These functions get values related to where the Vertex Coordinates are - * stored in the DataStructure - */ - - const std::optional& getFaceListDataArrayId() const; - - /** - * @brief - * @return - */ - const std::optional& getFaceAttributeMatrixId() const; - - void setFaceDataId(const OptionalId& faceDataId); - - /** - * @brief - * @return - */ - AttributeMatrix* getFaceAttributeMatrix(); - - /** - * @brief - * @return - */ - const AttributeMatrix* getFaceAttributeMatrix() const; - - /** - * @brief - * @return - */ - AttributeMatrix& getFaceAttributeMatrixRef(); - - /** - * @brief - * @return - */ - const AttributeMatrix& getFaceAttributeMatrixRef() const; - - /** - * @brief - * @return - */ - DataPath getFaceAttributeMatrixDataPath() const; - - /** - * @brief - * @param attributeMatrix - */ - void setFaceAttributeMatrix(const AttributeMatrix& attributeMatrix); - - /** - * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. - * @return A Result<> object possibly with error code and message. - */ - Result<> validate() const override; - protected: - INodeGeometry2D(DataStructure& dataStructure, std::string name); - - INodeGeometry2D(DataStructure& dataStructure, std::string name, IdType importId); - - /** - * @brief - * @param numEdges - * @return SharedEdgeList* - */ - SharedEdgeList* createSharedEdgeList(usize numEdges); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - /* *************************************************************************** - * These variables are the Ids of the arrays from the DataStructure object. - */ - std::optional m_FaceListId; - std::optional m_FaceAttributeMatrixId; - std::optional m_UnsharedEdgeListId; + INodeGeometry2D() = default; + INodeGeometry2D(const INodeGeometry2D&) = default; + INodeGeometry2D(INodeGeometry2D&&) = default; + INodeGeometry2D& operator=(const INodeGeometry2D&) = default; + INodeGeometry2D& operator=(INodeGeometry2D&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry3D.cpp b/src/simplnx/DataStructure/Geometry/INodeGeometry3D.cpp index cd4c265ae0..eaa959806a 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry3D.cpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry3D.cpp @@ -1,258 +1 @@ -#include "INodeGeometry3D.hpp" - -#include "simplnx/Utilities/DataObjectUtilities.hpp" - -namespace nx::core -{ -INodeGeometry3D::INodeGeometry3D(DataStructure& dataStructure, std::string name) -: INodeGeometry2D(dataStructure, std::move(name)) -{ -} - -INodeGeometry3D::INodeGeometry3D(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry2D(dataStructure, std::move(name), importId) -{ -} - -const std::optional& INodeGeometry3D::getPolyhedronListId() const -{ - return m_PolyhedronListId; -} - -void INodeGeometry3D::setPolyhedronListId(const OptionalId& polyListId) -{ - m_PolyhedronListId = polyListId; -} - -INodeGeometry3D::SharedFaceList* INodeGeometry3D::getPolyhedra() -{ - if(!m_PolyhedronListId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_PolyhedronListId); -} - -const INodeGeometry3D::SharedFaceList* INodeGeometry3D::getPolyhedra() const -{ - if(!m_PolyhedronListId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_PolyhedronListId); -} - -INodeGeometry3D::SharedFaceList& INodeGeometry3D::getPolyhedraRef() -{ - if(!m_PolyhedronListId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared polyhedra list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_PolyhedronListId.value()); -} - -const INodeGeometry3D::SharedFaceList& INodeGeometry3D::getPolyhedraRef() const -{ - if(!m_PolyhedronListId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a shared polyhedra list assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_PolyhedronListId.value()); -} - -INodeGeometry3D::OptionalId INodeGeometry3D::getPolyhedraDataId() const -{ - return m_PolyhedronAttributeMatrixId; -} - -void INodeGeometry3D::setPolyhedraList(const SharedFaceList& polyhedra) -{ - m_PolyhedronListId = polyhedra.getId(); -} - -void INodeGeometry3D::resizePolyhedraList(usize size) -{ - getPolyhedraRef().getIDataStoreRef().resizeTuples({size}); -} - -usize INodeGeometry3D::getNumberOfPolyhedra() const -{ - const auto* polyhedraPtr = getPolyhedra(); - return polyhedraPtr == nullptr ? 0 : polyhedraPtr->getNumberOfTuples(); -} - -void INodeGeometry3D::setCellPointIds(usize polyhedraId, nonstd::span vertexIds) -{ - auto& polyhedra = getPolyhedraRef(); - usize numVerts = getNumberOfVerticesPerCell(); - const usize offset = polyhedraId * numVerts; - if(offset + numVerts > polyhedra.getSize()) - { - return; - } - for(usize i = 0; i < numVerts; i++) - { - polyhedra[polyhedraId * numVerts + i] = vertexIds[i]; - } -} - -void INodeGeometry3D::getCellPointIds(usize polyhedraId, nonstd::span vertexIds) const -{ - auto& polyhedra = getPolyhedraRef(); - usize numVerts = getNumberOfVerticesPerCell(); - const usize offset = polyhedraId * numVerts; - if(offset + numVerts > polyhedra.getSize()) - { - return; - } - for(usize i = 0; i < numVerts; i++) - { - vertexIds[i] = polyhedra[offset + i]; - } -} - -void INodeGeometry3D::getCellCoordinates(usize hexId, nonstd::span coords) const -{ - usize numVerts = getNumberOfVerticesPerCell(); - std::vector vertIds(numVerts, 0); - getCellPointIds(hexId, vertIds); - for(usize index = 0; index < numVerts; index++) - { - coords[index] = getVertexCoordinate(vertIds[index]); - } -} - -void INodeGeometry3D::deleteFaces() -{ - getDataStructureRef().removeData(m_FaceListId); - m_FaceListId.reset(); -} - -const std::optional& INodeGeometry3D::getUnsharedFacesId() const -{ - return m_UnsharedFaceListId; -} - -void INodeGeometry3D::setUnsharedFacedId(const OptionalId& id) -{ - m_UnsharedFaceListId = id; -} - -const INodeGeometry3D::SharedFaceList* INodeGeometry3D::getUnsharedFaces() const -{ - return getDataStructureRef().getDataAs(m_UnsharedFaceListId); -} - -void INodeGeometry3D::deleteUnsharedFaces() -{ - getDataStructureRef().removeData(m_UnsharedFaceListId); - m_UnsharedFaceListId.reset(); -} - -const std::optional& INodeGeometry3D::getPolyhedraAttributeMatrixId() const -{ - return m_PolyhedronAttributeMatrixId; -} - -void INodeGeometry3D::setPolyhedraDataId(const OptionalId& polyDataId) -{ - m_PolyhedronAttributeMatrixId = polyDataId; -} - -AttributeMatrix* INodeGeometry3D::getPolyhedraAttributeMatrix() -{ - if(!m_PolyhedronAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_PolyhedronAttributeMatrixId); -} - -const AttributeMatrix* INodeGeometry3D::getPolyhedraAttributeMatrix() const -{ - if(!m_PolyhedronAttributeMatrixId.has_value()) - { - return nullptr; - } - return getDataStructureRef().getDataAs(m_PolyhedronAttributeMatrixId); -} - -AttributeMatrix& INodeGeometry3D::getPolyhedraAttributeMatrixRef() -{ - if(!m_PolyhedronAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a polyhedra attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_PolyhedronAttributeMatrixId.value()); -} - -const AttributeMatrix& INodeGeometry3D::getPolyhedraAttributeMatrixRef() const -{ - if(!m_PolyhedronAttributeMatrixId.has_value()) - { - throw std::runtime_error( - fmt::format("INodeGeometry1D::{} threw runtime exception. The geometry with name '{}' does not have a polyhedra attribute matrix assigned.\n {}:{}", __func__, getName(), __FILE__, __LINE__)); - } - return getDataStructureRef().getDataRefAs(m_PolyhedronAttributeMatrixId.value()); -} - -DataPath INodeGeometry3D::getPolyhedronAttributeMatrixDataPath() const -{ - return getPolyhedraAttributeMatrixRef().getDataPaths().at(0); -} - -void INodeGeometry3D::setPolyhedraAttributeMatrix(const AttributeMatrix& attributeMatrix) -{ - m_PolyhedronAttributeMatrixId = attributeMatrix.getId(); -} -INodeGeometry3D::SharedQuadList* INodeGeometry3D::createSharedQuadList(usize numQuads) -{ - auto dataStore = std::make_unique>(std::vector{numQuads}, std::vector{4}, 0); - SharedQuadList* quads = DataArray::Create(*getDataStructure(), k_SharedFacesListName, std::move(dataStore), getId()); - return quads; -} - -INodeGeometry3D::SharedTriList* INodeGeometry3D::createSharedTriList(usize numTris) -{ - auto dataStore = std::make_unique>(std::vector{numTris}, std::vector{3}, 0); - SharedTriList* triangles = DataArray::Create(*getDataStructure(), k_SharedFacesListName, std::move(dataStore), getId()); - return triangles; -} - -void INodeGeometry3D::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) -{ - INodeGeometry2D::checkUpdatedIdsImpl(updatedIdsMap); - std::vector visited(3, false); - - for(const auto& updatedId : updatedIdsMap) - { - m_PolyhedronListId = nx::core::VisitDataStructureId(m_PolyhedronListId, updatedId, visited, 0); - m_PolyhedronAttributeMatrixId = nx::core::VisitDataStructureId(m_PolyhedronAttributeMatrixId, updatedId, visited, 1); - m_UnsharedFaceListId = nx::core::VisitDataStructureId(m_UnsharedFaceListId, updatedId, visited, 2); - } -} - -Result<> INodeGeometry3D::validate() const -{ - // Validate the next lower dimension geometry - Result<> result = INodeGeometry2D::validate(); - - usize numTuples = getNumberOfPolyhedra(); - const AttributeMatrix* amPtr = getPolyhedraAttributeMatrix(); - if(nullptr == amPtr) - { - return result; - } - usize amNumTuples = amPtr->getNumberOfTuples(); - - if(numTuples != amNumTuples) - { - return MergeResults( - result, MakeErrorResult(-4501, fmt::format("Hex/Tet Geometry '{}' has {} cells but the cell Attribute Matrix '{}' has {} total tuples.", getName(), numTuples, amPtr->getName(), amNumTuples))); - } - return result; -} -} // namespace nx::core +#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" diff --git a/src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp b/src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp index 1834be5168..b26eeebdfe 100644 --- a/src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp +++ b/src/simplnx/DataStructure/Geometry/INodeGeometry3D.hpp @@ -1,70 +1,26 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/simplnx_export.hpp" namespace nx::core { -class SIMPLNX_EXPORT INodeGeometry3D : public INodeGeometry2D +/** + * @class INodeGeometry3D + * @brief Pure virtual interface for node-based geometries with polyhedra. + * + * Contains the string constants and pure virtual methods that form the + * public contract for 3D node geometries. + */ +class SIMPLNX_EXPORT INodeGeometry3D { public: static inline constexpr StringLiteral k_PolyhedronDataName = "Polyhedron Data"; static inline constexpr StringLiteral k_SharedPolyhedronListName = "Shared Polyhedron List"; - static inline constexpr StringLiteral k_TypeName = "INodeGeometry3D"; - INodeGeometry3D() = delete; - INodeGeometry3D(const INodeGeometry3D&) = default; - INodeGeometry3D(INodeGeometry3D&&) = default; - - INodeGeometry3D& operator=(const INodeGeometry3D&) = delete; - INodeGeometry3D& operator=(INodeGeometry3D&&) noexcept = delete; - - ~INodeGeometry3D() noexcept override = default; - - void setPolyhedronListId(const OptionalId& polyListId); - - /** - * @brief - * @return - */ - SharedFaceList* getPolyhedra(); - - /** - * @brief - * @return - */ - const SharedFaceList* getPolyhedra() const; - - /** - * @brief - * @return - */ - SharedFaceList& getPolyhedraRef(); - - /** - * @brief - * @return - */ - const SharedFaceList& getPolyhedraRef() const; - - /** - * @brief - * @param polyhedra - */ - void setPolyhedraList(const SharedFaceList& polyhedra); - - /** - * @brief Resizes the polyhedra list to the target size. - * @param size - */ - void resizePolyhedraList(usize size); - - OptionalId getPolyhedraDataId() const; - - /** - * @brief Returns the number of polyhedra in the geometry. - * @return usize - */ - usize getNumberOfPolyhedra() const; + virtual ~INodeGeometry3D() noexcept = default; /** * @brief Pure-Virtual intended to find the shared faces of each element @@ -76,150 +32,21 @@ class SIMPLNX_EXPORT INodeGeometry3D : public INodeGeometry2D virtual Result<> findFaces(bool recalculate) = 0; /** - * @brief Deletes the current face list array. - */ - void deleteFaces(); - - /** - * @brief - * @return - */ - const std::optional& getUnsharedFacesId() const; - - /** - * @brief - * @return - */ - void setUnsharedFacedId(const OptionalId& id); - - /** - * @brief Pure-Virtual intended to find the unshared faces of each element - * in the geometry and store it in a new or existing array in the DataStructure - * @param recalculate This will allow for skipping execution when an Unshared Faces - * Array exists and recalculate is `false` - * @return Result<> + * @brief Creates and assigns the unshared face list array for the current values. */ virtual Result<> findUnsharedFaces(bool recalculate) = 0; - /** - * @brief Returns a pointer to the unshared face list array. - * @return - */ - const SharedFaceList* getUnsharedFaces() const; - - /** - * @brief Deletes the current unshared face list array. - */ - void deleteUnsharedFaces(); - /** * @brief Returns the number of vertices in the cell. * @return */ virtual usize getNumberOfVerticesPerCell() const = 0; - /** - * @brief - * @param tetId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void setCellPointIds(usize tetId, nonstd::span vertexIds); - - /** - * @brief - * @param tetId - * @param vertexIds The index into the shared vertex list of each vertex - */ - void getCellPointIds(usize tetId, nonstd::span vertexIds) const; - - /** - * @brief - * @param tetId - * @param coords The coordinates of each vertex - */ - void getCellCoordinates(usize tetId, nonstd::span coords) const; - - /**************************************************************************** - * These functions get values related to where the Vertex Coordinates are - * stored in the DataStructure - */ - - /** - * @brief - * @return - */ - const std::optional& getPolyhedronListId() const; - - void setPolyhedraDataId(const OptionalId& polyDataId); - - /** - * @brief - * @return - */ - const std::optional& getPolyhedraAttributeMatrixId() const; - - /** - * @brief - * @return - */ - AttributeMatrix* getPolyhedraAttributeMatrix(); - - /** - * @brief - * @return - */ - const AttributeMatrix* getPolyhedraAttributeMatrix() const; - - /** - * @brief - * @return - */ - AttributeMatrix& getPolyhedraAttributeMatrixRef(); - - /** - * @brief - * @return - */ - const AttributeMatrix& getPolyhedraAttributeMatrixRef() const; - - /** - * @brief - * @return - */ - DataPath getPolyhedronAttributeMatrixDataPath() const; - - /** - * @brief - * @param attributeMatrix - */ - void setPolyhedraAttributeMatrix(const AttributeMatrix& attributeMatrix); - - /** - * @brief validates that linkages between shared node lists and their associated Attribute Matrix is correct. - * @return A Result<> object possibly with error code and message. - */ - Result<> validate() const override; - protected: - INodeGeometry3D(DataStructure& dataStructure, std::string name); - - INodeGeometry3D(DataStructure& dataStructure, std::string name, IdType importId); - - SharedQuadList* createSharedQuadList(usize numQuads); - - SharedTriList* createSharedTriList(usize numTris); - - /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. - * @param updatedIdsMap - */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; - - /* *************************************************************************** - * These variables are the Ids of the arrays from the DataStructure object. - */ - std::optional m_PolyhedronListId; - std::optional m_PolyhedronAttributeMatrixId; - std::optional m_UnsharedFaceListId; + INodeGeometry3D() = default; + INodeGeometry3D(const INodeGeometry3D&) = default; + INodeGeometry3D(INodeGeometry3D&&) = default; + INodeGeometry3D& operator=(const INodeGeometry3D&) = default; + INodeGeometry3D& operator=(INodeGeometry3D&&) noexcept = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Geometry/ImageGeom.cpp b/src/simplnx/DataStructure/Geometry/ImageGeom.cpp index 3e37f59719..9bebb27429 100644 --- a/src/simplnx/DataStructure/Geometry/ImageGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/ImageGeom.cpp @@ -10,12 +10,12 @@ using namespace nx::core; ImageGeom::ImageGeom(DataStructure& dataStructure, std::string name) -: IGridGeometry(dataStructure, std::move(name)) +: AbstractGridGeometry(dataStructure, std::move(name)) { } ImageGeom::ImageGeom(DataStructure& dataStructure, std::string name, IdType importId) -: IGridGeometry(dataStructure, std::move(name), importId) +: AbstractGridGeometry(dataStructure, std::move(name), importId) { } @@ -24,9 +24,9 @@ IGeometry::Type ImageGeom::getGeomType() const return IGeometry::Type::Image; } -DataObject::Type ImageGeom::getDataObjectType() const +AbstractDataObject::Type ImageGeom::getDataObjectType() const { - return DataObject::Type::ImageGeom; + return IDataObject::Type::ImageGeom; } BaseGroup::GroupType ImageGeom::getGroupType() const @@ -59,12 +59,12 @@ std::string ImageGeom::getTypeName() const return k_TypeName; } -DataObject* ImageGeom::shallowCopy() +AbstractDataObject* ImageGeom::shallowCopy() { return new ImageGeom(*this); } -std::shared_ptr ImageGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr ImageGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure diff --git a/src/simplnx/DataStructure/Geometry/ImageGeom.hpp b/src/simplnx/DataStructure/Geometry/ImageGeom.hpp index cbe5cd72c4..1f9c7b6291 100644 --- a/src/simplnx/DataStructure/Geometry/ImageGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/ImageGeom.hpp @@ -2,9 +2,9 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/Common/BoundingBox.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -16,7 +16,7 @@ namespace nx::core * @class ImageGeom * @brief */ -class SIMPLNX_EXPORT ImageGeom : public IGridGeometry +class SIMPLNX_EXPORT ImageGeom : public AbstractGridGeometry { public: friend class DataStructure; @@ -72,13 +72,13 @@ class SIMPLNX_EXPORT ImageGeom : public IGridGeometry * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -87,22 +87,22 @@ class SIMPLNX_EXPORT ImageGeom : public IGridGeometry GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief diff --git a/src/simplnx/DataStructure/Geometry/QuadGeom.cpp b/src/simplnx/DataStructure/Geometry/QuadGeom.cpp index b4feec3641..6913661bed 100644 --- a/src/simplnx/DataStructure/Geometry/QuadGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/QuadGeom.cpp @@ -9,13 +9,13 @@ using namespace nx::core; QuadGeom::QuadGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry2D(dataStructure, std::move(name)) +: AbstractNodeGeometry2D(dataStructure, std::move(name)) { m_UnitDimensionality = 2; } QuadGeom::QuadGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry2D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry2D(dataStructure, std::move(name), importId) { m_UnitDimensionality = 2; } @@ -25,9 +25,9 @@ IGeometry::Type QuadGeom::getGeomType() const return IGeometry::Type::Quad; } -DataObject::Type QuadGeom::getDataObjectType() const +AbstractDataObject::Type QuadGeom::getDataObjectType() const { - return DataObject::Type::QuadGeom; + return IDataObject::Type::QuadGeom; } BaseGroup::GroupType QuadGeom::getGroupType() const @@ -60,12 +60,12 @@ std::string QuadGeom::getTypeName() const return k_TypeName; } -DataObject* QuadGeom::shallowCopy() +AbstractDataObject* QuadGeom::shallowCopy() { return new QuadGeom(*this); } -std::shared_ptr QuadGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr QuadGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -149,7 +149,7 @@ std::shared_ptr QuadGeom::deepCopy(const DataPath& copyPath) { copy->m_UnsharedEdgeListId = unsharedEdgesCopy->getId(); } - if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry2D::k_SharedEdgeListName)); edgesCopy != nullptr) + if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry1D::k_SharedEdgeListName)); edgesCopy != nullptr) { copy->m_EdgeDataArrayId = edgesCopy->getId(); } diff --git a/src/simplnx/DataStructure/Geometry/QuadGeom.hpp b/src/simplnx/DataStructure/Geometry/QuadGeom.hpp index 408d9f31bd..ef7c530924 100644 --- a/src/simplnx/DataStructure/Geometry/QuadGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/QuadGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/simplnx_export.hpp" namespace nx::core @@ -9,19 +9,19 @@ namespace nx::core * @class QuadGeom * @brief */ -class SIMPLNX_EXPORT QuadGeom : public INodeGeometry2D +class SIMPLNX_EXPORT QuadGeom : public AbstractNodeGeometry2D { public: friend class DataStructure; - static inline constexpr usize k_NumEdgeVerts = 2; - static inline constexpr usize k_NumFaceVerts = 4; - static inline constexpr usize k_NumVerts = 4; - static inline constexpr StringLiteral k_VoxelSizes = "Quad Areas"; - static inline constexpr StringLiteral k_EltsContainingVert = "Quads Containing Vert"; - static inline constexpr StringLiteral k_EltNeighbors = "Quad Neighbors"; - static inline constexpr StringLiteral k_EltCentroids = "Quad Centroids"; - static inline constexpr StringLiteral k_TypeName = "QuadGeom"; + static constexpr usize k_NumEdgeVerts = 2; + static constexpr usize k_NumFaceVerts = 4; + static constexpr usize k_NumVerts = 4; + static constexpr StringLiteral k_VoxelSizes = "Quad Areas"; + static constexpr StringLiteral k_EltsContainingVert = "Quads Containing Vert"; + static constexpr StringLiteral k_EltNeighbors = "Quad Neighbors"; + static constexpr StringLiteral k_EltCentroids = "Quad Centroids"; + static constexpr StringLiteral k_TypeName = "QuadGeom"; /** * @brief * @param dataStructure @@ -62,13 +62,13 @@ class SIMPLNX_EXPORT QuadGeom : public INodeGeometry2D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -77,22 +77,22 @@ class SIMPLNX_EXPORT QuadGeom : public INodeGeometry2D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * diff --git a/src/simplnx/DataStructure/Geometry/RectGridGeom.cpp b/src/simplnx/DataStructure/Geometry/RectGridGeom.cpp index af76476149..a2b36f54d5 100644 --- a/src/simplnx/DataStructure/Geometry/RectGridGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/RectGridGeom.cpp @@ -11,12 +11,12 @@ using namespace nx::core; RectGridGeom::RectGridGeom(DataStructure& dataStructure, std::string name) -: IGridGeometry(dataStructure, std::move(name)) +: AbstractGridGeometry(dataStructure, std::move(name)) { } RectGridGeom::RectGridGeom(DataStructure& dataStructure, std::string name, IdType importId) -: IGridGeometry(dataStructure, std::move(name), importId) +: AbstractGridGeometry(dataStructure, std::move(name), importId) { } @@ -25,9 +25,9 @@ IGeometry::Type RectGridGeom::getGeomType() const return IGeometry::Type::RectGrid; } -DataObject::Type RectGridGeom::getDataObjectType() const +AbstractDataObject::Type RectGridGeom::getDataObjectType() const { - return DataObject::Type::RectGridGeom; + return IDataObject::Type::RectGridGeom; } BaseGroup::GroupType RectGridGeom::getGroupType() const @@ -60,12 +60,12 @@ std::string RectGridGeom::getTypeName() const return k_TypeName; } -DataObject* RectGridGeom::shallowCopy() +AbstractDataObject* RectGridGeom::shallowCopy() { return new RectGridGeom(*this); } -std::shared_ptr RectGridGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr RectGridGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -273,15 +273,15 @@ std::shared_ptr RectGridGeom::getSharedZBounds() return getDataStructure()->getSharedDataAs(m_zBoundsId.value()); } -DataObject::OptionalId RectGridGeom::getXBoundsId() const +AbstractDataObject::OptionalId RectGridGeom::getXBoundsId() const { return m_xBoundsId; } -DataObject::OptionalId RectGridGeom::getYBoundsId() const +AbstractDataObject::OptionalId RectGridGeom::getYBoundsId() const { return m_yBoundsId; } -DataObject::OptionalId RectGridGeom::getZBoundsId() const +AbstractDataObject::OptionalId RectGridGeom::getZBoundsId() const { return m_zBoundsId; } @@ -722,9 +722,9 @@ std::optional RectGridGeom::getIndex(float64 xCoord, float64 yCoord, floa return (ySize * xSize * z) + (xSize * y) + x; } -void RectGridGeom::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) +void RectGridGeom::checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) { - IGridGeometry::checkUpdatedIdsImpl(updatedIdsMap); + AbstractGridGeometry::checkUpdatedIdsImpl(updatedIdsMap); std::vector visited(3, false); for(const auto& updatedId : updatedIdsMap) diff --git a/src/simplnx/DataStructure/Geometry/RectGridGeom.hpp b/src/simplnx/DataStructure/Geometry/RectGridGeom.hpp index cfd4f3e4ac..43cee6b1fc 100644 --- a/src/simplnx/DataStructure/Geometry/RectGridGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/RectGridGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/simplnx_export.hpp" #include "simplnx/Common/Array.hpp" @@ -13,12 +13,12 @@ namespace nx::core * @class RectGridGeom * @brief */ -class SIMPLNX_EXPORT RectGridGeom : public IGridGeometry +class SIMPLNX_EXPORT RectGridGeom : public AbstractGridGeometry { public: friend class DataStructure; - static inline constexpr StringLiteral k_TypeName = "RectGridGeom"; + static constexpr StringLiteral k_TypeName = "RectGridGeom"; /** * @brief @@ -60,13 +60,13 @@ class SIMPLNX_EXPORT RectGridGeom : public IGridGeometry * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -75,22 +75,22 @@ class SIMPLNX_EXPORT RectGridGeom : public IGridGeometry GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief @@ -387,10 +387,10 @@ class SIMPLNX_EXPORT RectGridGeom : public IGridGeometry RectGridGeom(DataStructure& dataStructure, std::string name, IdType importId); /** - * @brief Updates the array IDs. Should only be called by DataObject::checkUpdatedIds. + * @brief Updates the array IDs. Should only be called by AbstractDataObject::checkUpdatedIds. * @param updatedIdsMap */ - void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; + void checkUpdatedIdsImpl(const std::unordered_map& updatedIdsMap) override; private: std::optional m_xBoundsId; diff --git a/src/simplnx/DataStructure/Geometry/TetrahedralGeom.cpp b/src/simplnx/DataStructure/Geometry/TetrahedralGeom.cpp index 093a62fd2a..eafe70d6e5 100644 --- a/src/simplnx/DataStructure/Geometry/TetrahedralGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/TetrahedralGeom.cpp @@ -9,12 +9,12 @@ using namespace nx::core; TetrahedralGeom::TetrahedralGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry3D(dataStructure, std::move(name)) +: AbstractNodeGeometry3D(dataStructure, std::move(name)) { } TetrahedralGeom::TetrahedralGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry3D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry3D(dataStructure, std::move(name), importId) { } @@ -23,9 +23,9 @@ IGeometry::Type TetrahedralGeom::getGeomType() const return IGeometry::Type::Tetrahedral; } -DataObject::Type TetrahedralGeom::getDataObjectType() const +AbstractDataObject::Type TetrahedralGeom::getDataObjectType() const { - return DataObject::Type::TetrahedralGeom; + return IDataObject::Type::TetrahedralGeom; } BaseGroup::GroupType TetrahedralGeom::getGroupType() const @@ -63,12 +63,12 @@ std::string TetrahedralGeom::getTypeName() const return k_TypeName; } -DataObject* TetrahedralGeom::shallowCopy() +AbstractDataObject* TetrahedralGeom::shallowCopy() { return new TetrahedralGeom(*this); } -std::shared_ptr TetrahedralGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr TetrahedralGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure @@ -163,7 +163,7 @@ std::shared_ptr TetrahedralGeom::deepCopy(const DataPath& copyPath) { copy->m_UnsharedEdgeListId = unsharedEdgesCopy->getId(); } - if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry2D::k_SharedEdgeListName)); edgesCopy != nullptr) + if(const auto edgesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry1D::k_SharedEdgeListName)); edgesCopy != nullptr) { copy->m_EdgeDataArrayId = edgesCopy->getId(); } @@ -171,7 +171,7 @@ std::shared_ptr TetrahedralGeom::deepCopy(const DataPath& copyPath) { copy->m_UnsharedFaceListId = unsharedFacesCopy->getId(); } - if(const auto facesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry3D::k_SharedFacesListName)); facesCopy != nullptr) + if(const auto facesCopy = dataStruct.getDataAs>(copyPath.createChildPath(INodeGeometry2D::k_SharedFacesListName)); facesCopy != nullptr) { copy->m_FaceListId = facesCopy->getId(); } diff --git a/src/simplnx/DataStructure/Geometry/TetrahedralGeom.hpp b/src/simplnx/DataStructure/Geometry/TetrahedralGeom.hpp index 726d149861..12af6861b0 100644 --- a/src/simplnx/DataStructure/Geometry/TetrahedralGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/TetrahedralGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/simplnx_export.hpp" namespace nx::core @@ -9,19 +9,19 @@ namespace nx::core * @class TetrahedralGeom * @brief */ -class SIMPLNX_EXPORT TetrahedralGeom : public INodeGeometry3D +class SIMPLNX_EXPORT TetrahedralGeom : public AbstractNodeGeometry3D { public: friend class DataStructure; - static inline constexpr usize k_NumEdgeVerts = 2; - static inline constexpr usize k_NumFaceVerts = 3; - static inline constexpr usize k_NumVerts = 4; - static inline constexpr StringLiteral k_VoxelSizes = "Tet Volumes"; - static inline constexpr StringLiteral k_EltsContainingVert = "Elements Containing Vert"; - static inline constexpr StringLiteral k_EltNeighbors = "Tet Neighbors"; - static inline constexpr StringLiteral k_EltCentroids = "Tet Centroids"; - static inline constexpr StringLiteral k_TypeName = "TetrahedralGeom"; + static constexpr usize k_NumEdgeVerts = 2; + static constexpr usize k_NumFaceVerts = 3; + static constexpr usize k_NumVerts = 4; + static constexpr StringLiteral k_VoxelSizes = "Tet Volumes"; + static constexpr StringLiteral k_EltsContainingVert = "Elements Containing Vert"; + static constexpr StringLiteral k_EltNeighbors = "Tet Neighbors"; + static constexpr StringLiteral k_EltCentroids = "Tet Centroids"; + static constexpr StringLiteral k_TypeName = "TetrahedralGeom"; /** * @brief @@ -52,7 +52,7 @@ class SIMPLNX_EXPORT TetrahedralGeom : public INodeGeometry3D * @brief * @param other */ - TetrahedralGeom(TetrahedralGeom&& other) = default; + TetrahedralGeom(TetrahedralGeom&& other) noexcept = default; ~TetrahedralGeom() noexcept override = default; @@ -63,13 +63,13 @@ class SIMPLNX_EXPORT TetrahedralGeom : public INodeGeometry3D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -78,22 +78,22 @@ class SIMPLNX_EXPORT TetrahedralGeom : public INodeGeometry3D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * diff --git a/src/simplnx/DataStructure/Geometry/TriangleGeom.cpp b/src/simplnx/DataStructure/Geometry/TriangleGeom.cpp index e26cfd88b1..1f98a0530a 100644 --- a/src/simplnx/DataStructure/Geometry/TriangleGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/TriangleGeom.cpp @@ -10,13 +10,13 @@ using namespace nx::core; TriangleGeom::TriangleGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry2D(dataStructure, std::move(name)) +: AbstractNodeGeometry2D(dataStructure, std::move(name)) { m_UnitDimensionality = 2; } TriangleGeom::TriangleGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry2D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry2D(dataStructure, std::move(name), importId) { m_UnitDimensionality = 2; } @@ -26,9 +26,9 @@ IGeometry::Type TriangleGeom::getGeomType() const return IGeometry::Type::Triangle; } -DataObject::Type TriangleGeom::getDataObjectType() const +AbstractDataObject::Type TriangleGeom::getDataObjectType() const { - return DataObject::Type::TriangleGeom; + return IDataObject::Type::TriangleGeom; } BaseGroup::GroupType TriangleGeom::getGroupType() const @@ -66,12 +66,12 @@ std::string TriangleGeom::getTypeName() const return k_TypeName; } -DataObject* TriangleGeom::shallowCopy() +AbstractDataObject* TriangleGeom::shallowCopy() { return new TriangleGeom(*this); } -std::shared_ptr TriangleGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr TriangleGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure diff --git a/src/simplnx/DataStructure/Geometry/TriangleGeom.hpp b/src/simplnx/DataStructure/Geometry/TriangleGeom.hpp index bee2193bdf..0c7ab8a46b 100644 --- a/src/simplnx/DataStructure/Geometry/TriangleGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/TriangleGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -11,19 +11,19 @@ namespace nx::core * @class TriangleGeom * @brief */ -class SIMPLNX_EXPORT TriangleGeom : public INodeGeometry2D +class SIMPLNX_EXPORT TriangleGeom : public AbstractNodeGeometry2D { public: friend class DataStructure; - static inline constexpr usize k_NumEdgeVerts = 2; - static inline constexpr usize k_NumFaceVerts = 3; - static inline constexpr usize k_NumVerts = 3; - static inline constexpr StringLiteral k_VoxelSizes = "Triangle Areas"; - static inline constexpr StringLiteral k_EltsContainingVert = "Triangles Containing Vert"; - static inline constexpr StringLiteral k_EltNeighbors = "Triangle Neighbors"; - static inline constexpr StringLiteral k_EltCentroids = "Triangle Centroids"; - static inline constexpr StringLiteral k_TypeName = "TriangleGeom"; + static constexpr usize k_NumEdgeVerts = 2; + static constexpr usize k_NumFaceVerts = 3; + static constexpr usize k_NumVerts = 3; + static constexpr StringLiteral k_VoxelSizes = "Triangle Areas"; + static constexpr StringLiteral k_EltsContainingVert = "Triangles Containing Vert"; + static constexpr StringLiteral k_EltNeighbors = "Triangle Neighbors"; + static constexpr StringLiteral k_EltCentroids = "Triangle Centroids"; + static constexpr StringLiteral k_TypeName = "TriangleGeom"; /** * @brief @@ -65,13 +65,13 @@ class SIMPLNX_EXPORT TriangleGeom : public INodeGeometry2D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -80,22 +80,22 @@ class SIMPLNX_EXPORT TriangleGeom : public INodeGeometry2D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * diff --git a/src/simplnx/DataStructure/Geometry/VertexGeom.cpp b/src/simplnx/DataStructure/Geometry/VertexGeom.cpp index a26a7496df..868d7873f9 100644 --- a/src/simplnx/DataStructure/Geometry/VertexGeom.cpp +++ b/src/simplnx/DataStructure/Geometry/VertexGeom.cpp @@ -10,13 +10,13 @@ using namespace nx::core; VertexGeom::VertexGeom(DataStructure& dataStructure, std::string name) -: INodeGeometry0D(dataStructure, std::move(name)) +: AbstractNodeGeometry0D(dataStructure, std::move(name)) { m_UnitDimensionality = 0; } VertexGeom::VertexGeom(DataStructure& dataStructure, std::string name, IdType importId) -: INodeGeometry0D(dataStructure, std::move(name), importId) +: AbstractNodeGeometry0D(dataStructure, std::move(name), importId) { m_UnitDimensionality = 0; } @@ -27,9 +27,9 @@ VertexGeom::VertexGeom(VertexGeom&&) = default; VertexGeom::~VertexGeom() noexcept = default; -DataObject::Type VertexGeom::getDataObjectType() const +AbstractDataObject::Type VertexGeom::getDataObjectType() const { - return DataObject::Type::VertexGeom; + return IDataObject::Type::VertexGeom; } BaseGroup::GroupType VertexGeom::getGroupType() const @@ -67,12 +67,12 @@ std::string VertexGeom::getTypeName() const return k_TypeName; } -DataObject* VertexGeom::shallowCopy() +AbstractDataObject* VertexGeom::shallowCopy() { return new VertexGeom(*this); } -std::shared_ptr VertexGeom::deepCopy(const DataPath& copyPath) +std::shared_ptr VertexGeom::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); // Don't construct with identifier since it will get created when inserting into data structure diff --git a/src/simplnx/DataStructure/Geometry/VertexGeom.hpp b/src/simplnx/DataStructure/Geometry/VertexGeom.hpp index b63a0da586..831e5059ea 100644 --- a/src/simplnx/DataStructure/Geometry/VertexGeom.hpp +++ b/src/simplnx/DataStructure/Geometry/VertexGeom.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" #include "simplnx/simplnx_export.hpp" namespace nx::core @@ -9,14 +9,14 @@ namespace nx::core * @class VertexGeom * @brief */ -class SIMPLNX_EXPORT VertexGeom : public INodeGeometry0D +class SIMPLNX_EXPORT VertexGeom : public AbstractNodeGeometry0D { public: friend class DataStructure; - static inline constexpr usize k_NumVerts = 1; + static constexpr usize k_NumVerts = 1; - static inline constexpr StringLiteral k_TypeName = "VertexGeom"; + static constexpr StringLiteral k_TypeName = "VertexGeom"; /** * @brief @@ -58,13 +58,13 @@ class SIMPLNX_EXPORT VertexGeom : public INodeGeometry0D * @brief Returns the type of geometry. * @return */ - IGeometry::Type getGeomType() const override; + AbstractGeometry::Type getGeomType() const override; /** * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns an enumeration of the class or subclass GroupType. Used for quick comparison or type deduction @@ -73,22 +73,22 @@ class SIMPLNX_EXPORT VertexGeom : public INodeGeometry0D GroupType getGroupType() const override; /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief Points have no space, so this function stores `0`s in a new diff --git a/src/simplnx/DataStructure/IDataObject.hpp b/src/simplnx/DataStructure/IDataObject.hpp new file mode 100644 index 0000000000..5290d29d5e --- /dev/null +++ b/src/simplnx/DataStructure/IDataObject.hpp @@ -0,0 +1,219 @@ +#pragma once + +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/Metadata.hpp" +#include "simplnx/simplnx_export.hpp" + +#include +#include +#include +#include + +namespace nx::core +{ +class DataPath; +class DataStructure; + +/** + * @class IDataObject + * @brief Pure virtual interface for all items stored in the DataStructure. + * + * Defines the public contract for querying AbstractDataObject identity, name, + * parentage, metadata, and memory usage. Concrete implementations live + * in AbstractDataObject and its subclasses. + */ +class SIMPLNX_EXPORT IDataObject +{ +public: + using EnumType = uint32; + enum class Type : EnumType + { + AbstractDataObject = 0, + + DynamicListArray = 1, + ScalarData = 2, + + BaseGroup = 3, + + AttributeMatrix = 4, + DataGroup = 5, + + AbstractDataArray = 6, + DataArray = 7, + + AbstractGeometry = 8, + + AbstractGridGeometry = 9, + RectGridGeom = 10, + ImageGeom = 11, + + AbstractNodeGeometry0D = 12, + VertexGeom = 13, + + AbstractNodeGeometry1D = 14, + EdgeGeom = 15, + + AbstractNodeGeometry2D = 16, + QuadGeom = 17, + TriangleGeom = 18, + + AbstractNodeGeometry3D = 19, + HexahedralGeom = 20, + TetrahedralGeom = 21, + + AbstractNeighborList = 22, + NeighborList = 23, + + StringArray = 24, + + AbstractMontage = 25, + GridMontage = 26, + + Unknown = 999, + Any = 4294967295U + }; + + /** + * @brief The IdType alias serves as an ID type for DataObjects within their + * respective DataStructure. + */ + using IdType = types::uint64; + + /** + * @brief The OptionalId alias specifies that the target AbstractDataObject is not required. + */ + using OptionalId = std::optional; + + /** + * @brief The ParentCollectionType alias describes the format by which parent + * collections are returned via public API. + */ + using ParentCollectionType = std::list; + + virtual ~IDataObject() noexcept = default; + + /** + * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction. + * @return Type + */ + virtual Type getDataObjectType() const = 0; + + /** + * @brief Returns true if this object is derived from BaseGroup. + * @return bool + */ + virtual bool isGroup() const = 0; + + /** + * @brief Returns typename of the AbstractDataObject as a std::string. + * @return std::string + */ + virtual std::string getTypeName() const = 0; + + /** + * @brief Returns the AbstractDataObject's ID value. + * @return IdType + */ + virtual IdType getId() const = 0; + + /** + * @brief Returns a pointer to the DataStructure this AbstractDataObject belongs to. + * @return DataStructure* + */ + virtual DataStructure* getDataStructure() = 0; + + /** + * @brief Returns a read-only pointer to the DataStructure this AbstractDataObject belongs to. + * @return const DataStructure* + */ + virtual const DataStructure* getDataStructure() const = 0; + + /** + * @brief Returns a reference to the DataStructure this AbstractDataObject belongs to. + * @return DataStructure& + */ + virtual DataStructure& getDataStructureRef() = 0; + + /** + * @brief Returns a read-only reference to the DataStructure this AbstractDataObject belongs to. + * @return const DataStructure& + */ + virtual const DataStructure& getDataStructureRef() const = 0; + + /** + * @brief Returns the AbstractDataObject's name. + * @return std::string + */ + virtual std::string getName() const = 0; + + /** + * @brief Checks and returns if the AbstractDataObject can be renamed to the provided value. + * @param name + * @return bool + */ + virtual bool canRename(const std::string& name) const = 0; + + /** + * @brief Attempts to rename the AbstractDataObject to the provided value. + * @param name + * @return bool + */ + virtual bool rename(const std::string& name) = 0; + + /** + * @brief Returns a collection of the parent container IDs that store the AbstractDataObject. + * @return ParentCollectionType + */ + virtual ParentCollectionType getParentIds() const = 0; + + /** + * @brief Clears the list of parent IDs. + */ + virtual void clearParents() = 0; + + /** + * @brief Returns a vector of DataPaths to the object. + * @return std::vector + */ + virtual std::vector getDataPaths() const = 0; + + /** + * @brief Returns a reference to the object's Metadata. + * @return Metadata& + */ + virtual Metadata& getMetadata() = 0; + + /** + * @brief Returns a reference to the object's Metadata. + * @return const Metadata& + */ + virtual const Metadata& getMetadata() const = 0; + + /** + * @brief Returns true if the AbstractDataObject has the specified parent path. + * @param parentPath + * @return bool + */ + virtual bool hasParent(const DataPath& parentPath) const = 0; + + /** + * @brief Flushes the AbstractDataObject to its respective target. + * In-memory DataObjects are not affected. + */ + virtual void flush() const = 0; + + /** + * @brief Returns the memory usage of the AbstractDataObject. + * @return uint64 + */ + virtual uint64 memoryUsage() const = 0; + +protected: + IDataObject() = default; + IDataObject(const IDataObject&) = default; + IDataObject(IDataObject&&) = default; + IDataObject& operator=(const IDataObject&) = default; + IDataObject& operator=(IDataObject&&) noexcept = default; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IDataStore.hpp b/src/simplnx/DataStructure/IDataStore.hpp index 4f644f0227..f4a2580086 100644 --- a/src/simplnx/DataStructure/IDataStore.hpp +++ b/src/simplnx/DataStructure/IDataStore.hpp @@ -67,28 +67,19 @@ class SIMPLNX_EXPORT IDataStore * @brief Returns the number of values stored within the DataStore. * @return usize */ - usize getSize() const - { - return getNumberOfTuples() * getNumberOfComponents(); - } + virtual usize getSize() const = 0; /** * @brief Returns the number of values stored within the DataStore. * @return usize */ - usize size() const - { - return getSize(); - } + virtual usize size() const = 0; /** * @brief Returns if there are any elements in the array object * @return bool, true if the DataStore has a size() == 0 */ - bool empty() const - { - return getNumberOfTuples() == 0; - } + virtual bool empty() const = 0; /** * @brief Resizes the DataStore to handle the specified number of tuples. @@ -112,10 +103,7 @@ class SIMPLNX_EXPORT IDataStore * @brief Returns the data format used for storing the array data. * @return data format as string */ - virtual std::string getDataFormat() const - { - return ""; - } + virtual std::string getDataFormat() const = 0; /** * @brief Returns the size of the stored type of the data store. diff --git a/src/simplnx/DataStructure/IDataStructure.cpp b/src/simplnx/DataStructure/IDataStructure.cpp new file mode 100644 index 0000000000..691f361aa4 --- /dev/null +++ b/src/simplnx/DataStructure/IDataStructure.cpp @@ -0,0 +1 @@ +#include "simplnx/DataStructure/IDataStructure.hpp" diff --git a/src/simplnx/DataStructure/IDataStructure.hpp b/src/simplnx/DataStructure/IDataStructure.hpp new file mode 100644 index 0000000000..b2f213d7e7 --- /dev/null +++ b/src/simplnx/DataStructure/IDataStructure.hpp @@ -0,0 +1,379 @@ +#pragma once + +#include "simplnx/Common/Result.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" +#include "simplnx/DataStructure/DataMap.hpp" +#include "simplnx/DataStructure/LinkedPath.hpp" +#include "simplnx/simplnx_export.hpp" + +#include +#include + +#include +#include +#include +#include +#include + +namespace nx::core +{ +class AbstractDataStructureMessage; +class DataPath; + +/** + * @class IDataStructure + * @brief Pure virtual interface for the DataStructure. + * + * Defines the public contract for accessing, querying, and manipulating + * data objects within the data structure. Template convenience methods + * (getDataAs, getDataRefAs, etc.) live on the concrete DataStructure class. + */ +class SIMPLNX_EXPORT IDataStructure +{ +public: + using SignalType = nod::signal&)>; + using Iterator = DataMap::Iterator; + using ConstIterator = DataMap::ConstIterator; + + virtual ~IDataStructure() noexcept = default; + + /** + * @brief Returns the number of unique DataObjects in the DataStructure. + * @return usize + */ + virtual usize getSize() const = 0; + + /** + * @brief Clears the DataStructure by removing all DataObjects. + */ + virtual void clear() = 0; + + /** + * @brief Returns the IdType for the AbstractDataObject found at the specified DataPath. + * @param path + * @return std::optional + */ + virtual std::optional getId(const DataPath& path) const = 0; + + /** + * @brief Returns true if the DataStructure contains a AbstractDataObject with the given key. + * @param identifier + * @return bool + */ + virtual bool containsData(AbstractDataObject::IdType identifier) const = 0; + + /** + * @brief Returns true if the DataStructure contains a AbstractDataObject with the given path. + * @param path + * @return bool + */ + virtual bool containsData(const DataPath& path) const = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. + * @param identifier + * @return AbstractDataObject* + */ + virtual AbstractDataObject* getData(AbstractDataObject::IdType identifier) = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. + * @param identifier + * @return AbstractDataObject* + */ + virtual AbstractDataObject* getData(const std::optional& identifier) = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. + * @param path + * @return AbstractDataObject* + */ + virtual AbstractDataObject* getData(const DataPath& path) = 0; + + /** + * @brief Returns a reference to the AbstractDataObject at the given DataPath. + * @param path + * @return AbstractDataObject& + */ + virtual AbstractDataObject& getDataRef(const DataPath& path) = 0; + + /** + * @brief Returns a reference to the AbstractDataObject with the given identifier. + * @param identifier + * @return AbstractDataObject& + */ + virtual AbstractDataObject& getDataRef(AbstractDataObject::IdType identifier) = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject found at the specified LinkedPath. + * @param path + * @return AbstractDataObject* + */ + virtual AbstractDataObject* getData(const LinkedPath& path) = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. + * @param identifier + * @return const AbstractDataObject* + */ + virtual const AbstractDataObject* getData(AbstractDataObject::IdType identifier) const = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject with the specified IdType. + * @param identifier + * @return const AbstractDataObject* + */ + virtual const AbstractDataObject* getData(const std::optional& identifier) const = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject at the given DataPath. + * @param path + * @return const AbstractDataObject* + */ + virtual const AbstractDataObject* getData(const DataPath& path) const = 0; + + /** + * @brief Returns a reference to the AbstractDataObject at the given DataPath. + * @param path + * @return const AbstractDataObject& + */ + virtual const AbstractDataObject& getDataRef(const DataPath& path) const = 0; + + /** + * @brief Returns a reference to the AbstractDataObject with the given identifier. + * @param identifier + * @return const AbstractDataObject& + */ + virtual const AbstractDataObject& getDataRef(AbstractDataObject::IdType identifier) const = 0; + + /** + * @brief Returns a pointer to the AbstractDataObject found at the specified LinkedPath. + * @param path + * @return const AbstractDataObject* + */ + virtual const AbstractDataObject* getData(const LinkedPath& path) const = 0; + + /** + * @brief Returns the shared pointer for the specified AbstractDataObject. + * @param id + * @return std::shared_ptr + */ + virtual std::shared_ptr getSharedData(AbstractDataObject::IdType id) = 0; + + /** + * @brief Returns the shared pointer for the specified AbstractDataObject. + * @param id + * @return std::shared_ptr + */ + virtual std::shared_ptr getSharedData(AbstractDataObject::IdType id) const = 0; + + /** + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * @param path + * @return std::shared_ptr + */ + virtual std::shared_ptr getSharedData(const DataPath& path) = 0; + + /** + * @brief Returns the shared pointer for the AbstractDataObject at the target path. + * @param path + * @return std::shared_ptr + */ + virtual std::shared_ptr getSharedData(const DataPath& path) const = 0; + + /** + * @brief Removes the AbstractDataObject using the specified IdType. + * @param identifier + * @return bool + */ + virtual bool removeData(AbstractDataObject::IdType identifier) = 0; + + /** + * @brief Removes the AbstractDataObject using the specified IdType. + * @param identifier + * @return bool + */ + virtual bool removeData(const std::optional& identifier) = 0; + + /** + * @brief Removes the AbstractDataObject using the specified DataPath. + * @param path + * @return bool + */ + virtual bool removeData(const DataPath& path) = 0; + + /** + * @brief Returns a LinkedPath based on the specified DataPath. + * @param path + * @return LinkedPath + */ + virtual LinkedPath getLinkedPath(const DataPath& path) const = 0; + + /** + * @brief Creates the path in the data structure as a series of DataObjects. + * @param path + * @return Result + */ + virtual Result makePath(const DataPath& path) = 0; + + /** + * @brief Returns a vector of DataPaths for the AbstractDataObject with the specified ID. + * @param identifier + * @return std::vector + */ + virtual std::vector getDataPathsForId(AbstractDataObject::IdType identifier) const = 0; + + /** + * @brief Returns a collection of all DataPaths within the structure. + * @return std::vector + */ + virtual std::vector getAllDataPaths() const = 0; + + /** + * @brief Returns a collection of all AbstractDataObject ids within the structure. + * @return std::vector + */ + virtual std::vector getAllDataObjectIds() const = 0; + + /** + * @brief Returns the top-level of the DataStructure. + * @return std::vector + */ + virtual std::vector getTopLevelData() const = 0; + + /** + * @brief Returns a reference to the DataMap backing the top level of the DataStructure. + * @return const DataMap& + */ + virtual const DataMap& getDataMap() const = 0; + + /** + * @brief Inserts a new AbstractDataObject into the DataStructure nested under the given DataPath. + * @param dataObject + * @param dataPath + * @return bool + */ + virtual bool insert(const std::shared_ptr& dataObject, const DataPath& dataPath) = 0; + + /** + * @brief Returns the next ID value to use in the DataStructure. + * @return AbstractDataObject::IdType + */ + virtual AbstractDataObject::IdType getNextId() const = 0; + + /** + * @brief Adds an additional parent to the target AbstractDataObject. + * @param targetId + * @param newParent + * @return bool + */ + virtual bool setAdditionalParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType newParent) = 0; + + /** + * @brief Removes a parent from the target AbstractDataObject. + * @param targetId + * @param parent + * @return bool + */ + virtual bool removeParent(AbstractDataObject::IdType targetId, AbstractDataObject::IdType parent) = 0; + + /** + * @brief Returns an iterator for the beginning of the top-level DataMap. + * @return iterator + */ + virtual Iterator begin() = 0; + + /** + * @brief Returns an iterator for the end of the top-level DataMap. + * @return iterator + */ + virtual Iterator end() = 0; + + /** + * @brief Returns an iterator for the beginning of the top-level DataMap. + * @return + */ + virtual ConstIterator begin() const = 0; + + /** + * @brief Returns an iterator for the end of the top-level DataMap. + * @return + */ + virtual ConstIterator end() const = 0; + + /** + * @brief Checks if all IDataArrays at the target paths have the same tuple count. + * @param dataPaths + * @return bool + */ + virtual nonstd::expected validateNumberOfTuples(const std::vector& dataPaths) const = 0; + + /** + * @brief Resets AbstractDataObject IDs starting at the provided value. + * @param startingId + */ + virtual void resetIds(AbstractDataObject::IdType startingId) = 0; + + /** + * @brief Outputs data graph in .dot file format. + * @param outputStream + */ + virtual void exportHierarchyAsGraphViz(std::ostream& outputStream) const = 0; + + /** + * @brief Outputs data graph in console readable format. + * @param outputStream + */ + virtual void exportHierarchyAsText(std::ostream& outputStream) const = 0; + + /** + * @brief Sets the next ID to use when constructing a AbstractDataObject. + * @param nextDataId + */ + virtual void setNextId(AbstractDataObject::IdType nextDataId) = 0; + + /** + * @brief Returns a reference to the root DataMap. + * @return DataMap& + */ + virtual DataMap& getRootGroup() = 0; + + /** + * @brief Flushes all DataObjects to their respective target. + */ + virtual void flush() const = 0; + + /** + * @brief Returns the memory usage of the DataStructure. + * @return uint64 + */ + virtual uint64 memoryUsage() const = 0; + + /** + * @brief Transfers array data to OOC if available. + * @return Result with warnings and errors + */ + virtual Result<> transferDataArraysOoc() = 0; + + /** + * @brief Validates that each Geometry is valid based on shared-list and + * AttributeMatrix tuple count criteria. + * @return Result<> + */ + virtual Result<> validateGeometries() const = 0; + + /** + * @brief Validates that each AttributeMatrix contains AbstractArray objects with + * consistent tuple counts. + * @return Result<> + */ + virtual Result<> validateAttributeMatrices() const = 0; + +protected: + IDataStructure() = default; + IDataStructure(const IDataStructure&) = default; + IDataStructure(IDataStructure&&) = default; + IDataStructure& operator=(const IDataStructure&) = default; + IDataStructure& operator=(IDataStructure&&) noexcept = default; +}; +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IListStore.hpp b/src/simplnx/DataStructure/IListStore.hpp index 047e7b33ec..d80ab9498c 100644 --- a/src/simplnx/DataStructure/IListStore.hpp +++ b/src/simplnx/DataStructure/IListStore.hpp @@ -48,10 +48,7 @@ class IListStore */ virtual uint64 getNumberOfLists() const = 0; - uint64 size() const - { - return getNumberOfLists(); - } + virtual uint64 size() const = 0; /** * @brief Clears the array. diff --git a/src/simplnx/DataStructure/INeighborList.cpp b/src/simplnx/DataStructure/INeighborList.cpp deleted file mode 100644 index 9e7f409e95..0000000000 --- a/src/simplnx/DataStructure/INeighborList.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "INeighborList.hpp" - -namespace nx::core -{ -INeighborList::INeighborList(DataStructure& dataStructure, const std::string& name) -: IArray(dataStructure, name) -{ -} - -INeighborList::INeighborList(DataStructure& dataStructure, const std::string& name, IdType importId) -: IArray(dataStructure, name, importId) -{ -} - -INeighborList::~INeighborList() noexcept = default; - -std::string INeighborList::getTypeName() const -{ - return NeighborListConstants::k_TypeName; -} - -DataObject::Type INeighborList::getDataObjectType() const -{ - return Type::INeighborList; -} - -void INeighborList::setNumNeighborsArrayName(const std::string& name) -{ - m_NumNeighborsArrayName = name; -} - -std::string INeighborList::getNumNeighborsArrayName() const -{ - std::string arrayName = m_NumNeighborsArrayName; - if(arrayName.empty()) - { - return getName() + "_NumNeighbors"; - } - return arrayName; -} - -IListStore& INeighborList::getIListStoreRef() -{ - IListStore* store = getIListStore(); - if(store == nullptr) - { - throw std::runtime_error("INeighborList: Null IListStore"); - } - return *store; -} - -const IListStore& INeighborList::getIListStoreRef() const -{ - const IListStore* store = getIListStore(); - if(store == nullptr) - { - throw std::runtime_error("INeighborList: Null IListStore"); - } - return *store; -} - -usize INeighborList::getNumberOfTuples() const -{ - return getIListStoreRef().getNumberOfTuples(); -} - -void INeighborList::resizeTuples(const ShapeType& tupleShape) -{ - getIListStoreRef().resizeTuples(tupleShape); -} - -usize INeighborList::getNumberOfComponents() const -{ - return 1; -} - -ShapeType INeighborList::getTupleShape() const -{ - return getIListStoreRef().getTupleShape(); -} - -ShapeType INeighborList::getComponentShape() const -{ - return {1}; -} - -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.cpp b/src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.cpp new file mode 100644 index 0000000000..34d23977bb --- /dev/null +++ b/src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.cpp @@ -0,0 +1,56 @@ +#include "AbstractDataIOManager.hpp" + +namespace nx::core +{ +AbstractDataIOManager::AbstractDataIOManager() = default; +AbstractDataIOManager::~AbstractDataIOManager() noexcept = default; + +AbstractDataIOManager::factory_collection AbstractDataIOManager::getFactories() const +{ + return m_FactoryCollection; +} + +AbstractDataIOManager::factory_ptr AbstractDataIOManager::getFactory(factory_id_type typeName) const +{ + if(m_FactoryCollection.find(typeName) == m_FactoryCollection.end()) + { + return nullptr; + } + return m_FactoryCollection.at(typeName); +} + +AbstractDataIOManager::DataStoreCreationMap AbstractDataIOManager::getDataStoreCreationFunctions() +{ + return m_DataStoreCreationMap; +} + +bool AbstractDataIOManager::hasDataStoreCreationFnc(const std::string& type) const +{ + return m_DataStoreCreationMap.find(type) != m_DataStoreCreationMap.end(); +} + +AbstractDataIOManager::DataStoreCreateFnc AbstractDataIOManager::dataStoreCreationFnc(const std::string& type) const +{ + return m_DataStoreCreationMap.at(type); +} + +void AbstractDataIOManager::addDataStoreCreationFnc(const std::string& type, DataStoreCreateFnc creationFnc) +{ + m_DataStoreCreationMap[type] = creationFnc; +} + +bool AbstractDataIOManager::hasListStoreCreationFnc(const std::string& type) const +{ + return m_ListStoreCreationMap.find(type) != m_ListStoreCreationMap.end(); +} + +AbstractDataIOManager::ListStoreCreateFnc AbstractDataIOManager::listStoreCreationFnc(const std::string& type) const +{ + return m_ListStoreCreationMap.at(type); +} + +void AbstractDataIOManager::addListStoreCreationFnc(const std::string& type, ListStoreCreateFnc creationFnc) +{ + m_ListStoreCreationMap[type] = creationFnc; +} +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/Generic/IDataIOManager.hpp b/src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp similarity index 85% rename from src/simplnx/DataStructure/IO/Generic/IDataIOManager.hpp rename to src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp index c2702bffed..8bbc893858 100644 --- a/src/simplnx/DataStructure/IO/Generic/IDataIOManager.hpp +++ b/src/simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/IDataStore.hpp" #include "simplnx/DataStructure/IListStore.hpp" #include "simplnx/DataStructure/IO/Generic/IDataFactory.hpp" @@ -18,10 +18,10 @@ namespace nx::core class IDataFactory; /** - * @brief The IDataIOManager class serves as a base point for reading and writing DataStructures to specific file formats. - * To support a new file format, create a derived class and provide subclasses of IDataFactory for all concrete DataObject types. + * @brief The AbstractDataIOManager class serves as a base point for reading and writing DataStructures to specific file formats. + * To support a new file format, create a derived class and provide subclasses of IDataFactory for all concrete AbstractDataObject types. */ -class SIMPLNX_EXPORT IDataIOManager +class SIMPLNX_EXPORT AbstractDataIOManager { public: using factory_id_type = std::string; @@ -32,7 +32,7 @@ class SIMPLNX_EXPORT IDataIOManager using DataStoreCreationMap = std::map; using ListStoreCreationMap = std::map; - virtual ~IDataIOManager() noexcept; + virtual ~AbstractDataIOManager() noexcept; virtual std::string formatName() const = 0; @@ -44,14 +44,14 @@ class SIMPLNX_EXPORT IDataIOManager /** * @brief Returns a pointer to the factory used for creating a specific - * DataObject subclass. + * AbstractDataObject subclass. * @param typeName * @return factory_ptr */ factory_ptr getFactory(factory_id_type typeName) const; /** - * @brief Returns a pointer to the factory used for creating a specific DataObject subclass. + * @brief Returns a pointer to the factory used for creating a specific AbstractDataObject subclass. * @param typeName * @return std::shared_ptr */ @@ -81,7 +81,7 @@ class SIMPLNX_EXPORT IDataIOManager ListStoreCreateFnc listStoreCreationFnc(const std::string& type) const; protected: - IDataIOManager(); + AbstractDataIOManager(); void addDataStoreCreationFnc(const std::string& type, DataStoreCreateFnc creationFnc); void addListStoreCreationFnc(const std::string& type, ListStoreCreateFnc creationFnc); diff --git a/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.cpp b/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.cpp index 4b92eff22a..6ba98d2224 100644 --- a/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.cpp +++ b/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.cpp @@ -6,7 +6,7 @@ namespace nx::core::Generic { CoreDataIOManager::CoreDataIOManager() -: IDataIOManager() +: AbstractDataIOManager() { addCoreFactories(); addDataStoreFnc(); diff --git a/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.hpp b/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.hpp index 557b74f87c..6cb08024e4 100644 --- a/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.hpp +++ b/src/simplnx/DataStructure/IO/Generic/CoreDataIOManager.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/Generic/IDataIOManager.hpp" +#include "simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp" namespace nx::core { @@ -9,7 +9,7 @@ namespace Generic /** * @brief The HDF5::DataIOManager class stores and returns the corresponding IO class for HDF5. */ -class SIMPLNX_EXPORT CoreDataIOManager : public IDataIOManager +class SIMPLNX_EXPORT CoreDataIOManager : public AbstractDataIOManager { public: /** @@ -19,14 +19,14 @@ class SIMPLNX_EXPORT CoreDataIOManager : public IDataIOManager ~CoreDataIOManager() noexcept override; /** - * @brief Returns the format name for the IDataIOManager as a string. + * @brief Returns the format name for the AbstractDataIOManager as a string. * @return std::string */ std::string formatName() const override; private: /** - * @brief Adds all core simplnx DataObject IO classes. + * @brief Adds all core simplnx AbstractDataObject IO classes. */ void addCoreFactories(); diff --git a/src/simplnx/DataStructure/IO/Generic/DataIOCollection.cpp b/src/simplnx/DataStructure/IO/Generic/DataIOCollection.cpp index da9de2fc6c..71bcfacda8 100644 --- a/src/simplnx/DataStructure/IO/Generic/DataIOCollection.cpp +++ b/src/simplnx/DataStructure/IO/Generic/DataIOCollection.cpp @@ -1,8 +1,8 @@ #include "DataIOCollection.hpp" #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp" #include "simplnx/DataStructure/IO/Generic/CoreDataIOManager.hpp" -#include "simplnx/DataStructure/IO/Generic/IDataIOManager.hpp" #include "simplnx/DataStructure/IO/HDF5/DataIOManager.hpp" namespace nx::core @@ -14,7 +14,7 @@ DataIOCollection::DataIOCollection() } DataIOCollection::~DataIOCollection() noexcept = default; -void DataIOCollection::addIOManager(std::shared_ptr manager) +void DataIOCollection::addIOManager(std::shared_ptr manager) { if(manager == nullptr) { @@ -24,7 +24,7 @@ void DataIOCollection::addIOManager(std::shared_ptr manager) m_ManagerMap[manager->formatName()] = manager; } -std::shared_ptr DataIOCollection::getManager(const std::string& formatName) const +std::shared_ptr DataIOCollection::getManager(const std::string& formatName) const { if(m_ManagerMap.find(formatName) == m_ManagerMap.end()) { diff --git a/src/simplnx/DataStructure/IO/Generic/DataIOCollection.hpp b/src/simplnx/DataStructure/IO/Generic/DataIOCollection.hpp index b53b88a7c4..d83f7c9d79 100644 --- a/src/simplnx/DataStructure/IO/Generic/DataIOCollection.hpp +++ b/src/simplnx/DataStructure/IO/Generic/DataIOCollection.hpp @@ -15,15 +15,15 @@ namespace nx::core { template class AbstractDataStore; -class IDataIOManager; +class AbstractDataIOManager; /** - * @brief The DataIOCollection class contains all known IDataIOManagers for the current Application instance. + * @brief The DataIOCollection class contains all known AbstractDataIOManagers for the current Application instance. */ class SIMPLNX_EXPORT DataIOCollection { public: - using map_type = std::map>; + using map_type = std::map>; using iterator = typename map_type::iterator; using const_iterator = typename map_type::const_iterator; @@ -34,16 +34,16 @@ class SIMPLNX_EXPORT DataIOCollection * Adds a specified data IO manager for reading and writing to the target format. * @param manager */ - void addIOManager(std::shared_ptr manager); + void addIOManager(std::shared_ptr manager); /** - * @brief Returns the IDataIOManager for the specified format name. + * @brief Returns the AbstractDataIOManager for the specified format name. * Simplnx comes with HDF5 IO Manager. - * Additional IDataIOManagers are added through plugins. + * Additional AbstractDataIOManagers are added through plugins. * @param formatName - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getManager(const std::string& formatName) const; + std::shared_ptr getManager(const std::string& formatName) const; /** * @brief Returns a vector of names used to reference available DataStructure IO formats. diff --git a/src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp b/src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp index beeb0a43e1..acfccc977d 100644 --- a/src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp +++ b/src/simplnx/DataStructure/IO/Generic/IDataFactory.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include @@ -19,10 +19,10 @@ class SIMPLNX_EXPORT IDataFactory virtual ~IDataFactory() noexcept = default; /** - * @brief Returns the Type of the DataObject subclass that the factory is designed for. + * @brief Returns the Type of the AbstractDataObject subclass that the factory is designed for. * @return std::string */ - virtual DataObject::Type getDataType() const = 0; + virtual AbstractDataObject::Type getDataType() const = 0; // Copy and move constuctors / operators deleted IDataFactory(const IDataFactory& other) = delete; diff --git a/src/simplnx/DataStructure/IO/Generic/IDataIOManager.cpp b/src/simplnx/DataStructure/IO/Generic/IDataIOManager.cpp deleted file mode 100644 index 29b80f5bcc..0000000000 --- a/src/simplnx/DataStructure/IO/Generic/IDataIOManager.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "IDataIOManager.hpp" - -namespace nx::core -{ -IDataIOManager::IDataIOManager() = default; -IDataIOManager::~IDataIOManager() noexcept = default; - -IDataIOManager::factory_collection IDataIOManager::getFactories() const -{ - return m_FactoryCollection; -} - -IDataIOManager::factory_ptr IDataIOManager::getFactory(factory_id_type typeName) const -{ - if(m_FactoryCollection.find(typeName) == m_FactoryCollection.end()) - { - return nullptr; - } - return m_FactoryCollection.at(typeName); -} - -IDataIOManager::DataStoreCreationMap IDataIOManager::getDataStoreCreationFunctions() -{ - return m_DataStoreCreationMap; -} - -bool IDataIOManager::hasDataStoreCreationFnc(const std::string& type) const -{ - return m_DataStoreCreationMap.find(type) != m_DataStoreCreationMap.end(); -} - -IDataIOManager::DataStoreCreateFnc IDataIOManager::dataStoreCreationFnc(const std::string& type) const -{ - return m_DataStoreCreationMap.at(type); -} - -void IDataIOManager::addDataStoreCreationFnc(const std::string& type, DataStoreCreateFnc creationFnc) -{ - m_DataStoreCreationMap[type] = creationFnc; -} - -bool IDataIOManager::hasListStoreCreationFnc(const std::string& type) const -{ - return m_ListStoreCreationMap.find(type) != m_ListStoreCreationMap.end(); -} - -IDataIOManager::ListStoreCreateFnc IDataIOManager::listStoreCreationFnc(const std::string& type) const -{ - return m_ListStoreCreationMap.at(type); -} - -void IDataIOManager::addListStoreCreationFnc(const std::string& type, ListStoreCreateFnc creationFnc) -{ - m_ListStoreCreationMap[type] = creationFnc; -} -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/Generic/IOConstants.hpp b/src/simplnx/DataStructure/IO/Generic/IOConstants.hpp index 5049f3e5f0..1ce5316ccb 100644 --- a/src/simplnx/DataStructure/IO/Generic/IOConstants.hpp +++ b/src/simplnx/DataStructure/IO/Generic/IOConstants.hpp @@ -16,32 +16,32 @@ inline constexpr StringLiteral k_RowCountTag = "Row Count"; inline constexpr StringLiteral k_ColCountTag = "Column Count"; inline constexpr StringLiteral k_DepthCountTag = "Depth Count"; -// IGeometry +// AbstractGeometry inline constexpr StringLiteral k_ElementSizesTag = "Element Sizes ID"; inline constexpr StringLiteral k_H5_UNITS = "Units"; -// INodeGeometry0D +// AbstractNodeGeometry0D inline constexpr StringLiteral k_VertexListTag = "Vertex List ID"; inline constexpr StringLiteral k_VertexDataTag = "Vertex Data ID"; -// INodeGeometry1D +// AbstractNodeGeometry1D inline constexpr StringLiteral k_EdgeListTag = "Edge List ID"; inline constexpr StringLiteral k_EdgeDataTag = "Edge Data ID"; inline constexpr StringLiteral k_ElementContainingVertTag = "Element Containing Vertex ID"; inline constexpr StringLiteral k_ElementNeighborsTag = "Element Neighbors ID"; inline constexpr StringLiteral k_ElementCentroidTag = "Element Centroids ID"; -// INodeGeometry2D +// AbstractNodeGeometry2D inline constexpr StringLiteral k_FaceListTag = "Face List ID"; inline constexpr StringLiteral k_FaceDataTag = "Face Data ID"; inline constexpr StringLiteral k_UnsharedEdgeListTag = "Unshared Edge List ID"; -// INodeGeometry3D +// AbstractNodeGeometry3D inline constexpr StringLiteral k_PolyhedronListTag = "Polyhedron List ID"; inline constexpr StringLiteral k_PolyhedronDataTag = "Polyhedron Data ID"; inline constexpr StringLiteral k_UnsharedFaceListTag = "Unshared Face List ID"; -// IGridGeometry +// AbstractGridGeometry inline constexpr StringLiteral k_CellDataTag = "Cell Data ID"; // Image Geometry diff --git a/src/simplnx/DataStructure/IO/HDF5/IDataIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.cpp similarity index 52% rename from src/simplnx/DataStructure/IO/HDF5/IDataIO.cpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.cpp index 28f9347957..4ea7b3aaa9 100644 --- a/src/simplnx/DataStructure/IO/HDF5/IDataIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.cpp @@ -1,4 +1,4 @@ -#include "IDataIO.hpp" +#include "AbstractDataIO.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp" @@ -9,38 +9,38 @@ namespace nx::core::HDF5 { -IDataIO::IDataIO() = default; -IDataIO::~IDataIO() noexcept = default; +AbstractDataIO::AbstractDataIO() = default; +AbstractDataIO::~AbstractDataIO() noexcept = default; -DataObject::OptionalId IDataIO::ReadDataId(const object_reader_type& groupReader, const std::string& tag) +AbstractDataObject::OptionalId AbstractDataIO::ReadDataId(const object_reader_type& groupReader, const std::string& tag) { if(!groupReader.isValid()) { return {}; } - auto result = groupReader.readScalarAttribute(tag); + auto result = groupReader.readScalarAttribute(tag); if(result.invalid()) { return {}; } - DataObject::IdType id = std::move(result.value()); + AbstractDataObject::IdType id = std::move(result.value()); return id; } -Result<> IDataIO::WriteDataId(object_writer_type& objectWriter, const std::optional& objectId, const std::string& tag) +Result<> AbstractDataIO::WriteDataId(object_writer_type& objectWriter, const std::optional& objectId, const std::string& tag) { if(!objectId.has_value()) { return {}; } - DataObject::IdType id = objectId.value(); + AbstractDataObject::IdType id = objectId.value(); return objectWriter.writeScalarAttribute(tag, id); } -Result<> IDataIO::WriteObjectAttributes(DataStructureWriter& dataStructureWriter, const DataObject& dataObject, object_writer_type& objectWriter, bool importable) +Result<> AbstractDataIO::WriteObjectAttributes(DataStructureWriter& dataStructureWriter, const AbstractDataObject& dataObject, object_writer_type& objectWriter, bool importable) { std::string dataTypeName = dataObject.getTypeName(); objectWriter.writeStringAttribute(Constants::k_ObjectTypeTag, dataTypeName); @@ -55,7 +55,7 @@ Result<> IDataIO::WriteObjectAttributes(DataStructureWriter& dataStructureWriter return {}; } -Result<> IDataIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const +Result<> AbstractDataIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const { return {}; } diff --git a/src/simplnx/DataStructure/IO/HDF5/IDataIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp similarity index 60% rename from src/simplnx/DataStructure/IO/HDF5/IDataIO.hpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp index c4bd73d579..bd9c2cdf92 100644 --- a/src/simplnx/DataStructure/IO/HDF5/IDataIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/IO/Generic/IDataFactory.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/GroupIO.hpp" @@ -16,7 +16,7 @@ class DataStructureWriter; using ErrorType = int32; -class SIMPLNX_EXPORT IDataIO : public nx::core::IDataFactory +class SIMPLNX_EXPORT AbstractDataIO : public nx::core::IDataFactory { public: using group_reader_type = nx::core::HDF5::GroupIO; @@ -24,10 +24,10 @@ class SIMPLNX_EXPORT IDataIO : public nx::core::IDataFactory using object_writer_type = nx::core::HDF5::ObjectIO; using object_reader_type = nx::core::HDF5::ObjectIO; - ~IDataIO() noexcept override; + ~AbstractDataIO() noexcept override; /** - * @brief Attempts to read the DataObject from HDF5. + * @brief Attempts to read the AbstractDataObject from HDF5. * Returns a Result<> with any errors or warnings encountered during the process. * @param dataStructureReader * @param parentGroup @@ -37,35 +37,35 @@ class SIMPLNX_EXPORT IDataIO : public nx::core::IDataFactory * @param useEmptyDataStore = false * @return Result<> */ - virtual Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const = 0; + virtual Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const = 0; virtual Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const; /** - * @brief Attempts to write a DataObject to HDF5. + * @brief Attempts to write a AbstractDataObject to HDF5. * @param dataStructureWriter * @param dataObject * @param parentGroupIO * @return Result<> */ - virtual Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentGroupIO) const = 0; + virtual Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentGroupIO) const = 0; virtual std::string getTypeName() const = 0; - IDataIO(const IDataIO& other) = delete; - IDataIO(IDataIO&& other) = delete; - IDataIO& operator=(const IDataIO& rhs) = delete; - IDataIO& operator=(IDataIO&& rhs) = delete; + AbstractDataIO(const AbstractDataIO& other) = delete; + AbstractDataIO(AbstractDataIO&& other) = delete; + AbstractDataIO& operator=(const AbstractDataIO& rhs) = delete; + AbstractDataIO& operator=(AbstractDataIO&& rhs) = delete; protected: - static DataObject::OptionalId ReadDataId(const object_reader_type& groupReader, const std::string& tag); - static Result<> WriteDataId(object_writer_type& groupWriter, const std::optional& objectId, const std::string& tag); - static Result<> WriteObjectAttributes(DataStructureWriter& dataStructureWriter, const DataObject& dataObject, object_writer_type& objectWriter, bool importable); - IDataIO(); + static AbstractDataObject::OptionalId ReadDataId(const object_reader_type& groupReader, const std::string& tag); + static Result<> WriteDataId(object_writer_type& groupWriter, const std::optional& objectId, const std::string& tag); + static Result<> WriteObjectAttributes(DataStructureWriter& dataStructureWriter, const AbstractDataObject& dataObject, object_writer_type& objectWriter, bool importable); + AbstractDataIO(); template - static Result<> WriteDataObjectImpl(IOClassT* instance, DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) + static Result<> WriteDataObjectImpl(IOClassT* instance, DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) { using T = typename IOClassT::data_type; const auto* targetData = dynamic_cast(dataObject); diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.cpp new file mode 100644 index 0000000000..a78e7c567a --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.cpp @@ -0,0 +1,52 @@ +#include "AbstractGeometryIO.hpp" + +#include "DataStructureWriter.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" + +namespace nx::core::HDF5 +{ +AbstractGeometryIO::AbstractGeometryIO() = default; +AbstractGeometryIO::~AbstractGeometryIO() noexcept = default; + +Result<> AbstractGeometryIO::ReadGeometryData(DataStructureReader& dataStructureReader, AbstractGeometry& geometry, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +{ + auto groupReader = parentGroup.openGroup(objectName); + + Result<> result = BaseGroupIO::ReadBaseGroupData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + if(result.invalid()) + { + return result; + } + + geometry.setElementSizesId(ReadDataId(groupReader, IOConstants::k_ElementSizesTag)); + + return {}; +} + +Result<> AbstractGeometryIO::FinishImportingGeomData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +{ + auto* geom = dataStructure.getDataAs(dataPath); + if(geom == nullptr) + { + return MakeErrorResult(-50590, fmt::format("Failed to finish importing AbstractGeometry at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + } + + return {}; +} + +Result<> AbstractGeometryIO::WriteGeometryData(DataStructureWriter& dataStructureWriter, const AbstractGeometry& geometry, group_writer_type& parentGroup, bool importable) +{ + auto groupWriter = parentGroup.createGroup(geometry.getName()); + + Result<> result = WriteDataId(groupWriter, geometry.getElementSizesId(), IOConstants::k_ElementSizesTag); + if(result.invalid()) + { + return result; + } + + return BaseGroupIO::WriteBaseGroupData(dataStructureWriter, geometry, parentGroup, importable); +} + +} // namespace nx::core::HDF5 diff --git a/src/simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.hpp similarity index 61% rename from src/simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.hpp index c8424aaff9..03384d2ae7 100644 --- a/src/simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.hpp @@ -5,23 +5,23 @@ namespace nx::core { -class IGeometry; +class AbstractGeometry; namespace HDF5 { /** * @brief Base class for simplnx geometry IO using HDF5 */ -class SIMPLNX_EXPORT IGeometryIO : public BaseGroupIO +class SIMPLNX_EXPORT AbstractGeometryIO : public BaseGroupIO { public: - IGeometryIO(); - virtual ~IGeometryIO() noexcept; + AbstractGeometryIO(); + virtual ~AbstractGeometryIO() noexcept; - IGeometryIO(const IGeometryIO& other) = delete; - IGeometryIO(IGeometryIO&& other) = delete; - IGeometryIO& operator=(const IGeometryIO& rhs) = delete; - IGeometryIO& operator=(IGeometryIO&& rhs) = delete; + AbstractGeometryIO(const AbstractGeometryIO& other) = delete; + AbstractGeometryIO(AbstractGeometryIO&& other) = delete; + AbstractGeometryIO& operator=(const AbstractGeometryIO& rhs) = delete; + AbstractGeometryIO& operator=(AbstractGeometryIO&& rhs) = delete; protected: /** @@ -36,8 +36,8 @@ class SIMPLNX_EXPORT IGeometryIO : public BaseGroupIO * @param useEmptyDataStore * @return Result<> */ - static Result<> ReadGeometryData(DataStructureReader& dataStructureReader, IGeometry& geometry, const group_reader_type& parentGroup, const std::string& geometryName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false); + static Result<> ReadGeometryData(DataStructureReader& dataStructureReader, AbstractGeometry& geometry, const group_reader_type& parentGroup, const std::string& geometryName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); /** * @brief Writes the generic geometry data to HDF5. @@ -48,7 +48,7 @@ class SIMPLNX_EXPORT IGeometryIO : public BaseGroupIO * @param importable * @return Result<> */ - static Result<> WriteGeometryData(DataStructureWriter& dataStructureWriter, const IGeometry& geometry, group_writer_type& parentGroup, bool importable); + static Result<> WriteGeometryData(DataStructureWriter& dataStructureWriter, const AbstractGeometry& geometry, group_writer_type& parentGroup, bool importable); static Result<> FinishImportingGeomData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); }; diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.cpp new file mode 100644 index 0000000000..15b5b01979 --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.cpp @@ -0,0 +1,52 @@ +#include "AbstractGridGeometryIO.hpp" + +#include "DataStructureWriter.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" +#include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" + +namespace nx::core::HDF5 +{ +AbstractGridGeometryIO::AbstractGridGeometryIO() = default; +AbstractGridGeometryIO::~AbstractGridGeometryIO() noexcept = default; + +Result<> AbstractGridGeometryIO::ReadGridGeometryData(DataStructureReader& dataStructureReader, AbstractGridGeometry& geometry, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +{ + Result<> result = AbstractGeometryIO::ReadGeometryData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + if(result.invalid()) + { + return result; + } + + auto groupReader = parentGroup.openGroup(objectName); + AbstractGeometry::OptionalId cellDataId = ReadDataId(groupReader, IOConstants::k_CellDataTag); + + geometry.setCellData(cellDataId); + + return {}; +} + +Result<> AbstractGridGeometryIO::FinishImportingGridGeometryData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +{ + auto* geom = dataStructure.getDataAs(dataPath); + if(geom == nullptr) + { + return MakeErrorResult(-50594, fmt::format("Failed to finish importing AbstractGridGeometry at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + } + + return {}; +} + +Result<> AbstractGridGeometryIO::WriteGridGeometryData(DataStructureWriter& dataStructureWriter, const AbstractGridGeometry& geometry, group_writer_type& parentGroup, bool importable) +{ + auto result = AbstractGeometryIO::WriteGeometryData(dataStructureWriter, geometry, parentGroup, importable); + if(result.invalid()) + { + return result; + } + + auto groupWriter = parentGroup.createGroup(geometry.getName()); + Result<> writeResult = WriteDataId(groupWriter, geometry.getCellDataId(), IOConstants::k_CellDataTag); + return writeResult; +} +} // namespace nx::core::HDF5 diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp new file mode 100644 index 0000000000..a9ca8889d4 --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.hpp" + +namespace nx::core +{ +class AbstractGridGeometry; + +namespace HDF5 +{ +class SIMPLNX_EXPORT AbstractGridGeometryIO : public AbstractGeometryIO +{ +public: + AbstractGridGeometryIO(); + ~AbstractGridGeometryIO() noexcept override; + + AbstractGridGeometryIO(const AbstractGridGeometryIO& other) = delete; + AbstractGridGeometryIO(AbstractGridGeometryIO&& other) = delete; + AbstractGridGeometryIO& operator=(const AbstractGridGeometryIO& rhs) = delete; + AbstractGridGeometryIO& operator=(AbstractGridGeometryIO&& rhs) = delete; + +protected: + /** + * @brief Attempts to read the GridGeometry data from HDF5. + * Returns a Result<> with any errors or warnings encountered during the process. + * @param dataStructureReader + * @param geometry + * @param parentGroup + * @param geometryName + * @param importId + * @param parentId + * @param useEmptyDataStore = false + * @return Result<> + */ + static Result<> ReadGridGeometryData(DataStructureReader& dataStructureReader, AbstractGridGeometry& geometry, const group_reader_type& parentGroup, const std::string& geometryName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); + + /** + * @brief Attempts to write the AbstractGridGeometry data to HDF5. + * @param dataStructureWriter + * @param geometry + * @param parentGroup + * @param importable + * @return Result<> + */ + static Result<> WriteGridGeometryData(DataStructureWriter& dataStructureWriter, const AbstractGridGeometry& geometry, group_writer_type& parentGroup, bool importable); + + static Result<> FinishImportingGridGeometryData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); +}; +} // namespace HDF5 +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.cpp similarity index 59% rename from src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.cpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.cpp index dc1ce0d40d..501d99c323 100644 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.cpp @@ -1,19 +1,19 @@ -#include "INodeGeom0dIO.hpp" +#include "AbstractNodeGeom0dIO.hpp" #include "DataStructureReader.hpp" #include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" #include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" namespace nx::core::HDF5 { -INodeGeom0dIO::INodeGeom0dIO() = default; -INodeGeom0dIO::~INodeGeom0dIO() noexcept = default; +AbstractNodeGeom0dIO::AbstractNodeGeom0dIO() = default; +AbstractNodeGeom0dIO::~AbstractNodeGeom0dIO() noexcept = default; -Result<> INodeGeom0dIO::ReadNodeGeom0dData(DataStructureReader& dataStructureReader, INodeGeometry0D& geometry, const group_reader_type& parentGroup, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +Result<> AbstractNodeGeom0dIO::ReadNodeGeom0dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry0D& geometry, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) { - Result<> result = IGeometryIO::ReadGeometryData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractGeometryIO::ReadGeometryData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -24,7 +24,7 @@ Result<> INodeGeom0dIO::ReadNodeGeom0dData(DataStructureReader& dataStructureRea if(const auto unitsAttr = groupReader.readScalarAttribute(IOConstants::k_H5_UNITS); unitsAttr.valid()) { auto value = unitsAttr.value(); - geometry.setUnits(static_cast(value)); + geometry.setUnits(static_cast(value)); } geometry.setVertexListId(ReadDataId(groupReader, IOConstants::k_VertexListTag)); @@ -40,12 +40,12 @@ Result<> INodeGeom0dIO::ReadNodeGeom0dData(DataStructureReader& dataStructureRea return {}; } -Result<> INodeGeom0dIO::FinishImportingNodeGeom0dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +Result<> AbstractNodeGeom0dIO::FinishImportingNodeGeom0dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) { - auto* geom = dataStructure.getDataAs(dataPath); + auto* geom = dataStructure.getDataAs(dataPath); if(geom == nullptr) { - return MakeErrorResult(-50590, fmt::format("Failed to finish importing INodeGeometry0D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + return MakeErrorResult(-50590, fmt::format("Failed to finish importing AbstractNodeGeometry0D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } { @@ -53,16 +53,16 @@ Result<> INodeGeom0dIO::FinishImportingNodeGeom0dData(DataStructure& dataStructu if(const auto unitsAttr = groupReader.readScalarAttribute(IOConstants::k_H5_UNITS); unitsAttr.valid()) { auto value = unitsAttr.value(); - geom->setUnits(static_cast(value)); + geom->setUnits(static_cast(value)); } } - return IGeometryIO::FinishImportingGeomData(dataStructure, dataPath, dataStructureGroup); + return AbstractGeometryIO::FinishImportingGeomData(dataStructure, dataPath, dataStructureGroup); } -Result<> INodeGeom0dIO::WriteNodeGeom0dData(DataStructureWriter& dataStructureWriter, const INodeGeometry0D& geometry, group_writer_type& parentGroupWriter, bool importable) +Result<> AbstractNodeGeom0dIO::WriteNodeGeom0dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry0D& geometry, group_writer_type& parentGroupWriter, bool importable) { - Result<> result = IGeometryIO::WriteGeometryData(dataStructureWriter, geometry, parentGroupWriter, importable); + Result<> result = AbstractGeometryIO::WriteGeometryData(dataStructureWriter, geometry, parentGroupWriter, importable); if(result.invalid()) { return result; @@ -70,7 +70,7 @@ Result<> INodeGeom0dIO::WriteNodeGeom0dData(DataStructureWriter& dataStructureWr auto groupWriter = parentGroupWriter.createGroup(geometry.getName()); - DataObject::OptionalId vertexListId = geometry.getVertexListId(); + AbstractDataObject::OptionalId vertexListId = geometry.getVertexListId(); result = WriteDataId(groupWriter, vertexListId, IOConstants::k_VertexListTag); if(result.invalid()) diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp similarity index 52% rename from src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp index 9395872900..fac7fa2d54 100644 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp @@ -1,24 +1,24 @@ #pragma once #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractGeometryIO.hpp" namespace nx::core { -class INodeGeometry0D; +class AbstractNodeGeometry0D; namespace HDF5 { -class SIMPLNX_EXPORT INodeGeom0dIO : public IGeometryIO +class SIMPLNX_EXPORT AbstractNodeGeom0dIO : public AbstractGeometryIO { public: - INodeGeom0dIO(); - ~INodeGeom0dIO() noexcept override; + AbstractNodeGeom0dIO(); + ~AbstractNodeGeom0dIO() noexcept override; - INodeGeom0dIO(const INodeGeom0dIO& other) = delete; - INodeGeom0dIO(INodeGeom0dIO&& other) = delete; - INodeGeom0dIO& operator=(const INodeGeom0dIO& rhs) = delete; - INodeGeom0dIO& operator=(INodeGeom0dIO&& rhs) = delete; + AbstractNodeGeom0dIO(const AbstractNodeGeom0dIO& other) = delete; + AbstractNodeGeom0dIO(AbstractNodeGeom0dIO&& other) = delete; + AbstractNodeGeom0dIO& operator=(const AbstractNodeGeom0dIO& rhs) = delete; + AbstractNodeGeom0dIO& operator=(AbstractNodeGeom0dIO&& rhs) = delete; protected: /** @@ -33,8 +33,8 @@ class SIMPLNX_EXPORT INodeGeom0dIO : public IGeometryIO * @param useEmptyDataStore = false * @return Result<> */ - static Result<> ReadNodeGeom0dData(DataStructureReader& dataStructureReader, INodeGeometry0D& geometry, const group_reader_type& parentGroup, const std::string& geomName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); + static Result<> ReadNodeGeom0dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry0D& geometry, const group_reader_type& parentGroup, const std::string& geomName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); /** * @brief Attempts to write the INodeGeom0D data to HDF5. @@ -44,7 +44,7 @@ class SIMPLNX_EXPORT INodeGeom0dIO : public IGeometryIO * @param importable * @return Result<> */ - static Result<> WriteNodeGeom0dData(DataStructureWriter& dataStructureWriter, const INodeGeometry0D& geometry, group_writer_type& parentGroup, bool importable); + static Result<> WriteNodeGeom0dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry0D& geometry, group_writer_type& parentGroup, bool importable); static Result<> FinishImportingNodeGeom0dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); }; diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.cpp similarity index 60% rename from src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.cpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.cpp index de57e39da8..9d12e11d67 100644 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.cpp @@ -1,19 +1,19 @@ -#include "INodeGeom1dIO.hpp" +#include "AbstractNodeGeom1dIO.hpp" #include "DataStructureReader.hpp" #include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" #include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" namespace nx::core::HDF5 { -INodeGeom1dIO::INodeGeom1dIO() = default; -INodeGeom1dIO::~INodeGeom1dIO() noexcept = default; +AbstractNodeGeom1dIO::AbstractNodeGeom1dIO() = default; +AbstractNodeGeom1dIO::~AbstractNodeGeom1dIO() noexcept = default; -Result<> INodeGeom1dIO::ReadNodeGeom1dData(DataStructureReader& dataStructureReader, INodeGeometry1D& geometry, const group_reader_type& parentGroup, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +Result<> AbstractNodeGeom1dIO::ReadNodeGeom1dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry1D& geometry, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) { - Result<> result = INodeGeom0dIO::ReadNodeGeom0dData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractNodeGeom0dIO::ReadNodeGeom0dData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -39,20 +39,20 @@ Result<> INodeGeom1dIO::ReadNodeGeom1dData(DataStructureReader& dataStructureRea return {}; } -Result<> INodeGeom1dIO::FinishImportingNodeGeom1dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +Result<> AbstractNodeGeom1dIO::FinishImportingNodeGeom1dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) { - auto* geom = dataStructure.getDataAs(dataPath); + auto* geom = dataStructure.getDataAs(dataPath); if(geom == nullptr) { - return MakeErrorResult(-50590, fmt::format("Failed to finish importing INodeGeometry1D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + return MakeErrorResult(-50590, fmt::format("Failed to finish importing AbstractNodeGeometry1D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom0dIO::FinishImportingNodeGeom0dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom0dIO::FinishImportingNodeGeom0dData(dataStructure, dataPath, dataStructureGroup); } -Result<> INodeGeom1dIO::WriteNodeGeom1dData(DataStructureWriter& dataStructureWriter, const INodeGeometry1D& geometry, group_writer_type& parentGroupWriter, bool importable) +Result<> AbstractNodeGeom1dIO::WriteNodeGeom1dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry1D& geometry, group_writer_type& parentGroupWriter, bool importable) { - Result<> result = INodeGeom0dIO::WriteNodeGeom0dData(dataStructureWriter, geometry, parentGroupWriter, importable); + Result<> result = AbstractNodeGeom0dIO::WriteNodeGeom0dData(dataStructureWriter, geometry, parentGroupWriter, importable); if(result.invalid()) { return result; diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp new file mode 100644 index 0000000000..36a9ed87f5 --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp" + +namespace nx::core +{ +class AbstractNodeGeometry1D; + +namespace HDF5 +{ +class SIMPLNX_EXPORT AbstractNodeGeom1dIO : public AbstractNodeGeom0dIO +{ +public: + AbstractNodeGeom1dIO(); + ~AbstractNodeGeom1dIO() noexcept override; + + AbstractNodeGeom1dIO(const AbstractNodeGeom1dIO& other) = delete; + AbstractNodeGeom1dIO(AbstractNodeGeom1dIO&& other) = delete; + AbstractNodeGeom1dIO& operator=(const AbstractNodeGeom1dIO& rhs) = delete; + AbstractNodeGeom1dIO& operator=(AbstractNodeGeom1dIO&& rhs) = delete; + +protected: + /** + * @brief Attempts to read the AbstractNodeGeometry1D data from HDF5. + * Returns a Result<> with any errors or warnings encountered during the process. + * @param dataStructureReader + * @param geometry + * @param parentGroup + * @param geomName + * @param importId + * @param parentId + * @param useEmptyDataStore = false + * @return Result<> + */ + static Result<> ReadNodeGeom1dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry1D& geometry, const group_reader_type& parentGroup, const std::string& geomName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); + + /** + * @brief Attempts to write the AbstractNodeGeometry1D data to HDF5. + * @param dataStructureWriter + * @param geometry + * @param parentGroup + * @param importable + * @return Result<> + */ + static Result<> WriteNodeGeom1dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry1D& geometry, group_writer_type& parentGroup, bool importable); + + static Result<> FinishImportingNodeGeom1dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); +}; +} // namespace HDF5 +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.cpp similarity index 51% rename from src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.cpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.cpp index 28771b7790..cae9fa8945 100644 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.cpp @@ -1,19 +1,19 @@ -#include "INodeGeom2dIO.hpp" +#include "AbstractNodeGeom2dIO.hpp" #include "DataStructureReader.hpp" #include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" namespace nx::core::HDF5 { -INodeGeom2dIO::INodeGeom2dIO() = default; -INodeGeom2dIO::~INodeGeom2dIO() noexcept = default; +AbstractNodeGeom2dIO::AbstractNodeGeom2dIO() = default; +AbstractNodeGeom2dIO::~AbstractNodeGeom2dIO() noexcept = default; -Result<> INodeGeom2dIO::ReadNodeGeom2dData(DataStructureReader& dataStructureReader, INodeGeometry2D& geometry, const group_reader_type& parentGroup, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +Result<> AbstractNodeGeom2dIO::ReadNodeGeom2dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry2D& geometry, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) { - Result<> result = INodeGeom1dIO::ReadNodeGeom1dData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractNodeGeom1dIO::ReadNodeGeom1dData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -36,20 +36,20 @@ Result<> INodeGeom2dIO::ReadNodeGeom2dData(DataStructureReader& dataStructureRea return {}; } -Result<> INodeGeom2dIO::FinishImportingNodeGeom2dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +Result<> AbstractNodeGeom2dIO::FinishImportingNodeGeom2dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) { - auto* geom = dataStructure.getDataAs(dataPath); + auto* geom = dataStructure.getDataAs(dataPath); if(geom == nullptr) { - return MakeErrorResult(-50591, fmt::format("Failed to finish importing INodeGeometry2D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + return MakeErrorResult(-50591, fmt::format("Failed to finish importing AbstractNodeGeometry2D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom1dIO::FinishImportingNodeGeom1dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom1dIO::FinishImportingNodeGeom1dData(dataStructure, dataPath, dataStructureGroup); } -Result<> INodeGeom2dIO::WriteNodeGeom2dData(DataStructureWriter& dataStructureWriter, const INodeGeometry2D& geometry, group_writer_type& parentGroupWriter, bool importable) +Result<> AbstractNodeGeom2dIO::WriteNodeGeom2dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry2D& geometry, group_writer_type& parentGroupWriter, bool importable) { - Result<> result = INodeGeom1dIO::WriteNodeGeom1dData(dataStructureWriter, geometry, parentGroupWriter, importable); + Result<> result = AbstractNodeGeom1dIO::WriteNodeGeom1dData(dataStructureWriter, geometry, parentGroupWriter, importable); if(result.invalid()) { return result; diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp new file mode 100644 index 0000000000..1f2980ebf4 --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp" + +namespace nx::core +{ +class AbstractNodeGeometry2D; + +namespace HDF5 +{ +class SIMPLNX_EXPORT AbstractNodeGeom2dIO : public AbstractNodeGeom1dIO +{ +public: + AbstractNodeGeom2dIO(); + ~AbstractNodeGeom2dIO() noexcept override; + + AbstractNodeGeom2dIO(const AbstractNodeGeom2dIO& other) = delete; + AbstractNodeGeom2dIO(AbstractNodeGeom2dIO&& other) = delete; + AbstractNodeGeom2dIO& operator=(const AbstractNodeGeom2dIO& rhs) = delete; + AbstractNodeGeom2dIO& operator=(AbstractNodeGeom2dIO&& rhs) = delete; + +protected: + /** + * @brief Attempts to read the AbstractNodeGeometry2D data from HDF5. + * Returns a Result<> with any errors or warnings encountered during the process. + * @param dataStructureReader + * @param geometry + * @param parentGroup + * @param geomName + * @param importId + * @param parentId + * @param useEmptyDataStore = false + * @return Result<> + */ + static Result<> ReadNodeGeom2dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry2D& geometry, const group_reader_type& parentGroup, const std::string& geomName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); + + /** + * @brief Attempts to write the AbstractNodeGeometry2D data to HDF5. + * @param dataStructureWriter + * @param geometry + * @param parentGroup + * @param importable + * @return Result<> + */ + static Result<> WriteNodeGeom2dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry2D& geometry, group_writer_type& parentGroup, bool importable); + + static Result<> FinishImportingNodeGeom2dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); +}; +} // namespace HDF5 +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.cpp similarity index 51% rename from src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.cpp rename to src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.cpp index 017bcd4d81..5699cb02dc 100644 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.cpp @@ -1,19 +1,19 @@ -#include "INodeGeom3dIO.hpp" +#include "AbstractNodeGeom3dIO.hpp" #include "DataStructureReader.hpp" #include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" namespace nx::core::HDF5 { -INodeGeom3dIO::INodeGeom3dIO() = default; -INodeGeom3dIO::~INodeGeom3dIO() noexcept = default; +AbstractNodeGeom3dIO::AbstractNodeGeom3dIO() = default; +AbstractNodeGeom3dIO::~AbstractNodeGeom3dIO() noexcept = default; -Result<> INodeGeom3dIO::ReadNodeGeom3dData(DataStructureReader& dataStructureReader, INodeGeometry3D& geom, const group_reader_type& parentGroup, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) +Result<> AbstractNodeGeom3dIO::ReadNodeGeom3dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry3D& geom, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) { - Result<> result = INodeGeom2dIO::ReadNodeGeom2dData(dataStructureReader, geom, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractNodeGeom2dIO::ReadNodeGeom2dData(dataStructureReader, geom, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -36,20 +36,20 @@ Result<> INodeGeom3dIO::ReadNodeGeom3dData(DataStructureReader& dataStructureRea return {}; } -Result<> INodeGeom3dIO::FinishImportingNodeGeom3dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) +Result<> AbstractNodeGeom3dIO::FinishImportingNodeGeom3dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) { - auto* geom = dataStructure.getDataAs(dataPath); + auto* geom = dataStructure.getDataAs(dataPath); if(geom == nullptr) { - return MakeErrorResult(-50592, fmt::format("Failed to finish importing INodeGeometry3D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); + return MakeErrorResult(-50592, fmt::format("Failed to finish importing AbstractNodeGeometry3D at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); } -Result<> INodeGeom3dIO::WriteNodeGeom3dData(DataStructureWriter& dataStructureWriter, const INodeGeometry3D& geom, group_writer_type& parentGroup, bool importable) +Result<> AbstractNodeGeom3dIO::WriteNodeGeom3dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry3D& geom, group_writer_type& parentGroup, bool importable) { - Result<> result = INodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geom, parentGroup, importable); + Result<> result = AbstractNodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geom, parentGroup, importable); if(result.invalid()) { return result; diff --git a/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp new file mode 100644 index 0000000000..3b1224af9a --- /dev/null +++ b/src/simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp" + +namespace nx::core +{ +class AbstractNodeGeometry3D; + +namespace HDF5 +{ +class SIMPLNX_EXPORT AbstractNodeGeom3dIO : public AbstractNodeGeom2dIO +{ +public: + AbstractNodeGeom3dIO(); + ~AbstractNodeGeom3dIO() noexcept override; + + AbstractNodeGeom3dIO(const AbstractNodeGeom3dIO& other) = delete; + AbstractNodeGeom3dIO(AbstractNodeGeom3dIO&& other) = delete; + AbstractNodeGeom3dIO& operator=(const AbstractNodeGeom3dIO& rhs) = delete; + AbstractNodeGeom3dIO& operator=(AbstractNodeGeom3dIO&& rhs) = delete; + +protected: + /** + * @brief Attempts to read the AbstractNodeGeometry3D data from HDF5. + * Returns a Result<> with any errors or warnings encountered during the process. + * @param dataStructureReader + * @param geometry + * @param parentGroup + * @param geomName + * @param importId + * @param parentId + * @param useEmptyDataStore = false + * @return Result<> + */ + static Result<> ReadNodeGeom3dData(DataStructureReader& dataStructureReader, AbstractNodeGeometry3D& geometry, const group_reader_type& parentGroup, const std::string& geomName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); + + /** + * @brief Attempts to write the AbstractNodeGeometry3D data to HDF5. + * @param dataStructureWriter + * @param geometry + * @param parentGroup + * @param importable + * @return Result<> + */ + static Result<> WriteNodeGeom3dData(DataStructureWriter& dataStructureWriter, const AbstractNodeGeometry3D& geometry, group_writer_type& parentGroup, bool importable); + + static Result<> FinishImportingNodeGeom3dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); +}; +} // namespace HDF5 +} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.cpp b/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.cpp index 76d865cea9..d2372aea0c 100644 --- a/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.cpp @@ -11,9 +11,9 @@ namespace nx::core::HDF5 AttributeMatrixIO::AttributeMatrixIO() = default; AttributeMatrixIO::~AttributeMatrixIO() noexcept = default; -DataObject::Type AttributeMatrixIO::getDataType() const +AbstractDataObject::Type AttributeMatrixIO::getDataType() const { - return DataObject::Type::AttributeMatrix; + return IDataObject::Type::AttributeMatrix; } std::string AttributeMatrixIO::getTypeName() const @@ -21,8 +21,8 @@ std::string AttributeMatrixIO::getTypeName() const return data_type::k_TypeName; } -Result<> AttributeMatrixIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> AttributeMatrixIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto groupReader = parentGroup.openGroup(objectName); @@ -59,7 +59,7 @@ Result<> AttributeMatrixIO::writeData(DataStructureWriter& dataStructureWriter, return WriteBaseGroupData(dataStructureWriter, attributeMatrix, parentGroup, importable); } -Result<> AttributeMatrixIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> AttributeMatrixIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.hpp b/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.hpp index 0d6007918a..237b0e8ffa 100644 --- a/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/AttributeMatrixIO.hpp @@ -35,8 +35,8 @@ class SIMPLNX_EXPORT AttributeMatrixIO : public BaseGroupIO * @param useEmptyDataStore * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& attributeMatrixName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& attributeMatrixName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; /** * @brief Attempts to write the AttributeMatrix to HDF5. @@ -51,22 +51,22 @@ class SIMPLNX_EXPORT AttributeMatrixIO : public BaseGroupIO /** * @param Attempts to write the AttributeMatrix to HDF5. - * This method is returns an error if DataObject cannot be cast to an AttributeMatrix. + * This method is returns an error if AbstractDataObject cannot be cast to an AttributeMatrix. * Otherwise, this method returns the result of writeData(...) * @param dataStructureWriter * @param dataObject * @param parentWriter */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; /** - * @brief Returns the DataObject::Type for this IO class. - * @return DataObject::Type + * @brief Returns the AbstractDataObject::Type for this IO class. + * @return AbstractDataObject::Type */ - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; /** - * @brief Returns the DataObject type name as a string for this IO class. + * @brief Returns the AbstractDataObject type name as a string for this IO class. * @return std::string */ std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.cpp b/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.cpp index 39b249ec64..bea62d3a4b 100644 --- a/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.cpp @@ -10,7 +10,7 @@ BaseGroupIO::BaseGroupIO() = default; BaseGroupIO::~BaseGroupIO() noexcept = default; Result<> BaseGroupIO::ReadBaseGroupData(DataStructureReader& dataStructureReader, BaseGroup& baseGroup, const group_reader_type& parentGroupReader, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) { auto groupReader = parentGroupReader.openGroup(objectName); return ReadDataMap(dataStructureReader, baseGroup.getDataMap(), groupReader, baseGroup.getId(), useEmptyDataStore); diff --git a/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.hpp b/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.hpp index 8de1047c45..e3ecd61c08 100644 --- a/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/BaseGroupIO.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace HDF5 /** * @brief The BaseGroupIO class serves as the base IO class for reading and writing BaseGroups to HDF5 */ -class SIMPLNX_EXPORT BaseGroupIO : public IDataIO +class SIMPLNX_EXPORT BaseGroupIO : public AbstractDataIO { public: BaseGroupIO(); @@ -47,8 +47,8 @@ class SIMPLNX_EXPORT BaseGroupIO : public IDataIO * @param useEmptyDataStore * @return Result<> */ - static Result<> ReadBaseGroupData(DataStructureReader& dataStructureReader, BaseGroup& baseGroup, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false); + static Result<> ReadBaseGroupData(DataStructureReader& dataStructureReader, BaseGroup& baseGroup, const group_reader_type& parentGroup, const std::string& objectName, + AbstractDataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); /** * @brief attempts to write the BaseGroup data to HDF5. diff --git a/src/simplnx/DataStructure/IO/HDF5/DataArrayIO.hpp b/src/simplnx/DataStructure/IO/HDF5/DataArrayIO.hpp index fb3ac1f5f5..b43985f6dc 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataArrayIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataArrayIO.hpp @@ -4,11 +4,11 @@ #include "simplnx/DataStructure/AbstractDataStore.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStoreIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp" #include "simplnx/DataStructure/IO/HDF5/EmptyDataStoreIO.hpp" -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" #include @@ -18,7 +18,7 @@ namespace nx::core::HDF5 * @brief The DataArrayIO class serves as the basis for reading and writing DataArrays from HDF5 */ template -class DataArrayIO : public IDataIO +class DataArrayIO : public AbstractDataIO { public: using data_type = DataArray; @@ -38,8 +38,8 @@ class DataArrayIO : public IDataIO * @param preflight */ template - static void importDataArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& datasetReader, const std::string dataArrayName, DataObject::IdType importId, - nx::core::HDF5::ErrorType& err, const std::optional& parentId, bool preflight) + static void importDataArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& datasetReader, const std::string dataArrayName, AbstractDataObject::IdType importId, + nx::core::HDF5::ErrorType& err, const std::optional& parentId, bool preflight) { std::shared_ptr> dataStore = preflight ? std::shared_ptr>(EmptyDataStoreIO::ReadDataStore(datasetReader)) : (DataStoreIO::ReadDataStore(datasetReader)); @@ -133,8 +133,8 @@ class DataArrayIO : public IDataIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& dataArrayName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& dataArrayName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override { auto datasetReader = parentGroup.openDataset(dataArrayName); @@ -236,16 +236,16 @@ class DataArrayIO : public IDataIO } /** - * @brief Returns the target DataObject::Type for this IO class. - * @return DataObject::Type + * @brief Returns the target AbstractDataObject::Type for this IO class. + * @return AbstractDataObject::Type */ - DataObject::Type getDataType() const override + AbstractDataObject::Type getDataType() const override { - return DataObject::Type::DataArray; + return IDataObject::Type::DataArray; } /** - * @brief Returns the target DataObject type name for this IO class. + * @brief Returns the target AbstractDataObject type name for this IO class. * @return std::string */ std::string getTypeName() const override @@ -255,14 +255,14 @@ class DataArrayIO : public IDataIO /** * @brief Attempts to write the DataArray to HDF5. - * Returns an error if the provided DataObject could not be cast to the corresponding DataArray type. + * Returns an error if the provided AbstractDataObject could not be cast to the corresponding DataArray type. * Otherwise, this method returns writeData(...) * @param dataStructructureWriter * @param dataObject * @param parentWriter * @return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.cpp b/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.cpp index 453b1ee328..565ae5cd05 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.cpp @@ -10,9 +10,9 @@ namespace nx::core::HDF5 DataGroupIO::DataGroupIO() = default; DataGroupIO::~DataGroupIO() noexcept = default; -DataObject::Type DataGroupIO::getDataType() const +AbstractDataObject::Type DataGroupIO::getDataType() const { - return DataObject::Type::DataGroup; + return IDataObject::Type::DataGroup; } std::string DataGroupIO::getTypeName() const @@ -20,8 +20,8 @@ std::string DataGroupIO::getTypeName() const return data_type::k_TypeName; } -Result<> DataGroupIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> DataGroupIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* dataGroup = DataGroup::Import(structureReader.getDataStructure(), objectName, importId, parentId); return BaseGroupIO::ReadBaseGroupData(structureReader, *dataGroup, parentGroup, objectName, importId, parentId, useEmptyDataStore); @@ -33,7 +33,7 @@ Result<> DataGroupIO::writeData(DataStructureWriter& dataStructureWriter, const return WriteBaseGroupData(dataStructureWriter, dataGroup, parentGroup, importable); } -Result<> DataGroupIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> DataGroupIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.hpp b/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.hpp index 8a7077e4fd..ef6de99f63 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataGroupIO.hpp @@ -35,8 +35,8 @@ class SIMPLNX_EXPORT DataGroupIO : public BaseGroupIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& dataGroupName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& dataGroupName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; /** * @brief Attempts to write a DataGroup to HDF5. @@ -50,16 +50,16 @@ class SIMPLNX_EXPORT DataGroupIO : public BaseGroupIO Result<> writeData(DataStructureWriter& dataStructureWriter, const DataGroup& dataGroup, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the target DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a DataGroup. + * @brief Attempts to write the target AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a DataGroup. * Otherwise, this method returns the result of writeData(...) * @param dataStructureWriter * @param dataObject * @param parentWriter */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; }; diff --git a/src/simplnx/DataStructure/IO/HDF5/DataIOManager.cpp b/src/simplnx/DataStructure/IO/HDF5/DataIOManager.cpp index cc0baa23b6..a16727960a 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataIOManager.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataIOManager.cpp @@ -18,7 +18,7 @@ namespace nx::core::HDF5 { DataIOManager::DataIOManager() -: IDataIOManager() +: AbstractDataIOManager() { addCoreFactories(); } diff --git a/src/simplnx/DataStructure/IO/HDF5/DataIOManager.hpp b/src/simplnx/DataStructure/IO/HDF5/DataIOManager.hpp index fca8f5c707..310d50a9f9 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataIOManager.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataIOManager.hpp @@ -1,13 +1,13 @@ #pragma once -#include "simplnx/DataStructure/IO/Generic/IDataIOManager.hpp" +#include "simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp" namespace nx::core::HDF5 { /** * @brief The HDF5::DataIOManager class stores and returns the corresponding IO class for HDF5. */ -class SIMPLNX_EXPORT DataIOManager : public IDataIOManager +class SIMPLNX_EXPORT DataIOManager : public AbstractDataIOManager { public: /** @@ -17,14 +17,14 @@ class SIMPLNX_EXPORT DataIOManager : public IDataIOManager ~DataIOManager() noexcept override; /** - * @brief Returns the format name for the IDataIOManager as a string. + * @brief Returns the format name for the AbstractDataIOManager as a string. * @return std::string */ std::string formatName() const override; private: /** - * @brief Adds all core simplnx DataObject IO classes. + * @brief Adds all core simplnx AbstractDataObject IO classes. */ void addCoreFactories(); diff --git a/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.cpp b/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.cpp index 73b93b0990..444e8d5064 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.cpp @@ -2,9 +2,9 @@ #include "simplnx/Core/Application.hpp" #include "simplnx/DataStructure/DataMap.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" #include "simplnx/DataStructure/IO/HDF5/BaseGroupIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataIOManager.hpp" -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" #include "simplnx/DataStructure/IO/HDF5/IOUtilities.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/DatasetIO.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/GroupIO.hpp" @@ -37,7 +37,7 @@ Result DataStructureReader::ReadFile(const nx::core::HDF5::FileIO return result; } -Result> DataStructureReader::ReadObject(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) +Result> DataStructureReader::ReadObject(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) { std::string parentPathString = Constants::k_DataStructureTag; parentPathString += dataPath.getParent().toString(); @@ -47,14 +47,14 @@ Result> DataStructureReader::ReadObject(const nx::co if(Result<> importResult = dataStructureReader.readObjectFromGroup(parentGroupReader, dataPath.getTargetName()); importResult.invalid()) { - return ConvertInvalidResult>(std::move(importResult)); + return ConvertInvalidResult>(std::move(importResult)); } const DataStructure& dataStructure = dataStructureReader.getDataStructure(); const DataMap& dataMap = dataStructure.getDataMap(); if(dataMap.getSize() == 0) { - return MakeErrorResult>(-69040, fmt::format("Failed to import DataObject at path '{}'", dataPath.toString())); + return MakeErrorResult>(-69040, fmt::format("Failed to import DataObject at path '{}'", dataPath.toString())); } auto item = dataMap.begin(); @@ -63,7 +63,7 @@ Result> DataStructureReader::ReadObject(const nx::co Result<> DataStructureReader::FinishImportingObject(DataStructure& dataStructure, const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) { - std::shared_ptr factory = nullptr; + std::shared_ptr factory = nullptr; std::string parentPathString = Constants::k_DataStructureTag; parentPathString += "/" + dataPath.getParent().toString(); @@ -113,12 +113,12 @@ Result DataStructureReader::readGroup(const nx::core::HDF5::Group return MakeErrorResult(-1, ss); } - auto idResult = groupReader.readScalarAttribute(Constants::k_NextIdTag); + auto idResult = groupReader.readScalarAttribute(Constants::k_NextIdTag); if(idResult.invalid()) { return ConvertInvalidResult(std::move(idResult)); } - DataObject::IdType objectId = std::move(idResult.value()); + AbstractDataObject::IdType objectId = std::move(idResult.value()); m_CurrentStructure = DataStructure(); m_CurrentStructure.setNextId(objectId); @@ -131,12 +131,13 @@ Result DataStructureReader::readGroup(const nx::core::HDF5::Group return {m_CurrentStructure}; } -Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& parentGroup, const std::string& objectName, const std::optional& parentId, bool useEmptyDataStores) +Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& parentGroup, const std::string& objectName, const std::optional& parentId, + bool useEmptyDataStores) { - std::shared_ptr factory = nullptr; - DataObject::IdType objectId = 0; + std::shared_ptr factory = nullptr; + AbstractDataObject::IdType objectId = 0; - // Get nx::core::HDF5::IDataFactory and check DataObject ID + // Get nx::core::HDF5::IDataFactory and check AbstractDataObject ID { bool isGroup = parentGroup.isGroup(objectName); @@ -159,7 +160,7 @@ Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& } // Check if data has already been read - auto idResult = childObj.readScalarAttribute(Constants::k_ObjectIdTag); + auto idResult = childObj.readScalarAttribute(Constants::k_ObjectIdTag); if(idResult.invalid()) { return ConvertResult(std::move(idResult)); @@ -172,7 +173,7 @@ Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& return {}; } - // Get DataObject type for factory + // Get AbstractDataObject type for factory auto attrResult = childObj.readStringAttribute(Constants::k_ObjectTypeTag); if(attrResult.invalid()) { @@ -200,7 +201,7 @@ Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& } // Check if data has already been read - auto objectIdResult = childObj.readScalarAttribute(Constants::k_ObjectIdTag); + auto objectIdResult = childObj.readScalarAttribute(Constants::k_ObjectIdTag); if(objectIdResult.valid()) { objectId = std::move(objectIdResult.value()); @@ -212,7 +213,7 @@ Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& return {}; } - // Get DataObject type for factory + // Get AbstractDataObject type for factory auto typeNameResult = childObj.readStringAttribute(Constants::k_ObjectTypeTag); if(typeNameResult.invalid()) { @@ -231,7 +232,7 @@ Result<> DataStructureReader::readObjectFromGroup(const nx::core::HDF5::GroupIO& return MakeErrorResult<>(-3, ss); } - // Read DataObject from Factory + // Read AbstractDataObject from Factory { auto errorCode = factory->readData(*this, parentGroup, objectName, objectId, parentId, useEmptyDataStores); if(errorCode.invalid()) @@ -263,9 +264,9 @@ std::shared_ptr DataStructureReader::getDataReader() const return Application::GetOrCreateInstance()->getIOManagerAs("HDF5"); } -std::shared_ptr DataStructureReader::getDataFactory(typename IDataIOManager::factory_id_type typeName) const +std::shared_ptr DataStructureReader::getDataFactory(typename AbstractDataIOManager::factory_id_type typeName) const { - return getDataReader()->getFactoryAs(typeName); + return getDataReader()->getFactoryAs(typeName); } void DataStructureReader::addRequiredPath(const DataPath& requiredDataPath) @@ -273,12 +274,12 @@ void DataStructureReader::addRequiredPath(const DataPath& requiredDataPath) m_RequiredPaths.push_back(requiredDataPath); } -void DataStructureReader::addRequiredId(DataObject::IdType requiredDataId) +void DataStructureReader::addRequiredId(AbstractDataObject::IdType requiredDataId) { m_RequiredIds.push_back(requiredDataId); } -void DataStructureReader::addRequiredId(DataObject::OptionalId requiredDataId) +void DataStructureReader::addRequiredId(AbstractDataObject::OptionalId requiredDataId) { if(requiredDataId.has_value()) { diff --git a/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp b/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp index f81c20701d..34facb4e21 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/Generic/IDataIOManager.hpp" +#include "simplnx/DataStructure/IO/Generic/AbstractDataIOManager.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/FileIO.hpp" @@ -9,7 +9,7 @@ namespace nx::core::HDF5 { -class IDataIO; +class AbstractDataIO; class DataIOManager; /** @@ -37,7 +37,7 @@ class SIMPLNX_EXPORT DataStructureReader */ static Result ReadFile(const nx::core::HDF5::FileIO& fileReader, bool useEmptyDataStores = false); - static Result> ReadObject(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath); + static Result> ReadObject(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath); static Result<> FinishImportingObject(DataStructure& dataStructure, const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath); @@ -52,15 +52,16 @@ class SIMPLNX_EXPORT DataStructureReader Result readGroup(const nx::core::HDF5::GroupIO& groupReader, bool useEmptyDataStores = false); /** - * @brief Imports a DataObject with the specified name from the target + * @brief Imports a AbstractDataObject with the specified name from the target * HDF5 group. Returns any HDF5 error code that occurs. Returns 0 otherwise. * @param parentGroup HDF5 group reader for the parent DataMap - * @param objectName Target DataObject name - * @param parentId = {} DataObject parent ID + * @param objectName Target AbstractDataObject name + * @param parentId = {} AbstractDataObject parent ID * @param useEmptyDataStores = false * @return Result<> */ - Result<> readObjectFromGroup(const nx::core::HDF5::GroupIO& parentGroup, const std::string& objectName, const std::optional& parentId = {}, bool useEmptyDataStores = false); + Result<> readObjectFromGroup(const nx::core::HDF5::GroupIO& parentGroup, const std::string& objectName, const std::optional& parentId = {}, + bool useEmptyDataStores = false); /** * @brief Returns a reference to the current DataStructure. Returns an empty @@ -75,8 +76,8 @@ class SIMPLNX_EXPORT DataStructureReader void clearDataStructure(); void addRequiredPath(const DataPath& requiredDataPath); - void addRequiredId(DataObject::IdType requiredDataId); - void addRequiredId(DataObject::OptionalId requiredDataId); + void addRequiredId(AbstractDataObject::IdType requiredDataId); + void addRequiredId(AbstractDataObject::OptionalId requiredDataId); protected: /** @@ -90,9 +91,9 @@ class SIMPLNX_EXPORT DataStructureReader /** * Returns a pointer to the appropriate nx::core::HDF5::IDataFactory based on a target * data type. - * @return std::shared_ptr + * @return std::shared_ptr */ - std::shared_ptr getDataFactory(typename IDataIOManager::factory_id_type typeName) const; + std::shared_ptr getDataFactory(typename AbstractDataIOManager::factory_id_type typeName) const; void loadRequiredData(const nx::core::HDF5::FileIO& fileReader); @@ -100,6 +101,6 @@ class SIMPLNX_EXPORT DataStructureReader std::shared_ptr m_IOManager = nullptr; DataStructure m_CurrentStructure; std::vector m_RequiredPaths; - std::vector m_RequiredIds; + std::vector m_RequiredIds; }; } // namespace nx::core::HDF5 diff --git a/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.cpp b/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.cpp index aa084ed98b..fa45ac279b 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.cpp @@ -1,9 +1,9 @@ #include "DataStructureWriter.hpp" #include "simplnx/Core/Application.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataIOManager.hpp" -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/FileIO.hpp" @@ -66,16 +66,16 @@ Result<> DataStructureWriter::AppendFile(FileIO& file, const DataStructure& data return MakeErrorResult(-6, fmt::format("Cannot append because object '{}' already exists", targetName)); } - auto idResult = dataStructureGroup.readScalarAttribute(Constants::k_NextIdTag); + auto idResult = dataStructureGroup.readScalarAttribute(Constants::k_NextIdTag); if(idResult.invalid()) { return ConvertResult(std::move(idResult)); } - DataObject::IdType nextObjectId = idResult.value(); + AbstractDataObject::IdType nextObjectId = idResult.value(); DataStructure dataStructureShallowCopy = dataStructure; - for(DataObject* topLevelObject : dataStructureShallowCopy.getTopLevelData()) + for(AbstractDataObject* topLevelObject : dataStructureShallowCopy.getTopLevelData()) { if(topLevelObject->getName() != targetName) { @@ -91,7 +91,7 @@ Result<> DataStructureWriter::AppendFile(FileIO& file, const DataStructure& data return writeNextIdResult; } - const DataObject& dataObject = dataStructureShallowCopy.getDataRef(dataPath); + const AbstractDataObject& dataObject = dataStructureShallowCopy.getDataRef(dataPath); HDF5::DataStructureWriter dataStructureWriter; return dataStructureWriter.writeDataObject(&dataObject, dataStructureGroup); } @@ -107,7 +107,7 @@ Result<> DataStructureWriter::AppendFile(const std::filesystem::path& filepath, return AppendFile(file, dataStructure, dataPath); } -Result<> DataStructureWriter::writeDataObject(const DataObject* dataObject, nx::core::HDF5::GroupIO& parentGroup) +Result<> DataStructureWriter::writeDataObject(const AbstractDataObject* dataObject, nx::core::HDF5::GroupIO& parentGroup) { // Check if data has already been written if(hasDataBeenWritten(dataObject)) @@ -118,7 +118,7 @@ Result<> DataStructureWriter::writeDataObject(const DataObject* dataObject, nx:: else { // Write new data - auto factory = m_IOManager->getFactoryAs(dataObject->getTypeName()); + auto factory = m_IOManager->getFactoryAs(dataObject->getTypeName()); if(factory == nullptr) { std::string ss = fmt::format("Could not find IO factory for datatype: {}", dataObject->getTypeName()); @@ -160,7 +160,7 @@ Result<> DataStructureWriter::writeDataStructure(const DataStructure& dataStruct return writeDataMap(dataStructure.getDataMap(), groupIO); } -Result<> DataStructureWriter::writeDataObjectLink(const DataObject* dataObject, nx::core::HDF5::GroupIO& parentGroup) +Result<> DataStructureWriter::writeDataObjectLink(const AbstractDataObject* dataObject, nx::core::HDF5::GroupIO& parentGroup) { auto objectPath = getPathForObjectId(dataObject->getId()); auto result = parentGroup.createLink(objectPath); @@ -170,7 +170,7 @@ Result<> DataStructureWriter::writeDataObjectLink(const DataObject* dataObject, } // NeighborList extra data link - if(const auto* neighborList = dynamic_cast(dataObject)) + if(const auto* neighborList = dynamic_cast(dataObject)) { auto numNeighborsName = neighborList->getNumNeighborsArrayName(); auto dataPath = getPathForObjectSibling(dataObject->getId(), numNeighborsName); @@ -183,7 +183,7 @@ Result<> DataStructureWriter::writeDataObjectLink(const DataObject* dataObject, return {}; } -bool DataStructureWriter::hasDataBeenWritten(const DataObject* targetObject) const +bool DataStructureWriter::hasDataBeenWritten(const AbstractDataObject* targetObject) const { if(targetObject == nullptr) { @@ -192,12 +192,12 @@ bool DataStructureWriter::hasDataBeenWritten(const DataObject* targetObject) con return hasDataBeenWritten(targetObject->getId()); } -bool DataStructureWriter::hasDataBeenWritten(DataObject::IdType targetId) const +bool DataStructureWriter::hasDataBeenWritten(AbstractDataObject::IdType targetId) const { return m_IdMap.find(targetId) != m_IdMap.end(); } -std::string DataStructureWriter::getPathForObjectId(DataObject::IdType objectId) const +std::string DataStructureWriter::getPathForObjectId(AbstractDataObject::IdType objectId) const { if(!hasDataBeenWritten(objectId)) { @@ -206,7 +206,7 @@ std::string DataStructureWriter::getPathForObjectId(DataObject::IdType objectId) return m_IdMap.at(objectId); } -std::string DataStructureWriter::getParentPathForObjectId(DataObject::IdType objectId) const +std::string DataStructureWriter::getParentPathForObjectId(AbstractDataObject::IdType objectId) const { auto objectPath = getPathForObjectId(objectId); if(objectPath.empty()) @@ -221,7 +221,7 @@ std::string DataStructureWriter::getParentPathForObjectId(DataObject::IdType obj return objectPath.substr(0, lastIndex); } -std::string DataStructureWriter::getPathForObjectSibling(DataObject::IdType objectId, const std::string& siblingName) const +std::string DataStructureWriter::getPathForObjectSibling(AbstractDataObject::IdType objectId, const std::string& siblingName) const { auto objectPath = getParentPathForObjectId(objectId); if(!objectPath.empty()) @@ -237,7 +237,7 @@ void DataStructureWriter::clearIdMap() m_IdMap.clear(); } -void DataStructureWriter::addWriter(nx::core::HDF5::ObjectIO& objectWriter, DataObject::IdType objectId) +void DataStructureWriter::addWriter(nx::core::HDF5::ObjectIO& objectWriter, AbstractDataObject::IdType objectId) { m_IdMap[objectId] = objectWriter.getObjectPath(); } diff --git a/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp b/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp index 006944e51a..d6cfb76f52 100644 --- a/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp @@ -18,7 +18,7 @@ namespace HDF5 { class IDataFactory; class DataIOManager; -class IDataIO; +class AbstractDataIO; class ObjectIO; /** @@ -26,11 +26,11 @@ class ObjectIO; */ class SIMPLNX_EXPORT DataStructureWriter { - friend class nx::core::DataObject; - friend SIMPLNX_EXPORT Result<> WriteObjectAttributes(DataStructureWriter&, ObjectIO&, const DataObject*, bool); - friend class HDF5::IDataIO; + friend class nx::core::AbstractDataObject; + friend SIMPLNX_EXPORT Result<> WriteObjectAttributes(DataStructureWriter&, ObjectIO&, const AbstractDataObject*, bool); + friend class HDF5::AbstractDataIO; - using DataMapType = std::map; + using DataMapType = std::map; public: DataStructureWriter(); @@ -42,8 +42,8 @@ class SIMPLNX_EXPORT DataStructureWriter static Result<> AppendFile(FileIO& file, const DataStructure& dataStructure, const DataPath& dataPath); /** - * @brief Writes the DataObject under the given GroupIO. If the - * DataObject has already been written, a link is create instead. + * @brief Writes the AbstractDataObject under the given GroupIO. If the + * AbstractDataObject has already been written, a link is create instead. * * If the process encounters an error, the error code is returned. Otherwise, * this method returns 0. @@ -51,7 +51,7 @@ class SIMPLNX_EXPORT DataStructureWriter * @param parentGroup * @return Result<> */ - Result<> writeDataObject(const DataObject* dataObject, GroupIO& parentGroup); + Result<> writeDataObject(const AbstractDataObject* dataObject, GroupIO& parentGroup); /** * @brief Writes the provided dataMap to HDF5 group. @@ -65,7 +65,7 @@ class SIMPLNX_EXPORT DataStructureWriter protected: /** - * @brief Writes a DataObject link under the given GroupIO. + * @brief Writes a AbstractDataObject link under the given GroupIO. * * If the process encounters an error, the error code is returned. Otherwise, * this method returns 0. @@ -73,63 +73,63 @@ class SIMPLNX_EXPORT DataStructureWriter * @param parentGroup * @return Result<> */ - Result<> writeDataObjectLink(const DataObject* dataObject, GroupIO& parentGroup); + Result<> writeDataObjectLink(const AbstractDataObject* dataObject, GroupIO& parentGroup); /** - * @brief Returns true if the DataObject has been written to the current + * @brief Returns true if the AbstractDataObject has been written to the current * file. Returns false otherwise. * - * This will always return false if the target DataObject is null. + * This will always return false if the target AbstractDataObject is null. * @param targetObject * @return bool */ - bool hasDataBeenWritten(const DataObject* targetObject) const; + bool hasDataBeenWritten(const AbstractDataObject* targetObject) const; /** - * @brief Returns true if the DataObject ID has been written to the current + * @brief Returns true if the AbstractDataObject ID has been written to the current * file. Returns false otherwise. * @param targetObject * @return bool */ - bool hasDataBeenWritten(DataObject::IdType targetId) const; + bool hasDataBeenWritten(AbstractDataObject::IdType targetId) const; /** * @brief Returns the path to the HDF5 object for the provided - * DataObject ID. Returns an empty string if no HDF5 writer could be found. + * AbstractDataObject ID. Returns an empty string if no HDF5 writer could be found. * @param objectId * @return std::string */ - std::string getPathForObjectId(DataObject::IdType objectId) const; + std::string getPathForObjectId(AbstractDataObject::IdType objectId) const; /** * @brief Returns the path to the HDF5 object for the provided - * DataObject ID. Returns an empty string if no HDF5 writer could be found. + * AbstractDataObject ID. Returns an empty string if no HDF5 writer could be found. * @param objectId * @return std::string */ - std::string getParentPathForObjectId(DataObject::IdType objectId) const; + std::string getParentPathForObjectId(AbstractDataObject::IdType objectId) const; /** * @brief Returns the path to the HDF5 object for the specified - * DataObject's sibling under the same parent. Returns an empty string if + * AbstractDataObject's sibling under the same parent. Returns an empty string if * no HDF5 writer could be found. * @param objectId * @param siblingName * @return std::string */ - std::string getPathForObjectSibling(DataObject::IdType objectId, const std::string& siblingName) const; + std::string getPathForObjectSibling(AbstractDataObject::IdType objectId, const std::string& siblingName) const; /** - * @brief Clears the DataObject to HDF5 ID map and resets the HDF5 parent ID. + * @brief Clears the AbstractDataObject to HDF5 ID map and resets the HDF5 parent ID. */ void clearIdMap(); /** - * @brief Adds the nx::core::HDF5::ObjectWriter to the DataStructureWriter for the given DataObject ID + * @brief Adds the nx::core::HDF5::ObjectWriter to the DataStructureWriter for the given AbstractDataObject ID * @param objectWriter * @param objectId */ - void addWriter(ObjectIO& objectWriter, DataObject::IdType objectId); + void addWriter(ObjectIO& objectWriter, AbstractDataObject::IdType objectId); private: DataStructure m_DataStructure; diff --git a/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.cpp index 5100df19d0..8e1d22e1da 100644 --- a/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.cpp @@ -11,9 +11,9 @@ namespace nx::core::HDF5 EdgeGeomIO::EdgeGeomIO() = default; EdgeGeomIO::~EdgeGeomIO() noexcept = default; -DataObject::Type EdgeGeomIO::getDataType() const +AbstractDataObject::Type EdgeGeomIO::getDataType() const { - return DataObject::Type::EdgeGeom; + return IDataObject::Type::EdgeGeom; } std::string EdgeGeomIO::getTypeName() const @@ -21,11 +21,11 @@ std::string EdgeGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> EdgeGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> EdgeGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = EdgeGeom::Import(structureReader.getDataStructure(), objectName, importId, parentId); - Result<> result = INodeGeom1dIO::ReadNodeGeom1dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractNodeGeom1dIO::ReadNodeGeom1dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -67,7 +67,7 @@ Result<> EdgeGeomIO::finishImportingData(DataStructure& dataStructure, const Dat Result<> EdgeGeomIO::writeData(DataStructureWriter& dataStructureWriter, const EdgeGeom& geometry, group_writer_type& parentGroupWriter, bool importable) const { auto groupWriter = parentGroupWriter.createGroup(geometry.getName()); - INodeGeom1dIO::WriteNodeGeom1dData(dataStructureWriter, geometry, parentGroupWriter, importable); + AbstractNodeGeom1dIO::WriteNodeGeom1dData(dataStructureWriter, geometry, parentGroupWriter, importable); Result<> result = WriteDataId(groupWriter, geometry.getVertexListId(), IOConstants::k_VertexListTag); if(result.invalid()) @@ -108,7 +108,7 @@ Result<> EdgeGeomIO::writeData(DataStructureWriter& dataStructureWriter, const E return {}; } -Result<> EdgeGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> EdgeGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.hpp index a01b108378..a89f260e1b 100644 --- a/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/EdgeGeomIO.hpp @@ -1,7 +1,7 @@ #pragma once -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" -#include "simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom1dIO.hpp" namespace nx::core { @@ -12,7 +12,7 @@ namespace HDF5 /** * @brief The EdgeGeomIO class exists to read and write EdgeGeoms using HDF5. */ -class SIMPLNX_EXPORT EdgeGeomIO : public INodeGeom1dIO +class SIMPLNX_EXPORT EdgeGeomIO : public AbstractNodeGeom1dIO { public: using data_type = EdgeGeom; @@ -31,8 +31,8 @@ class SIMPLNX_EXPORT EdgeGeomIO : public INodeGeom1dIO * @param useEmptyDataStore * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -47,14 +47,14 @@ class SIMPLNX_EXPORT EdgeGeomIO : public INodeGeom1dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const EdgeGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to EdgeGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to EdgeGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.cpp b/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.cpp index d48f426547..c5930f2cad 100644 --- a/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.cpp @@ -10,9 +10,9 @@ namespace nx::core::HDF5 GridMontageIO::GridMontageIO() = default; GridMontageIO::~GridMontageIO() noexcept = default; -DataObject::Type GridMontageIO::getDataType() const +AbstractDataObject::Type GridMontageIO::getDataType() const { - return DataObject::Type::AbstractMontage; + return IDataObject::Type::AbstractMontage; } std::string GridMontageIO::getTypeName() const @@ -20,8 +20,8 @@ std::string GridMontageIO::getTypeName() const return data_type::k_TypeName; } -Result<> GridMontageIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> GridMontageIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* montage = GridMontage::Import(structureReader.getDataStructure(), objectName, importId, parentId); return BaseGroupIO::ReadBaseGroupData(structureReader, *montage, parentGroup, objectName, importId, parentId, useEmptyDataStore); @@ -32,7 +32,7 @@ Result<> GridMontageIO::writeData(DataStructureWriter& dataStructureWriter, cons return BaseGroupIO::WriteBaseGroupData(dataStructureWriter, montage, parentGroup, importable); } -Result<> GridMontageIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> GridMontageIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.hpp b/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.hpp index 848b342df4..a00a4c8ed0 100644 --- a/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/GridMontageIO.hpp @@ -30,8 +30,8 @@ class SIMPLNX_EXPORT GridMontageIO : public BaseGroupIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& montageName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& montageName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; /** * @brief Attempts to write the GridMontage to HDF5. @@ -44,14 +44,14 @@ class SIMPLNX_EXPORT GridMontageIO : public BaseGroupIO Result<> writeData(DataStructureWriter& dataStructureWriter, const GridMontage& montage, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a GridMontage. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a GridMontage. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.cpp index 6693a37f98..5974ed5484 100644 --- a/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.cpp @@ -10,9 +10,9 @@ namespace nx::core::HDF5 HexahedralGeomIO::HexahedralGeomIO() = default; HexahedralGeomIO::~HexahedralGeomIO() noexcept = default; -DataObject::Type HexahedralGeomIO::getDataType() const +AbstractDataObject::Type HexahedralGeomIO::getDataType() const { - return DataObject::Type::HexahedralGeom; + return IDataObject::Type::HexahedralGeom; } std::string HexahedralGeomIO::getTypeName() const @@ -20,11 +20,11 @@ std::string HexahedralGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> HexahedralGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> HexahedralGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geom = HexahedralGeom::Import(structureReader.getDataStructure(), objectName, importId, parentId); - return INodeGeom3dIO::ReadNodeGeom3dData(structureReader, *geom, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractNodeGeom3dIO::ReadNodeGeom3dData(structureReader, *geom, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> HexahedralGeomIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const @@ -35,16 +35,16 @@ Result<> HexahedralGeomIO::finishImportingData(DataStructure& dataStructure, con return MakeErrorResult(-25070, fmt::format("Failed to finish importing geometry at path '{}'. Geometry does not exist or is of wrong type.", dataPath.toString())); } - return INodeGeom3dIO::FinishImportingNodeGeom3dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom3dIO::FinishImportingNodeGeom3dData(dataStructure, dataPath, dataStructureGroup); } Result<> HexahedralGeomIO::writeData(DataStructureWriter& structureReader, const HexahedralGeom& geom, group_writer_type& parentGroup, bool importable) const { auto groupWriter = parentGroup.createGroup(geom.getName()); - return INodeGeom3dIO::WriteNodeGeom3dData(structureReader, geom, parentGroup, importable); + return AbstractNodeGeom3dIO::WriteNodeGeom3dData(structureReader, geom, parentGroup, importable); } -Result<> HexahedralGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> HexahedralGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.hpp index 58f6eb70f0..628361f0db 100644 --- a/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/HexahedralGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class HexahedralGeom; namespace HDF5 { -class SIMPLNX_EXPORT HexahedralGeomIO : public INodeGeom3dIO +class SIMPLNX_EXPORT HexahedralGeomIO : public AbstractNodeGeom3dIO { public: using data_type = HexahedralGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT HexahedralGeomIO : public INodeGeom3dIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT HexahedralGeomIO : public INodeGeom3dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const HexahedralGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a HexahedralGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a HexahedralGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/IGeometryIO.cpp b/src/simplnx/DataStructure/IO/HDF5/IGeometryIO.cpp deleted file mode 100644 index f83b57d60e..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/IGeometryIO.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "IGeometryIO.hpp" - -#include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" - -namespace nx::core::HDF5 -{ -IGeometryIO::IGeometryIO() = default; -IGeometryIO::~IGeometryIO() noexcept = default; - -Result<> IGeometryIO::ReadGeometryData(DataStructureReader& dataStructureReader, IGeometry& geometry, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) -{ - auto groupReader = parentGroup.openGroup(objectName); - - Result<> result = BaseGroupIO::ReadBaseGroupData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); - if(result.invalid()) - { - return result; - } - - geometry.setElementSizesId(ReadDataId(groupReader, IOConstants::k_ElementSizesTag)); - - return {}; -} - -Result<> IGeometryIO::FinishImportingGeomData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) -{ - auto* geom = dataStructure.getDataAs(dataPath); - if(geom == nullptr) - { - return MakeErrorResult(-50590, fmt::format("Failed to finish importing IGeometry at path '{}'. Data not found or of incorrect type.", dataPath.toString())); - } - - return {}; -} - -Result<> IGeometryIO::WriteGeometryData(DataStructureWriter& dataStructureWriter, const IGeometry& geometry, group_writer_type& parentGroup, bool importable) -{ - auto groupWriter = parentGroup.createGroup(geometry.getName()); - - Result<> result = WriteDataId(groupWriter, geometry.getElementSizesId(), IOConstants::k_ElementSizesTag); - if(result.invalid()) - { - return result; - } - - return BaseGroupIO::WriteBaseGroupData(dataStructureWriter, geometry, parentGroup, importable); -} - -} // namespace nx::core::HDF5 diff --git a/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.cpp b/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.cpp deleted file mode 100644 index 5f5089fbf1..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "IGridGeometryIO.hpp" - -#include "DataStructureWriter.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" -#include "simplnx/DataStructure/IO/Generic/IOConstants.hpp" - -namespace nx::core::HDF5 -{ -IGridGeometryIO::IGridGeometryIO() = default; -IGridGeometryIO::~IGridGeometryIO() noexcept = default; - -Result<> IGridGeometryIO::ReadGridGeometryData(DataStructureReader& dataStructureReader, IGridGeometry& geometry, const group_reader_type& parentGroup, const std::string& objectName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore) -{ - Result<> result = IGeometryIO::ReadGeometryData(dataStructureReader, geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); - if(result.invalid()) - { - return result; - } - - auto groupReader = parentGroup.openGroup(objectName); - IGeometry::OptionalId cellDataId = ReadDataId(groupReader, IOConstants::k_CellDataTag); - - geometry.setCellData(cellDataId); - - return {}; -} - -Result<> IGridGeometryIO::FinishImportingGridGeometryData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) -{ - auto* geom = dataStructure.getDataAs(dataPath); - if(geom == nullptr) - { - return MakeErrorResult(-50594, fmt::format("Failed to finish importing IGridGeometry at path '{}'. Data not found or of incorrect type.", dataPath.toString())); - } - - return {}; -} - -Result<> IGridGeometryIO::WriteGridGeometryData(DataStructureWriter& dataStructureWriter, const IGridGeometry& geometry, group_writer_type& parentGroup, bool importable) -{ - auto result = IGeometryIO::WriteGeometryData(dataStructureWriter, geometry, parentGroup, importable); - if(result.invalid()) - { - return result; - } - - auto groupWriter = parentGroup.createGroup(geometry.getName()); - Result<> writeResult = WriteDataId(groupWriter, geometry.getCellDataId(), IOConstants::k_CellDataTag); - return writeResult; -} -} // namespace nx::core::HDF5 diff --git a/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp b/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp deleted file mode 100644 index aae600b61b..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/IGeometryIO.hpp" - -namespace nx::core -{ -class IGridGeometry; - -namespace HDF5 -{ -class SIMPLNX_EXPORT IGridGeometryIO : public IGeometryIO -{ -public: - IGridGeometryIO(); - ~IGridGeometryIO() noexcept override; - - IGridGeometryIO(const IGridGeometryIO& other) = delete; - IGridGeometryIO(IGridGeometryIO&& other) = delete; - IGridGeometryIO& operator=(const IGridGeometryIO& rhs) = delete; - IGridGeometryIO& operator=(IGridGeometryIO&& rhs) = delete; - -protected: - /** - * @brief Attempts to read the GridGeometry data from HDF5. - * Returns a Result<> with any errors or warnings encountered during the process. - * @param dataStructureReader - * @param geometry - * @param parentGroup - * @param geometryName - * @param importId - * @param parentId - * @param useEmptyDataStore = false - * @return Result<> - */ - static Result<> ReadGridGeometryData(DataStructureReader& dataStructureReader, IGridGeometry& geometry, const group_reader_type& parentGroup, const std::string& geometryName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); - - /** - * @brief Attempts to write the IGridGeometry data to HDF5. - * @param dataStructureWriter - * @param geometry - * @param parentGroup - * @param importable - * @return Result<> - */ - static Result<> WriteGridGeometryData(DataStructureWriter& dataStructureWriter, const IGridGeometry& geometry, group_writer_type& parentGroup, bool importable); - - static Result<> FinishImportingGridGeometryData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); -}; -} // namespace HDF5 -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp deleted file mode 100644 index 389fa8fc65..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp" - -namespace nx::core -{ -class INodeGeometry1D; - -namespace HDF5 -{ -class SIMPLNX_EXPORT INodeGeom1dIO : public INodeGeom0dIO -{ -public: - INodeGeom1dIO(); - ~INodeGeom1dIO() noexcept override; - - INodeGeom1dIO(const INodeGeom1dIO& other) = delete; - INodeGeom1dIO(INodeGeom1dIO&& other) = delete; - INodeGeom1dIO& operator=(const INodeGeom1dIO& rhs) = delete; - INodeGeom1dIO& operator=(INodeGeom1dIO&& rhs) = delete; - -protected: - /** - * @brief Attempts to read the INodeGeometry1D data from HDF5. - * Returns a Result<> with any errors or warnings encountered during the process. - * @param dataStructureReader - * @param geometry - * @param parentGroup - * @param geomName - * @param importId - * @param parentId - * @param useEmptyDataStore = false - * @return Result<> - */ - static Result<> ReadNodeGeom1dData(DataStructureReader& dataStructureReader, INodeGeometry1D& geometry, const group_reader_type& parentGroup, const std::string& geomName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); - - /** - * @brief Attempts to write the INodeGeometry1D data to HDF5. - * @param dataStructureWriter - * @param geometry - * @param parentGroup - * @param importable - * @return Result<> - */ - static Result<> WriteNodeGeom1dData(DataStructureWriter& dataStructureWriter, const INodeGeometry1D& geometry, group_writer_type& parentGroup, bool importable); - - static Result<> FinishImportingNodeGeom1dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); -}; -} // namespace HDF5 -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp deleted file mode 100644 index eef43d03ee..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/INodeGeom1dIO.hpp" - -namespace nx::core -{ -class INodeGeometry2D; - -namespace HDF5 -{ -class SIMPLNX_EXPORT INodeGeom2dIO : public INodeGeom1dIO -{ -public: - INodeGeom2dIO(); - ~INodeGeom2dIO() noexcept override; - - INodeGeom2dIO(const INodeGeom2dIO& other) = delete; - INodeGeom2dIO(INodeGeom2dIO&& other) = delete; - INodeGeom2dIO& operator=(const INodeGeom2dIO& rhs) = delete; - INodeGeom2dIO& operator=(INodeGeom2dIO&& rhs) = delete; - -protected: - /** - * @brief Attempts to read the INodeGeometry2D data from HDF5. - * Returns a Result<> with any errors or warnings encountered during the process. - * @param dataStructureReader - * @param geometry - * @param parentGroup - * @param geomName - * @param importId - * @param parentId - * @param useEmptyDataStore = false - * @return Result<> - */ - static Result<> ReadNodeGeom2dData(DataStructureReader& dataStructureReader, INodeGeometry2D& geometry, const group_reader_type& parentGroup, const std::string& geomName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); - - /** - * @brief Attempts to write the INodeGeometry2D data to HDF5. - * @param dataStructureWriter - * @param geometry - * @param parentGroup - * @param importable - * @return Result<> - */ - static Result<> WriteNodeGeom2dData(DataStructureWriter& dataStructureWriter, const INodeGeometry2D& geometry, group_writer_type& parentGroup, bool importable); - - static Result<> FinishImportingNodeGeom2dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); -}; -} // namespace HDF5 -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp b/src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp deleted file mode 100644 index c3622ca66b..0000000000 --- a/src/simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp" - -namespace nx::core -{ -class INodeGeometry3D; - -namespace HDF5 -{ -class SIMPLNX_EXPORT INodeGeom3dIO : public INodeGeom2dIO -{ -public: - INodeGeom3dIO(); - ~INodeGeom3dIO() noexcept override; - - INodeGeom3dIO(const INodeGeom3dIO& other) = delete; - INodeGeom3dIO(INodeGeom3dIO&& other) = delete; - INodeGeom3dIO& operator=(const INodeGeom3dIO& rhs) = delete; - INodeGeom3dIO& operator=(INodeGeom3dIO&& rhs) = delete; - -protected: - /** - * @brief Attempts to read the INodeGeometry3D data from HDF5. - * Returns a Result<> with any errors or warnings encountered during the process. - * @param dataStructureReader - * @param geometry - * @param parentGroup - * @param geomName - * @param importId - * @param parentId - * @param useEmptyDataStore = false - * @return Result<> - */ - static Result<> ReadNodeGeom3dData(DataStructureReader& dataStructureReader, INodeGeometry3D& geometry, const group_reader_type& parentGroup, const std::string& geomName, - DataObject::IdType importId, const std::optional& parentId, bool useEmptyDataStore = false); - - /** - * @brief Attempts to write the INodeGeometry3D data to HDF5. - * @param dataStructureWriter - * @param geometry - * @param parentGroup - * @param importable - * @return Result<> - */ - static Result<> WriteNodeGeom3dData(DataStructureWriter& dataStructureWriter, const INodeGeometry3D& geometry, group_writer_type& parentGroup, bool importable); - - static Result<> FinishImportingNodeGeom3dData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup); -}; -} // namespace HDF5 -} // namespace nx::core diff --git a/src/simplnx/DataStructure/IO/HDF5/IOUtilities.cpp b/src/simplnx/DataStructure/IO/HDF5/IOUtilities.cpp index e044f49fdd..11119e611d 100644 --- a/src/simplnx/DataStructure/IO/HDF5/IOUtilities.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/IOUtilities.cpp @@ -1,8 +1,8 @@ #include "IOUtilities.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataMap.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStructureReader.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp" @@ -14,7 +14,7 @@ namespace nx::core { -Result<> HDF5::WriteObjectAttributes(DataStructureWriter& dataStructureWriter, nx::core::HDF5::ObjectIO& objectWriter, const DataObject* dataObject, bool importable) +Result<> HDF5::WriteObjectAttributes(DataStructureWriter& dataStructureWriter, nx::core::HDF5::ObjectIO& objectWriter, const AbstractDataObject* dataObject, bool importable) { // Add to DataStructureWriter for use in linking dataStructureWriter.addWriter(objectWriter, dataObject->getId()); @@ -44,7 +44,8 @@ Result<> HDF5::ReadBaseGroup(DataStructureReader& dataStructureReader, const nx: return ReadDataMap(dataStructureReader, baseGroup->getDataMap(), groupReader, baseGroup->getId(), useEmptyDataStores); } -Result<> HDF5::ReadDataMap(DataStructureReader& dataStructureReader, DataMap& dataMap, const nx::core::HDF5::GroupIO& groupReader, std::optional parentId, bool useEmptyDataStore) +Result<> HDF5::ReadDataMap(DataStructureReader& dataStructureReader, DataMap& dataMap, const nx::core::HDF5::GroupIO& groupReader, std::optional parentId, + bool useEmptyDataStore) { auto childrenNames = groupReader.getChildNames(); if(childrenNames.empty()) diff --git a/src/simplnx/DataStructure/IO/HDF5/IOUtilities.hpp b/src/simplnx/DataStructure/IO/HDF5/IOUtilities.hpp index 6fab330533..f1a35dca9b 100644 --- a/src/simplnx/DataStructure/IO/HDF5/IOUtilities.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/IOUtilities.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Result.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/simplnx_export.hpp" #include "simplnx/Utilities/Parsing/HDF5/IO/GroupIO.hpp" @@ -10,7 +10,7 @@ namespace nx::core { class BaseGroup; class DataMap; -class DataObject; +class AbstractDataObject; namespace HDF5 { @@ -21,7 +21,7 @@ class GroupIO; class ObjectIO; /** - * @brief Attempts to write the DataObject attributes to HDF5. + * @brief Attempts to write the AbstractDataObject attributes to HDF5. * Returns a Result<> with any errors or warnings encountered during the process. * @param dataStructureWriter * @param objectWriter @@ -29,7 +29,7 @@ class ObjectIO; * @param importable * @return Result<> */ -Result<> SIMPLNX_EXPORT WriteObjectAttributes(DataStructureWriter& dataStructureWriter, ObjectIO& objectWriter, const DataObject* dataObject, bool importable); +Result<> SIMPLNX_EXPORT WriteObjectAttributes(DataStructureWriter& dataStructureWriter, ObjectIO& objectWriter, const AbstractDataObject* dataObject, bool importable); /** * @brief Attempts to read the DataMap from HDF5. @@ -41,7 +41,8 @@ Result<> SIMPLNX_EXPORT WriteObjectAttributes(DataStructureWriter& dataStructure * @param useEmptyDataStore = false * @return Result<> */ -Result<> SIMPLNX_EXPORT ReadDataMap(DataStructureReader& dataStructureReader, DataMap& dataMap, const GroupIO& parentGroup, std::optional parentId, bool useEmptyDataStore = false); +Result<> SIMPLNX_EXPORT ReadDataMap(DataStructureReader& dataStructureReader, DataMap& dataMap, const GroupIO& parentGroup, std::optional parentId, + bool useEmptyDataStore = false); /** * @brief Attempts to read the BaseGroup from HDF5. diff --git a/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.cpp index f149a57837..f8a47c84ee 100644 --- a/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.cpp @@ -31,9 +31,9 @@ namespace nx::core::HDF5 ImageGeomIO::ImageGeomIO() = default; ImageGeomIO::~ImageGeomIO() noexcept = default; -DataObject::Type ImageGeomIO::getDataType() const +AbstractDataObject::Type ImageGeomIO::getDataType() const { - return DataObject::Type::ImageGeom; + return IDataObject::Type::ImageGeom; } std::string ImageGeomIO::getTypeName() const @@ -41,8 +41,8 @@ std::string ImageGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> ImageGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> ImageGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* imageGeom = ImageGeom::Import(dataStructureReader.getDataStructure(), objectName, importId, parentId); @@ -59,7 +59,7 @@ Result<> ImageGeomIO::readData(DataStructureReader& dataStructureReader, const g if(const auto unitsAttr = groupReader.readScalarAttribute(IOConstants::k_H5_UNITS); unitsAttr.valid()) { auto value = unitsAttr.value(); - imageGeom->setUnits(static_cast(value)); + imageGeom->setUnits(static_cast(value)); } auto volDimsVectorResult = groupReader.readVectorAttribute(IOConstants::k_H5_DIMENSIONS); @@ -98,12 +98,12 @@ Result<> ImageGeomIO::readData(DataStructureReader& dataStructureReader, const g imageGeom->setSpacing(spacing); imageGeom->setOrigin(origin); - return IGridGeometryIO::ReadGridGeometryData(dataStructureReader, *imageGeom, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractGridGeometryIO::ReadGridGeometryData(dataStructureReader, *imageGeom, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> ImageGeomIO::writeData(DataStructureWriter& dataStructureWriter, const ImageGeom& geometry, group_writer_type& parentGroupWriter, bool importable) const { - Result<> result = IGridGeometryIO::WriteGridGeometryData(dataStructureWriter, geometry, parentGroupWriter, importable); + Result<> result = AbstractGridGeometryIO::WriteGridGeometryData(dataStructureWriter, geometry, parentGroupWriter, importable); if(result.invalid()) { return result; @@ -136,7 +136,7 @@ Result<> ImageGeomIO::writeData(DataStructureWriter& dataStructureWriter, const return {}; } -Result<> ImageGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> ImageGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.hpp index a3dda4081c..d96947acd7 100644 --- a/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/ImageGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class ImageGeom; namespace HDF5 { -class SIMPLNX_EXPORT ImageGeomIO : public IGridGeometryIO +class SIMPLNX_EXPORT ImageGeomIO : public AbstractGridGeometryIO { public: using data_type = ImageGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT ImageGeomIO : public IGridGeometryIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; /** * @brief Attempts to write an ImageGeom to HDF5. @@ -41,14 +41,14 @@ class SIMPLNX_EXPORT ImageGeomIO : public IGridGeometryIO Result<> writeData(DataStructureWriter& dataStructureWriter, const ImageGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to an ImageGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to an ImageGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/NeighborListIO.hpp b/src/simplnx/DataStructure/IO/HDF5/NeighborListIO.hpp index 17b06f6a5c..2bfae81615 100644 --- a/src/simplnx/DataStructure/IO/HDF5/NeighborListIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/NeighborListIO.hpp @@ -5,9 +5,9 @@ #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/EmptyListStore.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataArrayIO.hpp" #include "simplnx/DataStructure/IO/HDF5/DataStoreIO.hpp" -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" #include "simplnx/DataStructure/NeighborList.hpp" #include @@ -17,7 +17,7 @@ namespace nx::core namespace HDF5 { template -class NeighborListIO : public IDataIO +class NeighborListIO : public AbstractDataIO { public: using data_type = NeighborList; @@ -108,8 +108,8 @@ class NeighborListIO : public IDataIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override { auto datasetReader = parentGroup.openDataset(objectName); auto listStorePtr = ReadHdf5Data(parentGroup, datasetReader, useEmptyDataStore); @@ -249,19 +249,19 @@ class NeighborListIO : public IDataIO } /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a NeighborList. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a NeighborList. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } - DataObject::Type getDataType() const override + AbstractDataObject::Type getDataType() const override { - return DataObject::Type::NeighborList; + return IDataObject::Type::NeighborList; } std::string getTypeName() const override diff --git a/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.cpp index 576124bcff..2602b6d20e 100644 --- a/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.cpp @@ -10,9 +10,9 @@ namespace nx::core::HDF5 QuadGeomIO::QuadGeomIO() = default; QuadGeomIO::~QuadGeomIO() noexcept = default; -DataObject::Type QuadGeomIO::getDataType() const +AbstractDataObject::Type QuadGeomIO::getDataType() const { - return DataObject::Type::QuadGeom; + return IDataObject::Type::QuadGeom; } std::string QuadGeomIO::getTypeName() const @@ -20,11 +20,11 @@ std::string QuadGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> QuadGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> QuadGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = QuadGeom::Import(structureReader.getDataStructure(), objectName, importId, parentId); - return INodeGeom2dIO::ReadNodeGeom2dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractNodeGeom2dIO::ReadNodeGeom2dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> QuadGeomIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const @@ -35,15 +35,15 @@ Result<> QuadGeomIO::finishImportingData(DataStructure& dataStructure, const Dat return MakeErrorResult(-50590, fmt::format("Failed to finish importing QuadGeom at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); } Result<> QuadGeomIO::writeData(DataStructureWriter& dataStructureWriter, const QuadGeom& geom, group_writer_type& parentGroup, bool importable) const { - return INodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geom, parentGroup, importable); + return AbstractNodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geom, parentGroup, importable); } -Result<> QuadGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> QuadGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.hpp index 55d68cb3a4..714af6e5b0 100644 --- a/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/QuadGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/INodeGeom2dIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom2dIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class QuadGeom; namespace HDF5 { -class SIMPLNX_EXPORT QuadGeomIO : public INodeGeom2dIO +class SIMPLNX_EXPORT QuadGeomIO : public AbstractNodeGeom2dIO { public: using data_type = QuadGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT QuadGeomIO : public INodeGeom2dIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT QuadGeomIO : public INodeGeom2dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const QuadGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a QuadGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a QuadGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.cpp index 66a587a3b4..73740673bf 100644 --- a/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.cpp @@ -14,9 +14,9 @@ namespace nx::core::HDF5 RectGridGeomIO::RectGridGeomIO() = default; RectGridGeomIO::~RectGridGeomIO() noexcept = default; -DataObject::Type RectGridGeomIO::getDataType() const +AbstractDataObject::Type RectGridGeomIO::getDataType() const { - return DataObject::Type::RectGridGeom; + return IDataObject::Type::RectGridGeom; } std::string RectGridGeomIO::getTypeName() const @@ -24,12 +24,12 @@ std::string RectGridGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> RectGridGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> RectGridGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = RectGridGeom::Import(dataStructureReader.getDataStructure(), objectName, importId, parentId); - Result<> result = IGridGeometryIO::ReadGridGeometryData(dataStructureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + Result<> result = AbstractGridGeometryIO::ReadGridGeometryData(dataStructureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); if(result.invalid()) { return result; @@ -40,7 +40,7 @@ Result<> RectGridGeomIO::readData(DataStructureReader& dataStructureReader, cons if(const auto unitsAttr = groupReader.readScalarAttribute(IOConstants::k_H5_UNITS); unitsAttr.valid()) { auto value = unitsAttr.value(); - geometry->setUnits(static_cast(value)); + geometry->setUnits(static_cast(value)); } // Read Dimensions @@ -53,7 +53,7 @@ Result<> RectGridGeomIO::readData(DataStructureReader& dataStructureReader, cons geometry->setDimensions(volumeDimensions); - // Read DataObject IDs + // Read AbstractDataObject IDs geometry->setXBoundsId(ReadDataId(groupReader, IOConstants::k_XBoundsTag)); geometry->setYBoundsId(ReadDataId(groupReader, IOConstants::k_YBoundsTag)); geometry->setZBoundsId(ReadDataId(groupReader, IOConstants::k_ZBoundsTag)); @@ -83,7 +83,7 @@ Result<> RectGridGeomIO::finishImportingData(DataStructure& dataStructure, const if(const auto unitsAttr = groupReader.readScalarAttribute(IOConstants::k_H5_UNITS); unitsAttr.valid()) { auto value = unitsAttr.value(); - geom->setUnits(static_cast(value)); + geom->setUnits(static_cast(value)); } // Read Dimensions @@ -97,12 +97,12 @@ Result<> RectGridGeomIO::finishImportingData(DataStructure& dataStructure, const geom->setDimensions(volumeDimensions); } - return IGridGeometryIO::FinishImportingGridGeometryData(dataStructure, dataPath, dataStructureGroup); + return AbstractGridGeometryIO::FinishImportingGridGeometryData(dataStructure, dataPath, dataStructureGroup); } Result<> RectGridGeomIO::writeData(DataStructureWriter& dataStructureWriter, const RectGridGeom& geometry, group_writer_type& parentGroup, bool importable) const { - Result<> result = IGridGeometryIO::WriteGridGeometryData(dataStructureWriter, geometry, parentGroup, importable); + Result<> result = AbstractGridGeometryIO::WriteGridGeometryData(dataStructureWriter, geometry, parentGroup, importable); if(result.invalid()) { return result; @@ -123,7 +123,7 @@ Result<> RectGridGeomIO::writeData(DataStructureWriter& dataStructureWriter, con { return result; } - // Write DataObject IDs + // Write AbstractDataObject IDs result = WriteDataId(groupWriter, geometry.getXBoundsId(), IOConstants::k_XBoundsTag); if(result.invalid()) { @@ -151,7 +151,7 @@ Result<> RectGridGeomIO::writeData(DataStructureWriter& dataStructureWriter, con return {}; } -Result<> RectGridGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> RectGridGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.hpp index 90fd4fcd88..dd9acdc22f 100644 --- a/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/RectGridGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/IGridGeometryIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractGridGeometryIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class RectGridGeom; namespace HDF5 { -class SIMPLNX_EXPORT RectGridGeomIO : public IGridGeometryIO +class SIMPLNX_EXPORT RectGridGeomIO : public AbstractGridGeometryIO { public: using data_type = RectGridGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT RectGridGeomIO : public IGridGeometryIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT RectGridGeomIO : public IGridGeometryIO Result<> writeData(DataStructureWriter& dataStructureWriter, const RectGridGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a RectGridGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a RectGridGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/ScalarDataIO.hpp b/src/simplnx/DataStructure/IO/HDF5/ScalarDataIO.hpp index 39542158d4..2ea9cd182e 100644 --- a/src/simplnx/DataStructure/IO/HDF5/ScalarDataIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/ScalarDataIO.hpp @@ -1,12 +1,12 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" #include "simplnx/DataStructure/ScalarData.hpp" namespace nx::core::HDF5 { template -class ScalarDataIO : public IDataIO +class ScalarDataIO : public AbstractDataIO { public: using data_type = ScalarData; @@ -25,8 +25,8 @@ class ScalarDataIO : public IDataIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& scalarName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& scalarName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override { auto datasetReader = parentGroup.openDataset(scalarName); @@ -71,19 +71,19 @@ class ScalarDataIO : public IDataIO } /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a ScalarData. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a ScalarData. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } - DataObject::Type getDataType() const override + AbstractDataObject::Type getDataType() const override { - return DataObject::Type::ScalarData; + return IDataObject::Type::ScalarData; } std::string getTypeName() const override diff --git a/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.cpp b/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.cpp index 7a5116aabe..3f66ad651f 100644 --- a/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.cpp @@ -18,9 +18,9 @@ namespace nx::core::HDF5 StringArrayIO::StringArrayIO() = default; StringArrayIO::~StringArrayIO() noexcept = default; -DataObject::Type StringArrayIO::getDataType() const +AbstractDataObject::Type StringArrayIO::getDataType() const { - return DataObject::Type::AttributeMatrix; + return IDataObject::Type::AttributeMatrix; } std::string StringArrayIO::getTypeName() const @@ -28,8 +28,8 @@ std::string StringArrayIO::getTypeName() const return data_type::k_TypeName; } -Result<> StringArrayIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> StringArrayIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto datasetReader = parentGroup.openDataset(objectName); std::string dataArrayName = datasetReader.getName(); @@ -109,7 +109,7 @@ Result<> StringArrayIO::finishImportingData(DataStructure& dataStructure, const return {}; } -Result<> StringArrayIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> StringArrayIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.hpp b/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.hpp index d15909d218..52ca0c3272 100644 --- a/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/StringArrayIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/IDataIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractDataIO.hpp" namespace nx::core { @@ -11,7 +11,7 @@ namespace HDF5 /** * @brief The StringArrayIO class serves as a reader and writer between StringArrays and HDF5 */ -class SIMPLNX_EXPORT StringArrayIO : public IDataIO +class SIMPLNX_EXPORT StringArrayIO : public AbstractDataIO { public: using data_type = StringArray; @@ -35,8 +35,8 @@ class SIMPLNX_EXPORT StringArrayIO : public IDataIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& arrayName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& arrayName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const override; /** * @brief Attempts to write an StringArray to HDF5. @@ -58,14 +58,14 @@ class SIMPLNX_EXPORT StringArrayIO : public IDataIO Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& parentGroupReader) const override; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a StringArray. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a StringArray. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; }; diff --git a/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.cpp index 72a5337637..073368df96 100644 --- a/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.cpp @@ -11,9 +11,9 @@ namespace nx::core::HDF5 TetrahedralGeomIO::TetrahedralGeomIO() = default; TetrahedralGeomIO::~TetrahedralGeomIO() noexcept = default; -DataObject::Type TetrahedralGeomIO::getDataType() const +AbstractDataObject::Type TetrahedralGeomIO::getDataType() const { - return DataObject::Type::TetrahedralGeom; + return IDataObject::Type::TetrahedralGeom; } std::string TetrahedralGeomIO::getTypeName() const @@ -21,11 +21,11 @@ std::string TetrahedralGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> TetrahedralGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> TetrahedralGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = TetrahedralGeom::Import(structureReader.getDataStructure(), objectName, importId, parentId); - return INodeGeom3dIO::ReadNodeGeom3dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractNodeGeom3dIO::ReadNodeGeom3dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> TetrahedralGeomIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const @@ -35,15 +35,15 @@ Result<> TetrahedralGeomIO::finishImportingData(DataStructure& dataStructure, co { return MakeErrorResult(-50595, fmt::format("Failed to finish importing TetrahedraldGeom at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom3dIO::FinishImportingNodeGeom3dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom3dIO::FinishImportingNodeGeom3dData(dataStructure, dataPath, dataStructureGroup); } Result<> TetrahedralGeomIO::writeData(DataStructureWriter& dataStructureWriter, const TetrahedralGeom& geometry, group_writer_type& parentGroup, bool importable) const { - return INodeGeom3dIO::WriteNodeGeom3dData(dataStructureWriter, geometry, parentGroup, importable); + return AbstractNodeGeom3dIO::WriteNodeGeom3dData(dataStructureWriter, geometry, parentGroup, importable); } -Result<> TetrahedralGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> TetrahedralGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.hpp index a4c67b6ae0..9a08e722da 100644 --- a/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/TetrahedralGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class TetrahedralGeom; namespace HDF5 { -class SIMPLNX_EXPORT TetrahedralGeomIO : public INodeGeom3dIO +class SIMPLNX_EXPORT TetrahedralGeomIO : public AbstractNodeGeom3dIO { public: using data_type = TetrahedralGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT TetrahedralGeomIO : public INodeGeom3dIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT TetrahedralGeomIO : public INodeGeom3dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const TetrahedralGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a TetrahedralGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a TetrahedralGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.cpp index 888d698945..c7568cb426 100644 --- a/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.cpp @@ -11,9 +11,9 @@ namespace nx::core::HDF5 TriangleGeomIO::TriangleGeomIO() = default; TriangleGeomIO::~TriangleGeomIO() noexcept = default; -DataObject::Type TriangleGeomIO::getDataType() const +AbstractDataObject::Type TriangleGeomIO::getDataType() const { - return DataObject::Type::TriangleGeom; + return IDataObject::Type::TriangleGeom; } std::string TriangleGeomIO::getTypeName() const @@ -21,11 +21,11 @@ std::string TriangleGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> TriangleGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> TriangleGeomIO::readData(DataStructureReader& structureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = TriangleGeom::Import(structureReader.getDataStructure(), objectName, importId, parentId); - return INodeGeom2dIO::ReadNodeGeom2dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractNodeGeom2dIO::ReadNodeGeom2dData(structureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> TriangleGeomIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const @@ -35,15 +35,15 @@ Result<> TriangleGeomIO::finishImportingData(DataStructure& dataStructure, const { return MakeErrorResult(-50595, fmt::format("Failed to finish importing TriangleGeom at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom2dIO::FinishImportingNodeGeom2dData(dataStructure, dataPath, dataStructureGroup); } Result<> TriangleGeomIO::writeData(DataStructureWriter& dataStructureWriter, const TriangleGeom& geometry, group_writer_type& parentGroupWriter, bool importable) const { - return INodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geometry, parentGroupWriter, importable); + return AbstractNodeGeom2dIO::WriteNodeGeom2dData(dataStructureWriter, geometry, parentGroupWriter, importable); } -Result<> TriangleGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> TriangleGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.hpp index 24162823ed..346ca9455c 100644 --- a/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/TriangleGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/INodeGeom3dIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom3dIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class TriangleGeom; namespace HDF5 { -class SIMPLNX_EXPORT TriangleGeomIO : public INodeGeom3dIO +class SIMPLNX_EXPORT TriangleGeomIO : public AbstractNodeGeom3dIO { public: using data_type = TriangleGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT TriangleGeomIO : public INodeGeom3dIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT TriangleGeomIO : public INodeGeom3dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const TriangleGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a TriangleGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a TriangleGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.cpp b/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.cpp index 7491a0c358..895ea14fa2 100644 --- a/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.cpp +++ b/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.cpp @@ -10,9 +10,9 @@ namespace nx::core::HDF5 VertexGeomIO::VertexGeomIO() = default; VertexGeomIO::~VertexGeomIO() noexcept = default; -DataObject::Type VertexGeomIO::getDataType() const +AbstractDataObject::Type VertexGeomIO::getDataType() const { - return DataObject::Type::VertexGeom; + return IDataObject::Type::VertexGeom; } std::string VertexGeomIO::getTypeName() const @@ -20,11 +20,11 @@ std::string VertexGeomIO::getTypeName() const return data_type::k_TypeName; } -Result<> VertexGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore) const +Result<> VertexGeomIO::readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& objectName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore) const { auto* geometry = VertexGeom::Import(dataStructureReader.getDataStructure(), objectName, importId, parentId); - return INodeGeom0dIO::ReadNodeGeom0dData(dataStructureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); + return AbstractNodeGeom0dIO::ReadNodeGeom0dData(dataStructureReader, *geometry, parentGroup, objectName, importId, parentId, useEmptyDataStore); } Result<> VertexGeomIO::finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const @@ -34,15 +34,15 @@ Result<> VertexGeomIO::finishImportingData(DataStructure& dataStructure, const D { return MakeErrorResult(-50595, fmt::format("Failed to finish importing VertexGeom at path '{}'. Data not found or of incorrect type.", dataPath.toString())); } - return INodeGeom0dIO::FinishImportingNodeGeom0dData(dataStructure, dataPath, dataStructureGroup); + return AbstractNodeGeom0dIO::FinishImportingNodeGeom0dData(dataStructure, dataPath, dataStructureGroup); } Result<> VertexGeomIO::writeData(DataStructureWriter& structureReader, const VertexGeom& geometry, group_writer_type& parentGroupWriter, bool importable) const { - return INodeGeom0dIO::WriteNodeGeom0dData(structureReader, geometry, parentGroupWriter, importable); + return AbstractNodeGeom0dIO::WriteNodeGeom0dData(structureReader, geometry, parentGroupWriter, importable); } -Result<> VertexGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const +Result<> VertexGeomIO::writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const { return WriteDataObjectImpl(this, dataStructureWriter, dataObject, parentWriter); } diff --git a/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.hpp b/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.hpp index 566dae96ef..32b1b5549f 100644 --- a/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.hpp +++ b/src/simplnx/DataStructure/IO/HDF5/VertexGeomIO.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IO/HDF5/INodeGeom0dIO.hpp" +#include "simplnx/DataStructure/IO/HDF5/AbstractNodeGeom0dIO.hpp" namespace nx::core { @@ -8,7 +8,7 @@ class VertexGeom; namespace HDF5 { -class SIMPLNX_EXPORT VertexGeomIO : public INodeGeom0dIO +class SIMPLNX_EXPORT VertexGeomIO : public AbstractNodeGeom0dIO { public: using data_type = VertexGeom; @@ -27,8 +27,8 @@ class SIMPLNX_EXPORT VertexGeomIO : public INodeGeom0dIO * @param useEmptyDataStore = false * @return Result<> */ - Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, DataObject::IdType importId, - const std::optional& parentId, bool useEmptyDataStore = false) const override; + Result<> readData(DataStructureReader& dataStructureReader, const group_reader_type& parentGroup, const std::string& geomName, AbstractDataObject::IdType importId, + const std::optional& parentId, bool useEmptyDataStore = false) const override; Result<> finishImportingData(DataStructure& dataStructure, const DataPath& dataPath, const group_reader_type& dataStructureGroup) const override; @@ -43,14 +43,14 @@ class SIMPLNX_EXPORT VertexGeomIO : public INodeGeom0dIO Result<> writeData(DataStructureWriter& dataStructureWriter, const VertexGeom& geometry, group_writer_type& parentGroup, bool importable) const; /** - * @brief Attempts to write the DataObject to HDF5. - * Returns an error if the DataObject cannot be cast to a VertexGeom. + * @brief Attempts to write the AbstractDataObject to HDF5. + * Returns an error if the AbstractDataObject cannot be cast to a VertexGeom. * Otherwise, this method returns writeData(...) * Return Result<> */ - Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const DataObject* dataObject, group_writer_type& parentWriter) const override; + Result<> writeDataObject(DataStructureWriter& dataStructureWriter, const AbstractDataObject* dataObject, group_writer_type& parentWriter) const override; - DataObject::Type getDataType() const override; + AbstractDataObject::Type getDataType() const override; std::string getTypeName() const override; diff --git a/src/simplnx/DataStructure/IStringStore.cpp b/src/simplnx/DataStructure/IStringStore.cpp new file mode 100644 index 0000000000..c0cb8ca29d --- /dev/null +++ b/src/simplnx/DataStructure/IStringStore.cpp @@ -0,0 +1,56 @@ +#include "IStringStore.hpp" + +namespace nx::core +{ +IStringStore::iterator IStringStore::begin() +{ + return Iterator(*this, 0); +} + +IStringStore::iterator IStringStore::end() +{ + return Iterator(*this, size()); +} + +IStringStore::const_iterator IStringStore::begin() const +{ + return ConstIterator(*this, 0); +} + +IStringStore::const_iterator IStringStore::end() const +{ + return ConstIterator(*this, size()); +} + +IStringStore::const_iterator IStringStore::cbegin() const +{ + return ConstIterator(*this, 0); +} + +IStringStore::const_iterator IStringStore::cend() const +{ + return ConstIterator(*this, size()); +} + +bool IStringStore::operator==(const std::vector& values) const +{ + usize count = size(); + if(values.size() != count) + { + return false; + } + for(usize i = 0; i < count; i++) + { + if(values[i] != getValue(i)) + { + return false; + } + } + return true; +} +bool IStringStore::operator!=(const std::vector& values) const +{ + bool equals = (*this) == values; + return !equals; +} +} // namespace nx::core diff --git a/src/simplnx/DataStructure/AbstractStringStore.hpp b/src/simplnx/DataStructure/IStringStore.hpp similarity index 92% rename from src/simplnx/DataStructure/AbstractStringStore.hpp rename to src/simplnx/DataStructure/IStringStore.hpp index eeffbd2dc9..60a0640d8a 100644 --- a/src/simplnx/DataStructure/AbstractStringStore.hpp +++ b/src/simplnx/DataStructure/IStringStore.hpp @@ -9,7 +9,7 @@ namespace nx::core { -class AbstractStringStore +class IStringStore { public: using value_type = std::string; @@ -20,7 +20,7 @@ class AbstractStringStore { public: using iterator_category = std::random_access_iterator_tag; - using value_type = AbstractStringStore::value_type; + using value_type = IStringStore::value_type; using difference_type = int64; using pointer = value_type*; using reference = value_type&; @@ -32,7 +32,7 @@ class AbstractStringStore { } - Iterator(AbstractStringStore& dataStore, usize index) + Iterator(IStringStore& dataStore, usize index) : m_DataStore(&dataStore) , m_Index(index) { @@ -162,7 +162,7 @@ class AbstractStringStore } private: - AbstractStringStore* m_DataStore; + IStringStore* m_DataStore; usize m_Index = 0; }; @@ -170,7 +170,7 @@ class AbstractStringStore { public: using iterator_category = std::random_access_iterator_tag; - using value_type = AbstractStringStore::value_type; + using value_type = IStringStore::value_type; using difference_type = int64; using pointer = const value_type*; using reference = const value_type&; @@ -181,7 +181,7 @@ class AbstractStringStore { } - ConstIterator(const AbstractStringStore& dataStore, usize index) + ConstIterator(const IStringStore& dataStore, usize index) : m_DataStore(&dataStore) , m_Index(index) { @@ -316,16 +316,16 @@ class AbstractStringStore } private: - const AbstractStringStore* m_DataStore = nullptr; + const IStringStore* m_DataStore = nullptr; usize m_Index = 0; }; using iterator = Iterator; using const_iterator = ConstIterator; - ~AbstractStringStore() = default; + ~IStringStore() = default; - virtual std::unique_ptr deepCopy() const = 0; + virtual std::unique_ptr deepCopy() const = 0; virtual usize size() const = 0; virtual bool empty() const = 0; @@ -362,12 +362,12 @@ class AbstractStringStore const_iterator cbegin() const; const_iterator cend() const; - virtual AbstractStringStore& operator=(const std::vector& values) = 0; + virtual IStringStore& operator=(const std::vector& values) = 0; bool operator==(const std::vector& values) const; bool operator!=(const std::vector& values) const; protected: - AbstractStringStore() = default; + IStringStore() = default; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/LinkedPath.cpp b/src/simplnx/DataStructure/LinkedPath.cpp index b55a24d248..61272e37cc 100644 --- a/src/simplnx/DataStructure/LinkedPath.cpp +++ b/src/simplnx/DataStructure/LinkedPath.cpp @@ -7,7 +7,7 @@ using namespace nx::core; LinkedPath::LinkedPath() = default; -LinkedPath::LinkedPath(const DataStructure* dataStructure, const std::vector& idPath) +LinkedPath::LinkedPath(const DataStructure* dataStructure, const std::vector& idPath) : m_DataStructure(dataStructure) , m_IdPath(idPath) { @@ -72,27 +72,27 @@ usize LinkedPath::getLength() const return m_IdPath.size(); } -DataObject::IdType LinkedPath::operator[](usize index) const +AbstractDataObject::IdType LinkedPath::operator[](usize index) const { return getIdAt(index); } -DataObject::IdType LinkedPath::getId() const +AbstractDataObject::IdType LinkedPath::getId() const { return getIdAt(getLength() - 1); } -DataObject::IdType LinkedPath::getIdAt(usize index) const +AbstractDataObject::IdType LinkedPath::getIdAt(usize index) const { return m_IdPath[index]; } -const DataObject* LinkedPath::getData() const +const AbstractDataObject* LinkedPath::getData() const { return getDataAt(m_IdPath.size() - 1); } -const DataObject* LinkedPath::getDataAt(usize index) const +const AbstractDataObject* LinkedPath::getDataAt(usize index) const { return getDataStructure()->getData(m_IdPath[index]); } @@ -104,7 +104,7 @@ std::string LinkedPath::getName() const std::string LinkedPath::getNameAt(usize index) const { - const DataObject* data = getDataAt(index); + const AbstractDataObject* data = getDataAt(index); if(data == nullptr) { return "[ missing ]"; diff --git a/src/simplnx/DataStructure/LinkedPath.hpp b/src/simplnx/DataStructure/LinkedPath.hpp index 78bfdd1a5d..f7d6d5863b 100644 --- a/src/simplnx/DataStructure/LinkedPath.hpp +++ b/src/simplnx/DataStructure/LinkedPath.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/simplnx_export.hpp" @@ -10,10 +10,10 @@ namespace nx::core /** * @class LinkedPath * @brief The LinkedPath class is an alternate way to store a path through the - * DataStructure. Instead of storing DataObject names like DataPath does, the - * LinkedPath class stores DataObject IDs and the DataStructure it belongs to. + * DataStructure. Instead of storing AbstractDataObject names like DataPath does, the + * LinkedPath class stores AbstractDataObject IDs and the DataStructure it belongs to. * LinkedPath objects can be used to directly create a corresponding DataPath - * or find the DataObject at any point along the path. + * or find the AbstractDataObject at any point along the path. */ class SIMPLNX_EXPORT LinkedPath { @@ -82,53 +82,53 @@ class SIMPLNX_EXPORT LinkedPath usize getLength() const; /** - * @brief Returns the DataObject ID at the specified position in the path. + * @brief Returns the AbstractDataObject ID at the specified position in the path. * This method does not perform bounds checking. * @param index - * @return DataObject::IdType + * @return AbstractDataObject::IdType */ - DataObject::IdType operator[](usize index) const; + AbstractDataObject::IdType operator[](usize index) const; /** - * @brief Returns the ID for the target DataObject. + * @brief Returns the ID for the target AbstractDataObject. * * Throws an exception if the path is empty. Otherwise, this will operate * even if the path is otherwise invalid. - * @return DataObject::IdType + * @return AbstractDataObject::IdType */ - DataObject::IdType getId() const; + AbstractDataObject::IdType getId() const; /** - * @brief Returns the DataObject ID at the specified position in the path. + * @brief Returns the AbstractDataObject ID at the specified position in the path. * This method does not perform bounds checking. * @param index - * @return DataObject::IdType + * @return AbstractDataObject::IdType */ - DataObject::IdType getIdAt(usize index) const; + AbstractDataObject::IdType getIdAt(usize index) const; /** - * @brief Returns a pointer to the const DataObject targetted by the path. - * @return const DataObject* + * @brief Returns a pointer to the const AbstractDataObject targetted by the path. + * @return const AbstractDataObject* */ - const DataObject* getData() const; + const AbstractDataObject* getData() const; /** - * @brief Returns a pointer to the const DataObject at the specified path index. + * @brief Returns a pointer to the const AbstractDataObject at the specified path index. * @param index - * @return const DataObject* + * @return const AbstractDataObject* */ - const DataObject* getDataAt(usize index) const; + const AbstractDataObject* getDataAt(usize index) const; /** - * @brief Returns the name of the target DataObject. Throws an exception if - * the DataObject does not exist. + * @brief Returns the name of the target AbstractDataObject. Throws an exception if + * the AbstractDataObject does not exist. * @return std::string */ std::string getName() const; /** - * @brief Returns the name of the DataObject pointed to by the target position - * of the path. Returns "[ missing ]" if the DataObject could not be found. + * @brief Returns the name of the AbstractDataObject pointed to by the target position + * of the path. Returns "[ missing ]" if the AbstractDataObject could not be found. * @param index * @return std::string */ @@ -136,7 +136,7 @@ class SIMPLNX_EXPORT LinkedPath /** * @brief Returns a string representation of the path using the provided divider - * between DataObject names. If no divider is provided, " / " is used instead. + * between AbstractDataObject names. If no divider is provided, " / " is used instead. * * Names are provided using getNameAt(usize). * @param div = " / " @@ -174,14 +174,14 @@ class SIMPLNX_EXPORT LinkedPath protected: /** - * @brief Constructs a LinkedPath for the target DataStructure and vector of DataObject IDs. + * @brief Constructs a LinkedPath for the target DataStructure and vector of AbstractDataObject IDs. * @param dataStructure * @param idPath */ - LinkedPath(const DataStructure* dataStructure, const std::vector& idPath); + LinkedPath(const DataStructure* dataStructure, const std::vector& idPath); private: const DataStructure* m_DataStructure = nullptr; - std::vector m_IdPath; + std::vector m_IdPath; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Messaging/DataAddedMessage.cpp b/src/simplnx/DataStructure/Messaging/DataAddedMessage.cpp index 44f46cde29..4480e1e26b 100644 --- a/src/simplnx/DataStructure/Messaging/DataAddedMessage.cpp +++ b/src/simplnx/DataStructure/Messaging/DataAddedMessage.cpp @@ -4,7 +4,7 @@ using namespace nx::core; -DataAddedMessage::DataAddedMessage(const DataStructure* dataStructure, DataObject::IdType addedId) +DataAddedMessage::DataAddedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType addedId) : AbstractDataStructureMessage(dataStructure) , m_Id(addedId) { @@ -29,12 +29,12 @@ AbstractDataStructureMessage::MessageType DataAddedMessage::getMsgType() const return DataAddedMessage::MsgType; } -DataObject::IdType DataAddedMessage::getId() const +AbstractDataObject::IdType DataAddedMessage::getId() const { return m_Id; } -const DataObject* DataAddedMessage::getData() const +const AbstractDataObject* DataAddedMessage::getData() const { return getDataStructure()->getData(m_Id); } diff --git a/src/simplnx/DataStructure/Messaging/DataAddedMessage.hpp b/src/simplnx/DataStructure/Messaging/DataAddedMessage.hpp index c6549d4190..eb69dc063f 100644 --- a/src/simplnx/DataStructure/Messaging/DataAddedMessage.hpp +++ b/src/simplnx/DataStructure/Messaging/DataAddedMessage.hpp @@ -2,7 +2,7 @@ #include -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp" #include "simplnx/simplnx_export.hpp" @@ -13,8 +13,8 @@ namespace nx::core /** * @class DataAddedMessage * @brief The DataAddedMessage class is a DataStructure message class for - * notifying observers to the addition of a DataObject to the DataStructure. - * The message can be used to retrieve the DataObject in question and all + * notifying observers to the addition of a AbstractDataObject to the DataStructure. + * The message can be used to retrieve the AbstractDataObject in question and all * DataPaths to the created object. */ class SIMPLNX_EXPORT DataAddedMessage : public AbstractDataStructureMessage @@ -23,11 +23,11 @@ class SIMPLNX_EXPORT DataAddedMessage : public AbstractDataStructureMessage static const MessageType MsgType = 1; /** - * @brief Creates a DataAddedMessage for the target DataStructure and DataObject ID. + * @brief Creates a DataAddedMessage for the target DataStructure and AbstractDataObject ID. * @param dataStructure * @param addedId */ - DataAddedMessage(const DataStructure* dataStructure, DataObject::IdType addedId); + DataAddedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType addedId); /** * @brief Copy constructor @@ -50,25 +50,25 @@ class SIMPLNX_EXPORT DataAddedMessage : public AbstractDataStructureMessage MessageType getMsgType() const override; /** - * @brief Returns the added DataObject ID. + * @brief Returns the added AbstractDataObject ID. * @return IdType */ - DataObject::IdType getId() const; + AbstractDataObject::IdType getId() const; /** - * @brief Returns a read-only pointer to the added DataObject. - * @return DataObject* + * @brief Returns a read-only pointer to the added AbstractDataObject. + * @return AbstractDataObject* */ - const DataObject* getData() const; + const AbstractDataObject* getData() const; /** - * @brief Returns all DataPaths to the added DataObject. + * @brief Returns all DataPaths to the added AbstractDataObject. * @return std::vector */ std::vector getDataPaths() const; protected: private: - DataObject::IdType m_Id; + AbstractDataObject::IdType m_Id; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Messaging/DataRemovedMessage.cpp b/src/simplnx/DataStructure/Messaging/DataRemovedMessage.cpp index a97b8c8861..07ede91349 100644 --- a/src/simplnx/DataStructure/Messaging/DataRemovedMessage.cpp +++ b/src/simplnx/DataStructure/Messaging/DataRemovedMessage.cpp @@ -2,7 +2,7 @@ using namespace nx::core; -DataRemovedMessage::DataRemovedMessage(const DataStructure* dataStructure, DataObject::IdType identifier, const std::string& name) +DataRemovedMessage::DataRemovedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType identifier, const std::string& name) : AbstractDataStructureMessage(dataStructure) , m_Name(name) , m_Id(identifier) @@ -30,7 +30,7 @@ AbstractDataStructureMessage::MessageType DataRemovedMessage::getMsgType() const return MsgType; } -DataObject::IdType DataRemovedMessage::getId() const +AbstractDataObject::IdType DataRemovedMessage::getId() const { return m_Id; } diff --git a/src/simplnx/DataStructure/Messaging/DataRemovedMessage.hpp b/src/simplnx/DataStructure/Messaging/DataRemovedMessage.hpp index b4715cd2ce..5f64d79384 100644 --- a/src/simplnx/DataStructure/Messaging/DataRemovedMessage.hpp +++ b/src/simplnx/DataStructure/Messaging/DataRemovedMessage.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp" #include "simplnx/simplnx_export.hpp" @@ -11,9 +11,9 @@ namespace nx::core /** * @class DataRemovedMessage * @brief The DataRemovedMessage class is a DataStructure message class that - * notifies observers that a DataObject has been removed. The message includes - * DataObject's ID and name at the moment of deletion. DataPaths are not - * available because parent information is not available when a DataObject is + * notifies observers that a AbstractDataObject has been removed. The message includes + * AbstractDataObject's ID and name at the moment of deletion. DataPaths are not + * available because parent information is not available when a AbstractDataObject is * being deleted. */ class SIMPLNX_EXPORT DataRemovedMessage : public AbstractDataStructureMessage @@ -23,13 +23,13 @@ class SIMPLNX_EXPORT DataRemovedMessage : public AbstractDataStructureMessage /** * @brief Constructs a DataRemovedMessage for the target DataStructure marking a - * DataObject ID as being removed. The DataObject's name is also provided to + * AbstractDataObject ID as being removed. The AbstractDataObject's name is also provided to * describe the object in a human-readable format. * @param dataStructure * @param identifier * @param name */ - DataRemovedMessage(const DataStructure* dataStructure, DataObject::IdType identifier, const std::string& name); + DataRemovedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType identifier, const std::string& name); /** * @brief Creates a copy of the target DataRemovedMessage. @@ -52,13 +52,13 @@ class SIMPLNX_EXPORT DataRemovedMessage : public AbstractDataStructureMessage MessageType getMsgType() const override; /** - * @brief Returns the removed DataObject's ID. + * @brief Returns the removed AbstractDataObject's ID. * @return IdType */ - DataObject::IdType getId() const; + AbstractDataObject::IdType getId() const; /** - * @brief Returns the name of the removed DataObject. + * @brief Returns the name of the removed AbstractDataObject. * @return std::string */ std::string getName() const; @@ -66,6 +66,6 @@ class SIMPLNX_EXPORT DataRemovedMessage : public AbstractDataStructureMessage protected: private: std::string m_Name; - DataObject::IdType m_Id; + AbstractDataObject::IdType m_Id; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Messaging/DataRenamedMessage.cpp b/src/simplnx/DataStructure/Messaging/DataRenamedMessage.cpp index 2467b78caf..15d80b66eb 100644 --- a/src/simplnx/DataStructure/Messaging/DataRenamedMessage.cpp +++ b/src/simplnx/DataStructure/Messaging/DataRenamedMessage.cpp @@ -4,7 +4,7 @@ using namespace nx::core; -DataRenamedMessage::DataRenamedMessage(const DataStructure* dataStructure, DataObject::IdType identifier, const std::string& oldName, const std::string& newName) +DataRenamedMessage::DataRenamedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType identifier, const std::string& oldName, const std::string& newName) : AbstractDataStructureMessage(dataStructure) , m_Id(identifier) , m_OldName(oldName) @@ -35,12 +35,12 @@ AbstractDataStructureMessage::MessageType DataRenamedMessage::getMsgType() const return MsgType; } -DataObject::IdType DataRenamedMessage::getDataId() const +AbstractDataObject::IdType DataRenamedMessage::getDataId() const { return m_Id; } -const DataObject* DataRenamedMessage::getData() const +const AbstractDataObject* DataRenamedMessage::getData() const { return getDataStructure()->getData(m_Id); } diff --git a/src/simplnx/DataStructure/Messaging/DataRenamedMessage.hpp b/src/simplnx/DataStructure/Messaging/DataRenamedMessage.hpp index 85390feed4..2012e841c2 100644 --- a/src/simplnx/DataStructure/Messaging/DataRenamedMessage.hpp +++ b/src/simplnx/DataStructure/Messaging/DataRenamedMessage.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp" #include "simplnx/simplnx_export.hpp" @@ -10,8 +10,8 @@ namespace nx::core /** * @class DataRenamedMessage * @brief The DataRenamedMessage class is a DataStructure message class used - * to signal that a DataObject's name was changed. The message includes the - * target DataObject's ID, the previous name, and the name it was changed to. + * to signal that a AbstractDataObject's name was changed. The message includes the + * target AbstractDataObject's ID, the previous name, and the name it was changed to. */ class SIMPLNX_EXPORT DataRenamedMessage : public AbstractDataStructureMessage { @@ -19,14 +19,14 @@ class SIMPLNX_EXPORT DataRenamedMessage : public AbstractDataStructureMessage static const MessageType MsgType = 3; /** - * @brief Constructs a DataRenamedMessage specifying which DataObject was + * @brief Constructs a DataRenamedMessage specifying which AbstractDataObject was * renamed, its old name, and new name. * @param dataStructure * @param dataId * @param prevName * @param newName */ - DataRenamedMessage(const DataStructure* dataStructure, DataObject::IdType dataId, const std::string& prevName, const std::string& newName); + DataRenamedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType dataId, const std::string& prevName, const std::string& newName); /** * @brief Creates a copy of the target DataRenamedMessage. @@ -52,28 +52,28 @@ class SIMPLNX_EXPORT DataRenamedMessage : public AbstractDataStructureMessage * @brief Returns the renamed object's ID. * @return IdType */ - DataObject::IdType getDataId() const; + AbstractDataObject::IdType getDataId() const; /** - * @brief Returns a const pointer to the renamed DataObject. - * @return DataObject* + * @brief Returns a const pointer to the renamed AbstractDataObject. + * @return AbstractDataObject* */ - const DataObject* getData() const; + const AbstractDataObject* getData() const; /** - * @brief Returns the DataObject's previous name. + * @brief Returns the AbstractDataObject's previous name. * @return std::string */ std::string getPreviousName() const; /** - * @brief Returns the DataObject's new name. + * @brief Returns the AbstractDataObject's new name. * @return std::string */ std::string getNewName() const; private: - DataObject::IdType m_Id; + AbstractDataObject::IdType m_Id; std::string m_OldName; std::string m_NewName; }; diff --git a/src/simplnx/DataStructure/Messaging/DataReparentedMessage.cpp b/src/simplnx/DataStructure/Messaging/DataReparentedMessage.cpp index 48b89b1203..cd37b05308 100644 --- a/src/simplnx/DataStructure/Messaging/DataReparentedMessage.cpp +++ b/src/simplnx/DataStructure/Messaging/DataReparentedMessage.cpp @@ -4,7 +4,7 @@ using namespace nx::core; -DataReparentedMessage::DataReparentedMessage(const DataStructure* dataStructure, DataObject::IdType targetData, DataObject::IdType targetParent, bool parentAdded) +DataReparentedMessage::DataReparentedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType targetData, AbstractDataObject::IdType targetParent, bool parentAdded) : AbstractDataStructureMessage(dataStructure) , m_TargetId(targetData) , m_ParentId(targetParent) @@ -35,22 +35,22 @@ AbstractDataStructureMessage::MessageType DataReparentedMessage::getMsgType() co return MsgType; } -DataObject::IdType DataReparentedMessage::getTargetId() const +AbstractDataObject::IdType DataReparentedMessage::getTargetId() const { return m_TargetId; } -DataObject::IdType DataReparentedMessage::getParentId() const +AbstractDataObject::IdType DataReparentedMessage::getParentId() const { return m_ParentId; } -const DataObject* DataReparentedMessage::getTargetData() const +const AbstractDataObject* DataReparentedMessage::getTargetData() const { return getDataStructure()->getData(m_TargetId); } -const DataObject* DataReparentedMessage::getParentData() const +const AbstractDataObject* DataReparentedMessage::getParentData() const { return getDataStructure()->getData(m_ParentId); } diff --git a/src/simplnx/DataStructure/Messaging/DataReparentedMessage.hpp b/src/simplnx/DataStructure/Messaging/DataReparentedMessage.hpp index 4e42cf61d3..3b85ee4f41 100644 --- a/src/simplnx/DataStructure/Messaging/DataReparentedMessage.hpp +++ b/src/simplnx/DataStructure/Messaging/DataReparentedMessage.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/Messaging/AbstractDataStructureMessage.hpp" #include "simplnx/simplnx_export.hpp" @@ -11,7 +11,7 @@ namespace nx::core /** * @class DataReparentedMessage * @brief The DataReparentedMessage class is a type of DataStructure message - * emitted when a DataObject gains or loses a parent object. The message + * emitted when a AbstractDataObject gains or loses a parent object. The message * includes the target object's ID, the target parent's ID, and whether or not * the parent was added or removed. */ @@ -21,14 +21,14 @@ class SIMPLNX_EXPORT DataReparentedMessage : public AbstractDataStructureMessage static const MessageType MsgType = 4; /** - * @brief Constructs a DataReparentedMessage, specifying the target DataObject, + * @brief Constructs a DataReparentedMessage, specifying the target AbstractDataObject, * parent ID, and whether or not the parent was added or removed. * @param dataStructure * @param targetData * @param targetParent * @param parentAdded */ - DataReparentedMessage(const DataStructure* dataStructure, DataObject::IdType targetData, DataObject::IdType targetParent, bool parentAdded = true); + DataReparentedMessage(const DataStructure* dataStructure, AbstractDataObject::IdType targetData, AbstractDataObject::IdType targetParent, bool parentAdded = true); /** * @brief Copy constructor @@ -51,45 +51,45 @@ class SIMPLNX_EXPORT DataReparentedMessage : public AbstractDataStructureMessage MessageType getMsgType() const override; /** - * @brief Returns the target DataObject ID. + * @brief Returns the target AbstractDataObject ID. * @return IdType */ - DataObject::IdType getTargetId() const; + AbstractDataObject::IdType getTargetId() const; /** - * @brief Returns the parent DataObject ID. + * @brief Returns the parent AbstractDataObject ID. * @return IdType */ - DataObject::IdType getParentId() const; + AbstractDataObject::IdType getParentId() const; /** - * @brief Returns a read-only pointer to the target DataObject. - * @return DataObject* + * @brief Returns a read-only pointer to the target AbstractDataObject. + * @return AbstractDataObject* */ - const DataObject* getTargetData() const; + const AbstractDataObject* getTargetData() const; /** * @brief Returns a read-only pointer to the target parent. - * @return DataObject* + * @return AbstractDataObject* */ - const DataObject* getParentData() const; + const AbstractDataObject* getParentData() const; /** - * @brief Returns true if the target parent was added to the DataObject. + * @brief Returns true if the target parent was added to the AbstractDataObject. * @return bool */ bool wasParentAdded() const; /** - * @brief Returns true if the target parent was removed from the DataObject. + * @brief Returns true if the target parent was removed from the AbstractDataObject. * @return bool */ bool wasParentRemoved() const; protected: private: - DataObject::IdType m_TargetId; - DataObject::IdType m_ParentId; + AbstractDataObject::IdType m_TargetId; + AbstractDataObject::IdType m_ParentId; bool m_ParentAdded = true; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/Metadata.hpp b/src/simplnx/DataStructure/Metadata.hpp index 2290095b91..8d99e351fd 100644 --- a/src/simplnx/DataStructure/Metadata.hpp +++ b/src/simplnx/DataStructure/Metadata.hpp @@ -12,7 +12,7 @@ namespace nx::core /** * @class Metadata * @brief The Metadata class stores additional information related to a - * DataObject. Information is stored using key value pairs such that many + * AbstractDataObject. Information is stored using key value pairs such that many * pieces of information can be quickly inserted or retrieved. The Metadata * class is designed such that any type of information can be included from * color formats, descriptions, data source, etc. diff --git a/src/simplnx/DataStructure/Montage/AbstractMontage.cpp b/src/simplnx/DataStructure/Montage/AbstractMontage.cpp index fe3517b6c0..90aaa51bb9 100644 --- a/src/simplnx/DataStructure/Montage/AbstractMontage.cpp +++ b/src/simplnx/DataStructure/Montage/AbstractMontage.cpp @@ -1,6 +1,6 @@ #include "AbstractMontage.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" using namespace nx::core; @@ -28,7 +28,7 @@ AbstractMontage::AbstractMontage(AbstractMontage&& other) AbstractMontage::~AbstractMontage() = default; -DataObject::Type AbstractMontage::getDataObjectType() const +AbstractDataObject::Type AbstractMontage::getDataObjectType() const { return Type::AbstractMontage; } @@ -97,9 +97,9 @@ const AbstractMontage::CollectionType& AbstractMontage::getCollection() const return m_Collection; } -bool AbstractMontage::canInsert(const DataObject* obj) const +bool AbstractMontage::canInsert(const AbstractDataObject* obj) const { - if(!dynamic_cast(obj)) + if(!dynamic_cast(obj)) { return false; } diff --git a/src/simplnx/DataStructure/Montage/AbstractMontage.hpp b/src/simplnx/DataStructure/Montage/AbstractMontage.hpp index 6f52cbe5e8..837b166d0c 100644 --- a/src/simplnx/DataStructure/Montage/AbstractMontage.hpp +++ b/src/simplnx/DataStructure/Montage/AbstractMontage.hpp @@ -9,7 +9,7 @@ namespace nx::core { class AbstractTileIndex; -class IGeometry; +class AbstractGeometry; /** * @class AbstractMontage @@ -18,12 +18,12 @@ class IGeometry; class SIMPLNX_EXPORT AbstractMontage : public BaseGroup { public: - using CollectionType = std::vector; + using CollectionType = std::vector; using Iterator = CollectionType::iterator; using ConstIterator = CollectionType::const_iterator; using BoundsType = void; - static inline constexpr StringLiteral k_TypeName = "AbstractMontage"; + static constexpr StringLiteral k_TypeName = "AbstractMontage"; /** * @brief Creates a copy of the target AbstractMontage but does not add it to @@ -46,7 +46,7 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns the number of tiles in the montage. @@ -82,17 +82,17 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup * @brief Returns a pointer to the geometry at the specified tile index. * Returns nullptr if no geometry was found. * @param index - * @return IGeometry* + * @return AbstractGeometry* */ - virtual IGeometry* getGeometry(const AbstractTileIndex* index) = 0; + virtual AbstractGeometry* getGeometry(const AbstractTileIndex* index) = 0; /** * @brief Returns a pointer to the geometry at the specified tile index. * Returns nullptr if no geometry was found. * @param index - * @return const IGeometry* + * @return const AbstractGeometry* */ - virtual const IGeometry* getGeometry(const AbstractTileIndex* index) const = 0; + virtual const AbstractGeometry* getGeometry(const AbstractTileIndex* index) const = 0; /** * @brief Returns the tile index for the specified geometry. This is a pure @@ -101,7 +101,7 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup * @param geom * @return std::shared_ptr */ - virtual std::shared_ptr getTileIndex(IGeometry* geom) const = 0; + virtual std::shared_ptr getTileIndex(AbstractGeometry* geom) const = 0; /** * @brief Sets the geometry for the target tile index. The implementation is @@ -109,7 +109,7 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup * @param index * @param geom */ - virtual void setGeometry(const AbstractTileIndex* index, IGeometry* geom) = 0; + virtual void setGeometry(const AbstractTileIndex* index, AbstractGeometry* geom) = 0; /** * @brief Returns an iterator to the beginning of the montage. @@ -154,7 +154,7 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup AbstractMontage(DataStructure& dataStructure, std::string name, IdType importId); /** - * @brief Checks if the specified DataObject can be added to the montage. + * @brief Checks if the specified AbstractDataObject can be added to the montage. * Returns true if the object can be added. Returns false otherwise. * This is an override of the method in BaseGroup to ensure that only @@ -162,7 +162,7 @@ class SIMPLNX_EXPORT AbstractMontage : public BaseGroup * @param obj * @return bool */ - bool canInsert(const DataObject* obj) const override; + bool canInsert(const AbstractDataObject* obj) const override; /** * @brief Returns a reference of the collection for use in derived classes. diff --git a/src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp b/src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp index da277d5e17..8ba04964c8 100644 --- a/src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp +++ b/src/simplnx/DataStructure/Montage/AbstractTileIndex.hpp @@ -5,7 +5,7 @@ namespace nx::core { -class IGeometry; +class AbstractGeometry; class AbstractMontage; /** @@ -46,9 +46,9 @@ class SIMPLNX_EXPORT AbstractTileIndex /** * @brief Returns the geometry specified by the tile index. - * @return IGeometry* + * @return AbstractGeometry* */ - virtual const IGeometry* getGeometry() const = 0; + virtual const AbstractGeometry* getGeometry() const = 0; /** * @brief Checks if the index contains matches the conditions to be diff --git a/src/simplnx/DataStructure/Montage/GridMontage.cpp b/src/simplnx/DataStructure/Montage/GridMontage.cpp index d1afa1eeba..01c0cb5523 100644 --- a/src/simplnx/DataStructure/Montage/GridMontage.cpp +++ b/src/simplnx/DataStructure/Montage/GridMontage.cpp @@ -1,7 +1,7 @@ #include "GridMontage.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include @@ -54,12 +54,12 @@ std::string GridMontage::getTypeName() const return k_TypeName; } -DataObject* GridMontage::shallowCopy() +AbstractDataObject* GridMontage::shallowCopy() { return new GridMontage(*this); } -std::shared_ptr GridMontage::deepCopy(const DataPath& copyPath) +std::shared_ptr GridMontage::deepCopy(const DataPath& copyPath) { throw std::runtime_error("GridMontage deepCopy has not been implemented."); } @@ -138,7 +138,7 @@ GridTileIndex GridMontage::getTileIndex(const SizeVec3& pos) const return getTileIndex(pos[0], pos[1], pos[2]); } -std::optional GridMontage::getTilePosOfGeometry(const IGeometry* geom) const +std::optional GridMontage::getTilePosOfGeometry(const AbstractGeometry* geom) const { for(usize i = 0; i < getTileCount(); i++) { @@ -150,7 +150,7 @@ std::optional GridMontage::getTilePosOfGeometry(const IGeometry* geom) return {}; } -std::shared_ptr GridMontage::getTileIndex(IGeometry* geom) const +std::shared_ptr GridMontage::getTileIndex(AbstractGeometry* geom) const { auto tilePos = getTilePosOfGeometry(geom); if(!tilePos) @@ -160,7 +160,7 @@ std::shared_ptr GridMontage::getTileIndex(IGeometry* geom) co return std::shared_ptr(new GridTileIndex(this, tilePos.value())); } -IGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) +AbstractGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) { auto pos = dynamic_cast(index); if(!pos) @@ -170,7 +170,7 @@ IGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) return getGeometry(pos->getTilePos()); } -const IGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) const +const AbstractGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) const { auto pos = dynamic_cast(index); if(!pos) @@ -180,19 +180,19 @@ const IGeometry* GridMontage::getGeometry(const AbstractTileIndex* index) const return getGeometry(pos->getTilePos()); } -IGeometry* GridMontage::getGeometry(const SizeVec3& position) +AbstractGeometry* GridMontage::getGeometry(const SizeVec3& position) { usize index = getOffsetFromTilePos(position); return getCollection()[index]; } -const IGeometry* GridMontage::getGeometry(const SizeVec3& position) const +const AbstractGeometry* GridMontage::getGeometry(const SizeVec3& position) const { usize index = getOffsetFromTilePos(position); return getCollection()[index]; } -void GridMontage::setGeometry(const AbstractTileIndex* index, IGeometry* geom) +void GridMontage::setGeometry(const AbstractTileIndex* index, AbstractGeometry* geom) { auto pos = dynamic_cast(index); if(!pos) @@ -202,7 +202,7 @@ void GridMontage::setGeometry(const AbstractTileIndex* index, IGeometry* geom) setGeometry(pos->getTilePos(), geom); } -void GridMontage::setGeometry(const SizeVec3& position, IGeometry* geom) +void GridMontage::setGeometry(const SizeVec3& position, AbstractGeometry* geom) { CollectionType& collection = getCollection(); usize index = getOffsetFromTilePos(position); diff --git a/src/simplnx/DataStructure/Montage/GridMontage.hpp b/src/simplnx/DataStructure/Montage/GridMontage.hpp index f6aceba9f0..40eda25189 100644 --- a/src/simplnx/DataStructure/Montage/GridMontage.hpp +++ b/src/simplnx/DataStructure/Montage/GridMontage.hpp @@ -21,12 +21,12 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage using DimensionsType = SizeVec3; using TileIdType = GridTileIndex; - static inline constexpr StringLiteral k_TypeName = "GridMontage"; + static constexpr StringLiteral k_TypeName = "GridMontage"; /** * @brief Attempts to create a new GridMontage and insert it into the * DataStructure. If the parentId is provided, then the created montage will - * be nested under the target DataObject. Otherwise, the montage will be + * be nested under the target AbstractDataObject. Otherwise, the montage will be * placed directly under the DataStructure. * * If the created montage cannot be placed under the target parent, then this @@ -42,14 +42,14 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage /** * @brief Attempts to create a new GridMontage and insert it into the * DataStructure. If the parentId is provided, then the created montage will - * be nested under the target DataObject. Otherwise, the montage will be + * be nested under the target AbstractDataObject. Otherwise, the montage will be * placed directly under the DataStructure. * * If the created montage cannot be placed under the target parent, then this * method returns nullptr. Otherwise, this method returns a pointer to the * created montage. * - * Unlike Create, Import allows the DataObject ID to be set for use in + * Unlike Create, Import allows the AbstractDataObject ID to be set for use in * importing data. * @param dataStructure * @param name @@ -76,25 +76,25 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage ~GridMontage() override; /** - * @brief Returns the typename of the DataObject as a std::string. + * @brief Returns the typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override; /** - * @brief Returns a shallow copy of the current DataObject but does not add + * @brief Returns a shallow copy of the current AbstractDataObject but does not add * it to the DataStructure. It is up to the caller to delete the returned * value. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** - * @brief Returns a deep copy of the current DataObject but does not add it + * @brief Returns a deep copy of the current AbstractDataObject but does not add it * to the DataStructure. It is up to the caller to delete the returned value. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief Returns the number of rows in the montage. @@ -154,7 +154,7 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage * @param geom * @return std::optional */ - std::optional getTilePosOfGeometry(const IGeometry* geom) const; + std::optional getTilePosOfGeometry(const AbstractGeometry* geom) const; /** * @brief Returns the tile index for the target geometry. Returns nullptr if the geometry @@ -162,23 +162,23 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage * @param geom * @return std::shared_ptr */ - std::shared_ptr getTileIndex(IGeometry* geom) const override; + std::shared_ptr getTileIndex(AbstractGeometry* geom) const override; /** * @brief Returns a pointer to the geometry at the specified tile index. Returns nullptr * if no geometry was found. * @param index - * @return IGeometry* + * @return AbstractGeometry* */ - IGeometry* getGeometry(const AbstractTileIndex* index) override; + AbstractGeometry* getGeometry(const AbstractTileIndex* index) override; /** * @brief Returns a pointer to the geometry at the specified tile index. Returns nullptr * if no geometry was found. * @param index - * @return const IGeometry* + * @return const AbstractGeometry* */ - const IGeometry* getGeometry(const AbstractTileIndex* index) const override; + const AbstractGeometry* getGeometry(const AbstractTileIndex* index) const override; /** * @brief Sets the geometry at the position specified by the provided @@ -187,7 +187,7 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage * @param index * @param geom */ - void setGeometry(const AbstractTileIndex* index, IGeometry* geom) override; + void setGeometry(const AbstractTileIndex* index, AbstractGeometry* geom) override; /** * @brief Sets the geometry at the specified 3D tile position. Does nothing @@ -195,21 +195,21 @@ class SIMPLNX_EXPORT GridMontage : virtual public AbstractMontage * @param position * @param geom */ - void setGeometry(const SizeVec3& position, IGeometry* geom); + void setGeometry(const SizeVec3& position, AbstractGeometry* geom); /** * @brief Returns the geometry at the specified position. * Returns nullptr if no geometry could be found. - * @return const IGeometry* + * @return const AbstractGeometry* */ - IGeometry* getGeometry(const SizeVec3& position); + AbstractGeometry* getGeometry(const SizeVec3& position); /** * @brief Returns the geometry at the specified position. * Returns nullptr if no geometry could be found. - * @return const IGeometry* + * @return const AbstractGeometry* */ - const IGeometry* getGeometry(const SizeVec3& position) const; + const AbstractGeometry* getGeometry(const SizeVec3& position) const; /** * @brief Returns a TooltipGenerator for generating the appropriate HTML tooltips. diff --git a/src/simplnx/DataStructure/Montage/GridTileIndex.cpp b/src/simplnx/DataStructure/Montage/GridTileIndex.cpp index e801ccd23f..a9e284ee37 100644 --- a/src/simplnx/DataStructure/Montage/GridTileIndex.cpp +++ b/src/simplnx/DataStructure/Montage/GridTileIndex.cpp @@ -51,7 +51,7 @@ SizeVec3 GridTileIndex::getTilePos() const return m_Pos; } -const IGeometry* GridTileIndex::getGeometry() const +const AbstractGeometry* GridTileIndex::getGeometry() const { auto montage = dynamic_cast(getMontage()); if(!montage) diff --git a/src/simplnx/DataStructure/Montage/GridTileIndex.hpp b/src/simplnx/DataStructure/Montage/GridTileIndex.hpp index 4942c999a8..e086619768 100644 --- a/src/simplnx/DataStructure/Montage/GridTileIndex.hpp +++ b/src/simplnx/DataStructure/Montage/GridTileIndex.hpp @@ -64,9 +64,9 @@ class SIMPLNX_EXPORT GridTileIndex : public AbstractTileIndex /** * @brief Returns a const pointer to the target geometry. - * @return IGeometry* + * @return AbstractGeometry* */ - const IGeometry* getGeometry() const override; + const AbstractGeometry* getGeometry() const override; /** * @brief Returns a TooltipGenerator containing information for generating an diff --git a/src/simplnx/DataStructure/NeighborList.cpp b/src/simplnx/DataStructure/NeighborList.cpp index b603516ab5..eaf17c62a7 100644 --- a/src/simplnx/DataStructure/NeighborList.cpp +++ b/src/simplnx/DataStructure/NeighborList.cpp @@ -10,7 +10,7 @@ namespace nx::core { template NeighborList::NeighborList(DataStructure& dataStructure, const std::string& name, const ShapeType& tupleShape) -: INeighborList(dataStructure, name) +: AbstractNeighborList(dataStructure, name) , m_Store(std::make_shared>(tupleShape)) , m_IsAllocated(false) , m_InitValue(static_cast(0.0)) @@ -19,7 +19,7 @@ NeighborList::NeighborList(DataStructure& dataStructure, const std::string& n template NeighborList::NeighborList(DataStructure& dataStructure, const std::string& name, const std::vector& dataVector, IdType importId) -: INeighborList(dataStructure, name, importId) +: AbstractNeighborList(dataStructure, name, importId) , m_Store(std::make_shared>(dataVector)) , m_IsAllocated(true) , m_InitValue(static_cast(0.0)) @@ -28,7 +28,7 @@ NeighborList::NeighborList(DataStructure& dataStructure, const std::string& n template NeighborList::NeighborList(DataStructure& dataStructure, const std::string& name, const std::shared_ptr& dataStore, IdType importId) -: INeighborList(dataStructure, name, importId) +: AbstractNeighborList(dataStructure, name, importId) , m_Store(dataStore) , m_IsAllocated(true) , m_InitValue(static_cast(0.0)) @@ -37,7 +37,7 @@ NeighborList::NeighborList(DataStructure& dataStructure, const std::string& n template NeighborList::NeighborList(DataStructure& dataStructure, const std::string& name, const std::shared_ptr& dataStore) -: INeighborList(dataStructure, name) +: AbstractNeighborList(dataStructure, name) , m_Store(dataStore) , m_IsAllocated(true) , m_InitValue(static_cast(0.0)) @@ -95,7 +95,7 @@ NeighborList* NeighborList::Import(DataStructure& dataStructure, const std template NeighborList::NeighborList(const NeighborList& other) -: INeighborList(other) +: AbstractNeighborList(other) , m_Store(other.m_Store) , m_IsAllocated(other.m_IsAllocated) , m_InitValue(other.m_InitValue) @@ -128,13 +128,13 @@ NeighborList& NeighborList::operator=(NeighborList&& rhs) noexcept } template -DataObject* NeighborList::shallowCopy() +AbstractDataObject* NeighborList::shallowCopy() { return new NeighborList(*this); } template -std::shared_ptr NeighborList::deepCopy(const DataPath& copyPath) +std::shared_ptr NeighborList::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); if(dataStruct.containsData(copyPath)) @@ -397,7 +397,7 @@ typename NeighborList::VectorType NeighborList::at(usize grainId) const } template -DataObject::Type NeighborList::getDataObjectType() const +AbstractDataObject::Type NeighborList::getDataObjectType() const { return Type::NeighborList; } diff --git a/src/simplnx/DataStructure/NeighborList.hpp b/src/simplnx/DataStructure/NeighborList.hpp index dd6cef9bce..8389900d79 100644 --- a/src/simplnx/DataStructure/NeighborList.hpp +++ b/src/simplnx/DataStructure/NeighborList.hpp @@ -3,7 +3,7 @@ #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/Types.hpp" #include "simplnx/DataStructure/AbstractListStore.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" namespace nx::core { @@ -13,7 +13,7 @@ namespace nx::core * @tparam T */ template -class NeighborList : public INeighborList +class NeighborList : public AbstractNeighborList { public: using value_type = T; @@ -76,16 +76,16 @@ class NeighborList : public INeighborList /** * @brief Returns a shallow copy of the NeighborList without copying data. * THE CALLING CODE MUST DISPOSE OF THE RETURNED OBJECT. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override; + AbstractDataObject* shallowCopy() override; /** * @brief Returns a deep copy of the NeighborList including a deep copy of the * data. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; /** * @brief Gives this array a human readable name @@ -368,7 +368,7 @@ class NeighborList : public INeighborList * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; /** * @brief Returns a pointer to the underlying IListStore. diff --git a/src/simplnx/DataStructure/ReadMe.md b/src/simplnx/DataStructure/ReadMe.md index 02b689dfd5..7ce7180909 100644 --- a/src/simplnx/DataStructure/ReadMe.md +++ b/src/simplnx/DataStructure/ReadMe.md @@ -2,7 +2,7 @@ ## Adding DataObject types -When adding DataObject types, additional IDataFactories need to be created for each IDataIOManager subclass. Simplnx provides the HDF5 version of IDataIOManager and IDataFactory, but plugins providing additional formats will need to be updated to enable reading and writing to the new types. +When adding DataObject types, additional IDataFactories need to be created for each AbstractDataIOManager subclass. Simplnx provides the HDF5 version of AbstractDataIOManager and IDataFactory, but plugins providing additional formats will need to be updated to enable reading and writing to the new types. ## Adding IO formats @@ -11,7 +11,7 @@ simplnx comes with HDF5 readers and writers by default. To add additional IO for Required subclasses: - IDataFactory for each concrete DataObject type -- IDataIOManager for the format +- AbstractDataIOManager for the format - Add IDataFactory subclasses to the IO Manager diff --git a/src/simplnx/DataStructure/ScalarData.hpp b/src/simplnx/DataStructure/ScalarData.hpp index d1fe1ee164..1e01732125 100644 --- a/src/simplnx/DataStructure/ScalarData.hpp +++ b/src/simplnx/DataStructure/ScalarData.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/TypeTraits.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" namespace nx::core { @@ -18,7 +18,7 @@ inline constexpr StringLiteral k_TypeName = "ScalarData"; * retrieved or edited after the object has been constructed. */ template -class ScalarData : public DataObject +class ScalarData : public AbstractDataObject { public: using value_type = T; @@ -56,7 +56,7 @@ class ScalarData : public DataObject * If the ScalarData cannot be created, this method returns nullptr. * Otherwise, a pointer to the created ScalarData will be returned. * - * Unlike Create, Import allows setting the DataObject ID for use in + * Unlike Create, Import allows setting the AbstractDataObject ID for use in * importing DataObjects from external sources. * @param dataStructure * @param name @@ -81,7 +81,7 @@ class ScalarData : public DataObject * @param other */ ScalarData(const ScalarData& other) - : DataObject(other) + : AbstractDataObject(other) , m_Data(other.m_Data) { } @@ -93,7 +93,7 @@ class ScalarData : public DataObject * @param other */ ScalarData(ScalarData&& other) noexcept - : DataObject(std::move(other)) + : AbstractDataObject(std::move(other)) , m_Data(std::move(other.m_Data)) { } @@ -104,7 +104,7 @@ class ScalarData : public DataObject * @brief Returns an enumeration of the class or subclass. Used for quick comparison or type deduction * @return */ - DataObject::Type getDataObjectType() const override + AbstractDataObject::Type getDataObjectType() const override { return Type::ScalarData; } @@ -166,7 +166,7 @@ class ScalarData : public DataObject } /** - * @brief Returns typename of the DataObject as a std::string. + * @brief Returns typename of the AbstractDataObject as a std::string. * @return std::string */ std::string getTypeName() const override @@ -178,9 +178,9 @@ class ScalarData : public DataObject * @brief Returns a shallow copy of the ScalarData. The created ScalarData * is not added to the DataStructure, and it is up to the caller to delete * it. - * @return DataObject* + * @return AbstractDataObject* */ - DataObject* shallowCopy() override + AbstractDataObject* shallowCopy() override { return new ScalarData(*this); } @@ -188,9 +188,9 @@ class ScalarData : public DataObject /** * @brief Returns a deep copy of the ScalarData. This copy is not added to * the DataStructure, and it is up to the caller to delete it. - * @return DataObject* + * @return AbstractDataObject* */ - std::shared_ptr deepCopy(const DataPath& copyPath) override + std::shared_ptr deepCopy(const DataPath& copyPath) override { auto& dataStruct = *getDataStructure(); if(dataStruct.containsData(copyPath)) @@ -286,7 +286,7 @@ class ScalarData : public DataObject * @param defaultValue */ ScalarData(DataStructure& dataStructure, const std::string& name, value_type defaultValue) - : DataObject(dataStructure, name) + : AbstractDataObject(dataStructure, name) , m_Data(defaultValue) { } @@ -299,7 +299,7 @@ class ScalarData : public DataObject * @param defaultValue */ ScalarData(DataStructure& dataStructure, const std::string& name, IdType importId, value_type defaultValue) - : DataObject(dataStructure, name, importId) + : AbstractDataObject(dataStructure, name, importId) , m_Data(defaultValue) { } diff --git a/src/simplnx/DataStructure/StringArray.cpp b/src/simplnx/DataStructure/StringArray.cpp index a9cded53c3..569a4a7fc1 100644 --- a/src/simplnx/DataStructure/StringArray.cpp +++ b/src/simplnx/DataStructure/StringArray.cpp @@ -35,30 +35,30 @@ StringArray* StringArray::Import(DataStructure& dataStructure, const std::string } StringArray::StringArray(DataStructure& dataStructure, std::string name) -: IArray(dataStructure, std::move(name)) +: AbstractArray(dataStructure, std::move(name)) { } StringArray::StringArray(DataStructure& dataStructure, std::string name, const ShapeType& tupleShape, collection_type strings) -: IArray(dataStructure, std::move(name)) +: AbstractArray(dataStructure, std::move(name)) { m_Strings = std::make_shared(strings, tupleShape); } StringArray::StringArray(DataStructure& dataStructure, std::string name, std::shared_ptr& store) -: IArray(dataStructure, std::move(name)) +: AbstractArray(dataStructure, std::move(name)) , m_Strings(store) { } StringArray::StringArray(DataStructure& dataStructure, std::string name, const ShapeType& tupleShape, IdType importId, collection_type strings) -: IArray(dataStructure, std::move(name), importId) +: AbstractArray(dataStructure, std::move(name), importId) { m_Strings = std::make_shared(strings, tupleShape); } StringArray::StringArray(const StringArray& other) -: IArray(other) +: AbstractArray(other) , m_Strings(other.m_Strings) { } @@ -78,39 +78,39 @@ StringArray::StringArray(const StringArray& other) * The initialization performed by each mem-initializer constitutes a full-expression. * Any expression in a mem-initializer is evaluated as part of the full-expression that performs the initialization. * - * Thus, disregard clang-tidy, the second move here is still a valid one because the IArray portion of the object will + * Thus, disregard clang-tidy, the second move here is still a valid one because the AbstractArray portion of the object will * be moved first leaving the derived class member variables (m_Strings) in a valid state as only - * the base (IArray) has been marked-to-be/or-is destroyed, however, `other` should not be used after ctor initializer list as + * the base (AbstractArray) has been marked-to-be/or-is destroyed, however, `other` should not be used after ctor initializer list as * it will no longer be in a valid state. */ StringArray::StringArray(StringArray&& other) noexcept -: IArray(std::move(other)) +: AbstractArray(std::move(other)) , m_Strings(std::move(other.m_Strings)) { } StringArray::~StringArray() noexcept = default; -DataObject::Type StringArray::getDataObjectType() const +AbstractDataObject::Type StringArray::getDataObjectType() const { - return DataObject::Type::StringArray; + return IDataObject::Type::StringArray; } std::string StringArray::getTypeName() const { return k_TypeName; } -IArray::ArrayType StringArray::getArrayType() const +AbstractArray::ArrayType StringArray::getArrayType() const { return ArrayType::StringArray; } -DataObject* StringArray::shallowCopy() +AbstractDataObject* StringArray::shallowCopy() { return new StringArray(*this); } -std::shared_ptr StringArray::deepCopy(const DataPath& copyPath) +std::shared_ptr StringArray::deepCopy(const DataPath& copyPath) { auto& dataStruct = getDataStructureRef(); if(dataStruct.containsData(copyPath)) @@ -199,14 +199,14 @@ StringArray::const_iterator StringArray::cend() const StringArray& StringArray::operator=(const StringArray& rhs) { - DataObject::operator=(rhs); + AbstractDataObject::operator=(rhs); m_Strings = rhs.m_Strings; return *this; } StringArray& StringArray::operator=(StringArray&& rhs) noexcept { - DataObject::operator=(rhs); + AbstractDataObject::operator=(rhs); m_Strings = std::move(rhs.m_Strings); return *this; } @@ -257,7 +257,7 @@ void StringArray::swapTuples(usize index0, usize index1) (*m_Strings)[index1] = value; } -void StringArray::setStore(const std::shared_ptr& newStore) +void StringArray::setStore(const std::shared_ptr& newStore) { m_Strings = newStore; } diff --git a/src/simplnx/DataStructure/StringArray.hpp b/src/simplnx/DataStructure/StringArray.hpp index 6309d194ae..06ba54db43 100644 --- a/src/simplnx/DataStructure/StringArray.hpp +++ b/src/simplnx/DataStructure/StringArray.hpp @@ -1,24 +1,24 @@ #pragma once -#include "simplnx/DataStructure/AbstractStringStore.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" +#include "simplnx/DataStructure/IStringStore.hpp" #include namespace nx::core { -class SIMPLNX_EXPORT StringArray : public IArray +class SIMPLNX_EXPORT StringArray : public AbstractArray { public: using value_type = std::string; using collection_type = std::vector; using reference = value_type&; using const_reference = const value_type&; - using store_type = AbstractStringStore; + using store_type = IStringStore; using iterator = typename store_type::iterator; using const_iterator = typename store_type::const_iterator; - static inline constexpr StringLiteral k_TypeName = "StringArray"; + static constexpr StringLiteral k_TypeName = "StringArray"; static StringArray* Create(DataStructure& dataStructure, const std::string_view& name, const std::optional& parentId = {}); static StringArray* CreateWithValues(DataStructure& dataStructure, const std::string_view& name, const ShapeType& tupleShape, collection_type strings, const std::optional& parentId = {}); @@ -31,7 +31,7 @@ class SIMPLNX_EXPORT StringArray : public IArray ~StringArray() noexcept override; - DataObject::Type getDataObjectType() const override; + AbstractDataObject::Type getDataObjectType() const override; std::string getTypeName() const override; /** @@ -40,8 +40,8 @@ class SIMPLNX_EXPORT StringArray : public IArray */ ArrayType getArrayType() const override; - DataObject* shallowCopy() override; - std::shared_ptr deepCopy(const DataPath& copyPath) override; + AbstractDataObject* shallowCopy() override; + std::shared_ptr deepCopy(const DataPath& copyPath) override; size_t size() const override; collection_type values() const; @@ -130,7 +130,7 @@ class SIMPLNX_EXPORT StringArray : public IArray */ void resizeTuples(const ShapeType& tupleShape) override; - void setStore(const std::shared_ptr& newStore); + void setStore(const std::shared_ptr& newStore); protected: StringArray(DataStructure& dataStructure, std::string name); @@ -139,6 +139,6 @@ class SIMPLNX_EXPORT StringArray : public IArray StringArray(DataStructure& dataStructure, std::string name, const ShapeType& tupleShape, IdType importId, collection_type strings); private: - std::shared_ptr m_Strings = nullptr; + std::shared_ptr m_Strings = nullptr; }; } // namespace nx::core diff --git a/src/simplnx/DataStructure/StringStore.cpp b/src/simplnx/DataStructure/StringStore.cpp index 2019f0b8ae..82e7a8d325 100644 --- a/src/simplnx/DataStructure/StringStore.cpp +++ b/src/simplnx/DataStructure/StringStore.cpp @@ -5,7 +5,7 @@ namespace nx::core { StringStore::StringStore(const ShapeType& tupleShape) -: AbstractStringStore() +: IStringStore() , m_TupleShape(tupleShape.cbegin(), tupleShape.cend()) , m_NumTuples(std::accumulate(m_TupleShape.cbegin(), m_TupleShape.cend(), static_cast(1), std::multiplies<>())) , m_Data(m_NumTuples) @@ -13,7 +13,7 @@ StringStore::StringStore(const ShapeType& tupleShape) } StringStore::StringStore(std::vector strings, const ShapeType& tupleShape) -: AbstractStringStore() +: IStringStore() , m_TupleShape(tupleShape.cbegin(), tupleShape.cend()) , m_NumTuples(strings.size()) , m_Data(std::move(strings)) @@ -72,12 +72,12 @@ void StringStore::setValue(usize index, const value_type& value) m_Data.at(index) = value; } -std::unique_ptr StringStore::deepCopy() const +std::unique_ptr StringStore::deepCopy() const { return std::make_unique(m_Data, m_TupleShape); } -AbstractStringStore& StringStore::operator=(const std::vector& values) +IStringStore& StringStore::operator=(const std::vector& values) { m_Data = values; m_TupleShape = ShapeType{values.size()}; diff --git a/src/simplnx/DataStructure/StringStore.hpp b/src/simplnx/DataStructure/StringStore.hpp index 8c6afa39ff..7e72c8f3ed 100644 --- a/src/simplnx/DataStructure/StringStore.hpp +++ b/src/simplnx/DataStructure/StringStore.hpp @@ -1,20 +1,20 @@ #pragma once -#include "AbstractStringStore.hpp" +#include "IStringStore.hpp" #include #include namespace nx::core { -class StringStore : public AbstractStringStore +class StringStore : public IStringStore { public: explicit StringStore(const ShapeType& tupleShape); explicit StringStore(std::vector strings, const ShapeType& tupleShape); ~StringStore(); - std::unique_ptr deepCopy() const override; + std::unique_ptr deepCopy() const override; /** * @brief Returns the number of tuples in the ListStore. @@ -45,7 +45,7 @@ class StringStore : public AbstractStringStore const_reference getValue(usize index) const override; void setValue(usize index, const value_type& value) override; - AbstractStringStore& operator=(const std::vector& values) override; + IStringStore& operator=(const std::vector& values) override; private: ShapeType m_TupleShape; diff --git a/src/simplnx/Filter/AbstractFilter.cpp b/src/simplnx/Filter/AbstractFilter.cpp new file mode 100644 index 0000000000..a7d7cfd2f0 --- /dev/null +++ b/src/simplnx/Filter/AbstractFilter.cpp @@ -0,0 +1,357 @@ +#include "AbstractFilter.hpp" + +#include "simplnx/Filter/DataParameter.hpp" +#include "simplnx/Filter/ValueParameter.hpp" +#include "simplnx/Utilities/StringUtilities.hpp" + +#include +#include + +#include +#include + +using namespace nx::core; + +namespace +{ +template +void moveResult(nx::core::Result& result, std::vector& errors, std::vector& warnings) +{ + for(auto& warning : result.warnings()) + { + warnings.push_back(std::move(warning)); + } + if(!result.valid()) + { + for(auto& error : result.errors()) + { + errors.push_back(std::move(error)); + } + } +} + +std::pair> GetResolvedArgs(const Arguments& filterArgs, const Parameters& params, const IFilter& filter, const ExecutionContext& executionContext) +{ + Arguments resolvedArgs; + std::vector warnings; + + for(const auto& [name, arg] : filterArgs) + { + if(!params.contains(name)) + { + warnings.push_back(Warning{-1, fmt::format("The list of arguments for Filter '{}' contained the argument key '{}' which is not an accepted argument key. The accepted Keys are:\n{}", + filter.humanName(), name, fmt::join(params.getKeys(), ", "))}); + + continue; + } + resolvedArgs.insert(name, arg); + } + + for(const auto& [name, parameter] : params) + { + if(!filterArgs.contains(name)) + { + resolvedArgs.insert(name, parameter->defaultValue()); + } + } + + Arguments constructedArgs; + for(const auto& [name, parameter] : params) + { + constructedArgs.insert(name, parameter->construct(resolvedArgs, executionContext)); + } + + return {std::move(constructedArgs), std::move(warnings)}; +} + +std::pair>, std::set> GetGroupedParameters(const Parameters& params, const Arguments& args) +{ + std::set ungroupedParameters; + for(const auto& [name, parameter] : params) + { + ungroupedParameters.insert(name); + } + + std::map> groupedParameters; + + std::vector groupKeys = params.getGroupKeys(); + for(const auto& groupKey : groupKeys) + { + ungroupedParameters.erase(groupKey); + std::vector childKeys = params.getKeysInGroup(groupKey); + for(const auto& childKey : childKeys) + { + ungroupedParameters.erase(childKey); + } + groupedParameters.insert({groupKey, std::move(childKeys)}); + } + + return {std::move(groupedParameters), std::move(ungroupedParameters)}; +} + +Result<> ValidateParameter(std::string_view name, const AnyParameter& parameter, const Arguments& args, const DataStructure& data, const IFilter& filter) +{ + const auto& arg = args.at(name); + + IParameter::AcceptedTypes acceptedTypes = parameter->acceptedTypes(); + if(std::find(acceptedTypes.cbegin(), acceptedTypes.cend(), arg.type()) == acceptedTypes.cend()) + { + std::stringstream acceptedTypesStr; + for(const auto& acceptedType : acceptedTypes) + { + acceptedTypesStr << " " << acceptedType.name() << std::endl; + } + throw std::invalid_argument(fmt::format("A mismatch between the argument types for a parameter was detected. This can happen if the improper type is specified when creating a parameter " + "argument or if this filter is being called from another filter where the other filter is NOT using the correct parameter type.\n Filter='{}'\n " + "Parameter Name:'{}'\n Argument Name='{}'\n Argument Type: '{}'.\n The accepted types for this parameter are:\n", + filter.humanName(), parameter->humanName(), name, arg.type().name(), acceptedTypesStr.str())); + } + + switch(parameter->type()) + { + case IParameter::Type::Value: { + const auto& valueParameter = dynamic_cast(parameter.getRef()); + Result result = valueParameter.validate(arg); + return result; + } + case IParameter::Type::Data: { + const auto& dataStructureParameter = dynamic_cast(parameter.getRef()); + Result result = dataStructureParameter.validate(data, arg); + return result; + } + default: + throw std::runtime_error("Invalid parameter type"); + } +} +} // namespace + +namespace nx::core +{ +AbstractFilter::~AbstractFilter() noexcept = default; + +IFilter::PreflightResult AbstractFilter::preflight(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel, + const ExecutionContext& executionContext) const +{ + Parameters params = parameters(); + + std::vector errors; + + auto [resolvedArgs, warnings] = GetResolvedArgs(args, params, *this, executionContext); + + auto [groupedParameters, ungroupedParameters] = GetGroupedParameters(params, resolvedArgs); + + for(const auto& [groupKey, dependentKeys] : groupedParameters) + { + const auto& parameter = params.at(groupKey); + Result<> result = ValidateParameter(groupKey, parameter, resolvedArgs, data, *this); + if(!ExtractResult(std::move(result), errors, warnings)) + { + continue; + } + // Only validate dependent parameters if their parent is valid + for(const auto& key : dependentKeys) + { + const auto& dependentParameter = params.at(key); + if(!params.isParameterActive(key, resolvedArgs)) + { + continue; + } + Result<> dependentResult = ValidateParameter(key, dependentParameter, resolvedArgs, data, *this); + if(!ExtractResult(std::move(dependentResult), errors, warnings)) + { + continue; + } + } + } + + // Validate ungrouped parameters + for(const auto& name : ungroupedParameters) + { + const auto& parameter = params.at(name); + Result<> result = ValidateParameter(name, parameter, resolvedArgs, data, *this); + + if(!ExtractResult(std::move(result), errors, warnings)) + { + continue; + } + } + + if(!errors.empty()) + { + return {nonstd::make_unexpected(std::move(errors)), std::move(warnings)}; + } + + PreflightResult implResult = preflightImpl(data, resolvedArgs, messageHandler, shouldCancel, executionContext); + if(shouldCancel) + { + return {MakeErrorResult(-1, "Filter cancelled")}; + } + + for(auto&& warning : warnings) + { + implResult.outputActions.warnings().push_back(std::move(warning)); + } + + return implResult; +} + +IFilter::ExecuteResult AbstractFilter::execute(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineFilter, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const +{ + PreflightResult preflightResult = preflight(dataStructure, filterArgs, messageHandler, shouldCancel, executionContext); + if(preflightResult.outputActions.invalid()) + { + return ExecuteResult{ConvertResult(std::move(preflightResult.outputActions)), std::move(preflightResult.outputValues)}; + } + + OutputActions outputActions = std::move(preflightResult.outputActions.value()); + + Result<> outputActionsResult = ConvertResult(std::move(preflightResult.outputActions)); + + Result<> actionsResult = outputActions.applyRegular(dataStructure, IDataAction::Mode::Execute); + + Result<> preflightActionsResult = MergeResults(std::move(outputActionsResult), std::move(actionsResult)); + + if(preflightActionsResult.invalid()) + { + return ExecuteResult{std::move(preflightActionsResult), std::move(preflightResult.outputValues)}; + } + + Parameters params = parameters(); + // We can discard the warnings since they're already reported in preflight + auto [resolvedArgs, warnings] = GetResolvedArgs(filterArgs, params, *this, executionContext); + + Result<> executeImplResult = executeImpl(dataStructure, resolvedArgs, pipelineFilter, messageHandler, shouldCancel, executionContext); + if(shouldCancel) + { + return {MakeErrorResult(-1, "Filter cancelled")}; + } + + Result<> preflightActionsExecuteResult = MergeResults(std::move(preflightActionsResult), std::move(executeImplResult)); + + if(preflightActionsExecuteResult.invalid()) + { + return ExecuteResult{std::move(preflightActionsExecuteResult), std::move(preflightResult.outputValues)}; + } + // Apply any deferred actions + Result<> deferredActionsResult = outputActions.applyDeferred(dataStructure, IDataAction::Mode::Execute); + + // Validate the Geometry and Attribute Matrix objects + Result<> validGeometryAndAttributeMatrices = MergeResults(dataStructure.validateGeometries(), dataStructure.validateAttributeMatrices()); + validGeometryAndAttributeMatrices = MergeResults(validGeometryAndAttributeMatrices, deferredActionsResult); + + // Merge all the results together. + Result<> finalResult = MergeResults(std::move(preflightActionsExecuteResult), std::move(validGeometryAndAttributeMatrices)); + + return ExecuteResult{std::move(finalResult), std::move(preflightResult.outputValues)}; +} + +nlohmann::json AbstractFilter::toJson(const Arguments& args) const +{ + nlohmann::json json; + json["parameters_version"] = parametersVersion(); + Parameters params = parameters(); + for(const auto& [name, param] : params) + { + try + { + nlohmann::json parameterJson; + if(args.contains(name)) + { + parameterJson = param->toJson(args.at(name)); + } + else + { + parameterJson = param->toJson(param->defaultValue()); + } + json[name] = std::move(parameterJson); + } catch(const std::exception& e) + { + throw std::runtime_error(fmt::format("While serializing the filter '{}' to JSON an exception was thrown with message:\n {}", className(), e.what())); + } + } + return json; +} + +Result AbstractFilter::fromJson(const nlohmann::json& json) const +{ + Parameters params = parameters(); + Arguments args; + std::vector errors; + std::vector warnings; + + std::vector paramKeyNotFound; + std::vector jsonKeyNotFound; + + // Check that each key from the filter's parameters appears in the JSON. + for(const auto& [name, param] : params) + { + if(!json.contains(name)) + { + warnings.push_back(Warning{-5432, fmt::format("Parameter key not found in JSON for filter: '{}'\n Parameter Key '{}' missing from the JSON", className(), name)}); + args.insert(name, param->defaultValue()); + paramKeyNotFound.push_back(name); + continue; + } + const auto& jsonValue = json[name]; + Result jsonResult = param->fromJson(jsonValue); + moveResult(jsonResult, errors, warnings); + if(jsonResult.invalid()) + { + continue; + } + args.insert(name, std::move(jsonResult.value())); + } + + // Check if any keys from the JSON do NOT appear in the Filter's set of parameters + for(auto& [key, val] : json.items()) + { + if(key != "parameters_version" && !params.contains(key)) + { + warnings.push_back( + Warning{-5433, fmt::format("JSON has parameter key that does not exist in filter '{}' parameter key set.\n JSON Key '{}' missing from the parameter list", className(), key)}); + jsonKeyNotFound.push_back(key); + } + } + + // Now run an N^2 comparison between those to try and find any commonality, i.e., + // is one of the keys pretty "close" to another key. That is what is going to be + // suggested below. This relies on an algorithm to determine what is "close". This + // may not be correct or even remotely close. + auto bestMatches = StringUtilities::FindBestMatches(jsonKeyNotFound, paramKeyNotFound); + for(const auto& match : bestMatches) + { + if(!std::get<0>(match).empty() && !std::get<1>(match).empty()) + { + warnings.push_back(Warning{-5434, fmt::format("Filter '{}': JSON Parameter Warning\n JSON Parameter Key '{}' is not an accepted Parameter Key for the filter. Closest match is " + "'{}' with a match distance of {}.\n Suggested change is '{}' ==> '{}' (This is *ONLY* a suggestion.)\n You can open the pipeline file in a " + "text editor and make the changes if those changes make sense.", + className(), std::get<0>(match), std::get<1>(match), std::get<2>(match), std::get<0>(match), std::get<1>(match))}); + } + } + + if(!errors.empty()) + { + return {nonstd::make_unexpected(std::move(errors))}; + } + + return {std::move(args), std::move(warnings)}; +} + +std::vector AbstractFilter::defaultTags() const +{ + return {}; +} + +Arguments AbstractFilter::getDefaultArguments() const +{ + Arguments args; + + for(const auto& [key, param] : parameters()) + { + args.insertOrAssign(key, param->defaultValue()); + } + + return args; +} +} // namespace nx::core diff --git a/src/simplnx/Filter/AbstractFilter.hpp b/src/simplnx/Filter/AbstractFilter.hpp new file mode 100644 index 0000000000..b12fea2802 --- /dev/null +++ b/src/simplnx/Filter/AbstractFilter.hpp @@ -0,0 +1,106 @@ +#pragma once + +#include "simplnx/Filter/IFilter.hpp" + +namespace nx::core +{ +/** + * @class AbstractFilter + * @brief AbstractFilter provides the concrete template-method implementations + * of the IFilter interface: parameter validation, preflight orchestration, + * execution pipeline, JSON serialization, and default arguments. + * Concrete filters inherit from AbstractFilter and implement preflightImpl() + * and executeImpl(). + */ +class SIMPLNX_EXPORT AbstractFilter : public IFilter +{ +public: + ~AbstractFilter() noexcept override; + + AbstractFilter(const AbstractFilter&) = delete; + AbstractFilter(AbstractFilter&&) noexcept = delete; + + AbstractFilter& operator=(const AbstractFilter&) = delete; + AbstractFilter& operator=(AbstractFilter&&) noexcept = delete; + + /** + * @brief Returns the default tags for this filter. + * @return std::vector + */ + std::vector defaultTags() const override; + + /** + * @brief Takes in a DataStructure and checks that the filter can be run on it with the given arguments. + * Returns any warnings/errors. Also returns the changes that would be applied to the DataStructure. + * Some parts of the actions may not be completely filled out if all the required information is not available at preflight time. + * @param data + * @param args + * @param messageHandler + * @param shouldCancel + * @return PreflightResult + */ + PreflightResult preflight(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler = {}, const std::atomic_bool& shouldCancel = false, + const ExecutionContext& executionContext = ExecutionContext()) const override; + + /** + * @brief Applies the filter's algorithm to the DataStructure with the given arguments. Returns any warnings/errors. + * On failure, there is no guarantee that the DataStructure is in a correct state. + * @param dataStructure + * @param args + * @param pipelineNode = nullptr + * @param messageHandler = {} + * @param shouldCancel + * @return ExecuteResult + */ + ExecuteResult execute(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode = nullptr, const MessageHandler& messageHandler = {}, + const std::atomic_bool& shouldCancel = false, const ExecutionContext& executionContext = ExecutionContext()) const override; + + /** + * @brief Converts the given arguments to a JSON representation using the filter's parameters. + * @param args + * @return nlohmann::json + */ + nlohmann::json toJson(const Arguments& args) const override; + + /** + * @brief Converts JSON to arguments based on the filter's parameters. + * @param json + * @return Result + */ + Result fromJson(const nlohmann::json& json) const override; + + /** + * @brief Returns the set of default arguments for this filter. + * @return Arguments + */ + Arguments getDefaultArguments() const override; + +protected: + AbstractFilter() = default; + + /** + * @brief Classes that implement AbstractFilter must provide this function for preflight. + * Runs after the filter runs the checks in its parameters. + * @param data + * @param args + * @param messageHandler + * @param shouldCancel + * @return PreflightResult + */ + virtual PreflightResult preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel, + const ExecutionContext& executionContext) const = 0; + + /** + * @brief Classes that implement AbstractFilter must provide this function for execute. + * Runs after the filter applies the OutputActions from preflight. + * @param data + * @param args + * @param pipelineNode + * @param messageHandler + * @param shouldCancel + * @return Result<> + */ + virtual Result<> executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const = 0; +}; +} // namespace nx::core diff --git a/src/simplnx/Filter/AbstractParameter.cpp b/src/simplnx/Filter/AbstractParameter.cpp index 09f92a892d..f321745ebb 100644 --- a/src/simplnx/Filter/AbstractParameter.cpp +++ b/src/simplnx/Filter/AbstractParameter.cpp @@ -1,7 +1,18 @@ #include "AbstractParameter.hpp" +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Common/StringLiteralFormatting.hpp" + +#include + namespace nx::core { +namespace +{ +constexpr StringLiteral k_ValueKey = "value"; +constexpr StringLiteral k_VersionKey = "version"; +} // namespace + AbstractParameter::AbstractParameter(const std::string& name, const std::string& humanName, const std::string& helpText) : m_Name(name) , m_HumanName(humanName) @@ -27,4 +38,56 @@ std::string AbstractParameter::helpText() const { return m_HelpText; } + +std::any AbstractParameter::construct(const Arguments& args, const ExecutionContext& executionContext) const +{ + return args.at(name()); +} + +nlohmann::json AbstractParameter::toJson(const std::any& value) const +{ + nlohmann::json json; + + json[k_ValueKey] = toJsonImpl(value); + json[k_VersionKey] = getVersion(); + + return json; +} + +Result AbstractParameter::fromJson(const nlohmann::json& json) const +{ + std::vector warnings; + VersionType version = 1; + if(json.contains(k_VersionKey)) + { + nlohmann::json versionJson = json[k_VersionKey]; + if(!versionJson.is_number_unsigned()) + { + return MakeErrorResult(-2, fmt::format("{}: Parameter key '{}' is not an unsigned integer", name(), k_VersionKey)); + } + + version = versionJson.get(); + } + else + { + warnings.push_back(Warning{-1, fmt::format("{}: Parameter key '{}' does not exist. Assuming version={}. To fix this, save the pipeline file.", name(), k_VersionKey, version)}); + } + + nlohmann::json valueJson; + if(json.contains(k_ValueKey)) + { + valueJson = json[k_ValueKey]; + } + else + { + warnings.push_back(Warning{-2, fmt::format("{}: Parameter key '{}' does not exist. Assuming json is the current json object", name(), k_ValueKey, version)}); + valueJson = json; + } + + Result result = fromJsonImpl(valueJson, version); + + result.warnings().insert(result.warnings().begin(), warnings.cbegin(), warnings.cend()); + + return result; +} } // namespace nx::core diff --git a/src/simplnx/Filter/AbstractParameter.hpp b/src/simplnx/Filter/AbstractParameter.hpp index 2241d3ecdd..e0df92a394 100644 --- a/src/simplnx/Filter/AbstractParameter.hpp +++ b/src/simplnx/Filter/AbstractParameter.hpp @@ -7,6 +7,7 @@ namespace nx::core { /** * @brief AbstractParameter stores name, human name, and help text for classes that want to inherit from IParameter. + * Also provides the template-method implementations for toJson/fromJson/construct. */ class SIMPLNX_EXPORT AbstractParameter : public IParameter { @@ -37,11 +38,49 @@ class SIMPLNX_EXPORT AbstractParameter : public IParameter */ std::string helpText() const final; + /** + * @brief Converts the given value to JSON. + * Throws if value is not an accepted type. + * @param value + */ + nlohmann::json toJson(const std::any& value) const override; + + /** + * @brief Converts the given JSON to a std::any containing the appropriate input type. + * Returns any warnings/errors. + * @return + */ + Result fromJson(const nlohmann::json& json) const override; + + /** + * @brief Constructs an input value from the given arguments. + * By default, accesses a singular value by key and returns that. + * May be overriden by subclasses that depend on other parameters. + * @param args + * @param executionContext + * @return + */ + std::any construct(const Arguments& args, const ExecutionContext& executionContext) const override; + protected: AbstractParameter() = delete; AbstractParameter(const std::string& name, const std::string& humanName, const std::string& helpText); + /** + * @brief Converts the given value to JSON. + * Throws if value is not an accepted type. + * @param value + */ + virtual nlohmann::json toJsonImpl(const std::any& value) const = 0; + + /** + * @brief Converts the given JSON to a std::any containing the appropriate input type. + * Returns any warnings/errors. + * @return + */ + virtual Result fromJsonImpl(const nlohmann::json& json, uint64 version) const = 0; + private: std::string m_Name; std::string m_HumanName; diff --git a/src/simplnx/Filter/Actions/CopyArrayInstanceAction.cpp b/src/simplnx/Filter/Actions/CopyArrayInstanceAction.cpp index f3dfc991b6..31a665d3b6 100644 --- a/src/simplnx/Filter/Actions/CopyArrayInstanceAction.cpp +++ b/src/simplnx/Filter/Actions/CopyArrayInstanceAction.cpp @@ -14,7 +14,7 @@ namespace constexpr int32_t k_UnsupportedTypeError = -5001; template -Result<> DoCopy(IDataArray* inputDataArray, DataStructure& dataStructure, DataPath&& path, IDataAction::Mode mode) +Result<> DoCopy(AbstractDataArray* inputDataArray, DataStructure& dataStructure, DataPath&& path, IDataAction::Mode mode) { auto* castInputArray = dynamic_cast*>(inputDataArray); ShapeType tupleShape = castInputArray->getDataStore()->getTupleShape(); @@ -26,7 +26,7 @@ Result<> DoCopy(IDataArray* inputDataArray, DataStructure& dataStructure, DataPa namespace nx::core { CopyArrayInstanceAction::CopyArrayInstanceAction(const DataPath& selectedDataPath, const DataPath& createdDataPath) -: IDataCreationAction(createdDataPath) +: AbstractDataCreationAction(createdDataPath) , m_SelectedDataPath(selectedDataPath) { } @@ -35,7 +35,7 @@ CopyArrayInstanceAction::~CopyArrayInstanceAction() noexcept = default; Result<> CopyArrayInstanceAction::apply(DataStructure& dataStructure, Mode mode) const { - auto* inputDataArray = dataStructure.getDataAs(m_SelectedDataPath); + auto* inputDataArray = dataStructure.getDataAs(m_SelectedDataPath); if(TemplateHelpers::CanDynamicCast()(inputDataArray)) { diff --git a/src/simplnx/Filter/Actions/CopyArrayInstanceAction.hpp b/src/simplnx/Filter/Actions/CopyArrayInstanceAction.hpp index fe8e2a6974..0e63c0c973 100644 --- a/src/simplnx/Filter/Actions/CopyArrayInstanceAction.hpp +++ b/src/simplnx/Filter/Actions/CopyArrayInstanceAction.hpp @@ -8,7 +8,7 @@ namespace nx::core /** * @brief Action that will copy a Source DataArray to a Destination DataPath. */ -class SIMPLNX_EXPORT CopyArrayInstanceAction : public IDataCreationAction +class SIMPLNX_EXPORT CopyArrayInstanceAction : public AbstractDataCreationAction { public: CopyArrayInstanceAction() = delete; diff --git a/src/simplnx/Filter/Actions/CopyDataObjectAction.cpp b/src/simplnx/Filter/Actions/CopyDataObjectAction.cpp index 798efa4a52..5ba89444b6 100644 --- a/src/simplnx/Filter/Actions/CopyDataObjectAction.cpp +++ b/src/simplnx/Filter/Actions/CopyDataObjectAction.cpp @@ -10,7 +10,7 @@ using namespace nx::core; namespace nx::core { CopyDataObjectAction::CopyDataObjectAction(const DataPath& path, const DataPath& newPath, const std::vector allCreatedPaths) -: IDataCreationAction(newPath) +: AbstractDataCreationAction(newPath) , m_Path(path) , m_NewPath(newPath) , m_AllCreatedPaths(allCreatedPaths) @@ -19,10 +19,10 @@ CopyDataObjectAction::CopyDataObjectAction(const DataPath& path, const DataPath& CopyDataObjectAction::~CopyDataObjectAction() noexcept = default; -std::shared_ptr CopyDataObjectAction::copyData(DataStructure& dataStructure, const DataPath& sourcePath, const DataPath& destPath) +std::shared_ptr CopyDataObjectAction::copyData(DataStructure& dataStructure, const DataPath& sourcePath, const DataPath& destPath) { auto* data = dataStructure.getData(sourcePath); - std::shared_ptr copy = data->deepCopy(destPath); + std::shared_ptr copy = data->deepCopy(destPath); return copy; } diff --git a/src/simplnx/Filter/Actions/CopyDataObjectAction.hpp b/src/simplnx/Filter/Actions/CopyDataObjectAction.hpp index ac5d468c52..47f8b7c6ae 100644 --- a/src/simplnx/Filter/Actions/CopyDataObjectAction.hpp +++ b/src/simplnx/Filter/Actions/CopyDataObjectAction.hpp @@ -8,7 +8,7 @@ namespace nx::core /** * @brief Action for copying a BaseGroup in a DataStructure */ -class SIMPLNX_EXPORT CopyDataObjectAction : public IDataCreationAction +class SIMPLNX_EXPORT CopyDataObjectAction : public AbstractDataCreationAction { public: CopyDataObjectAction() = delete; @@ -60,9 +60,9 @@ class SIMPLNX_EXPORT CopyDataObjectAction : public IDataCreationAction * @param dataStructure * @param targetPath * @param copyPath - * @return std::shared_ptr + * @return std::shared_ptr */ - static std::shared_ptr copyData(DataStructure& dataStructure, const DataPath& sourcePath, const DataPath& destPath); + static std::shared_ptr copyData(DataStructure& dataStructure, const DataPath& sourcePath, const DataPath& destPath); //////////// // Variables diff --git a/src/simplnx/Filter/Actions/CreateArrayAction.cpp b/src/simplnx/Filter/Actions/CreateArrayAction.cpp index c5ea2caa40..4fcf0dda77 100644 --- a/src/simplnx/Filter/Actions/CreateArrayAction.cpp +++ b/src/simplnx/Filter/Actions/CreateArrayAction.cpp @@ -21,7 +21,7 @@ struct CreateArrayFunctor namespace nx::core { CreateArrayAction::CreateArrayAction(DataType type, const std::vector& tDims, const std::vector& cDims, const DataPath& path, std::string dataFormat, std::string fillValue) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_Type(type) , m_Dims(tDims) , m_CDims(cDims) diff --git a/src/simplnx/Filter/Actions/CreateArrayAction.hpp b/src/simplnx/Filter/Actions/CreateArrayAction.hpp index 815e28d66e..dc32254519 100644 --- a/src/simplnx/Filter/Actions/CreateArrayAction.hpp +++ b/src/simplnx/Filter/Actions/CreateArrayAction.hpp @@ -15,7 +15,7 @@ namespace nx::core /** * @brief Action for creating DataArrays in a DataStructure */ -class SIMPLNX_EXPORT CreateArrayAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateArrayAction : public AbstractDataCreationAction { public: inline static constexpr StringLiteral k_DefaultDataFormat = ""; diff --git a/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.cpp b/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.cpp index c4ff77310b..17984997ea 100644 --- a/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.cpp +++ b/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.cpp @@ -9,7 +9,7 @@ namespace nx::core { //------------------------------------------------------------------------------ CreateAttributeMatrixAction::CreateAttributeMatrixAction(const DataPath& path, const ShapeType& shape) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_TupleShape(shape) { } diff --git a/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp b/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp index 28c882f09f..a2e34440db 100644 --- a/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp +++ b/src/simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp @@ -10,7 +10,7 @@ namespace nx::core /** * @brief Action to create a DataGroup with the DataStructure */ -class SIMPLNX_EXPORT CreateAttributeMatrixAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateAttributeMatrixAction : public AbstractDataCreationAction { public: CreateAttributeMatrixAction() = delete; diff --git a/src/simplnx/Filter/Actions/CreateDataGroupAction.cpp b/src/simplnx/Filter/Actions/CreateDataGroupAction.cpp index 4ac1224e91..b3eb9b99ad 100644 --- a/src/simplnx/Filter/Actions/CreateDataGroupAction.cpp +++ b/src/simplnx/Filter/Actions/CreateDataGroupAction.cpp @@ -10,7 +10,7 @@ namespace nx::core { //------------------------------------------------------------------------------ CreateDataGroupAction::CreateDataGroupAction(const DataPath& path) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) { } diff --git a/src/simplnx/Filter/Actions/CreateDataGroupAction.hpp b/src/simplnx/Filter/Actions/CreateDataGroupAction.hpp index eb04d72e21..3e3d3ec71c 100644 --- a/src/simplnx/Filter/Actions/CreateDataGroupAction.hpp +++ b/src/simplnx/Filter/Actions/CreateDataGroupAction.hpp @@ -9,7 +9,7 @@ namespace nx::core /** * @brief Action to create a DataGroup with the DataStructure */ -class SIMPLNX_EXPORT CreateDataGroupAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateDataGroupAction : public AbstractDataCreationAction { public: CreateDataGroupAction() = delete; diff --git a/src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp b/src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp index 969becfda9..17f793ef23 100644 --- a/src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp +++ b/src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp @@ -3,8 +3,8 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/Utilities/ArrayCreationUtilities.hpp" #include "simplnx/simplnx_export.hpp" @@ -19,7 +19,7 @@ namespace nx::core * @brief Action for creating an Edge Geometry in a DataStructure */ template -class CreateGeometry1DAction : public IDataCreationAction +class CreateGeometry1DAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; @@ -36,7 +36,7 @@ class CreateGeometry1DAction : public IDataCreationAction */ CreateGeometry1DAction(const DataPath& geometryPath, size_t numEdges, size_t numVertices, const std::string& vertexAttributeMatrixName, const std::string& edgeAttributeMatrixName, const std::string& sharedVerticesName, const std::string& sharedEdgesName, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_NumEdges(numEdges) , m_NumVertices(numVertices) , m_VertexDataName(vertexAttributeMatrixName) @@ -58,7 +58,7 @@ class CreateGeometry1DAction : public IDataCreationAction */ CreateGeometry1DAction(const DataPath& geometryPath, const DataPath& inputVerticesArrayPath, const DataPath& inputEdgesArrayPath, const std::string& vertexAttributeMatrixName, const std::string& edgeAttributeMatrixName, const ArrayHandlingType& arrayType, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_VertexDataName(vertexAttributeMatrixName) , m_EdgeDataName(edgeAttributeMatrixName) , m_SharedVerticesName(inputVerticesArrayPath.getTargetName()) @@ -87,8 +87,8 @@ class CreateGeometry1DAction : public IDataCreationAction { static constexpr StringLiteral prefix = "CreateGeometry1DAction: "; - using MeshIndexType = IGeometry::MeshIndexType; - using SharedEdgeList = IGeometry::SharedEdgeList; + using MeshIndexType = AbstractGeometry::MeshIndexType; + using SharedEdgeList = AbstractGeometry::SharedEdgeList; DataPath edgeDataPath = getEdgeDataPath(); DataPath vertexDataPath = getVertexDataPath(); @@ -144,10 +144,10 @@ class CreateGeometry1DAction : public IDataCreationAction edgeTupleShape = edges->getTupleShape(); vertexTupleShape = vertices->getTupleShape(); - std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); + std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); const auto vertexArray = std::dynamic_pointer_cast(vertexCopy); - std::shared_ptr edgesCopy = edges->deepCopy(getCreatedPath().createChildPath(m_SharedEdgesName)); + std::shared_ptr edgesCopy = edges->deepCopy(getCreatedPath().createChildPath(m_SharedEdgesName)); const auto edgesArray = std::dynamic_pointer_cast>(edgesCopy); geometry1d->setEdgeList(*edgesArray); @@ -288,7 +288,7 @@ class CreateGeometry1DAction : public IDataCreationAction * @brief Returns the number of edges * @return */ - IGeometry::MeshIndexType numEdges() const + AbstractGeometry::MeshIndexType numEdges() const { return m_NumEdges; } @@ -297,7 +297,7 @@ class CreateGeometry1DAction : public IDataCreationAction * @brief Returns the number of vertices (estimated in some circumstances) * @return */ - IGeometry::MeshIndexType numVertices() const + AbstractGeometry::MeshIndexType numVertices() const { return m_NumVertices; } @@ -322,8 +322,8 @@ class CreateGeometry1DAction : public IDataCreationAction CreateGeometry1DAction() = default; private: - IGeometry::MeshIndexType m_NumEdges = 1; - IGeometry::MeshIndexType m_NumVertices = 2; + AbstractGeometry::MeshIndexType m_NumEdges = 1; + AbstractGeometry::MeshIndexType m_NumVertices = 2; std::string m_VertexDataName; std::string m_EdgeDataName; std::string m_SharedVerticesName; diff --git a/src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp b/src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp index 5213776808..b2f01066dd 100644 --- a/src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp +++ b/src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/Filter/Output.hpp" @@ -20,7 +20,7 @@ namespace nx::core * @brief Action for creating a Triangle or QuadGeometry in a DataStructure */ template -class CreateGeometry2DAction : public IDataCreationAction +class CreateGeometry2DAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; @@ -37,7 +37,7 @@ class CreateGeometry2DAction : public IDataCreationAction */ CreateGeometry2DAction(const DataPath& geometryPath, size_t numFaces, size_t numVertices, const std::string& vertexAttributeMatrixName, const std::string& faceAttributeMatrixName, const std::string& sharedVerticesName, const std::string& sharedFacesName, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_NumFaces(numFaces) , m_NumVertices(numVertices) , m_VertexDataName(vertexAttributeMatrixName) @@ -59,7 +59,7 @@ class CreateGeometry2DAction : public IDataCreationAction */ CreateGeometry2DAction(const DataPath& geometryPath, const DataPath& inputVerticesArrayPath, const DataPath& inputFacesArrayPath, const std::string& vertexAttributeMatrixName, const std::string& faceAttributeMatrixName, const ArrayHandlingType& arrayType, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_VertexDataName(vertexAttributeMatrixName) , m_FaceDataName(faceAttributeMatrixName) , m_SharedVerticesName(inputVerticesArrayPath.getTargetName()) @@ -87,8 +87,8 @@ class CreateGeometry2DAction : public IDataCreationAction Result<> apply(DataStructure& dataStructure, Mode mode) const override { static constexpr StringLiteral prefix = "CreateGeometry2DAction: "; - using MeshIndexType = IGeometry::MeshIndexType; - using SharedTriList = IGeometry::SharedTriList; + using MeshIndexType = AbstractGeometry::MeshIndexType; + using SharedTriList = AbstractGeometry::SharedTriList; const DataPath faceDataPath = getFaceDataPath(); const DataPath vertexDataPath = getVertexDataPath(); @@ -144,10 +144,10 @@ class CreateGeometry2DAction : public IDataCreationAction faceTupleShape = faces->getTupleShape(); vertexTupleShape = vertices->getTupleShape(); - std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); + std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); const auto vertexArray = std::dynamic_pointer_cast(vertexCopy); - std::shared_ptr facesCopy = faces->deepCopy(getCreatedPath().createChildPath(m_SharedFacesName)); + std::shared_ptr facesCopy = faces->deepCopy(getCreatedPath().createChildPath(m_SharedFacesName)); const auto facesArray = std::dynamic_pointer_cast>(facesCopy); geometry2d->setFaceList(*facesArray); @@ -288,7 +288,7 @@ class CreateGeometry2DAction : public IDataCreationAction * @brief Returns the number of faces * @return */ - IGeometry::MeshIndexType numFaces() const + AbstractGeometry::MeshIndexType numFaces() const { return m_NumFaces; } @@ -297,7 +297,7 @@ class CreateGeometry2DAction : public IDataCreationAction * @brief Returns the number of vertices (estimated in some circumstances) * @return */ - IGeometry::MeshIndexType numVertices() const + AbstractGeometry::MeshIndexType numVertices() const { return m_NumVertices; } @@ -322,8 +322,8 @@ class CreateGeometry2DAction : public IDataCreationAction CreateGeometry2DAction() = default; private: - IGeometry::MeshIndexType m_NumFaces = 1; - IGeometry::MeshIndexType m_NumVertices = Geometry2DType::k_NumVerts; + AbstractGeometry::MeshIndexType m_NumFaces = 1; + AbstractGeometry::MeshIndexType m_NumVertices = Geometry2DType::k_NumVerts; std::string m_VertexDataName; std::string m_FaceDataName; std::string m_SharedVerticesName; diff --git a/src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp b/src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp index fb6cb20ee4..ca926b2931 100644 --- a/src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp +++ b/src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp @@ -3,8 +3,8 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/HexahedralGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" #include "simplnx/DataStructure/Geometry/TetrahedralGeom.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/Utilities/ArrayCreationUtilities.hpp" @@ -20,7 +20,7 @@ namespace nx::core * @brief Action for creating a Tetrahedral or Hexehedral Geometry in a DataStructure */ template -class CreateGeometry3DAction : public IDataCreationAction +class CreateGeometry3DAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; @@ -37,7 +37,7 @@ class CreateGeometry3DAction : public IDataCreationAction */ CreateGeometry3DAction(const DataPath& geometryPath, size_t numCells, size_t numVertices, const std::string& vertexAttributeMatrixName, const std::string& cellAttributeMatrixName, const std::string& sharedVerticesName, const std::string& sharedCellsName, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_NumCells(numCells) , m_NumVertices(numVertices) , m_VertexDataName(vertexAttributeMatrixName) @@ -59,7 +59,7 @@ class CreateGeometry3DAction : public IDataCreationAction */ CreateGeometry3DAction(const DataPath& geometryPath, const DataPath& inputVerticesArrayPath, const DataPath& inputCellsArrayPath, const std::string& vertexAttributeMatrixName, const std::string& cellAttributeMatrixName, const ArrayHandlingType& arrayType, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_VertexDataName(vertexAttributeMatrixName) , m_CellDataName(cellAttributeMatrixName) , m_SharedVerticesName(inputVerticesArrayPath.getTargetName()) @@ -87,8 +87,8 @@ class CreateGeometry3DAction : public IDataCreationAction Result<> apply(DataStructure& dataStructure, Mode mode) const override { static constexpr StringLiteral prefix = "CreateGeometry3DAction: "; - using MeshIndexType = IGeometry::MeshIndexType; - using SharedCellList = IGeometry::SharedFaceList; + using MeshIndexType = AbstractGeometry::MeshIndexType; + using SharedCellList = AbstractGeometry::SharedFaceList; const DataPath cellDataPath = getCellDataPath(); const DataPath vertexDataPath = getVertexDataPath(); @@ -144,10 +144,10 @@ class CreateGeometry3DAction : public IDataCreationAction cellTupleShape = cells->getTupleShape(); vertexTupleShape = vertices->getTupleShape(); - std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); + std::shared_ptr vertexCopy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVerticesName)); const auto vertexArray = std::dynamic_pointer_cast(vertexCopy); - std::shared_ptr cellsCopy = cells->deepCopy(getCreatedPath().createChildPath(m_SharedCellsName)); + std::shared_ptr cellsCopy = cells->deepCopy(getCreatedPath().createChildPath(m_SharedCellsName)); const auto cellsArray = std::dynamic_pointer_cast>(cellsCopy); geometry3d->setPolyhedraList(*cellsArray); @@ -287,7 +287,7 @@ class CreateGeometry3DAction : public IDataCreationAction * @brief Returns the number of cells * @return */ - IGeometry::MeshIndexType numCells() const + AbstractGeometry::MeshIndexType numCells() const { return m_NumCells; } @@ -296,7 +296,7 @@ class CreateGeometry3DAction : public IDataCreationAction * @brief Returns the number of vertices (estimated in some circumstances) * @return */ - IGeometry::MeshIndexType numVertices() const + AbstractGeometry::MeshIndexType numVertices() const { return m_NumVertices; } @@ -321,8 +321,8 @@ class CreateGeometry3DAction : public IDataCreationAction CreateGeometry3DAction() = default; private: - IGeometry::MeshIndexType m_NumCells = 1; - IGeometry::MeshIndexType m_NumVertices = Geometry3DType::k_NumVerts; + AbstractGeometry::MeshIndexType m_NumCells = 1; + AbstractGeometry::MeshIndexType m_NumVertices = Geometry3DType::k_NumVerts; std::string m_VertexDataName; std::string m_CellDataName; std::string m_SharedVerticesName; diff --git a/src/simplnx/Filter/Actions/CreateGridMontageAction.cpp b/src/simplnx/Filter/Actions/CreateGridMontageAction.cpp index 693ae5cd7b..b51b429099 100644 --- a/src/simplnx/Filter/Actions/CreateGridMontageAction.cpp +++ b/src/simplnx/Filter/Actions/CreateGridMontageAction.cpp @@ -4,7 +4,7 @@ namespace nx::core { CreateGridMontageAction::CreateGridMontageAction(const DataPath& path, const DimensionType& dims, const OriginType& origin, const SpacingType& spacing) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_Dims(dims) , m_Origin(origin) , m_Spacing(spacing) diff --git a/src/simplnx/Filter/Actions/CreateGridMontageAction.hpp b/src/simplnx/Filter/Actions/CreateGridMontageAction.hpp index 16ddeb75a6..f3deae3c30 100644 --- a/src/simplnx/Filter/Actions/CreateGridMontageAction.hpp +++ b/src/simplnx/Filter/Actions/CreateGridMontageAction.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/simplnx_export.hpp" @@ -10,7 +10,7 @@ namespace nx::core /** * @brief Action for creating an ImageGeometry in a DataStructure */ -class SIMPLNX_EXPORT CreateGridMontageAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateGridMontageAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; diff --git a/src/simplnx/Filter/Actions/CreateImageGeometryAction.cpp b/src/simplnx/Filter/Actions/CreateImageGeometryAction.cpp index 7d0e8d4018..ccd744ca41 100644 --- a/src/simplnx/Filter/Actions/CreateImageGeometryAction.cpp +++ b/src/simplnx/Filter/Actions/CreateImageGeometryAction.cpp @@ -8,8 +8,8 @@ using namespace nx::core; namespace nx::core { CreateImageGeometryAction::CreateImageGeometryAction(const DataPath& path, const DimensionType& dims, const OriginType& origin, const SpacingType& spacing, const std::string& cellAttributeMatrixName, - IGeometry::LengthUnit units) -: IDataCreationAction(path) + AbstractGeometry::LengthUnit units) +: AbstractDataCreationAction(path) , m_Dims(dims) , m_Origin(origin) , m_Spacing(spacing) @@ -102,7 +102,7 @@ std::string CreateImageGeometryAction::cellAttributeMatrixName() const return m_CellDataName; } -IGeometry::LengthUnit CreateImageGeometryAction::units() const +AbstractGeometry::LengthUnit CreateImageGeometryAction::units() const { return m_Units; } diff --git a/src/simplnx/Filter/Actions/CreateImageGeometryAction.hpp b/src/simplnx/Filter/Actions/CreateImageGeometryAction.hpp index 43d52ffa03..6e4f5588a7 100644 --- a/src/simplnx/Filter/Actions/CreateImageGeometryAction.hpp +++ b/src/simplnx/Filter/Actions/CreateImageGeometryAction.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/simplnx_export.hpp" @@ -10,7 +10,7 @@ namespace nx::core /** * @brief Action for creating an ImageGeometry in a DataStructure */ -class SIMPLNX_EXPORT CreateImageGeometryAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateImageGeometryAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; @@ -27,7 +27,7 @@ class SIMPLNX_EXPORT CreateImageGeometryAction : public IDataCreationAction * @param cellAttributeMatrixName */ CreateImageGeometryAction(const DataPath& path, const DimensionType& dims, const OriginType& origin, const SpacingType& spacing, const std::string& cellAttributeMatrixName, - IGeometry::LengthUnit units = IGeometry::LengthUnit::Micrometer); + AbstractGeometry::LengthUnit units = AbstractGeometry::LengthUnit::Micrometer); ~CreateImageGeometryAction() noexcept override; @@ -84,7 +84,7 @@ class SIMPLNX_EXPORT CreateImageGeometryAction : public IDataCreationAction * @brief Returns the units of the ImageGeometry to be created. * @return */ - IGeometry::LengthUnit units() const; + AbstractGeometry::LengthUnit units() const; /** * @brief Returns all of the DataPaths to be created. @@ -96,7 +96,7 @@ class SIMPLNX_EXPORT CreateImageGeometryAction : public IDataCreationAction DimensionType m_Dims; OriginType m_Origin; SpacingType m_Spacing; - IGeometry::LengthUnit m_Units; + AbstractGeometry::LengthUnit m_Units; std::string m_CellDataName; }; } // namespace nx::core diff --git a/src/simplnx/Filter/Actions/CreateNeighborListAction.cpp b/src/simplnx/Filter/Actions/CreateNeighborListAction.cpp index 2fd32b8585..b86e973f91 100644 --- a/src/simplnx/Filter/Actions/CreateNeighborListAction.cpp +++ b/src/simplnx/Filter/Actions/CreateNeighborListAction.cpp @@ -10,7 +10,7 @@ using namespace nx::core; namespace nx::core { CreateNeighborListAction::CreateNeighborListAction(DataType type, const ShapeType& tupleShape, const DataPath& path) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_Type(type) , m_TupleShape(tupleShape.cbegin(), tupleShape.cend()) { diff --git a/src/simplnx/Filter/Actions/CreateNeighborListAction.hpp b/src/simplnx/Filter/Actions/CreateNeighborListAction.hpp index 513a654d52..6c3bbeeb79 100644 --- a/src/simplnx/Filter/Actions/CreateNeighborListAction.hpp +++ b/src/simplnx/Filter/Actions/CreateNeighborListAction.hpp @@ -11,7 +11,7 @@ namespace nx::core * @class CreateNeighborListAction * @brief Action for creating NeighborList arrays in a DataStructure */ -class SIMPLNX_EXPORT CreateNeighborListAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateNeighborListAction : public AbstractDataCreationAction { public: CreateNeighborListAction() = delete; diff --git a/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.cpp b/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.cpp index b4706181d3..90589ac13d 100644 --- a/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.cpp +++ b/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.cpp @@ -11,7 +11,7 @@ namespace nx::core { CreateRectGridGeometryAction::CreateRectGridGeometryAction(const DataPath& path, usize xBoundTuples, usize yBoundTuples, usize zBoundTuples, const std::string& cellAttributeMatrixName, const std::string& xBoundsName, const std::string& yBoundsName, const std::string& zBoundsName, std::string createdDataFormat) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_NumXBoundTuples(xBoundTuples) , m_NumYBoundTuples(yBoundTuples) , m_NumZBoundTuples(zBoundTuples) @@ -25,7 +25,7 @@ CreateRectGridGeometryAction::CreateRectGridGeometryAction(const DataPath& path, CreateRectGridGeometryAction::CreateRectGridGeometryAction(const DataPath& path, const DataPath& inputXBoundsPath, const DataPath& inputYBoundsPath, const DataPath& inputZBoundsPath, const std::string& cellAttributeMatrixName, const ArrayHandlingType& arrayType, std::string createdDataFormat) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_CellDataName(cellAttributeMatrixName) , m_XBoundsArrayName(inputXBoundsPath.getTargetName()) , m_YBoundsArrayName(inputYBoundsPath.getTargetName()) @@ -108,9 +108,9 @@ Result<> CreateRectGridGeometryAction::apply(DataStructure& dataStructure, Mode Result<> results; if(m_ArrayHandlingType == ArrayHandlingType::Copy) { - std::shared_ptr xCopy = xBounds->deepCopy(getCreatedPath().createChildPath(m_XBoundsArrayName)); - std::shared_ptr yCopy = yBounds->deepCopy(getCreatedPath().createChildPath(m_YBoundsArrayName)); - std::shared_ptr zCopy = zBounds->deepCopy(getCreatedPath().createChildPath(m_ZBoundsArrayName)); + std::shared_ptr xCopy = xBounds->deepCopy(getCreatedPath().createChildPath(m_XBoundsArrayName)); + std::shared_ptr yCopy = yBounds->deepCopy(getCreatedPath().createChildPath(m_YBoundsArrayName)); + std::shared_ptr zCopy = zBounds->deepCopy(getCreatedPath().createChildPath(m_ZBoundsArrayName)); const auto xBoundsArray = std::dynamic_pointer_cast(xCopy); const auto yBoundsArray = std::dynamic_pointer_cast(yCopy); const auto zBoundsArray = std::dynamic_pointer_cast(zCopy); diff --git a/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.hpp b/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.hpp index 56cc266251..44c9719c00 100644 --- a/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.hpp +++ b/src/simplnx/Filter/Actions/CreateRectGridGeometryAction.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Array.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/simplnx_export.hpp" @@ -10,7 +10,7 @@ namespace nx::core /** * @brief Action for creating an RectGridGeometry in a DataStructure */ -class SIMPLNX_EXPORT CreateRectGridGeometryAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateRectGridGeometryAction : public AbstractDataCreationAction { public: using DimensionType = std::vector; diff --git a/src/simplnx/Filter/Actions/CreateStringArrayAction.cpp b/src/simplnx/Filter/Actions/CreateStringArrayAction.cpp index 064c5f58a6..ab63504f34 100644 --- a/src/simplnx/Filter/Actions/CreateStringArrayAction.cpp +++ b/src/simplnx/Filter/Actions/CreateStringArrayAction.cpp @@ -11,7 +11,7 @@ using namespace nx::core; namespace nx::core { CreateStringArrayAction::CreateStringArrayAction(const std::vector& tDims, const DataPath& path, const std::string& initializeValue) -: IDataCreationAction(path) +: AbstractDataCreationAction(path) , m_Dims(tDims) , m_InitializeValue(initializeValue) { @@ -24,9 +24,9 @@ Result<> CreateStringArrayAction::apply(DataStructure& dataStructure, Mode mode) static constexpr StringLiteral prefix = "CreateStringArrayAction: "; auto parentPath = path().getParent(); - std::optional dataObjectId; + std::optional dataObjectId; - DataObject* parentObject = nullptr; + AbstractDataObject* parentObject = nullptr; if(parentPath.getLength() != 0) { parentObject = dataStructure.getData(parentPath); @@ -51,7 +51,7 @@ Result<> CreateStringArrayAction::apply(DataStructure& dataStructure, Mode mode) StringArray* array = StringArray::CreateWithValues(dataStructure, name, m_Dims, values, dataObjectId); if(array == nullptr) { - if(parentObject != nullptr && parentObject->getDataObjectType() == DataObject::Type::AttributeMatrix) + if(parentObject != nullptr && parentObject->getDataObjectType() == IDataObject::Type::AttributeMatrix) { auto* attrMatrix = dynamic_cast(parentObject); std::string amShape = fmt::format("Attribute Matrix Tuple Dims: {}", fmt::join(attrMatrix->getShape(), " x ")); diff --git a/src/simplnx/Filter/Actions/CreateStringArrayAction.hpp b/src/simplnx/Filter/Actions/CreateStringArrayAction.hpp index c2940818c4..8befc776b0 100644 --- a/src/simplnx/Filter/Actions/CreateStringArrayAction.hpp +++ b/src/simplnx/Filter/Actions/CreateStringArrayAction.hpp @@ -8,7 +8,7 @@ namespace nx::core /** * @brief Action for creating DataArrays in a DataStructure */ -class SIMPLNX_EXPORT CreateStringArrayAction : public IDataCreationAction +class SIMPLNX_EXPORT CreateStringArrayAction : public AbstractDataCreationAction { public: CreateStringArrayAction() = delete; diff --git a/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp b/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp index c5962a6049..722b4a2ac2 100644 --- a/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp +++ b/src/simplnx/Filter/Actions/CreateVertexGeometryAction.hpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Array.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" #include "simplnx/Filter/Output.hpp" #include "simplnx/Utilities/ArrayCreationUtilities.hpp" @@ -19,7 +19,7 @@ namespace nx::core * @brief Action for creating a Vertex Geometry in a DataStructure */ -class CreateVertexGeometryAction : public IDataCreationAction +class CreateVertexGeometryAction : public AbstractDataCreationAction { public: /** @@ -29,9 +29,9 @@ class CreateVertexGeometryAction : public IDataCreationAction * @param vertexAttributeMatrixName The name of the vertex AttributeMatrix to be created * @param sharedVertexListName The name of the shared vertex list array to be created */ - CreateVertexGeometryAction(const DataPath& geometryPath, IGeometry::MeshIndexType numVertices, const std::string& vertexAttributeMatrixName, const std::string& sharedVertexListName, + CreateVertexGeometryAction(const DataPath& geometryPath, AbstractGeometry::MeshIndexType numVertices, const std::string& vertexAttributeMatrixName, const std::string& sharedVertexListName, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_NumVertices(numVertices) , m_VertexDataName(vertexAttributeMatrixName) , m_SharedVertexListName(sharedVertexListName) @@ -48,7 +48,7 @@ class CreateVertexGeometryAction : public IDataCreationAction */ CreateVertexGeometryAction(const DataPath& geometryPath, const DataPath& inputVerticesArrayPath, const std::string& vertexAttributeMatrixName, const ArrayHandlingType& arrayType, std::string createdDataFormat = "") - : IDataCreationAction(geometryPath) + : AbstractDataCreationAction(geometryPath) , m_VertexDataName(vertexAttributeMatrixName) , m_SharedVertexListName(inputVerticesArrayPath.getTargetName()) , m_InputVertices(inputVerticesArrayPath) @@ -118,7 +118,7 @@ class CreateVertexGeometryAction : public IDataCreationAction { tupleShape = vertices->getTupleShape(); - std::shared_ptr copy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVertexListName)); + std::shared_ptr copy = vertices->deepCopy(getCreatedPath().createChildPath(m_SharedVertexListName)); const auto vertexArray = std::dynamic_pointer_cast(copy); vertexGeom->setVertices(*vertexArray); @@ -196,9 +196,9 @@ class CreateVertexGeometryAction : public IDataCreationAction /** * @brief Returns the number of vertices (estimated in some circumstances) - * @return IGeometry::MeshIndexType + * @return AbstractGeometry::MeshIndexType */ - IGeometry::MeshIndexType numVertices() const + AbstractGeometry::MeshIndexType numVertices() const { return m_NumVertices; } @@ -240,7 +240,7 @@ class CreateVertexGeometryAction : public IDataCreationAction CreateVertexGeometryAction() = default; private: - IGeometry::MeshIndexType m_NumVertices = 1; + AbstractGeometry::MeshIndexType m_NumVertices = 1; std::string m_VertexDataName; std::string m_SharedVertexListName; DataPath m_InputVertices; diff --git a/src/simplnx/Filter/Actions/DeleteDataAction.cpp b/src/simplnx/Filter/Actions/DeleteDataAction.cpp index 98f3eae865..9e7765a707 100644 --- a/src/simplnx/Filter/Actions/DeleteDataAction.cpp +++ b/src/simplnx/Filter/Actions/DeleteDataAction.cpp @@ -1,9 +1,9 @@ #include "DeleteDataAction.hpp" #include "simplnx/Common/Result.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/BaseGroup.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/EmptyDataStore.hpp" @@ -18,7 +18,7 @@ constexpr int32 k_ClassTypeErrorCode = -3246; Result<> TerminateNode(DataStructure& dataStructure, const DataPath& path, IDataAction::Mode mode) { - DataObject* targetObject = dataStructure.getData(path); + AbstractDataObject* targetObject = dataStructure.getData(path); if(targetObject == nullptr) { return MakeErrorResult(k_TargetNotFoundErrorCode, fmt::format("Trying to delete DataObject '{}' which does not exist.", path.getTargetName())); @@ -48,7 +48,7 @@ Result<> TerminateNode(DataStructure& dataStructure, const DataPath& path, IData // for(const auto& childName : childrenNames) // { // DataPath childPath = parent.createChildPath(childName); -// const DataObject* dataObject = dataStructure.getData(childPath); +// const AbstractDataObject* dataObject = dataStructure.getData(childPath); // childDataObjects.push_back(childPath); // } // } catch(std::exception& e) @@ -61,7 +61,7 @@ Result<> TerminateNode(DataStructure& dataStructure, const DataPath& path, IData // Result<> TerminateNodesRecursively(DataStructure& dataStructure, const DataPath& path, IDataAction::Mode mode, const bool checkDependence) //{ // Result<> result = {}; -// DataObject* node = dataStructure.getData(path); +// AbstractDataObject* node = dataStructure.getData(path); // // if(checkDependence) // { @@ -88,7 +88,7 @@ Result<> TerminateNode(DataStructure& dataStructure, const DataPath& path, IData // // Result<> TerminateEdge(DataStructure& dataStructure, const DataPath& path, IDataAction::Mode mode) //{ -// DataObject* targetObject = dataStructure.getData(path); +// AbstractDataObject* targetObject = dataStructure.getData(path); // if(targetObject == nullptr) // { // return MakeErrorResult(k_TargetNotFoundErrorCode, fmt::format("Trying to delete DataPath '{}' which does not exist.", path.toString())); diff --git a/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.cpp b/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.cpp index 8e89250d0e..112bd6135a 100644 --- a/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.cpp +++ b/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.cpp @@ -24,7 +24,7 @@ void sortImportPaths(std::vector& importPaths) namespace nx::core { ImportH5ObjectPathsAction::ImportH5ObjectPathsAction(const std::filesystem::path& importFile, const PathsType& paths) -: IDataCreationAction(DataPath{}) +: AbstractDataCreationAction(DataPath{}) , m_H5FilePath(importFile) , m_Paths(paths) { @@ -45,7 +45,7 @@ Result<> ImportH5ObjectPathsAction::apply(DataStructure& dataStructure, Mode mod return ConvertResult(std::move(dataStructureResult)); } - // Ensure there are no conflicting DataObject ID values + // Ensure there are no conflicting AbstractDataObject ID values DataStructure importStructure = std::move(dataStructureResult.value()); importStructure.resetIds(dataStructure.getNextId()); @@ -53,7 +53,7 @@ Result<> ImportH5ObjectPathsAction::apply(DataStructure& dataStructure, Mode mod std::stringstream errorMessages; for(const auto& targetPath : m_Paths) { - if(dataStructure.getDataAs(targetPath) != nullptr) + if(dataStructure.getDataAs(targetPath) != nullptr) { return MakeErrorResult(-6203, fmt::format("{}Unable to import DataObject at '{}' because an object already exists there. Consider a rename of existing object.", prefix, targetPath.toString())); } diff --git a/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.hpp b/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.hpp index b659392e63..111dc5c2de 100644 --- a/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.hpp +++ b/src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.hpp @@ -11,7 +11,7 @@ namespace nx::core /** * @brief Action for importing DataObjects from an HDF5 file. */ -class SIMPLNX_EXPORT ImportH5ObjectPathsAction : public IDataCreationAction +class SIMPLNX_EXPORT ImportH5ObjectPathsAction : public AbstractDataCreationAction { public: using PathsType = std::vector; diff --git a/src/simplnx/Filter/Actions/ImportObjectAction.cpp b/src/simplnx/Filter/Actions/ImportObjectAction.cpp index 55b0339225..a136f99f7a 100644 --- a/src/simplnx/Filter/Actions/ImportObjectAction.cpp +++ b/src/simplnx/Filter/Actions/ImportObjectAction.cpp @@ -14,8 +14,8 @@ constexpr nx::core::int32 k_InsertFailureError = -6301; namespace nx::core { -ImportObjectAction::ImportObjectAction(const std::shared_ptr& importObject, const DataPath& path) -: IDataCreationAction(path) +ImportObjectAction::ImportObjectAction(const std::shared_ptr& importObject, const DataPath& path) +: AbstractDataCreationAction(path) , m_ImportData(importObject) { } @@ -25,7 +25,7 @@ ImportObjectAction::~ImportObjectAction() noexcept = default; Result<> ImportObjectAction::apply(DataStructure& dataStructure, Mode mode) const { static constexpr StringLiteral prefix = "ImportObjectAction: "; - const auto importData = std::shared_ptr(getImportObject()->shallowCopy()); + const auto importData = std::shared_ptr(getImportObject()->shallowCopy()); // Clear all children before inserting into the DataStructure if(const auto importGroup = std::dynamic_pointer_cast(importData); importGroup != nullptr) { @@ -45,7 +45,7 @@ IDataAction::UniquePointer ImportObjectAction::clone() const return std::make_unique(m_ImportData, getCreatedPath()); } -std::shared_ptr ImportObjectAction::getImportObject() const +std::shared_ptr ImportObjectAction::getImportObject() const { return m_ImportData; } diff --git a/src/simplnx/Filter/Actions/ImportObjectAction.hpp b/src/simplnx/Filter/Actions/ImportObjectAction.hpp index 43bcb82af4..b76f3deda1 100644 --- a/src/simplnx/Filter/Actions/ImportObjectAction.hpp +++ b/src/simplnx/Filter/Actions/ImportObjectAction.hpp @@ -7,12 +7,12 @@ namespace nx::core /** * @brief Action for importing DataObjects into a DataStructure. */ -class SIMPLNX_EXPORT ImportObjectAction : public IDataCreationAction +class SIMPLNX_EXPORT ImportObjectAction : public AbstractDataCreationAction { public: ImportObjectAction() = delete; - ImportObjectAction(const std::shared_ptr& importObject, const DataPath& path); + ImportObjectAction(const std::shared_ptr& importObject, const DataPath& path); ~ImportObjectAction() noexcept override; @@ -37,13 +37,13 @@ class SIMPLNX_EXPORT ImportObjectAction : public IDataCreationAction UniquePointer clone() const override; /** - * @brief Returns a shared_ptr to the DataObject being imported into the DataStructure. - * @return std::shared_ptr + * @brief Returns a shared_ptr to the AbstractDataObject being imported into the DataStructure. + * @return std::shared_ptr */ - std::shared_ptr getImportObject() const; + std::shared_ptr getImportObject() const; /** - * @brief Returns the path used to insert the DataObject into the DataStructure. + * @brief Returns the path used to insert the AbstractDataObject into the DataStructure. * @return DataPath */ DataPath path() const; @@ -55,6 +55,6 @@ class SIMPLNX_EXPORT ImportObjectAction : public IDataCreationAction std::vector getAllCreatedPaths() const override; private: - std::shared_ptr m_ImportData; + std::shared_ptr m_ImportData; }; } // namespace nx::core \ No newline at end of file diff --git a/src/simplnx/Filter/Actions/RenameDataAction.cpp b/src/simplnx/Filter/Actions/RenameDataAction.cpp index 93fb290a69..f0b2351657 100644 --- a/src/simplnx/Filter/Actions/RenameDataAction.cpp +++ b/src/simplnx/Filter/Actions/RenameDataAction.cpp @@ -9,10 +9,10 @@ using namespace nx::core; namespace { -Result<> TerminateNodesRecursively(DataStructure& dataStructure, DataObject::IdType id, IDataAction::Mode mode, const bool checkDependence) +Result<> TerminateNodesRecursively(DataStructure& dataStructure, AbstractDataObject::IdType id, IDataAction::Mode mode, const bool checkDependence) { Result<> result = {}; - DataObject* node = dataStructure.getData(id); + AbstractDataObject* node = dataStructure.getData(id); if(checkDependence) { @@ -82,7 +82,7 @@ Result<> RenameDataAction::apply(DataStructure& dataStructure, Mode mode) const } } - DataObject::IdType targetId = std::numeric_limits::max(); + AbstractDataObject::IdType targetId = std::numeric_limits::max(); for(auto dataObjectID : dataStructure.getAllDataObjectIds()) { if(dataStructure.getData(dataObjectID)->getName() == m_NewName) @@ -92,7 +92,7 @@ Result<> RenameDataAction::apply(DataStructure& dataStructure, Mode mode) const } } - if(targetId != std::numeric_limits::max()) + if(targetId != std::numeric_limits::max()) { if(mode == Mode::Preflight) { diff --git a/src/simplnx/Filter/ConstDataParameter.hpp b/src/simplnx/Filter/ConstDataParameter.hpp index d4831ddcbd..2f8bacab04 100644 --- a/src/simplnx/Filter/ConstDataParameter.hpp +++ b/src/simplnx/Filter/ConstDataParameter.hpp @@ -25,7 +25,7 @@ class SIMPLNX_EXPORT ConstDataParameter : public DataParameter Mutability mutability() const final; /** - * @brief Takes the value and a const DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a const DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Filter/DataParameter.hpp b/src/simplnx/Filter/DataParameter.hpp index 2404f4721b..7622f69edc 100644 --- a/src/simplnx/Filter/DataParameter.hpp +++ b/src/simplnx/Filter/DataParameter.hpp @@ -39,7 +39,7 @@ class SIMPLNX_EXPORT DataParameter : public AbstractParameter Type type() const final; /** - * @brief Returns whether the parameter refers to a required or created DataObject. + * @brief Returns whether the parameter refers to a required or created AbstractDataObject. * @return */ Category category() const; diff --git a/src/simplnx/Filter/FilterTraits.hpp b/src/simplnx/Filter/FilterTraits.hpp index 46b0bdc589..e915bfdf6d 100644 --- a/src/simplnx/Filter/FilterTraits.hpp +++ b/src/simplnx/Filter/FilterTraits.hpp @@ -23,9 +23,9 @@ struct FilterTraits template <> \ struct nx::core::FilterTraits \ { \ - static inline constexpr nx::core::StringLiteral className = #filter_name; \ - static inline constexpr nx::core::StringLiteral name = SIMPLNX_DEF(ns::filter_name); \ - static inline constexpr nx::core::Uuid uuid = *nx::core::Uuid::FromString(uuidString); \ + static constexpr nx::core::StringLiteral className = #filter_name; \ + static constexpr nx::core::StringLiteral name = SIMPLNX_DEF(ns::filter_name); \ + static constexpr nx::core::Uuid uuid = *nx::core::Uuid::FromString(uuidString); \ } #define SIMPLNX_DEF_FILTER_TRAITS(ns, name, uuidString) SIMPLNX_DEF_FILTER_TRAITS_NAMED(ns, name, uuidString) diff --git a/src/simplnx/Filter/IFilter.cpp b/src/simplnx/Filter/IFilter.cpp index b06536e26b..c9c43e377e 100644 --- a/src/simplnx/Filter/IFilter.cpp +++ b/src/simplnx/Filter/IFilter.cpp @@ -1,357 +1,6 @@ #include "IFilter.hpp" -#include "simplnx/Filter/DataParameter.hpp" -#include "simplnx/Filter/ValueParameter.hpp" -#include "simplnx/Utilities/StringUtilities.hpp" - -#include -#include - -#include -#include - -using namespace nx::core; - -namespace -{ -template -void moveResult(nx::core::Result& result, std::vector& errors, std::vector& warnings) -{ - for(auto& warning : result.warnings()) - { - warnings.push_back(std::move(warning)); - } - if(!result.valid()) - { - for(auto& error : result.errors()) - { - errors.push_back(std::move(error)); - } - } -} - -std::pair> GetResolvedArgs(const Arguments& filterArgs, const Parameters& params, const IFilter& filter, const ExecutionContext& executionContext) -{ - Arguments resolvedArgs; - std::vector warnings; - - for(const auto& [name, arg] : filterArgs) - { - if(!params.contains(name)) - { - warnings.push_back(Warning{-1, fmt::format("The list of arguments for Filter '{}' contained the argument key '{}' which is not an accepted argument key. The accepted Keys are:\n{}", - filter.humanName(), name, fmt::join(params.getKeys(), ", "))}); - - continue; - } - resolvedArgs.insert(name, arg); - } - - for(const auto& [name, parameter] : params) - { - if(!filterArgs.contains(name)) - { - resolvedArgs.insert(name, parameter->defaultValue()); - } - } - - Arguments constructedArgs; - for(const auto& [name, parameter] : params) - { - constructedArgs.insert(name, parameter->construct(resolvedArgs, executionContext)); - } - - return {std::move(constructedArgs), std::move(warnings)}; -} - -std::pair>, std::set> GetGroupedParameters(const Parameters& params, const Arguments& args) -{ - std::set ungroupedParameters; - for(const auto& [name, parameter] : params) - { - ungroupedParameters.insert(name); - } - - std::map> groupedParameters; - - std::vector groupKeys = params.getGroupKeys(); - for(const auto& groupKey : groupKeys) - { - ungroupedParameters.erase(groupKey); - std::vector childKeys = params.getKeysInGroup(groupKey); - for(const auto& childKey : childKeys) - { - ungroupedParameters.erase(childKey); - } - groupedParameters.insert({groupKey, std::move(childKeys)}); - } - - return {std::move(groupedParameters), std::move(ungroupedParameters)}; -} - -Result<> ValidateParameter(std::string_view name, const AnyParameter& parameter, const Arguments& args, const DataStructure& data, const IFilter& filter) -{ - const auto& arg = args.at(name); - - IParameter::AcceptedTypes acceptedTypes = parameter->acceptedTypes(); - if(std::find(acceptedTypes.cbegin(), acceptedTypes.cend(), arg.type()) == acceptedTypes.cend()) - { - std::stringstream acceptedTypesStr; - for(const auto& acceptedType : acceptedTypes) - { - acceptedTypesStr << " " << acceptedType.name() << std::endl; - } - throw std::invalid_argument(fmt::format("A mismatch between the argument types for a parameter was detected. This can happen if the improper type is specified when creating a parameter " - "argument or if this filter is being called from another filter where the other filter is NOT using the correct parameter type.\n Filter='{}'\n " - "Parameter Name:'{}'\n Argument Name='{}'\n Argument Type: '{}'.\n The accepted types for this parameter are:\n", - filter.humanName(), parameter->humanName(), name, arg.type().name(), acceptedTypesStr.str())); - } - - switch(parameter->type()) - { - case IParameter::Type::Value: { - const auto& valueParameter = dynamic_cast(parameter.getRef()); - Result result = valueParameter.validate(arg); - return result; - } - case IParameter::Type::Data: { - const auto& dataStructureParameter = dynamic_cast(parameter.getRef()); - Result result = dataStructureParameter.validate(data, arg); - return result; - } - default: - throw std::runtime_error("Invalid parameter type"); - } -} -} // namespace - namespace nx::core { IFilter::~IFilter() noexcept = default; - -IFilter::PreflightResult IFilter::preflight(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel, - const ExecutionContext& executionContext) const -{ - Parameters params = parameters(); - - std::vector errors; - - auto [resolvedArgs, warnings] = GetResolvedArgs(args, params, *this, executionContext); - - auto [groupedParameters, ungroupedParameters] = GetGroupedParameters(params, resolvedArgs); - - for(const auto& [groupKey, dependentKeys] : groupedParameters) - { - const auto& parameter = params.at(groupKey); - Result<> result = ValidateParameter(groupKey, parameter, resolvedArgs, data, *this); - if(!ExtractResult(std::move(result), errors, warnings)) - { - continue; - } - // Only validate dependent parameters if their parent is valid - for(const auto& key : dependentKeys) - { - const auto& dependentParameter = params.at(key); - if(!params.isParameterActive(key, resolvedArgs)) - { - continue; - } - Result<> dependentResult = ValidateParameter(key, dependentParameter, resolvedArgs, data, *this); - if(!ExtractResult(std::move(dependentResult), errors, warnings)) - { - continue; - } - } - } - - // Validate ungrouped parameters - for(const auto& name : ungroupedParameters) - { - const auto& parameter = params.at(name); - Result<> result = ValidateParameter(name, parameter, resolvedArgs, data, *this); - - if(!ExtractResult(std::move(result), errors, warnings)) - { - continue; - } - } - - if(!errors.empty()) - { - return {nonstd::make_unexpected(std::move(errors)), std::move(warnings)}; - } - - PreflightResult implResult = preflightImpl(data, resolvedArgs, messageHandler, shouldCancel, executionContext); - if(shouldCancel) - { - return {MakeErrorResult(-1, "Filter cancelled")}; - } - - for(auto&& warning : warnings) - { - implResult.outputActions.warnings().push_back(std::move(warning)); - } - - return implResult; -} - -IFilter::ExecuteResult IFilter::execute(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineFilter, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const -{ - PreflightResult preflightResult = preflight(dataStructure, filterArgs, messageHandler, shouldCancel, executionContext); - if(preflightResult.outputActions.invalid()) - { - return ExecuteResult{ConvertResult(std::move(preflightResult.outputActions)), std::move(preflightResult.outputValues)}; - } - - OutputActions outputActions = std::move(preflightResult.outputActions.value()); - - Result<> outputActionsResult = ConvertResult(std::move(preflightResult.outputActions)); - - Result<> actionsResult = outputActions.applyRegular(dataStructure, IDataAction::Mode::Execute); - - Result<> preflightActionsResult = MergeResults(std::move(outputActionsResult), std::move(actionsResult)); - - if(preflightActionsResult.invalid()) - { - return ExecuteResult{std::move(preflightActionsResult), std::move(preflightResult.outputValues)}; - } - - Parameters params = parameters(); - // We can discard the warnings since they're already reported in preflight - auto [resolvedArgs, warnings] = GetResolvedArgs(filterArgs, params, *this, executionContext); - - Result<> executeImplResult = executeImpl(dataStructure, resolvedArgs, pipelineFilter, messageHandler, shouldCancel, executionContext); - if(shouldCancel) - { - return {MakeErrorResult(-1, "Filter cancelled")}; - } - - Result<> preflightActionsExecuteResult = MergeResults(std::move(preflightActionsResult), std::move(executeImplResult)); - - if(preflightActionsExecuteResult.invalid()) - { - return ExecuteResult{std::move(preflightActionsExecuteResult), std::move(preflightResult.outputValues)}; - } - // Apply any deferred actions - Result<> deferredActionsResult = outputActions.applyDeferred(dataStructure, IDataAction::Mode::Execute); - - // Validate the Geometry and Attribute Matrix objects - Result<> validGeometryAndAttributeMatrices = MergeResults(dataStructure.validateGeometries(), dataStructure.validateAttributeMatrices()); - validGeometryAndAttributeMatrices = MergeResults(validGeometryAndAttributeMatrices, deferredActionsResult); - - // Merge all the results together. - Result<> finalResult = MergeResults(std::move(preflightActionsExecuteResult), std::move(validGeometryAndAttributeMatrices)); - - return ExecuteResult{std::move(finalResult), std::move(preflightResult.outputValues)}; -} - -nlohmann::json IFilter::toJson(const Arguments& args) const -{ - nlohmann::json json; - json["parameters_version"] = parametersVersion(); - Parameters params = parameters(); - for(const auto& [name, param] : params) - { - try - { - nlohmann::json parameterJson; - if(args.contains(name)) - { - parameterJson = param->toJson(args.at(name)); - } - else - { - parameterJson = param->toJson(param->defaultValue()); - } - json[name] = std::move(parameterJson); - } catch(const std::exception& e) - { - throw std::runtime_error(fmt::format("While serializing the filter '{}' to JSON an exception was thrown with message:\n {}", className(), e.what())); - } - } - return json; -} - -Result IFilter::fromJson(const nlohmann::json& json) const -{ - Parameters params = parameters(); - Arguments args; - std::vector errors; - std::vector warnings; - - std::vector paramKeyNotFound; - std::vector jsonKeyNotFound; - - // Check that each key from the filter's parameters appears in the JSON. - for(const auto& [name, param] : params) - { - if(!json.contains(name)) - { - warnings.push_back(Warning{-5432, fmt::format("Parameter key not found in JSON for filter: '{}'\n Parameter Key '{}' missing from the JSON", className(), name)}); - args.insert(name, param->defaultValue()); - paramKeyNotFound.push_back(name); - continue; - } - const auto& jsonValue = json[name]; - Result jsonResult = param->fromJson(jsonValue); - moveResult(jsonResult, errors, warnings); - if(jsonResult.invalid()) - { - continue; - } - args.insert(name, std::move(jsonResult.value())); - } - - // Check if any keys from the JSON do NOT appear in the Filter's set of parameters - for(auto& [key, val] : json.items()) - { - if(key != "parameters_version" && !params.contains(key)) - { - warnings.push_back( - Warning{-5433, fmt::format("JSON has parameter key that does not exist in filter '{}' parameter key set.\n JSON Key '{}' missing from the parameter list", className(), key)}); - jsonKeyNotFound.push_back(key); - } - } - - // Now run an N^2 comparison between those to try and find any commonality, i.e., - // is one of the keys pretty "close" to another key. That is what is going to be - // suggested below. This relies on an algorithm to determine what is "close". This - // may not be correct or even remotely close. - auto bestMatches = StringUtilities::FindBestMatches(jsonKeyNotFound, paramKeyNotFound); - for(const auto& match : bestMatches) - { - if(!std::get<0>(match).empty() && !std::get<1>(match).empty()) - { - warnings.push_back(Warning{-5434, fmt::format("Filter '{}': JSON Parameter Warning\n JSON Parameter Key '{}' is not an accepted Parameter Key for the filter. Closest match is " - "'{}' with a match distance of {}.\n Suggested change is '{}' ==> '{}' (This is *ONLY* a suggestion.)\n You can open the pipeline file in a " - "text editor and make the changes if those changes make sense.", - className(), std::get<0>(match), std::get<1>(match), std::get<2>(match), std::get<0>(match), std::get<1>(match))}); - } - } - - if(!errors.empty()) - { - return {nonstd::make_unexpected(std::move(errors))}; - } - - return {std::move(args), std::move(warnings)}; -} - -std::vector IFilter::defaultTags() const -{ - return {}; -} - -Arguments IFilter::getDefaultArguments() const -{ - Arguments args; - - for(const auto& [key, param] : parameters()) - { - args.insertOrAssign(key, param->defaultValue()); - } - - return args; -} } // namespace nx::core diff --git a/src/simplnx/Filter/IFilter.hpp b/src/simplnx/Filter/IFilter.hpp index 6555cecbe8..cedc2ae835 100644 --- a/src/simplnx/Filter/IFilter.hpp +++ b/src/simplnx/Filter/IFilter.hpp @@ -22,8 +22,9 @@ class PipelineFilter; /** * @class IFilter - * @brief IFilter is the interface for filters providing access to both metadata (e.g. name, uuid, etc.) - * and the algorithm itself (i.e. preflight/execute). + * @brief IFilter is the pure virtual interface for all filters, providing the + * public API contract for metadata (name, uuid, etc.) and algorithm execution + * (preflight/execute). All nested types that form the public API are defined here. */ class SIMPLNX_EXPORT IFilter { @@ -136,7 +137,7 @@ class SIMPLNX_EXPORT IFilter * @brief Returns the default tags for this filter. * @return std::vector */ - virtual std::vector defaultTags() const; + virtual std::vector defaultTags() const = 0; /** * @brief Returns the parameters of the filter (i.e. its inputs) @@ -168,8 +169,8 @@ class SIMPLNX_EXPORT IFilter * @param shouldCancel * @return PreflightResult */ - PreflightResult preflight(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler = {}, const std::atomic_bool& shouldCancel = false, - const ExecutionContext& executionContext = ExecutionContext()) const; + virtual PreflightResult preflight(const DataStructure& data, const Arguments& args, const MessageHandler& messageHandler = {}, const std::atomic_bool& shouldCancel = false, + const ExecutionContext& executionContext = ExecutionContext()) const = 0; /** * @brief Applies the filter's algorithm to the DataStructure with the given arguments. Returns any warnings/errors. @@ -181,56 +182,31 @@ class SIMPLNX_EXPORT IFilter * @param shouldCancel * @return ExecuteResult */ - ExecuteResult execute(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode = nullptr, const MessageHandler& messageHandler = {}, - const std::atomic_bool& shouldCancel = false, const ExecutionContext& executionContext = ExecutionContext()) const; + virtual ExecuteResult execute(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode = nullptr, const MessageHandler& messageHandler = {}, + const std::atomic_bool& shouldCancel = false, const ExecutionContext& executionContext = ExecutionContext()) const = 0; /** * @brief Converts the given arguments to a JSON representation using the filter's parameters. * @param args * @return nlohmann::json */ - virtual nlohmann::json toJson(const Arguments& args) const; + virtual nlohmann::json toJson(const Arguments& args) const = 0; /** * @brief Converts JSON to arguments based on the filter's parameters. * @param json * @return Result */ - Result fromJson(const nlohmann::json& json) const; + virtual Result fromJson(const nlohmann::json& json) const = 0; /** - * @brief Returns the set of default arguments for this filter.k + * @brief Returns the set of default arguments for this filter. * @return Arguments */ - Arguments getDefaultArguments() const; + virtual Arguments getDefaultArguments() const = 0; protected: IFilter() = default; - - /** - * @brief Classes that implement IFilter must provide this function for preflight. - * Runs after the filter runs the checks in its parameters. - * @param data - * @param args - * @param messageHandler - * @param shouldCancel - * @return PreflightResult - */ - virtual PreflightResult preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel, - const ExecutionContext& executionContext) const = 0; - - /** - * @brief Classes that implement IFilter must provide this function for execute. - * Runs after the filter applies the OutputActions from preflight. - * @param data - * @param args - * @param pipelineNode - * @param messageHandler - * @param shouldCancel - * @return Result<> - */ - virtual Result<> executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel, const ExecutionContext& executionContext) const = 0; }; using FilterCreationFunc = std::function; diff --git a/src/simplnx/Filter/IParameter.cpp b/src/simplnx/Filter/IParameter.cpp index 5635010930..226b37157e 100644 --- a/src/simplnx/Filter/IParameter.cpp +++ b/src/simplnx/Filter/IParameter.cpp @@ -1,67 +1,5 @@ #include "IParameter.hpp" -#include "simplnx/Common/StringLiteral.hpp" -#include "simplnx/Common/StringLiteralFormatting.hpp" - -#include - namespace nx::core { -namespace -{ -constexpr StringLiteral k_ValueKey = "value"; -constexpr StringLiteral k_VersionKey = "version"; -} // namespace - -std::any IParameter::construct(const Arguments& args, const ExecutionContext& executionContext) const -{ - return args.at(name()); -} - -nlohmann::json IParameter::toJson(const std::any& value) const -{ - nlohmann::json json; - - json[k_ValueKey] = toJsonImpl(value); - json[k_VersionKey] = getVersion(); - - return json; -} - -Result IParameter::fromJson(const nlohmann::json& json) const -{ - std::vector warnings; - VersionType version = 1; - if(json.contains(k_VersionKey)) - { - nlohmann::json versionJson = json[k_VersionKey]; - if(!versionJson.is_number_unsigned()) - { - return MakeErrorResult(-2, fmt::format("{}: Parameter key '{}' is not an unsigned integer", name(), k_VersionKey)); - } - - version = versionJson.get(); - } - else - { - warnings.push_back(Warning{-1, fmt::format("{}: Parameter key '{}' does not exist. Assuming version={}. To fix this, save the pipeline file.", name(), k_VersionKey, version)}); - } - - nlohmann::json valueJson; - if(json.contains(k_ValueKey)) - { - valueJson = json[k_ValueKey]; - } - else - { - warnings.push_back(Warning{-2, fmt::format("{}: Parameter key '{}' does not exist. Assuming json is the current json object", name(), k_ValueKey, version)}); - valueJson = json; - } - - Result result = fromJsonImpl(valueJson, version); - - result.warnings().insert(result.warnings().begin(), warnings.cbegin(), warnings.cend()); - - return result; -} } // namespace nx::core diff --git a/src/simplnx/Filter/IParameter.hpp b/src/simplnx/Filter/IParameter.hpp index 013dad0f9a..67bbf831ae 100644 --- a/src/simplnx/Filter/IParameter.hpp +++ b/src/simplnx/Filter/IParameter.hpp @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -125,14 +124,14 @@ class SIMPLNX_EXPORT IParameter * Throws if value is not an accepted type. * @param value */ - nlohmann::json toJson(const std::any& value) const; + virtual nlohmann::json toJson(const std::any& value) const = 0; /** * @brief Converts the given JSON to a std::any containing the appropriate input type. * Returns any warnings/errors. * @return */ - Result fromJson(const nlohmann::json& json) const; + virtual Result fromJson(const nlohmann::json& json) const = 0; /** * @brief Creates a copy of the parameter. @@ -148,24 +147,10 @@ class SIMPLNX_EXPORT IParameter * @param executionContext * @return */ - virtual std::any construct(const Arguments& args, const ExecutionContext& executionContext) const; + virtual std::any construct(const Arguments& args, const ExecutionContext& executionContext) const = 0; protected: IParameter() = default; - - /** - * @brief Converts the given value to JSON. - * Throws if value is not an accepted type. - * @param value - */ - virtual nlohmann::json toJsonImpl(const std::any& value) const = 0; - - /** - * @brief Converts the given JSON to a std::any containing the appropriate input type. - * Returns any warnings/errors. - * @return - */ - virtual Result fromJsonImpl(const nlohmann::json& json, uint64 version) const = 0; }; using AnyParameter = AnyCloneable; diff --git a/src/simplnx/Filter/MutableDataParameter.hpp b/src/simplnx/Filter/MutableDataParameter.hpp index 8d002c1e28..8a36e6af84 100644 --- a/src/simplnx/Filter/MutableDataParameter.hpp +++ b/src/simplnx/Filter/MutableDataParameter.hpp @@ -25,7 +25,7 @@ class SIMPLNX_EXPORT MutableDataParameter : public DataParameter Mutability mutability() const final; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Filter/Output.hpp b/src/simplnx/Filter/Output.hpp index 9fbfc5434d..46756752bb 100644 --- a/src/simplnx/Filter/Output.hpp +++ b/src/simplnx/Filter/Output.hpp @@ -56,26 +56,26 @@ class SIMPLNX_EXPORT IDataAction using AnyDataAction = AnyCloneable; /** - * @brief The IDataCreationAction class is a subclass of IDataAction used for - * inserting a DataObject to a target DataStructure. + * @brief The AbstractDataCreationAction class is a subclass of IDataAction used for + * inserting a AbstractDataObject to a target DataStructure. */ -class SIMPLNX_EXPORT IDataCreationAction : public IDataAction +class SIMPLNX_EXPORT AbstractDataCreationAction : public IDataAction { public: /** - * @brief Constructs an IDataCreationAction that takes a DataPath specifying the path to be created. + * @brief Constructs an AbstractDataCreationAction that takes a DataPath specifying the path to be created. * @param createdPath */ - IDataCreationAction(const DataPath& createdPath) + AbstractDataCreationAction(const DataPath& createdPath) : m_CreatedPath(createdPath) { } - ~IDataCreationAction() noexcept override = default; + ~AbstractDataCreationAction() noexcept override = default; - IDataCreationAction(const IDataCreationAction&) = delete; - IDataCreationAction(IDataCreationAction&&) noexcept = delete; - IDataCreationAction& operator=(const IDataCreationAction&) = delete; - IDataCreationAction& operator=(IDataCreationAction&&) noexcept = delete; + AbstractDataCreationAction(const AbstractDataCreationAction&) = delete; + AbstractDataCreationAction(AbstractDataCreationAction&&) noexcept = delete; + AbstractDataCreationAction& operator=(const AbstractDataCreationAction&) = delete; + AbstractDataCreationAction& operator=(AbstractDataCreationAction&&) noexcept = delete; /** * @brief Returns the DataPath of the top level object to be created. @@ -93,7 +93,7 @@ class SIMPLNX_EXPORT IDataCreationAction : public IDataAction virtual std::vector getAllCreatedPaths() const = 0; protected: - IDataCreationAction() = default; + AbstractDataCreationAction() = default; private: DataPath m_CreatedPath; @@ -114,7 +114,7 @@ struct SIMPLNX_EXPORT DataObjectModification DataPath modifiedPath; ModifiedType modifiedType = ModifiedType::Unknown; - DataObject::Type dataObjectType = DataObject::Type::Unknown; + AbstractDataObject::Type dataObjectType = IDataObject::Type::Unknown; }; /** diff --git a/src/simplnx/Filter/ParameterTraits.hpp b/src/simplnx/Filter/ParameterTraits.hpp index 1a2f5aad43..7f321ff3e6 100644 --- a/src/simplnx/Filter/ParameterTraits.hpp +++ b/src/simplnx/Filter/ParameterTraits.hpp @@ -21,8 +21,8 @@ struct ParameterTraits template <> \ struct nx::core::ParameterTraits \ { \ - static inline constexpr nx::core::StringLiteral name = nameString; \ - static inline constexpr nx::core::Uuid uuid = *nx::core::Uuid::FromString(uuidString); \ + static constexpr nx::core::StringLiteral name = nameString; \ + static constexpr nx::core::Uuid uuid = *nx::core::Uuid::FromString(uuidString); \ } #define SIMPLNX_DEF_PARAMETER_TRAITS(type, uuidString) SIMPLNX_DEF_PARAMETER_TRAITS_NAMED(type, #type, uuidString) diff --git a/src/simplnx/Parameters/ArrayCreationParameter.cpp b/src/simplnx/Parameters/ArrayCreationParameter.cpp index 25c57717e0..19beb19600 100644 --- a/src/simplnx/Parameters/ArrayCreationParameter.cpp +++ b/src/simplnx/Parameters/ArrayCreationParameter.cpp @@ -84,7 +84,7 @@ Result<> ArrayCreationParameter::validatePath(const DataStructure& dataStructure { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(value); + const AbstractDataObject* object = dataStructure.getData(value); if(object != nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_ExistingValue, fmt::format("{}Object exists at path '{}'", prefix, value.toString())); @@ -96,7 +96,7 @@ Result<> ArrayCreationParameter::validatePath(const DataStructure& dataStructure Result ArrayCreationParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } diff --git a/src/simplnx/Parameters/ArraySelectionParameter.cpp b/src/simplnx/Parameters/ArraySelectionParameter.cpp index a8aa7a7d86..ebd9f008d9 100644 --- a/src/simplnx/Parameters/ArraySelectionParameter.cpp +++ b/src/simplnx/Parameters/ArraySelectionParameter.cpp @@ -3,8 +3,8 @@ #include "simplnx/Common/Any.hpp" #include "simplnx/Common/StringLiteralFormatting.hpp" #include "simplnx/Common/TypesUtility.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Utilities/SIMPLConversion.hpp" #include "simplnx/Utilities/StringUtilities.hpp" @@ -143,21 +143,21 @@ Result<> ArraySelectionParameter::validatePath(const DataStructure& dataStructur { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(value); + const AbstractDataObject* object = dataStructure.getData(value); if(object == nullptr) { return nx::core::MakeErrorResult<>(nx::core::FilterParameter::Constants::k_Validate_Does_Not_Exist, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); } - const auto* iArrayPtr = dynamic_cast(object); + const auto* iArrayPtr = dynamic_cast(object); if(iArrayPtr == nullptr) { return nx::core::MakeErrorResult<>(nx::core::FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Object at path '{}' must be a DataArray.", prefix, value.toString())); } - // Only validate IDataArray? Ignore StringData Array because there is only a + // Only validate AbstractDataArray? Ignore StringData Array because there is only a // single type and component dims do not matter? - const auto* dataArray = dynamic_cast(object); + const auto* dataArray = dynamic_cast(object); if(dataArray != nullptr) { if(!m_AllowedTypes.empty()) @@ -219,7 +219,7 @@ Result<> ArraySelectionParameter::validatePath(const DataStructure& dataStructur Result ArraySelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } diff --git a/src/simplnx/Parameters/ArraySelectionParameter.hpp b/src/simplnx/Parameters/ArraySelectionParameter.hpp index cac9541fa9..abfef014ea 100644 --- a/src/simplnx/Parameters/ArraySelectionParameter.hpp +++ b/src/simplnx/Parameters/ArraySelectionParameter.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/DataTypeUtilities.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" #include "simplnx/simplnx_export.hpp" @@ -12,7 +12,7 @@ namespace nx::core { /** - * @brief This Filter Parameter describes a specific DataPath where the last DataObject in + * @brief This Filter Parameter describes a specific DataPath where the last AbstractDataObject in * the path is a DataArray Object. */ class SIMPLNX_EXPORT ArraySelectionParameter : public MutableDataParameter @@ -125,7 +125,7 @@ class SIMPLNX_EXPORT ArraySelectionParameter : public MutableDataParameter Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/ArrayThresholdsParameter.cpp b/src/simplnx/Parameters/ArrayThresholdsParameter.cpp index 37282d7fac..773eb70e93 100644 --- a/src/simplnx/Parameters/ArrayThresholdsParameter.cpp +++ b/src/simplnx/Parameters/ArrayThresholdsParameter.cpp @@ -1,7 +1,7 @@ #include "ArrayThresholdsParameter.hpp" #include "simplnx/Common/Any.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/Utilities/StringUtilities.hpp" #include @@ -86,13 +86,13 @@ Result<> ArrayThresholdsParameter::validatePath(const DataStructure& dataStructu { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(dataPath); + const AbstractDataObject* object = dataStructure.getData(dataPath); if(object == nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_ExistingValue, fmt::format("{}Object does not exist at path '{}'", prefix, dataPath.toString())); } - const auto* dataArray = dynamic_cast(object); + const auto* dataArray = dynamic_cast(object); if(dataArray == nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Object at path '{}' must be a DataArray.", prefix, dataPath.toString())); diff --git a/src/simplnx/Parameters/ArrayThresholdsParameter.hpp b/src/simplnx/Parameters/ArrayThresholdsParameter.hpp index 3db57626eb..d3eb5309bc 100644 --- a/src/simplnx/Parameters/ArrayThresholdsParameter.hpp +++ b/src/simplnx/Parameters/ArrayThresholdsParameter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" #include "simplnx/Utilities/ArrayThreshold.hpp" diff --git a/src/simplnx/Parameters/AttributeMatrixSelectionParameter.cpp b/src/simplnx/Parameters/AttributeMatrixSelectionParameter.cpp index 0d76426bc2..56b15e0c0a 100644 --- a/src/simplnx/Parameters/AttributeMatrixSelectionParameter.cpp +++ b/src/simplnx/Parameters/AttributeMatrixSelectionParameter.cpp @@ -87,7 +87,7 @@ Result<> AttributeMatrixSelectionParameter::validatePath(const DataStructure& da return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* dataObject = dataStructure.getData(value); + const AbstractDataObject* dataObject = dataStructure.getData(value); if(dataObject == nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_DuplicateValue, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); @@ -105,7 +105,7 @@ Result<> AttributeMatrixSelectionParameter::validatePath(const DataStructure& da Result AttributeMatrixSelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } diff --git a/src/simplnx/Parameters/AttributeMatrixSelectionParameter.hpp b/src/simplnx/Parameters/AttributeMatrixSelectionParameter.hpp index 3e351942b2..6a8023f0c7 100644 --- a/src/simplnx/Parameters/AttributeMatrixSelectionParameter.hpp +++ b/src/simplnx/Parameters/AttributeMatrixSelectionParameter.hpp @@ -15,7 +15,7 @@ class SIMPLNX_EXPORT AttributeMatrixSelectionParameter : public MutableDataParam public: using ValueType = DataPath; - using AllowedTypes = std::set; + using AllowedTypes = std::set; AttributeMatrixSelectionParameter() = delete; AttributeMatrixSelectionParameter(const std::string& name, const std::string& humanName, const std::string& helpText, const ValueType& defaultValue); @@ -82,7 +82,7 @@ class SIMPLNX_EXPORT AttributeMatrixSelectionParameter : public MutableDataParam Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/CalculatorParameter.cpp b/src/simplnx/Parameters/CalculatorParameter.cpp index 8694ddaefc..943f06ccc2 100644 --- a/src/simplnx/Parameters/CalculatorParameter.cpp +++ b/src/simplnx/Parameters/CalculatorParameter.cpp @@ -117,7 +117,7 @@ Result<> CalculatorParameter::validate(const DataStructure& dataStructure, const } if(!structValue.m_SelectedGroup.empty()) // if empty then using root group { - const DataObject* dataObject = dataStructure.getData(structValue.m_SelectedGroup); + const AbstractDataObject* dataObject = dataStructure.getData(structValue.m_SelectedGroup); if(dataObject == nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_DuplicateValue, @@ -136,7 +136,7 @@ Result<> CalculatorParameter::validate(const DataStructure& dataStructure, const Result CalculatorParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& structValue = GetAnyRef(value); - DataObject* object = dataStructure.getData(structValue.m_SelectedGroup); + AbstractDataObject* object = dataStructure.getData(structValue.m_SelectedGroup); return {{object}}; } diff --git a/src/simplnx/Parameters/CalculatorParameter.hpp b/src/simplnx/Parameters/CalculatorParameter.hpp index 9300b49406..2f1c4d726b 100644 --- a/src/simplnx/Parameters/CalculatorParameter.hpp +++ b/src/simplnx/Parameters/CalculatorParameter.hpp @@ -81,7 +81,7 @@ class SIMPLNX_EXPORT CalculatorParameter : public MutableDataParameter Result<> validate(const DataStructure& dataStructure, const std::any& value) const override; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/DataGroupCreationParameter.cpp b/src/simplnx/Parameters/DataGroupCreationParameter.cpp index 1bff563921..2c105928e7 100644 --- a/src/simplnx/Parameters/DataGroupCreationParameter.cpp +++ b/src/simplnx/Parameters/DataGroupCreationParameter.cpp @@ -85,7 +85,7 @@ Result<> DataGroupCreationParameter::validatePath(const DataStructure& dataStruc { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(value); + const AbstractDataObject* object = dataStructure.getData(value); if(object != nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_ExistingValue, fmt::format("{}Object exists at path '{}'", prefix, value.toString())); @@ -97,7 +97,7 @@ Result<> DataGroupCreationParameter::validatePath(const DataStructure& dataStruc Result DataGroupCreationParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } diff --git a/src/simplnx/Parameters/DataGroupCreationParameter.hpp b/src/simplnx/Parameters/DataGroupCreationParameter.hpp index fc95de4b09..3571e4bdcf 100644 --- a/src/simplnx/Parameters/DataGroupCreationParameter.hpp +++ b/src/simplnx/Parameters/DataGroupCreationParameter.hpp @@ -79,7 +79,7 @@ class SIMPLNX_EXPORT DataGroupCreationParameter : public MutableDataParameter Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/DataGroupSelectionParameter.cpp b/src/simplnx/Parameters/DataGroupSelectionParameter.cpp index d5436ab176..76cf3b294e 100644 --- a/src/simplnx/Parameters/DataGroupSelectionParameter.cpp +++ b/src/simplnx/Parameters/DataGroupSelectionParameter.cpp @@ -96,7 +96,7 @@ Result<> DataGroupSelectionParameter::validatePath(const DataStructure& dataStru return MakeErrorResult(FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* dataObject = dataStructure.getData(value); + const AbstractDataObject* dataObject = dataStructure.getData(value); if(dataObject == nullptr) { return MakeErrorResult(FilterParameter::Constants::k_Validate_DuplicateValue, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); @@ -121,7 +121,7 @@ Result<> DataGroupSelectionParameter::validatePath(const DataStructure& dataStru Result DataGroupSelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } diff --git a/src/simplnx/Parameters/DataGroupSelectionParameter.hpp b/src/simplnx/Parameters/DataGroupSelectionParameter.hpp index a16dbec8b5..77a194f10d 100644 --- a/src/simplnx/Parameters/DataGroupSelectionParameter.hpp +++ b/src/simplnx/Parameters/DataGroupSelectionParameter.hpp @@ -67,7 +67,7 @@ class SIMPLNX_EXPORT DataGroupSelectionParameter : public MutableDataParameter ValueType defaultPath() const; /** - * @brief Returns the list of allowed DataObject types. + * @brief Returns the list of allowed AbstractDataObject types. * @return */ const AllowedTypes& allowedTypes() const; @@ -89,7 +89,7 @@ class SIMPLNX_EXPORT DataGroupSelectionParameter : public MutableDataParameter Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/DataObjectNameParameter.cpp b/src/simplnx/Parameters/DataObjectNameParameter.cpp index a453b835ab..44fe44b675 100644 --- a/src/simplnx/Parameters/DataObjectNameParameter.cpp +++ b/src/simplnx/Parameters/DataObjectNameParameter.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Any.hpp" #include "simplnx/Common/StringLiteralFormatting.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/Utilities/SIMPLConversion.hpp" #include @@ -80,7 +80,7 @@ Result<> DataObjectNameParameter::validateName(const std::string& value) const return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataObjectName cannot be empty", prefix)); } - if(!DataObject::IsValidName(value)) + if(!AbstractDataObject::IsValidName(value)) { return MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_InvalidDataObjectName, fmt::format("{}'{}' is not a valid DataObject name", prefix, value)); } diff --git a/src/simplnx/Parameters/DataPathSelectionParameter.cpp b/src/simplnx/Parameters/DataPathSelectionParameter.cpp index 40d8c94e12..43ea15818e 100644 --- a/src/simplnx/Parameters/DataPathSelectionParameter.cpp +++ b/src/simplnx/Parameters/DataPathSelectionParameter.cpp @@ -85,7 +85,7 @@ Result<> DataPathSelectionParameter::validatePath(const DataStructure& dataStruc return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* dataObject = dataStructure.getData(value); + const AbstractDataObject* dataObject = dataStructure.getData(value); if(dataObject == nullptr) { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_DuplicateValue, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); @@ -97,7 +97,7 @@ Result<> DataPathSelectionParameter::validatePath(const DataStructure& dataStruc Result DataPathSelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } } // namespace nx::core diff --git a/src/simplnx/Parameters/DataPathSelectionParameter.hpp b/src/simplnx/Parameters/DataPathSelectionParameter.hpp index 4ba15b1b4d..d2412fe6eb 100644 --- a/src/simplnx/Parameters/DataPathSelectionParameter.hpp +++ b/src/simplnx/Parameters/DataPathSelectionParameter.hpp @@ -79,7 +79,7 @@ class SIMPLNX_EXPORT DataPathSelectionParameter : public MutableDataParameter Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/EnsembleInfoParameter.hpp b/src/simplnx/Parameters/EnsembleInfoParameter.hpp index 3b736f6c91..a8c4dd6d8b 100644 --- a/src/simplnx/Parameters/EnsembleInfoParameter.hpp +++ b/src/simplnx/Parameters/EnsembleInfoParameter.hpp @@ -25,7 +25,7 @@ class SIMPLNX_EXPORT EnsembleInfoParameter : public ValueParameter "Tetragonal-High 4/mmm", "Trigonal-Low -3", "Trigonal-High -3m"}; static inline const std::vector k_PhaseTypes = {"Primary", "Precipitate", "Transformation", "Matrix", "Boundary"}; - static inline constexpr StringLiteral k_DefaultPhaseName = "_PHASE_NAME_"; + static constexpr StringLiteral k_DefaultPhaseName = "_PHASE_NAME_"; EnsembleInfoParameter() = delete; diff --git a/src/simplnx/Parameters/GeometrySelectionParameter.cpp b/src/simplnx/Parameters/GeometrySelectionParameter.cpp index 921f81afa2..2717212726 100644 --- a/src/simplnx/Parameters/GeometrySelectionParameter.cpp +++ b/src/simplnx/Parameters/GeometrySelectionParameter.cpp @@ -94,16 +94,16 @@ Result<> GeometrySelectionParameter::validatePath(const DataStructure& dataStruc return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}Geometry Path cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(value); + const AbstractDataObject* object = dataStructure.getData(value); if(object == nullptr) { return nx::core::MakeErrorResult<>(nx::core::FilterParameter::Constants::k_Validate_Does_Not_Exist, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); } - const IGeometry* geometry = dynamic_cast(object); + const AbstractGeometry* geometry = dynamic_cast(object); if(geometry == nullptr) { - return MakeErrorResult(-3, fmt::format("Object at path '{}' is not a subclass of IGeometry.", value.toString())); + return MakeErrorResult(-3, fmt::format("Object at path '{}' is not a subclass of AbstractGeometry.", value.toString())); } // Look for the actual geometry type that the user selected in the allowed set @@ -112,15 +112,15 @@ Result<> GeometrySelectionParameter::validatePath(const DataStructure& dataStruc return {}; } - return nx::core::MakeErrorResult( - nx::core::FilterParameter::Constants::k_Validate_AllowedType_Error, - fmt::format("{}Geometry at path '{}' was of type '{}', but only {} are allowed", prefix, value.toString(), geometry->getTypeName(), IGeometry::StringListFromGeometryType(m_AllowedTypes))); + return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_AllowedType_Error, + fmt::format("{}Geometry at path '{}' was of type '{}', but only {} are allowed", prefix, value.toString(), geometry->getTypeName(), + AbstractGeometry::StringListFromGeometryType(m_AllowedTypes))); } Result GeometrySelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - IGeometry* object = dataStructure.getDataAs(path); + AbstractGeometry* object = dataStructure.getDataAs(path); return {{object}}; } diff --git a/src/simplnx/Parameters/GeometrySelectionParameter.hpp b/src/simplnx/Parameters/GeometrySelectionParameter.hpp index c158775785..f5da120afa 100644 --- a/src/simplnx/Parameters/GeometrySelectionParameter.hpp +++ b/src/simplnx/Parameters/GeometrySelectionParameter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" #include "simplnx/simplnx_export.hpp" @@ -11,14 +11,14 @@ namespace nx::core { /** - * @brief This Filter Parameter describes a specific DataPath where the last DataObject in + * @brief This Filter Parameter describes a specific DataPath where the last AbstractDataObject in * the path is a geometry of the specified type. */ class SIMPLNX_EXPORT GeometrySelectionParameter : public MutableDataParameter { public: using ValueType = DataPath; - using AllowedType = IGeometry::Type; + using AllowedType = AbstractGeometry::Type; using AllowedTypes = std::set; GeometrySelectionParameter() = delete; @@ -70,7 +70,7 @@ class SIMPLNX_EXPORT GeometrySelectionParameter : public MutableDataParameter const ValueType& defaultPath() const; /** - * @brief Returns the list of allowed DataObject types. + * @brief Returns the list of allowed AbstractDataObject types. * @return */ const AllowedTypes& allowedTypes() const; @@ -92,7 +92,7 @@ class SIMPLNX_EXPORT GeometrySelectionParameter : public MutableDataParameter Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/MultiArraySelectionParameter.cpp b/src/simplnx/Parameters/MultiArraySelectionParameter.cpp index f2df0bb37e..23ca607f50 100644 --- a/src/simplnx/Parameters/MultiArraySelectionParameter.cpp +++ b/src/simplnx/Parameters/MultiArraySelectionParameter.cpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Any.hpp" #include "simplnx/Common/StringLiteralFormatting.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Utilities/SIMPLConversion.hpp" #include "simplnx/Utilities/StringUtilities.hpp" @@ -135,22 +135,22 @@ Result<> MultiArraySelectionParameter::validatePaths(const DataStructure& dataSt errors.push_back(Error{FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty at index {}", prefix, i)}); continue; } - const DataObject* object = dataStructure.getData(path); + const AbstractDataObject* object = dataStructure.getData(path); if(object == nullptr) { errors.push_back(Error{FilterParameter::Constants::k_Validate_Does_Not_Exist, fmt::format("{}Object does not exist at path '{}'", prefix, path.toString())}); continue; } - const auto* dataArray = dataStructure.getDataAs(path); + const auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { - errors.push_back(Error{FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Object at path '{}' is not an IArray type", prefix, path.toString())}); + errors.push_back(Error{FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Object at path '{}' is not an AbstractArray type", prefix, path.toString())}); continue; } - if(m_AllowedTypes.find(IArray::ArrayType::Any) == m_AllowedTypes.end() && m_AllowedTypes.count(dataArray->getArrayType()) == 0) + if(m_AllowedTypes.find(AbstractArray::ArrayType::Any) == m_AllowedTypes.end() && m_AllowedTypes.count(dataArray->getArrayType()) == 0) { errors.push_back(Error{FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Array at path '{}' was of type {}, but only {} are allowed", prefix, path.toString(), - dataArray->getTypeName(), IArray::StringListFromArrayType(m_AllowedTypes))}); + dataArray->getTypeName(), AbstractArray::StringListFromArrayType(m_AllowedTypes))}); continue; } if(!m_RequiredComponentShapes.empty()) @@ -190,7 +190,7 @@ Result<> MultiArraySelectionParameter::validatePaths(const DataStructure& dataSt Result MultiArraySelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& paths = GetAnyRef(value); - std::vector objects; + std::vector objects; for(const auto& path : paths) { objects.push_back(dataStructure.getData(path)); diff --git a/src/simplnx/Parameters/MultiArraySelectionParameter.hpp b/src/simplnx/Parameters/MultiArraySelectionParameter.hpp index f14d525af6..cfa6292fd2 100644 --- a/src/simplnx/Parameters/MultiArraySelectionParameter.hpp +++ b/src/simplnx/Parameters/MultiArraySelectionParameter.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/DataTypeUtilities.hpp" -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" @@ -14,7 +14,7 @@ class SIMPLNX_EXPORT MultiArraySelectionParameter : public MutableDataParameter { public: using ValueType = std::vector; - using AllowedTypes = std::set; + using AllowedTypes = std::set; using AllowedDataTypes = nx::core::DataTypeSetType; using AllowedComponentShapes = std::vector; @@ -68,7 +68,7 @@ class SIMPLNX_EXPORT MultiArraySelectionParameter : public MutableDataParameter ValueType defaultPath() const; /** - * @brief Returns the set of allowed IArray types. An empty set means all are allowed. + * @brief Returns the set of allowed AbstractArray types. An empty set means all are allowed. * @return */ AllowedTypes allowedTypes() const; @@ -102,7 +102,7 @@ class SIMPLNX_EXPORT MultiArraySelectionParameter : public MutableDataParameter Result<> validatePaths(const DataStructure& dataStructure, const ValueType& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/MultiPathSelectionParameter.cpp b/src/simplnx/Parameters/MultiPathSelectionParameter.cpp index 39eafa1ad6..7db84f0a1d 100644 --- a/src/simplnx/Parameters/MultiPathSelectionParameter.cpp +++ b/src/simplnx/Parameters/MultiPathSelectionParameter.cpp @@ -114,7 +114,7 @@ Result<> MultiPathSelectionParameter::validatePaths(const DataStructure& dataStr errors.push_back(Error{FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty at index {}", prefix, i)}); continue; } - const DataObject* object = dataStructure.getData(path); + const AbstractDataObject* object = dataStructure.getData(path); if(object == nullptr) { errors.push_back(Error{FilterParameter::Constants::k_Validate_Does_Not_Exist, fmt::format("{}Object does not exist at path '{}'", prefix, path.toString())}); @@ -133,7 +133,7 @@ Result<> MultiPathSelectionParameter::validatePaths(const DataStructure& dataStr Result MultiPathSelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& paths = GetAnyRef(value); - std::vector objects; + std::vector objects; for(const auto& path : paths) { objects.push_back(dataStructure.getData(path)); diff --git a/src/simplnx/Parameters/MultiPathSelectionParameter.hpp b/src/simplnx/Parameters/MultiPathSelectionParameter.hpp index 91fcb1d54d..f7b6560924 100644 --- a/src/simplnx/Parameters/MultiPathSelectionParameter.hpp +++ b/src/simplnx/Parameters/MultiPathSelectionParameter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" @@ -79,7 +79,7 @@ class SIMPLNX_EXPORT MultiPathSelectionParameter : public MutableDataParameter Result<> validatePaths(const DataStructure& dataStructure, const ValueType& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure The active DataStructure to use during resolution * @param value The value to resolve diff --git a/src/simplnx/Parameters/NeighborListSelectionParameter.cpp b/src/simplnx/Parameters/NeighborListSelectionParameter.cpp index 97502e8fd0..e4f1cc4cf2 100644 --- a/src/simplnx/Parameters/NeighborListSelectionParameter.cpp +++ b/src/simplnx/Parameters/NeighborListSelectionParameter.cpp @@ -3,7 +3,7 @@ #include "simplnx/Common/Any.hpp" #include "simplnx/Common/StringLiteralFormatting.hpp" #include "simplnx/Common/TypesUtility.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include #include @@ -122,13 +122,13 @@ Result<> NeighborListSelectionParameter::validatePath(const DataStructure& dataS { return nx::core::MakeErrorResult(nx::core::FilterParameter::Constants::k_Validate_Empty_Value, fmt::format("{}DataPath cannot be empty", prefix)); } - const DataObject* object = dataStructure.getData(value); + const AbstractDataObject* object = dataStructure.getData(value); if(object == nullptr) { return nx::core::MakeErrorResult<>(nx::core::FilterParameter::Constants::k_Validate_Does_Not_Exist, fmt::format("{}Object does not exist at path '{}'", prefix, value.toString())); } - const auto* neighborList = dynamic_cast(object); + const auto* neighborList = dynamic_cast(object); if(neighborList == nullptr) { return nx::core::MakeErrorResult<>(nx::core::FilterParameter::Constants::k_Validate_Type_Error, fmt::format("{}Object at path '{}' is not a neighbor list.", prefix, value.toString())); @@ -150,7 +150,7 @@ Result<> NeighborListSelectionParameter::validatePath(const DataStructure& dataS Result NeighborListSelectionParameter::resolve(DataStructure& dataStructure, const std::any& value) const { const auto& path = GetAnyRef(value); - DataObject* object = dataStructure.getData(path); + AbstractDataObject* object = dataStructure.getData(path); return {{object}}; } } // namespace nx::core diff --git a/src/simplnx/Parameters/NeighborListSelectionParameter.hpp b/src/simplnx/Parameters/NeighborListSelectionParameter.hpp index e18695d4e7..9b26421d55 100644 --- a/src/simplnx/Parameters/NeighborListSelectionParameter.hpp +++ b/src/simplnx/Parameters/NeighborListSelectionParameter.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/DataStructure/IArray.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" #include "simplnx/simplnx_export.hpp" @@ -88,7 +88,7 @@ class SIMPLNX_EXPORT NeighborListSelectionParameter : public MutableDataParamete Result<> validatePath(const DataStructure& dataStructure, const DataPath& value) const; /** - * @brief Takes the value and a mutable DataStructure and attempts store the actual derived DataObject in the std::any. + * @brief Takes the value and a mutable DataStructure and attempts store the actual derived AbstractDataObject in the std::any. * Returns any warnings/errors. * @param dataStructure * @param value diff --git a/src/simplnx/Parameters/ReadHDF5DatasetParameter.hpp b/src/simplnx/Parameters/ReadHDF5DatasetParameter.hpp index a24c69ddfb..c4818a0870 100644 --- a/src/simplnx/Parameters/ReadHDF5DatasetParameter.hpp +++ b/src/simplnx/Parameters/ReadHDF5DatasetParameter.hpp @@ -51,9 +51,9 @@ class SIMPLNX_EXPORT ReadHDF5DatasetParameter : public ValueParameter std::string componentDimensions; std::string tupleDimensions; - static inline constexpr StringLiteral k_DatasetPath_Key = "dataset_path"; - static inline constexpr StringLiteral k_ComponentDimensions_Key = "component_dimensions"; - static inline constexpr StringLiteral k_TupleDimensions_Key = "tuple_dimensions"; + static constexpr StringLiteral k_DatasetPath_Key = "dataset_path"; + static constexpr StringLiteral k_ComponentDimensions_Key = "component_dimensions"; + static constexpr StringLiteral k_TupleDimensions_Key = "tuple_dimensions"; static Result ReadJson(const nlohmann::json& json); diff --git a/src/simplnx/Pipeline/AbstractPipelineNode.hpp b/src/simplnx/Pipeline/AbstractPipelineNode.hpp index f75f8221a2..d05f07c650 100644 --- a/src/simplnx/Pipeline/AbstractPipelineNode.hpp +++ b/src/simplnx/Pipeline/AbstractPipelineNode.hpp @@ -1,5 +1,7 @@ #pragma once +#include "simplnx/Pipeline/IPipelineNode.hpp" + #include "simplnx/Common/Types.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/Filter/ExecutionContext.hpp" @@ -23,16 +25,13 @@ class Pipeline; * all items that can be contained within a pipeline. Shared API is declared * for implementation in derived classes. */ -class SIMPLNX_EXPORT AbstractPipelineNode +class SIMPLNX_EXPORT AbstractPipelineNode : public IPipelineNode { public: // Making Pipeline a friend class allows Pipelines to set flags of the nodes // they contain. friend class Pipeline; - using RenamedPath = std::pair; - using RenamedPaths = std::vector; - using SignalType = nod::signal&)>; using PipelineRunStateSignalType = nod::signal; @@ -75,47 +74,38 @@ class SIMPLNX_EXPORT AbstractPipelineNode CancelledSignalType& getCancelledSignal(); void sendCancelledMessage(); - /** - * @brief Specific types of pipeline node for quick type checking. - */ - enum class NodeType - { - Pipeline, - Filter - }; - - virtual ~AbstractPipelineNode() noexcept; + ~AbstractPipelineNode() noexcept override; /** * @brief Returns the node type for quick type checking. * @return NodeType */ - virtual NodeType getType() const = 0; + NodeType getType() const override = 0; /** * @brief Returns the pipeline node's name. * @return std::string */ - virtual std::string getName() const = 0; + std::string getName() const override = 0; /** * @brief Returns a pointer to the parent Pipeline. Returns nullptr if no * parent could be found. * @return Pipeline* */ - Pipeline* getParentPipeline() const; + Pipeline* getParentPipeline() const override; /** * @brief Sets the parent Pipeline pointer. * @param parent */ - void setParentPipeline(Pipeline* parent); + void setParentPipeline(Pipeline* parent) override; /** * @brief Returns true if the node has a parent pipeline. Returns false otherwise. * @return bool */ - bool hasParentPipeline() const; + bool hasParentPipeline() const override; /** * @brief Attempts to preflight the node using the provided DataStructure. @@ -123,7 +113,7 @@ class SIMPLNX_EXPORT AbstractPipelineNode * @param data * @return bool */ - virtual bool preflight(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) = 0; + bool preflight(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) override = 0; /** * @brief Attempts to preflight the node using the provided DataStructure. @@ -135,7 +125,7 @@ class SIMPLNX_EXPORT AbstractPipelineNode * @param allowRenaming * @return bool */ - virtual bool preflight(DataStructure& dataStructure, RenamedPaths& renamedPaths, const std::atomic_bool& shouldCancel, bool allowRenaming) = 0; + bool preflight(DataStructure& dataStructure, RenamedPaths& renamedPaths, const std::atomic_bool& shouldCancel, bool allowRenaming) override = 0; /** * @brief Attempts to execute the node using the provided DataStructure. @@ -143,90 +133,90 @@ class SIMPLNX_EXPORT AbstractPipelineNode * @param data * @return bool */ - virtual bool execute(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) = 0; + bool execute(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) override = 0; /** * @brief Creates and returns a unique pointer to a copy of the node. * @return std::unique_ptr */ - virtual std::unique_ptr deepCopy() const = 0; + std::unique_ptr deepCopy() const override = 0; /** * @brief Returns the fault state of the node. * @return bool */ - FaultState getFaultState() const; + FaultState getFaultState() const override; /** * @brief Returns true if the node has errors. Otherwise, this method returns * false. * @return bool */ - bool hasErrors() const; + bool hasErrors() const override; /** * @brief Returns true if the node has warnings. Otherwise, this method * returns false. * @return bool */ - bool hasWarnings() const; + bool hasWarnings() const override; /** * @brief Returns true if the node is disabled. Otherwise, this method * returns false. * @return bool */ - bool isDisabled() const; + bool isDisabled() const override; /** * @brief Returns true if the node is enabled. Otherwise, this method * returns false. * @return bool */ - bool isEnabled() const; + bool isEnabled() const override; /** * @brief Sets whether the node is disabled. * @param disabled = true */ - void setDisabled(bool disabled = true); + void setDisabled(bool disabled = true) override; /** * @brief Sets whether the node is disabled. * @param enabled = true */ - void setEnabled(bool enabled = true); + void setEnabled(bool enabled = true) override; /** * @brief Returns a const reference to the executed DataStructure. * @return const DataStructure& */ - const DataStructure& getDataStructure() const; + const DataStructure& getDataStructure() const override; /** * @brief Returns a const reference to the preflight DataStructure. * @return const DataStructure& */ - const DataStructure& getPreflightStructure() const; + const DataStructure& getPreflightStructure() const override; /** * @brief Clears the stored DataStructure and marks the node as dirty. The * dirty status does not propogate to dependent nodes. */ - void clearDataStructure(); + void clearDataStructure() override; /** * @brief Clears the stored preflight and execute DataStructures, marks the * node as dirty, and clears the preflighted flag. */ - void clearPreflightStructure(); + void clearPreflightStructure() override; /** * @brief Returns true if the node has been preflighted and contains the * resulting DataStructure. Returns false otherwise. * @return bool */ - bool isPreflighted() const; + bool isPreflighted() const override; /** * @brief Returns a reference to the signal used for messaging. @@ -238,20 +228,20 @@ class SIMPLNX_EXPORT AbstractPipelineNode * @brief Converts the current node to json. * @return */ - nlohmann::json toJson() const; + nlohmann::json toJson() const override; /** * @brief Returns a Pipeline containing the entire pipeline up to the current * node. This will expand DREAM3D files as their own Pipeline. * @return std::unique_ptr */ - std::unique_ptr getPrecedingPipeline() const; + std::unique_ptr getPrecedingPipeline() const override; /** * @brief Gets the executionContext for the pipeline. * @return */ - ExecutionContext getPipelineExecutionContext() const; + ExecutionContext getPipelineExecutionContext() const override; protected: /** diff --git a/src/simplnx/Pipeline/IPipelineNode.cpp b/src/simplnx/Pipeline/IPipelineNode.cpp new file mode 100644 index 0000000000..841e2584c2 --- /dev/null +++ b/src/simplnx/Pipeline/IPipelineNode.cpp @@ -0,0 +1,6 @@ +#include "IPipelineNode.hpp" + +namespace nx::core +{ +IPipelineNode::~IPipelineNode() noexcept = default; +} // namespace nx::core diff --git a/src/simplnx/Pipeline/IPipelineNode.hpp b/src/simplnx/Pipeline/IPipelineNode.hpp new file mode 100644 index 0000000000..8eb7a61b9b --- /dev/null +++ b/src/simplnx/Pipeline/IPipelineNode.hpp @@ -0,0 +1,208 @@ +#pragma once + +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/Filter/ExecutionContext.hpp" +#include "simplnx/simplnx_export.hpp" + +#include + +#include +#include +#include + +namespace nx::core +{ +class AbstractPipelineNode; +class Pipeline; + +/** + * @class IPipelineNode + * @brief Pure interface defining the public contract for all pipeline nodes. + * Provides the core identity, operations, and state query methods that every + * pipeline node must implement. Signal/observer mechanisms are provided by + * the AbstractPipelineNode base class. + */ +class SIMPLNX_EXPORT IPipelineNode +{ +public: + /** + * @brief Specific types of pipeline node for quick type checking. + */ + enum class NodeType + { + Pipeline, + Filter + }; + + using RenamedPath = std::pair; + using RenamedPaths = std::vector; + + virtual ~IPipelineNode() noexcept; + + IPipelineNode(const IPipelineNode&) = delete; + IPipelineNode(IPipelineNode&&) noexcept = delete; + IPipelineNode& operator=(const IPipelineNode&) = delete; + IPipelineNode& operator=(IPipelineNode&&) noexcept = delete; + + /** + * @brief Returns the node type for quick type checking. + * @return NodeType + */ + virtual NodeType getType() const = 0; + + /** + * @brief Returns the pipeline node's name. + * @return std::string + */ + virtual std::string getName() const = 0; + + /** + * @brief Returns a pointer to the parent Pipeline. Returns nullptr if no + * parent could be found. + * @return Pipeline* + */ + virtual Pipeline* getParentPipeline() const = 0; + + /** + * @brief Sets the parent Pipeline pointer. + * @param parent + */ + virtual void setParentPipeline(Pipeline* parent) = 0; + + /** + * @brief Returns true if the node has a parent pipeline. Returns false otherwise. + * @return bool + */ + virtual bool hasParentPipeline() const = 0; + + /** + * @brief Attempts to preflight the node using the provided DataStructure. + * Returns true if preflighting succeeded. Otherwise, this returns false. + * @param dataStructure + * @param shouldCancel + * @return bool + */ + virtual bool preflight(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) = 0; + + /** + * @brief Attempts to preflight the node using the provided DataStructure. + * Returns true if preflighting succeeded. Otherwise, this returns false. + * @param dataStructure + * @param renamedPaths Collection of renamed output paths. + * @param shouldCancel + * @param allowRenaming + * @return bool + */ + virtual bool preflight(DataStructure& dataStructure, RenamedPaths& renamedPaths, const std::atomic_bool& shouldCancel, bool allowRenaming) = 0; + + /** + * @brief Attempts to execute the node using the provided DataStructure. + * Returns true if execution succeeded. Otherwise, this returns false. + * @param dataStructure + * @param shouldCancel + * @return bool + */ + virtual bool execute(DataStructure& dataStructure, const std::atomic_bool& shouldCancel) = 0; + + /** + * @brief Creates and returns a unique pointer to a copy of the node. + * @return std::unique_ptr + */ + virtual std::unique_ptr deepCopy() const = 0; + + /** + * @brief Returns the fault state of the node. + * @return FaultState + */ + virtual FaultState getFaultState() const = 0; + + /** + * @brief Returns true if the node has errors. Otherwise, this method returns false. + * @return bool + */ + virtual bool hasErrors() const = 0; + + /** + * @brief Returns true if the node has warnings. Otherwise, this method returns false. + * @return bool + */ + virtual bool hasWarnings() const = 0; + + /** + * @brief Returns true if the node is disabled. Otherwise, this method returns false. + * @return bool + */ + virtual bool isDisabled() const = 0; + + /** + * @brief Returns true if the node is enabled. Otherwise, this method returns false. + * @return bool + */ + virtual bool isEnabled() const = 0; + + /** + * @brief Sets whether the node is disabled. + * @param disabled = true + */ + virtual void setDisabled(bool disabled = true) = 0; + + /** + * @brief Sets whether the node is disabled. + * @param enabled = true + */ + virtual void setEnabled(bool enabled = true) = 0; + + /** + * @brief Returns a const reference to the executed DataStructure. + * @return const DataStructure& + */ + virtual const DataStructure& getDataStructure() const = 0; + + /** + * @brief Returns a const reference to the preflight DataStructure. + * @return const DataStructure& + */ + virtual const DataStructure& getPreflightStructure() const = 0; + + /** + * @brief Clears the stored DataStructure and marks the node as dirty. + */ + virtual void clearDataStructure() = 0; + + /** + * @brief Clears the stored preflight and execute DataStructures, marks the + * node as dirty, and clears the preflighted flag. + */ + virtual void clearPreflightStructure() = 0; + + /** + * @brief Returns true if the node has been preflighted and contains the + * resulting DataStructure. Returns false otherwise. + * @return bool + */ + virtual bool isPreflighted() const = 0; + + /** + * @brief Converts the current node to json. + * @return nlohmann::json + */ + virtual nlohmann::json toJson() const = 0; + + /** + * @brief Returns a Pipeline containing the entire pipeline up to the current + * node. This will expand DREAM3D files as their own Pipeline. + * @return std::unique_ptr + */ + virtual std::unique_ptr getPrecedingPipeline() const = 0; + + /** + * @brief Gets the executionContext for the pipeline. + * @return ExecutionContext + */ + virtual ExecutionContext getPipelineExecutionContext() const = 0; + +protected: + IPipelineNode() = default; +}; +} // namespace nx::core diff --git a/src/simplnx/Pipeline/PipelineFilter.cpp b/src/simplnx/Pipeline/PipelineFilter.cpp index 40e443c461..faf059fe4a 100644 --- a/src/simplnx/Pipeline/PipelineFilter.cpp +++ b/src/simplnx/Pipeline/PipelineFilter.cpp @@ -198,7 +198,7 @@ bool PipelineFilter::preflight(DataStructure& dataStructure, RenamedPaths& renam std::vector newModifiedPaths; for(const auto& action : result.outputActions.value().actions) { - if(const auto* creationActionPtr = dynamic_cast(action.get()); creationActionPtr != nullptr) + if(const auto* creationActionPtr = dynamic_cast(action.get()); creationActionPtr != nullptr) { auto allCreatedPaths = creationActionPtr->getAllCreatedPaths(); newCreatedPaths.insert(newCreatedPaths.end(), allCreatedPaths.begin(), allCreatedPaths.end()); @@ -207,7 +207,7 @@ bool PipelineFilter::preflight(DataStructure& dataStructure, RenamedPaths& renam for(const auto& action : result.outputActions.value().deferredActions) { - if(const auto* creationActionPtr = dynamic_cast(action.get()); creationActionPtr != nullptr) + if(const auto* creationActionPtr = dynamic_cast(action.get()); creationActionPtr != nullptr) { auto allCreatedPaths = creationActionPtr->getAllCreatedPaths(); newCreatedPaths.insert(newCreatedPaths.end(), allCreatedPaths.begin(), allCreatedPaths.end()); diff --git a/src/simplnx/Plugin/AbstractPlugin.hpp b/src/simplnx/Plugin/AbstractPlugin.hpp index c2a9be6f05..3dbbae01cd 100644 --- a/src/simplnx/Plugin/AbstractPlugin.hpp +++ b/src/simplnx/Plugin/AbstractPlugin.hpp @@ -1,5 +1,7 @@ #pragma once +#include "simplnx/Plugin/IPlugin.hpp" + #include "simplnx/Filter/FilterHandle.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/simplnx_export.hpp" @@ -17,7 +19,7 @@ namespace H5 class IDataFactory; } -class IDataIOManager; +class AbstractDataIOManager; /** * @class AbstractPlugin @@ -26,43 +28,28 @@ class IDataIOManager; * retrieving information about the plugin and creating filters within the * plugin. */ -class SIMPLNX_EXPORT AbstractPlugin +class SIMPLNX_EXPORT AbstractPlugin : public IPlugin { public: - using IdType = Uuid; - using FilterContainerType = std::unordered_set; - using IOManagerPointer = std::shared_ptr; - using IOManagersContainerType = std::vector; - - struct SIMPLNX_EXPORT SIMPLData - { - using ConversionFunction = std::function(const nlohmann::json&)>; - - Uuid simplnxUuid; - ConversionFunction convertJson; - }; - - using SIMPLMapType = std::map; - - virtual ~AbstractPlugin(); + ~AbstractPlugin() override; /** * @brief Returns the plugin's name. * @return std::string */ - std::string getName() const; + std::string getName() const override; /** * @brief Returns the plugin's description. * @return std::string */ - std::string getDescription() const; + std::string getDescription() const override; /** * @brief Returns the plugin's ID. * @return IdType */ - IdType getId() const; + IdType getId() const override; /** * @brief Checks if the plugin contains a filter with the given ID. Returns @@ -70,7 +57,7 @@ class SIMPLNX_EXPORT AbstractPlugin * @param identifier * @return bool */ - bool containsFilterId(FilterHandle::FilterIdType identifier) const; + bool containsFilterId(FilterHandle::FilterIdType identifier) const override; /** * @brief Create's an IFilter with the specified ID. If the plugin @@ -79,26 +66,26 @@ class SIMPLNX_EXPORT AbstractPlugin * @param filterId * @return IFilter::UniquePointer */ - IFilter::UniquePointer createFilter(FilterHandle::FilterIdType filterId) const; + IFilter::UniquePointer createFilter(FilterHandle::FilterIdType filterId) const override; /** * @brief Returns a set of FilterHandles pointing to each of the filters * contained in the plugin. * @return std::unordered_set */ - FilterContainerType getFilterHandles() const; + FilterContainerType getFilterHandles() const override; /** * @brief * @return */ - FilterContainerType::size_type getFilterCount() const; + FilterContainerType::size_type getFilterCount() const override; /** * @brief Returns the plugin's vendor name. * @return std::string */ - std::string getVendor() const; + std::string getVendor() const override; /** * @brief Returns a collection of DataStructure IO managers available @@ -106,16 +93,16 @@ class SIMPLNX_EXPORT AbstractPlugin * to a specific format. * @return IOManagersContainerType */ - IOManagersContainerType getDataIOManagers() const; + IOManagersContainerType getDataIOManagers() const override; /** * @brief Returns a map of UUIDs as strings, where SIMPL UUIDs are keys to * their simplnx counterpart * @return SIMPLMapType */ - virtual SIMPLMapType getSimplToSimplnxMap() const = 0; + SIMPLMapType getSimplToSimplnxMap() const override = 0; - virtual void setOocTempDirectory(const std::string& path); + void setOocTempDirectory(const std::string& path) override; protected: /** diff --git a/src/simplnx/Plugin/IPlugin.cpp b/src/simplnx/Plugin/IPlugin.cpp new file mode 100644 index 0000000000..65f1004cde --- /dev/null +++ b/src/simplnx/Plugin/IPlugin.cpp @@ -0,0 +1,6 @@ +#include "IPlugin.hpp" + +namespace nx::core +{ +IPlugin::~IPlugin() noexcept = default; +} // namespace nx::core diff --git a/src/simplnx/Plugin/IPlugin.hpp b/src/simplnx/Plugin/IPlugin.hpp new file mode 100644 index 0000000000..9fd81ad784 --- /dev/null +++ b/src/simplnx/Plugin/IPlugin.hpp @@ -0,0 +1,125 @@ +#pragma once + +#include "simplnx/Filter/FilterHandle.hpp" +#include "simplnx/Filter/IFilter.hpp" +#include "simplnx/simplnx_export.hpp" + +#include +#include +#include +#include +#include +#include + +namespace nx::core +{ +class AbstractDataIOManager; + +/** + * @class IPlugin + * @brief Pure interface defining the public contract for all plugins. + * Provides identity, filter creation, IO manager, and SIMPL compatibility + * methods that every plugin must implement. The AbstractPlugin base class + * provides shared implementation details. + */ +class SIMPLNX_EXPORT IPlugin +{ +public: + using IdType = Uuid; + using FilterContainerType = std::unordered_set; + using IOManagerPointer = std::shared_ptr; + using IOManagersContainerType = std::vector; + + struct SIMPLNX_EXPORT SIMPLData + { + using ConversionFunction = std::function(const nlohmann::json&)>; + + Uuid simplnxUuid; + ConversionFunction convertJson; + }; + + using SIMPLMapType = std::map; + + virtual ~IPlugin() noexcept; + + IPlugin(const IPlugin&) = delete; + IPlugin(IPlugin&&) noexcept = delete; + IPlugin& operator=(const IPlugin&) = delete; + IPlugin& operator=(IPlugin&&) noexcept = delete; + + /** + * @brief Returns the plugin's name. + * @return std::string + */ + virtual std::string getName() const = 0; + + /** + * @brief Returns the plugin's description. + * @return std::string + */ + virtual std::string getDescription() const = 0; + + /** + * @brief Returns the plugin's ID. + * @return IdType + */ + virtual IdType getId() const = 0; + + /** + * @brief Returns the plugin's vendor name. + * @return std::string + */ + virtual std::string getVendor() const = 0; + + /** + * @brief Checks if the plugin contains a filter with the given ID. + * @param identifier + * @return bool + */ + virtual bool containsFilterId(FilterHandle::FilterIdType identifier) const = 0; + + /** + * @brief Creates an IFilter with the specified ID. Returns nullptr if the + * plugin does not contain a filter with that ID. + * @param filterId + * @return IFilter::UniquePointer + */ + virtual IFilter::UniquePointer createFilter(FilterHandle::FilterIdType filterId) const = 0; + + /** + * @brief Returns a set of FilterHandles pointing to each of the filters + * contained in the plugin. + * @return FilterContainerType + */ + virtual FilterContainerType getFilterHandles() const = 0; + + /** + * @brief Returns the number of filters in the plugin. + * @return FilterContainerType::size_type + */ + virtual FilterContainerType::size_type getFilterCount() const = 0; + + /** + * @brief Returns a collection of DataStructure IO managers available + * through the plugin. + * @return IOManagersContainerType + */ + virtual IOManagersContainerType getDataIOManagers() const = 0; + + /** + * @brief Returns a map of UUIDs where SIMPL UUIDs are keys to their + * simplnx counterpart. + * @return SIMPLMapType + */ + virtual SIMPLMapType getSimplToSimplnxMap() const = 0; + + /** + * @brief Sets the out-of-core temporary directory path. + * @param path + */ + virtual void setOocTempDirectory(const std::string& path) = 0; + +protected: + IPlugin() = default; +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/SegmentFeatures.cpp b/src/simplnx/Utilities/AbstractSegmentFeatures.cpp similarity index 88% rename from src/simplnx/Utilities/SegmentFeatures.cpp rename to src/simplnx/Utilities/AbstractSegmentFeatures.cpp index 037b7175b0..c41b84ad1a 100644 --- a/src/simplnx/Utilities/SegmentFeatures.cpp +++ b/src/simplnx/Utilities/AbstractSegmentFeatures.cpp @@ -1,6 +1,6 @@ -#include "SegmentFeatures.hpp" +#include "AbstractSegmentFeatures.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" #include "simplnx/Utilities/ClusteringUtilities.hpp" #include "simplnx/Utilities/MessageHelper.hpp" @@ -124,7 +124,7 @@ std::vector getAllNeighbors(const int64 currentPoint, const int64 width, } // namespace // ----------------------------------------------------------------------------- -SegmentFeatures::SegmentFeatures(DataStructure& dataStructure, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler) +AbstractSegmentFeatures::AbstractSegmentFeatures(DataStructure& dataStructure, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler) : m_DataStructure(dataStructure) , m_ShouldCancel(shouldCancel) , m_MessageHelper(mesgHandler) @@ -132,10 +132,10 @@ SegmentFeatures::SegmentFeatures(DataStructure& dataStructure, const std::atomic } // ----------------------------------------------------------------------------- -SegmentFeatures::~SegmentFeatures() = default; +AbstractSegmentFeatures::~AbstractSegmentFeatures() = default; // ----------------------------------------------------------------------------- -Result<> SegmentFeatures::execute(IGridGeometry* gridGeom) +Result<> AbstractSegmentFeatures::execute(AbstractGridGeometry* gridGeom) { ThrottledMessenger throttledMessenger = m_MessageHelper.createThrottledMessenger(); @@ -221,24 +221,24 @@ Result<> SegmentFeatures::execute(IGridGeometry* gridGeom) return {}; } -int64 SegmentFeatures::getSeed(int32 gnum, int64 nextSeed) const +int64 AbstractSegmentFeatures::getSeed(int32 gnum, int64 nextSeed) const { return -1; } -bool SegmentFeatures::determineGrouping(int64 referencePoint, int64 neighborPoint, int32 gnum) const +bool AbstractSegmentFeatures::determineGrouping(int64 referencePoint, int64 neighborPoint, int32 gnum) const { return false; } // ----------------------------------------------------------------------------- -SegmentFeatures::SeedGenerator SegmentFeatures::initializeStaticVoxelSeedGenerator() const +AbstractSegmentFeatures::SeedGenerator AbstractSegmentFeatures::initializeStaticVoxelSeedGenerator() const { return SeedGenerator(SeedGenerator::default_seed); } // ----------------------------------------------------------------------------- -void SegmentFeatures::randomizeFeatureIds(nx::core::Int32Array* featureIds, uint64 totalFeatures) +void AbstractSegmentFeatures::randomizeFeatureIds(nx::core::Int32Array* featureIds, uint64 totalFeatures) { m_MessageHelper.sendMessage("Randomizing Feature Ids"); ClusterUtilities::RandomizeFeatureIds(featureIds->getDataStoreRef(), totalFeatures); diff --git a/src/simplnx/Utilities/SegmentFeatures.hpp b/src/simplnx/Utilities/AbstractSegmentFeatures.hpp similarity index 53% rename from src/simplnx/Utilities/SegmentFeatures.hpp rename to src/simplnx/Utilities/AbstractSegmentFeatures.hpp index 1c015485e2..3a8f21e80d 100644 --- a/src/simplnx/Utilities/SegmentFeatures.hpp +++ b/src/simplnx/Utilities/AbstractSegmentFeatures.hpp @@ -2,12 +2,13 @@ #include "simplnx/simplnx_export.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" +#include "simplnx/Utilities/ISegmentFeatures.hpp" #include "simplnx/Utilities/MessageHelper.hpp" #include @@ -16,7 +17,7 @@ namespace nx::core { -class IGridGeometry; +class AbstractGridGeometry; namespace segment_features { @@ -29,33 +30,25 @@ inline constexpr ChoicesParameter::ValueType k_6NeighborIndex = 0ULL; inline constexpr ChoicesParameter::ValueType k_26NeighborIndex = 1ULL; } // namespace segment_features -class SIMPLNX_EXPORT SegmentFeatures +class SIMPLNX_EXPORT AbstractSegmentFeatures : public ISegmentFeatures { public: - using SeedGenerator = std::mt19937_64; + AbstractSegmentFeatures(DataStructure& dataStructure, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler); - SegmentFeatures(DataStructure& dataStructure, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler); + ~AbstractSegmentFeatures() override; - virtual ~SegmentFeatures(); - - SegmentFeatures(const SegmentFeatures&) = delete; // Copy Constructor Not Implemented - SegmentFeatures(SegmentFeatures&&) = delete; // Move Constructor Not Implemented - SegmentFeatures& operator=(const SegmentFeatures&) = delete; // Copy Assignment Not Implemented - SegmentFeatures& operator=(SegmentFeatures&&) = delete; // Move Assignment Not Implemented - - enum class NeighborScheme : ChoicesParameter::ValueType - { - Face = 0, - FaceEdgeVertex = 1 - }; + AbstractSegmentFeatures(const AbstractSegmentFeatures&) = delete; // Copy Constructor Not Implemented + AbstractSegmentFeatures(AbstractSegmentFeatures&&) = delete; // Move Constructor Not Implemented + AbstractSegmentFeatures& operator=(const AbstractSegmentFeatures&) = delete; // Copy Assignment Not Implemented + AbstractSegmentFeatures& operator=(AbstractSegmentFeatures&&) = delete; // Move Assignment Not Implemented /** * @brief execute * @param gridGeom * @return */ - Result<> execute(IGridGeometry* gridGeom); + Result<> execute(AbstractGridGeometry* gridGeom) override; /** * @brief Returns the seed for the specified values. @@ -65,7 +58,7 @@ class SIMPLNX_EXPORT SegmentFeatures * @param nextSeed * @return int64 */ - virtual int64_t getSeed(int32_t gnum, int64 nextSeed) const; + int64_t getSeed(int32_t gnum, int64 nextSeed) const override; /** * @brief Determines the grouping for the specified values. @@ -76,7 +69,7 @@ class SIMPLNX_EXPORT SegmentFeatures * @param gnum * @return bool */ - virtual bool determineGrouping(int64_t referencePoint, int64_t neighborPoint, int32_t gnum) const; + bool determineGrouping(int64_t referencePoint, int64_t neighborPoint, int32_t gnum) const override; /** * @brief @@ -84,29 +77,13 @@ class SIMPLNX_EXPORT SegmentFeatures * @param totalFeatures * @param distribution */ - void randomizeFeatureIds(Int32Array* featureIds, uint64 totalFeatures); + void randomizeFeatureIds(Int32Array* featureIds, uint64 totalFeatures) override; /** * @brief * @return */ - virtual SeedGenerator initializeStaticVoxelSeedGenerator() const; - - /* from http://www.newty.de/fpt/functor.html */ - /** - * @brief The CompareFunctor class serves as a functor superclass for specific implementations - * of performing scalar comparisons - */ - class CompareFunctor - { - public: - virtual ~CompareFunctor() = default; - - virtual bool operator()(int64 index, int64 neighIndex, int32 gnum) // call using () operator - { - return false; - } - }; + SeedGenerator initializeStaticVoxelSeedGenerator() const override; protected: DataStructure& m_DataStructure; diff --git a/src/simplnx/Utilities/AlignSections.cpp b/src/simplnx/Utilities/AlignSections.cpp index de5988f7a4..bc4f6bc3e6 100644 --- a/src/simplnx/Utilities/AlignSections.cpp +++ b/src/simplnx/Utilities/AlignSections.cpp @@ -22,7 +22,7 @@ class AlignSectionsTransferDataImpl AlignSectionsTransferDataImpl(const AlignSectionsTransferDataImpl&) = default; // Copy Constructor Default Implemented AlignSectionsTransferDataImpl(AlignSectionsTransferDataImpl&&) noexcept = default; // Move Constructor Default Implemented - AlignSectionsTransferDataImpl(AlignSections* filter, SizeVec3 dims, std::vector xShifts, std::vector yShifts, IDataArray& dataArray) + AlignSectionsTransferDataImpl(AlignSections* filter, SizeVec3 dims, std::vector xShifts, std::vector yShifts, AbstractDataArray& dataArray) : m_Filter(filter) , m_Dims(std::move(dims)) , m_Xshifts(std::move(xShifts)) @@ -157,7 +157,7 @@ Result<> AlignSections::execute(const SizeVec3& udims, const DataPath& imageGeom } m_MessageHelper.sendMessage(fmt::format("Updating DataArray '{}'", cellArrayPath.toString())); - auto& cellArray = m_DataStructure.getDataRefAs(cellArrayPath); + auto& cellArray = m_DataStructure.getDataRefAs(cellArrayPath); ExecuteParallelFunction(cellArray.getDataType(), taskRunner, this, udims, xShifts, yShifts, cellArray); } diff --git a/src/simplnx/Utilities/AlignSections.hpp b/src/simplnx/Utilities/AlignSections.hpp index 2ef906accb..ea48d135c0 100644 --- a/src/simplnx/Utilities/AlignSections.hpp +++ b/src/simplnx/Utilities/AlignSections.hpp @@ -1,9 +1,9 @@ #pragma once #include "simplnx/Common/Array.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Utilities/MessageHelper.hpp" @@ -12,7 +12,7 @@ namespace nx::core { -class IGridGeometry; +class AbstractGridGeometry; class SIMPLNX_EXPORT AlignSections { diff --git a/src/simplnx/Utilities/ArrayCreationUtilities.hpp b/src/simplnx/Utilities/ArrayCreationUtilities.hpp index 2a6baef858..3818fbbf88 100644 --- a/src/simplnx/Utilities/ArrayCreationUtilities.hpp +++ b/src/simplnx/Utilities/ArrayCreationUtilities.hpp @@ -38,9 +38,9 @@ Result<> CreateArray(DataStructure& dataStructure, const ShapeType& tupleShape, { auto parentPath = path.getParent(); - std::optional dataObjectId; + std::optional dataObjectId; - DataObject* parentObjectPtr = nullptr; + AbstractDataObject* parentObjectPtr = nullptr; if(parentPath.getLength() != 0) { parentObjectPtr = dataStructure.getData(parentPath); @@ -121,7 +121,7 @@ Result<> CreateArray(DataStructure& dataStructure, const ShapeType& tupleShape, { return MakeErrorResult(-267, fmt::format("CreateArray: Parent object '{}' does not exist", parentPath.toString())); } - if(parentObjectPtr->getDataObjectType() == DataObject::Type::AttributeMatrix) + if(parentObjectPtr->getDataObjectType() == IDataObject::Type::AttributeMatrix) { auto* attrMatrixPtr = dynamic_cast(parentObjectPtr); std::string amShape = fmt::format("Attribute Matrix Tuple Dims: {}", fmt::join(attrMatrixPtr->getShape(), " x ")); diff --git a/src/simplnx/Utilities/ArrayThreshold.cpp b/src/simplnx/Utilities/ArrayThreshold.cpp index 1d3b8de465..2f628654f0 100644 --- a/src/simplnx/Utilities/ArrayThreshold.cpp +++ b/src/simplnx/Utilities/ArrayThreshold.cpp @@ -20,35 +20,35 @@ constexpr StringLiteral k_ArrayType = "array"; constexpr StringLiteral k_CollectionType = "collection"; } // namespace -IArrayThreshold::IArrayThreshold() = default; -IArrayThreshold::IArrayThreshold(const IArrayThreshold& other) = default; +AbstractArrayThreshold::AbstractArrayThreshold() = default; +AbstractArrayThreshold::AbstractArrayThreshold(const AbstractArrayThreshold& other) = default; -IArrayThreshold::IArrayThreshold(IArrayThreshold&& other) noexcept +AbstractArrayThreshold::AbstractArrayThreshold(AbstractArrayThreshold&& other) noexcept : m_IsInverted(other.m_IsInverted) , m_UnionType(other.m_UnionType) { } -IArrayThreshold::~IArrayThreshold() = default; +AbstractArrayThreshold::~AbstractArrayThreshold() = default; -bool IArrayThreshold::isInverted() const +bool AbstractArrayThreshold::isInverted() const { return m_IsInverted; } -void IArrayThreshold::setInverted(bool inverted) +void AbstractArrayThreshold::setInverted(bool inverted) { m_IsInverted = inverted; } -IArrayThreshold::UnionOperator IArrayThreshold::getUnionOperator() const +AbstractArrayThreshold::UnionOperator AbstractArrayThreshold::getUnionOperator() const { return m_UnionType; } -void IArrayThreshold::setUnionOperator(UnionOperator unionType) +void AbstractArrayThreshold::setUnionOperator(UnionOperator unionType) { m_UnionType = unionType; } -nlohmann::json IArrayThreshold::toJson() const +nlohmann::json AbstractArrayThreshold::toJson() const { nlohmann::json json; json[k_Inverted_Tag] = isInverted(); @@ -58,7 +58,7 @@ nlohmann::json IArrayThreshold::toJson() const } ArrayThreshold::ArrayThreshold() -: IArrayThreshold() +: AbstractArrayThreshold() , m_ArrayPath() { @@ -66,7 +66,7 @@ ArrayThreshold::ArrayThreshold() ArrayThreshold::ArrayThreshold(const ArrayThreshold& other) = default; ArrayThreshold::ArrayThreshold(ArrayThreshold&& other) noexcept -: IArrayThreshold(std::move(other)) +: AbstractArrayThreshold(std::move(other)) , m_ArrayPath(std::move(other.m_ArrayPath)) , m_Value(other.m_Value) , m_Comparison(other.m_Comparison) @@ -141,7 +141,7 @@ std::set ArrayThreshold::getRequiredPaths() const nlohmann::json ArrayThreshold::toJson() const { - auto json = IArrayThreshold::toJson(); + auto json = AbstractArrayThreshold::toJson(); json[k_Type_Tag] = k_ArrayType; json[k_ArrayPath_Tag] = getArrayPath().toString(); json[k_ComponentIndex_Tag] = getComponentIndex(); @@ -182,14 +182,14 @@ std::shared_ptr ArrayThreshold::FromJson(const nlohmann::json& j } ArrayThresholdSet::ArrayThresholdSet() -: IArrayThreshold() +: AbstractArrayThreshold() { } ArrayThresholdSet::ArrayThresholdSet(const ArrayThresholdSet& other) = default; ArrayThresholdSet::ArrayThresholdSet(ArrayThresholdSet&& other) noexcept -: IArrayThreshold(std::move(other)) +: AbstractArrayThreshold(std::move(other)) , m_Thresholds(std::move(other.m_Thresholds)) { } @@ -234,7 +234,7 @@ std::set ArrayThresholdSet::getRequiredPaths() const nlohmann::json ArrayThresholdSet::toJson() const { - auto json = IArrayThreshold::toJson(); + auto json = AbstractArrayThreshold::toJson(); json[k_Type_Tag] = k_CollectionType; nlohmann::json collection = nlohmann::json::array(); diff --git a/src/simplnx/Utilities/ArrayThreshold.hpp b/src/simplnx/Utilities/ArrayThreshold.hpp index a2e7aec8e1..c7d62b8f06 100644 --- a/src/simplnx/Utilities/ArrayThreshold.hpp +++ b/src/simplnx/Utilities/ArrayThreshold.hpp @@ -3,6 +3,7 @@ #include "simplnx/Common/Types.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" +#include "simplnx/Utilities/IArrayThreshold.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -15,31 +16,25 @@ namespace nx::core { /** - * @brief + * @brief Abstract base class for array thresholds. Provides data storage for + * inversion state and union operator, with concrete implementations of the + * IArrayThreshold interface methods. */ -class SIMPLNX_EXPORT IArrayThreshold +class SIMPLNX_EXPORT AbstractArrayThreshold : public IArrayThreshold { public: - enum class UnionOperator : uint8 - { - And, - Or - }; + AbstractArrayThreshold(); + AbstractArrayThreshold(const AbstractArrayThreshold& other); + AbstractArrayThreshold(AbstractArrayThreshold&& other) noexcept; + ~AbstractArrayThreshold() override; - IArrayThreshold(); - IArrayThreshold(const IArrayThreshold& other); - IArrayThreshold(IArrayThreshold&& other) noexcept; - virtual ~IArrayThreshold(); + [[nodiscard]] bool isInverted() const override; + void setInverted(bool inverted) override; - [[nodiscard]] bool isInverted() const; - void setInverted(bool inverted); + [[nodiscard]] UnionOperator getUnionOperator() const override; + void setUnionOperator(UnionOperator unionType) override; - [[nodiscard]] UnionOperator getUnionOperator() const; - void setUnionOperator(UnionOperator unionType); - - [[nodiscard]] virtual std::set getRequiredPaths() const = 0; - - [[nodiscard]] virtual nlohmann::json toJson() const; + [[nodiscard]] nlohmann::json toJson() const override; private: bool m_IsInverted{false}; @@ -49,7 +44,7 @@ class SIMPLNX_EXPORT IArrayThreshold /** * @brief */ -class SIMPLNX_EXPORT ArrayThreshold : public IArrayThreshold +class SIMPLNX_EXPORT ArrayThreshold : public AbstractArrayThreshold { public: using ComparisonValue = float64; @@ -96,7 +91,7 @@ class SIMPLNX_EXPORT ArrayThreshold : public IArrayThreshold /** * @brief */ -class SIMPLNX_EXPORT ArrayThresholdSet : public IArrayThreshold +class SIMPLNX_EXPORT ArrayThresholdSet : public AbstractArrayThreshold { public: using CollectionType = std::vector>; diff --git a/src/simplnx/Utilities/ClusteringUtilities.cpp b/src/simplnx/Utilities/ClusteringUtilities.cpp index 7a902544e3..481b8bb255 100644 --- a/src/simplnx/Utilities/ClusteringUtilities.cpp +++ b/src/simplnx/Utilities/ClusteringUtilities.cpp @@ -49,7 +49,7 @@ void RandomizeFeatureIds(Int32AbstractDataStore& featureIdsStore, usize totalFea } } -void RandomizeFeatureIds(Int32AbstractDataStore& featureIdsStore, usize totalFeatures, std::vector& featureIArrays) +void RandomizeFeatureIds(Int32AbstractDataStore& featureIdsStore, usize totalFeatures, std::vector& featureIArrays) { std::vector randomIds = CreateRandomizedIdsList(totalFeatures); diff --git a/src/simplnx/Utilities/ClusteringUtilities.hpp b/src/simplnx/Utilities/ClusteringUtilities.hpp index 1f4fa05ef1..6a040cd7a7 100644 --- a/src/simplnx/Utilities/ClusteringUtilities.hpp +++ b/src/simplnx/Utilities/ClusteringUtilities.hpp @@ -1,8 +1,8 @@ #pragma once #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" #include "simplnx/DataStructure/AbstractDataStore.hpp" -#include "simplnx/DataStructure/IArray.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -159,7 +159,7 @@ float64 GetDistance(const leftDataType& leftVector, usize leftOffset, const righ SIMPLNX_EXPORT void RandomizeFeatureIds(Int32AbstractDataStore& featureIds, usize totalFeatures); /** - * @brief Randomize the provided Feature IDs and update supplied feature IArray data. + * @brief Randomize the provided Feature IDs and update supplied feature AbstractArray data. * Assumption: Every array in `featureIArrays` are at least the length of totalFeatures * @param featureIds the array that maps cell data to feature data via IDs * @param totalFeatures the total feature count in the feature ids array (equivalent to max value in feature ids + 1) @@ -168,5 +168,5 @@ SIMPLNX_EXPORT void RandomizeFeatureIds(Int32AbstractDataStore& featureIds, usiz * (Note: These are not found from a datapath, so calling functions can threshold out feature arrays if necessary) * @return void */ -SIMPLNX_EXPORT void RandomizeFeatureIds(Int32AbstractDataStore& featureIds, usize totalFeatures, std::vector& featureIArrays); +SIMPLNX_EXPORT void RandomizeFeatureIds(Int32AbstractDataStore& featureIds, usize totalFeatures, std::vector& featureIArrays); } // namespace nx::core::ClusterUtilities diff --git a/src/simplnx/Utilities/DataArrayUtilities.cpp b/src/simplnx/Utilities/DataArrayUtilities.cpp index 24c3349962..af8ebef848 100644 --- a/src/simplnx/Utilities/DataArrayUtilities.cpp +++ b/src/simplnx/Utilities/DataArrayUtilities.cpp @@ -17,7 +17,7 @@ using namespace nx::core; namespace { template -Result<> ReplaceArray(DataStructure& dataStructure, const DataPath& dataPath, const ShapeType& tupleShape, IDataAction::Mode mode, const IDataArray& inputDataArray) +Result<> ReplaceArray(DataStructure& dataStructure, const DataPath& dataPath, const ShapeType& tupleShape, IDataAction::Mode mode, const AbstractDataArray& inputDataArray) { auto& castInputArray = dynamic_cast&>(inputDataArray); const ShapeType componentShape = castInputArray.getDataStoreRef().getComponentShape(); @@ -28,7 +28,7 @@ Result<> ReplaceArray(DataStructure& dataStructure, const DataPath& dataPath, co struct InitializeNeighborListFunctor { template - void operator()(INeighborList* iNeighborList) + void operator()(AbstractNeighborList* iNeighborList) { auto* neighborListPtr = dynamic_cast*>(iNeighborList); neighborListPtr->setList(neighborListPtr->getNumberOfTuples() - 1, typename NeighborList::SharedVectorType(new typename NeighborList::VectorType)); @@ -41,14 +41,14 @@ struct InitializeNeighborListFunctor struct CreateDefaultValueDataArrayFunctor { template - Result operator()(DataStructure& destDataStructure, const std::string& name, const ShapeType& tupleShape, const ShapeType& componentShape, const std::string& defaultValue, - const std::optional parentId) + Result operator()(DataStructure& destDataStructure, const std::string& name, const ShapeType& tupleShape, const ShapeType& componentShape, const std::string& defaultValue, + const std::optional parentId) { auto newDataArray = DataArray::template CreateWithStore>(destDataStructure, name, tupleShape, componentShape, parentId); auto result = StringInterpretationUtilities::Convert(defaultValue); if(result.invalid()) { - return ConvertResultTo(ConvertResult(std::move(result)), {}); + return ConvertResultTo(ConvertResult(std::move(result)), {}); } std::fill(newDataArray->begin(), newDataArray->end(), result.value()); return {newDataArray}; @@ -61,7 +61,7 @@ struct CreateDefaultValueDataArrayFunctor struct CreateDefaultValueNeighborListFunctor { template - Result operator()(DataStructure& destDataStructure, const std::string& name, const ShapeType& tupleShape, const std::optional parentId) + Result operator()(DataStructure& destDataStructure, const std::string& name, const ShapeType& tupleShape, const std::optional parentId) { auto newNeighborList = NeighborList::Create(destDataStructure, name, tupleShape, parentId); return {newNeighborList}; @@ -77,7 +77,7 @@ bool CheckArraysAreSameType(const DataStructure& dataStructure, const std::vecto std::set types; for(const auto& dataPath : dataArrayPaths) { - const auto* dataArrayPtr = dataStructure.getDataAs(dataPath); + const auto* dataArrayPtr = dataStructure.getDataAs(dataPath); types.insert(dataArrayPtr->getDataType()); } return types.size() == 1; @@ -89,16 +89,16 @@ bool CheckArraysHaveSameTupleCount(const DataStructure& dataStructure, const std std::set types; for(const auto& dataPath : dataArrayPaths) { - const auto* iArrayPtr = dataStructure.getDataAs(dataPath); + const auto* iArrayPtr = dataStructure.getDataAs(dataPath); types.insert(iArrayPtr->getNumberOfTuples()); } return types.size() == 1; } //----------------------------------------------------------------------------- -Result<> ConditionalReplaceValueInArray(const std::string& valueAsStr, DataObject& inputDataObject, const IDataArray& conditionalDataArray, bool invertMask) +Result<> ConditionalReplaceValueInArray(const std::string& valueAsStr, AbstractDataObject& inputDataObject, const AbstractDataArray& conditionalDataArray, bool invertMask) { - const IDataArray& iDataArray = dynamic_cast(inputDataObject); + const AbstractDataArray& iDataArray = dynamic_cast(inputDataObject); const nx::core::DataType arrayType = iDataArray.getDataType(); return ExecuteDataFunction(ConditionalReplaceValueInArrayFromString{}, arrayType, valueAsStr, inputDataObject, conditionalDataArray, invertMask); } @@ -106,7 +106,7 @@ Result<> ConditionalReplaceValueInArray(const std::string& valueAsStr, DataObjec //----------------------------------------------------------------------------- Result<> ResizeAndReplaceDataArray(DataStructure& dataStructure, const DataPath& dataPath, ShapeType& tupleShape, IDataAction::Mode mode) { - auto* inputDataArrayPtr = dataStructure.getDataAs(dataPath); + auto* inputDataArrayPtr = dataStructure.getDataAs(dataPath); if(TemplateHelpers::CanDynamicCast()(inputDataArrayPtr)) { @@ -172,7 +172,7 @@ Result<> ValidateFeatureIdsToFeatureAttributeMatrixIndexing(const DataStructure& numFeatures = targetAttributeMatrixPtr->getNumberOfTuples(); } // Check if a feature array was passed in - auto* targetFeatureArrayPtr = dataStructure.getDataAs(sourceDataPath); + auto* targetFeatureArrayPtr = dataStructure.getDataAs(sourceDataPath); if(nullptr != targetFeatureArrayPtr) { numFeatures = targetFeatureArrayPtr->getNumberOfTuples(); @@ -200,12 +200,12 @@ Result<> ValidateFeatureIdsToFeatureAttributeMatrixIndexing(const DataStructure& //----------------------------------------------------------------------------- void InitializeNeighborList(DataStructure& dataStructure, const DataPath& neighborListPath) { - auto* neighborListPtr = dataStructure.getDataAs(neighborListPath); + auto* neighborListPtr = dataStructure.getDataAs(neighborListPath); ExecuteNeighborFunction(InitializeNeighborListFunctor{}, neighborListPtr->getDataType(), neighborListPtr); } //----------------------------------------------------------------------------- -bool ConvertIDataArray(const std::shared_ptr& dataArray, const std::string& dataFormat) +bool ConvertIDataArray(const std::shared_ptr& dataArray, const std::string& dataFormat) { auto dataType = dataArray->getDataType(); switch(dataType) @@ -237,38 +237,39 @@ bool ConvertIDataArray(const std::shared_ptr& dataArray, const std:: } } -Result CreateDefaultValueArrayFromArray(DataStructure& destDataStructure, IArray* array, const std::string& newArrayName, const ShapeType& tupleShape, const std::string& defaultValue, - const std::optional parentId) +Result CreateDefaultValueArrayFromArray(DataStructure& destDataStructure, AbstractArray* array, const std::string& newArrayName, const ShapeType& tupleShape, + const std::string& defaultValue, const std::optional parentId) { switch(array->getArrayType()) { - case IArray::ArrayType::StringArray: { + case AbstractArray::ArrayType::StringArray: { auto newStringArray = StringArray::Create(destDataStructure, newArrayName, parentId); newStringArray->resizeTuples(tupleShape); std::fill(newStringArray->begin(), newStringArray->end(), defaultValue); return {newStringArray}; } - case IArray::ArrayType::DataArray: { - auto iDataArray = dynamic_cast(array); + case AbstractArray::ArrayType::DataArray: { + auto iDataArray = dynamic_cast(array); auto result = ExecuteDataFunction(CreateDefaultValueDataArrayFunctor{}, iDataArray->getDataType(), destDataStructure, newArrayName, tupleShape, array->getComponentShape(), defaultValue, parentId); if(result.invalid()) { - return MakeErrorResult(-1050, fmt::format("Unable to create default-initialized data array to append to data array '{}': {}", array->getName(), result.errors()[0].message)); + return MakeErrorResult(-1050, fmt::format("Unable to create default-initialized data array to append to data array '{}': {}", array->getName(), result.errors()[0].message)); } return result; } - case IArray::ArrayType::NeighborListArray: { - auto iNeighborList = dynamic_cast(array); + case AbstractArray::ArrayType::NeighborListArray: { + auto iNeighborList = dynamic_cast(array); auto result = ExecuteNeighborFunction(CreateDefaultValueNeighborListFunctor{}, iNeighborList->getDataType(), destDataStructure, newArrayName, tupleShape, parentId); if(result.invalid()) { - return MakeErrorResult(-1051, fmt::format("Unable to create default-initialized neighbor list to append to neighbor list '{}': {}", array->getName(), result.errors()[0].message)); + return MakeErrorResult(-1051, + fmt::format("Unable to create default-initialized neighbor list to append to neighbor list '{}': {}", array->getName(), result.errors()[0].message)); } return result; } - case IArray::ArrayType::Any: + case AbstractArray::ArrayType::Any: default: { - return MakeErrorResult( + return MakeErrorResult( -1052, fmt::format("Unable to create a default-initialized array: array '{}' is not a StringArray, DataArray, or NeighborList, and these are the only array types supported by this filter!", array->getName())); } @@ -290,10 +291,10 @@ void transferElementData(DataStructure& m_DataStructure, AttributeMatrix& destCe return; } - const auto& oldDataArray = m_DataStructure.getDataRefAs(edgeDataArrayPath); + const auto& oldDataArray = m_DataStructure.getDataRefAs(edgeDataArrayPath); const std::string srcName = oldDataArray.getName(); - auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); + auto& newDataArray = dynamic_cast(destCellDataAM.at(srcName)); m_MessageHandler(fmt::format("Copying Data Array {}", srcName)); ExecuteParallelFunction(oldDataArray.getDataType(), taskRunner, oldDataArray, newDataArray, newEdgesIndexList, m_ShouldCancel); } @@ -307,7 +308,7 @@ void CreateDataArrayActions(const DataStructure& dataStructure, const AttributeM // in the destination geometry's attribute matrix for(const auto& dataPath : selectedArrayPaths) { - const auto& srcArray = dataStructure.getDataRefAs(dataPath); + const auto& srcArray = dataStructure.getDataRefAs(dataPath); DataType dataType = srcArray.getDataType(); ShapeType componentShape = srcArray.getIDataStoreRef().getComponentShape(); DataPath dataArrayPath = reducedGeometryPathAttrMatPath.createChildPath(srcArray.getName()); diff --git a/src/simplnx/Utilities/DataArrayUtilities.hpp b/src/simplnx/Utilities/DataArrayUtilities.hpp index bfaacb8af5..c4aac75631 100644 --- a/src/simplnx/Utilities/DataArrayUtilities.hpp +++ b/src/simplnx/Utilities/DataArrayUtilities.hpp @@ -77,7 +77,7 @@ void ReplaceValue(DataArray& inputArrayPtr, const DataArray* struct ConditionalReplaceValueInArrayFromString { template - Result<> operator()(const std::string& valueAsStr, DataObject& inputDataObject, const IDataArray& conditionalDataArray, const bool invertMask = false) + Result<> operator()(const std::string& valueAsStr, AbstractDataObject& inputDataObject, const AbstractDataArray& conditionalDataArray, const bool invertMask = false) { using DataArrayType = DataArray; @@ -117,7 +117,7 @@ struct ConditionalReplaceValueInArrayFromString * @param conditionalDataArray The mask array as a boolean array * @return */ -SIMPLNX_EXPORT Result<> ConditionalReplaceValueInArray(const std::string& valueAsStr, DataObject& inputDataObject, const IDataArray& conditionalDataArray, bool invertmask = false); +SIMPLNX_EXPORT Result<> ConditionalReplaceValueInArray(const std::string& valueAsStr, AbstractDataObject& inputDataObject, const AbstractDataArray& conditionalDataArray, bool invertmask = false); template bool ConvertDataArrayDataStore(const std::shared_ptr> dataArray, const std::string& dataFormat) @@ -137,7 +137,7 @@ bool ConvertDataArrayDataStore(const std::shared_ptr> dataArray, co return true; } -bool ConvertIDataArray(const std::shared_ptr& dataArray, const std::string& dataFormat); +bool ConvertIDataArray(const std::shared_ptr& dataArray, const std::string& dataFormat); /** * @brief Creates a NeighborList array with the given properties @@ -154,7 +154,7 @@ Result<> CreateNeighbors(DataStructure& dataStructure, const ShapeType& tupleSha static constexpr StringLiteral prefix = "CreateNeighborListAction: "; auto parentPath = path.getParent(); - std::optional dataObjectId; + std::optional dataObjectId; if(parentPath.getLength() != 0) { @@ -199,7 +199,7 @@ Result<> CreateNeighbors(DataStructure& dataStructure, const ShapeType& tupleSha template DataArray& ArrayRefFromPath(DataStructure& dataStructure, const DataPath& path) { - DataObject* objectPtr = dataStructure.getData(path); + AbstractDataObject* objectPtr = dataStructure.getData(path); auto* dataArrayPtr = dynamic_cast*>(objectPtr); if(dataArrayPtr == nullptr) { @@ -275,7 +275,7 @@ Result<> ImportFromBinaryFile(const std::filesystem::path& binaryFilePath, DataA */ template DataArray* ImportFromBinaryFile(const std::string& filename, const std::string& name, DataStructure& dataStructure, const ShapeType& tupleShape, const ShapeType& componentShape, - DataObject::IdType parentId = {}) + AbstractDataObject::IdType parentId = {}) { // std::cout << " Reading file " << filename << std::endl; using DataStoreType = DataStore; @@ -310,9 +310,9 @@ DataArray* ImportFromBinaryFile(const std::string& filename, const std::strin /** * @brief Creates a deep copy of an array into another location in the DataStructure. * - * WARNING: If there is a DataObject already at the destination path then that data object + * WARNING: If there is a AbstractDataObject already at the destination path then that data object * is removed from the DataStructure and replaced with the new copy - * @tparam ArrayType The Type of DataArray to copy. IDataArray and StringArray are supported + * @tparam ArrayType The Type of DataArray to copy. AbstractDataArray and StringArray are supported * @param dataStructure The DataStructure object * @param sourceDataPath The source path to copy from. * @param destDataPath The destination path to copy into. @@ -383,7 +383,7 @@ template class CopyTupleUsingIndexList { public: - CopyTupleUsingIndexList(const IDataArray& oldCellArray, IDataArray& newCellArray, nonstd::span newIndices) + CopyTupleUsingIndexList(const AbstractDataArray& oldCellArray, AbstractDataArray& newCellArray, nonstd::span newIndices) : m_OldCellArray(oldCellArray) , m_NewCellArray(newCellArray) , m_NewToOldIndices(newIndices) @@ -427,8 +427,8 @@ class CopyTupleUsingIndexList } private: - const IDataArray& m_OldCellArray; - IDataArray& m_NewCellArray; + const AbstractDataArray& m_OldCellArray; + AbstractDataArray& m_NewCellArray; nonstd::span m_NewToOldIndices; }; @@ -522,8 +522,8 @@ inline void IncrementLikeOdometer(std::vector& idx, const std::vector CreateDefaultValueArrayFromArray(DataStructure& destDataStructure, IArray* array, const std::string& newArrayName, const ShapeType& tupleShape, - const std::string& defaultValue, const std::optional parentId = {}); +SIMPLNX_EXPORT Result CreateDefaultValueArrayFromArray(DataStructure& destDataStructure, AbstractArray* array, const std::string& newArrayName, const ShapeType& tupleShape, + const std::string& defaultValue, const std::optional parentId = {}); template std::vector> GetComponentMinMax(std::shared_ptr> dataArray) @@ -554,16 +554,16 @@ std::vector> GetComponentMinMax(std::shared_ptr> d } /** - * @brief The following functions and classes are meant to make copying data from one IArray into another easier for the developer. + * @brief The following functions and classes are meant to make copying data from one AbstractArray into another easier for the developer. * * An example use of these functions would be the following (where newCellData is an AttributeMatrix in dataStructure ): * ParallelTaskAlgorithm taskRunner; * for (const auto& [dataId, dataObject] : *newCellData) * { - * auto* inputDataArray = dataStructure.getDataAs(inputCellDataPath.createChildPath(name)); - * auto* destDataArray = dataStructure.getDataAs(destCellDataPath.createChildPath(name)); - * auto* newDataArray = dataStructure.getDataAs(newCellDataPath.createChildPath(name)); - * const IArray::ArrayType arrayType = destDataArray->getArrayType(); + * auto* inputDataArray = dataStructure.getDataAs(inputCellDataPath.createChildPath(name)); + * auto* destDataArray = dataStructure.getDataAs(destCellDataPath.createChildPath(name)); + * auto* newDataArray = dataStructure.getDataAs(newCellDataPath.createChildPath(name)); + * const AbstractArray::ArrayType arrayType = destDataArray->getArrayType(); * CopyFromArray::RunParallel(arrayType, destDataArray, taskRunner, inputDataArray, newDataArray); * } * taskRunner.wait(); @@ -732,7 +732,7 @@ Result<> CopyDataND(const K& inputArray, K& destArray, const std::vector& { destArray[dstLinearIdx] = inputArray[srcLinearIdx]; } - else if constexpr(std::is_base_of_v) + else if constexpr(std::is_base_of_v) { destArray.setList(static_cast(dstLinearIdx), inputArray.getList(static_cast(srcLinearIdx))); } @@ -1047,15 +1047,15 @@ Result<> CombineData(const std::vector& inputArrays, const std::vector } /** - * @brief This class will append all of the data from the input array of any IArray type to the given destination array of the same IArray type starting at the given tupleOffset. This class DOES NOT - * do any bounds checking and assumes that the destination array has already been properly resized to fit all of the data + * @brief This class will append all of the data from the input array of any AbstractArray type to the given destination array of the same AbstractArray type starting at the given tupleOffset. This + * class DOES NOT do any bounds checking and assumes that the destination array has already been properly resized to fit all of the data */ template class AppendArray { public: - AppendArray(IArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, const std::vector& originalDestDims, - const std::vector& newDestDims, Direction direction = Direction::Z, bool mirror = false) + AppendArray(AbstractArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, + const std::vector& originalDestDims, const std::vector& newDestDims, Direction direction = Direction::Z, bool mirror = false) : m_ArrayType(destCellArray.getArrayType()) , m_InputCellArrays(inputCellArrays) , m_InputTupleShapes(inputTupleShapes) @@ -1076,7 +1076,7 @@ class AppendArray void operator()() const { - if(m_ArrayType == IArray::ArrayType::NeighborListArray) + if(m_ArrayType == AbstractArray::ArrayType::NeighborListArray) { using NeighborListType = NeighborList; auto* destArrayPtr = dynamic_cast(m_DestCellArray); @@ -1090,34 +1090,34 @@ class AppendArray std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const NeighborListType* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const NeighborListType* { return dynamic_cast(elem); }); AppendData(castedArrays, m_InputTupleShapes, *destArrayPtr, m_OriginalDestDims, m_NewDestDims, m_Direction, m_Mirror); } - if(m_ArrayType == IArray::ArrayType::DataArray) + if(m_ArrayType == AbstractArray::ArrayType::DataArray) { using DataArrayType = DataArray; std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); AppendData(castedArrays, m_InputTupleShapes, *dynamic_cast(m_DestCellArray), m_OriginalDestDims, m_NewDestDims, m_Direction, m_Mirror); } - if(m_ArrayType == IArray::ArrayType::StringArray) + if(m_ArrayType == AbstractArray::ArrayType::StringArray) { std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const StringArray* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const StringArray* { return dynamic_cast(elem); }); AppendData(castedArrays, m_InputTupleShapes, *dynamic_cast(m_DestCellArray), m_OriginalDestDims, m_NewDestDims, m_Direction, m_Mirror); } } private: - IArray::ArrayType m_ArrayType = IArray::ArrayType::Any; - std::vector m_InputCellArrays; + AbstractArray::ArrayType m_ArrayType = AbstractArray::ArrayType::Any; + std::vector m_InputCellArrays; std::vector> m_InputTupleShapes; - IArray* m_DestCellArray = nullptr; + AbstractArray* m_DestCellArray = nullptr; std::vector m_OriginalDestDims; std::vector m_NewDestDims; Direction m_Direction = Direction::Z; @@ -1125,14 +1125,14 @@ class AppendArray }; /** - * @brief This class will copy over all of the data from the first input array of any IArray type, then the second input array of the same IArray type to the given destination array (of the same - * IArray type). This class DOES NOT do any bounds checking and assumes that the destination array has already been properly sized to fit all of the data. + * @brief This class will copy over all of the data from the first input array of any AbstractArray type, then the second input array of the same AbstractArray type to the given destination array (of + * the same AbstractArray type). This class DOES NOT do any bounds checking and assumes that the destination array has already been properly sized to fit all of the data. */ template class CombineArrays { public: - CombineArrays(IArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, const std::vector& newDestDims, + CombineArrays(AbstractArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, const std::vector& newDestDims, Direction direction = Direction::Z, bool mirror = false) : m_ArrayType(destCellArray.getArrayType()) , m_InputCellArrays(inputCellArrays) @@ -1153,7 +1153,7 @@ class CombineArrays void operator()() const { - if(m_ArrayType == IArray::ArrayType::NeighborListArray) + if(m_ArrayType == AbstractArray::ArrayType::NeighborListArray) { using NeighborListT = NeighborList; auto* destArray = dynamic_cast(m_DestCellArray); @@ -1165,41 +1165,41 @@ class CombineArrays std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const NeighborListT* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const NeighborListT* { return dynamic_cast(elem); }); CombineData(castedArrays, m_InputTupleShapes, *destArray, m_NewDestDims, m_Direction, m_Mirror); } - if(m_ArrayType == IArray::ArrayType::DataArray) + if(m_ArrayType == AbstractArray::ArrayType::DataArray) { using DataArrayType = DataArray; std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); CombineData(castedArrays, m_InputTupleShapes, *dynamic_cast(m_DestCellArray), m_NewDestDims, m_Direction, m_Mirror); } - if(m_ArrayType == IArray::ArrayType::StringArray) + if(m_ArrayType == AbstractArray::ArrayType::StringArray) { std::vector castedArrays; castedArrays.reserve(m_InputCellArrays.size()); std::transform(m_InputCellArrays.begin(), m_InputCellArrays.end(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const StringArray* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const StringArray* { return dynamic_cast(elem); }); CombineData(castedArrays, m_InputTupleShapes, *dynamic_cast(m_DestCellArray), m_NewDestDims, m_Direction, m_Mirror); } } private: - IArray::ArrayType m_ArrayType = IArray::ArrayType::Any; - std::vector m_InputCellArrays; + AbstractArray::ArrayType m_ArrayType = AbstractArray::ArrayType::Any; + std::vector m_InputCellArrays; std::vector> m_InputTupleShapes; std::vector m_NewDestDims; - IArray* m_DestCellArray = nullptr; + AbstractArray* m_DestCellArray = nullptr; Direction m_Direction = Direction::Z; bool m_Mirror = false; }; /** - * @brief This class will copy all of the data from the input array of any IArray type to the given destination array of the same IArray using the newToOldIndices list. This class DOES NOT - * do any bounds checking and assumes that the destination array has already been properly resized to fit all of the data + * @brief This class will copy all of the data from the input array of any AbstractArray type to the given destination array of the same AbstractArray using the newToOldIndices list. This class DOES + * NOT do any bounds checking and assumes that the destination array has already been properly resized to fit all of the data * * WARNING: This method can be very memory intensive for larger geometries. Use this method with caution! */ @@ -1207,7 +1207,7 @@ template class CopyUsingIndexList { public: - CopyUsingIndexList(IArray& destCellArray, const IArray& inputCellArray, const nonstd::span& newToOldIndices) + CopyUsingIndexList(AbstractArray& destCellArray, const AbstractArray& inputCellArray, const nonstd::span& newToOldIndices) : m_ArrayType(destCellArray.getArrayType()) , m_InputCellArray(&inputCellArray) , m_DestCellArray(&destCellArray) @@ -1228,7 +1228,7 @@ class CopyUsingIndexList { int64 oldIndexI = m_NewToOldIndices[i]; Result<> copySucceeded; - if(m_ArrayType == IArray::ArrayType::NeighborListArray) + if(m_ArrayType == AbstractArray::ArrayType::NeighborListArray) { using NeighborListT = NeighborList; auto* destArray = dynamic_cast(m_DestCellArray); @@ -1239,7 +1239,7 @@ class CopyUsingIndexList copySucceeded = CopyData(*dynamic_cast(m_InputCellArray), *destArray, i, oldIndexI, 1); } } - else if(m_ArrayType == IArray::ArrayType::DataArray) + else if(m_ArrayType == AbstractArray::ArrayType::DataArray) { using DataArrayType = DataArray; auto* destArray = dynamic_cast(m_DestCellArray); @@ -1252,7 +1252,7 @@ class CopyUsingIndexList destArray->initializeTuple(i, 0); } } - else if(m_ArrayType == IArray::ArrayType::StringArray) + else if(m_ArrayType == AbstractArray::ArrayType::StringArray) { auto destArray = *dynamic_cast(m_DestCellArray); if(oldIndexI >= 0) @@ -1276,22 +1276,22 @@ class CopyUsingIndexList } private: - IArray::ArrayType m_ArrayType = IArray::ArrayType::Any; - const IArray* m_InputCellArray = nullptr; - IArray* m_DestCellArray = nullptr; + AbstractArray::ArrayType m_ArrayType = AbstractArray::ArrayType::Any; + const AbstractArray* m_InputCellArray = nullptr; + AbstractArray* m_DestCellArray = nullptr; nonstd::span m_NewToOldIndices; }; /** - * @brief This class will copy all of the data from the RectGrid geometry input array of any IArray type to the given Image geometry destination array of the same IArray type by calculating the mapped - * RectGrid geometry index from the Image geometry dimensions/spacing. This class DOES NOT do any bounds checking and assumes that the destination array has already been properly resized to fit all of - * the data + * @brief This class will copy all of the data from the RectGrid geometry input array of any AbstractArray type to the given Image geometry destination array of the same AbstractArray type by + * calculating the mapped RectGrid geometry index from the Image geometry dimensions/spacing. This class DOES NOT do any bounds checking and assumes that the destination array has already been + * properly resized to fit all of the data */ template class MapRectGridDataToImageData { public: - MapRectGridDataToImageData(IArray& destCellArray, const IArray& inputCellArray, const FloatVec3& origin, const SizeVec3& imageGeoDims, const std::vector& imageGeoSpacing, + MapRectGridDataToImageData(AbstractArray& destCellArray, const AbstractArray& inputCellArray, const FloatVec3& origin, const SizeVec3& imageGeoDims, const std::vector& imageGeoSpacing, const SizeVec3& rectGridDims, const Float32Array* xGridValues, const Float32Array* yGridValues, const Float32Array* zGridValues) : m_ArrayType(destCellArray.getArrayType()) , m_InputCellArray(&inputCellArray) @@ -1367,7 +1367,7 @@ class MapRectGridDataToImageData // Use the computed index to copy the data from the RectGrid to the Image Geometry Result<> copySucceeded; - if(m_ArrayType == IArray::ArrayType::NeighborListArray) + if(m_ArrayType == AbstractArray::ArrayType::NeighborListArray) { using NeighborListT = NeighborList; auto* destArrayPtr = dynamic_cast(m_DestCellArray); @@ -1378,7 +1378,7 @@ class MapRectGridDataToImageData copySucceeded = CopyData(*dynamic_cast(m_InputCellArray), *destArrayPtr, imageIndex, rectGridIndex, 1); } } - else if(m_ArrayType == IArray::ArrayType::DataArray) + else if(m_ArrayType == AbstractArray::ArrayType::DataArray) { using DataArrayType = DataArray; auto* destArray = dynamic_cast(m_DestCellArray); @@ -1391,7 +1391,7 @@ class MapRectGridDataToImageData destArray->initializeTuple(imageIndex, 0); } } - else if(m_ArrayType == IArray::ArrayType::StringArray) + else if(m_ArrayType == AbstractArray::ArrayType::StringArray) { auto destArray = *dynamic_cast(m_DestCellArray); if(rectGridIndex >= 0) @@ -1418,9 +1418,9 @@ class MapRectGridDataToImageData } private: - IArray::ArrayType m_ArrayType = IArray::ArrayType::Any; - const IArray* m_InputCellArray = nullptr; - IArray* m_DestCellArray = nullptr; + AbstractArray::ArrayType m_ArrayType = AbstractArray::ArrayType::Any; + const AbstractArray* m_InputCellArray = nullptr; + AbstractArray* m_DestCellArray = nullptr; const FloatVec3 m_Origin; const SizeVec3 m_ImageGeomDims; const std::vector m_ImageGeomSpacing; @@ -1432,50 +1432,50 @@ class MapRectGridDataToImageData }; /** - * @brief This function will make use of the AppendData class with the bool data type only to append data from the input IArray to the destination IArray at the given tupleOffset. This function DOES - * NOT do any bounds checking! + * @brief This function will make use of the AppendData class with the bool data type only to append data from the input AbstractArray to the destination AbstractArray at the given tupleOffset. This + * function DOES NOT do any bounds checking! */ -inline void RunAppendBoolAppend(IArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, +inline void RunAppendBoolAppend(AbstractArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, const std::vector& originalDestDims, const std::vector& newDestDims, Direction direction = Direction::Z, bool mirror = false) { using DataArrayType = DataArray; std::vector castedArrays; castedArrays.reserve(inputTupleShapes.size()); std::transform(inputCellArrays.cbegin(), inputCellArrays.cend(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); AppendData(castedArrays, inputTupleShapes, *dynamic_cast(&destCellArray), originalDestDims, newDestDims, direction, mirror); } /** - * @brief This function will make use of the CombineData method with the bool data type only to combine data from the input IArrays to the destination IArray. This function DOES + * @brief This function will make use of the CombineData method with the bool data type only to combine data from the input IArrays to the destination AbstractArray. This function DOES * NOT do any bounds checking! */ -inline void RunCombineBoolAppend(IArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, +inline void RunCombineBoolAppend(AbstractArray& destCellArray, const std::vector& inputCellArrays, const std::vector>& inputTupleShapes, const std::vector& newDestDims, Direction direction = Direction::Z, bool mirror = false) { using DataArrayType = DataArray; std::vector castedArrays; castedArrays.reserve(inputCellArrays.size()); std::transform(inputCellArrays.cbegin(), inputCellArrays.cend(), std::back_inserter(castedArrays), - [](const IArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); + [](const AbstractArray* elem) -> const DataArrayType* { return dynamic_cast(elem); }); CombineData(castedArrays, inputTupleShapes, *dynamic_cast(&destCellArray), newDestDims, direction, mirror); } /** - * @brief This function will make use of the CopyUsingIndexList class with the bool data type only to copy data from the input IArray to the destination IArray using the given index list. This - * function DOES NOT do any bounds checking! + * @brief This function will make use of the CopyUsingIndexList class with the bool data type only to copy data from the input AbstractArray to the destination AbstractArray using the given index + * list. This function DOES NOT do any bounds checking! */ -inline void RunBoolCopyUsingIndexList(IArray& destCellArray, const IArray& inputCellArray, const nonstd::span& newToOldIndices) +inline void RunBoolCopyUsingIndexList(AbstractArray& destCellArray, const AbstractArray& inputCellArray, const nonstd::span& newToOldIndices) { using DataArrayType = DataArray; CopyUsingIndexList(*dynamic_cast(&destCellArray), *dynamic_cast(&inputCellArray), newToOldIndices); } /** - * @brief This function will make use of the MapRectGridDataToImageData class with the bool data type only to copy data from the input IArray to the destination IArray using the given index list. This - * function DOES NOT do any bounds checking! + * @brief This function will make use of the MapRectGridDataToImageData class with the bool data type only to copy data from the input AbstractArray to the destination AbstractArray using the given + * index list. This function DOES NOT do any bounds checking! */ -inline void RunBoolMapRectToImage(IArray& destCellArray, const IArray& inputCellArray, const FloatVec3& origin, const SizeVec3& imageGeoDims, const std::vector& imageGeoSpacing, +inline void RunBoolMapRectToImage(AbstractArray& destCellArray, const AbstractArray& inputCellArray, const FloatVec3& origin, const SizeVec3& imageGeoDims, const std::vector& imageGeoSpacing, const SizeVec3& rectGridDims, const Float32Array* xGridValues, const Float32Array* yGridValues, const Float32Array* zGridValues) { using DataArrayType = DataArray; @@ -1484,17 +1484,17 @@ inline void RunBoolMapRectToImage(IArray& destCellArray, const IArray& inputCell } template -void RunParallelAppend(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) +void RunParallelAppend(AbstractArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) { - const IArray::ArrayType arrayType = destArray.getArrayType(); + const AbstractArray::ArrayType arrayType = destArray.getArrayType(); DataType dataType = DataType::int32; - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); } - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); if(dataType == DataType::boolean) { return RunAppendBoolAppend(destArray, std::forward(args)...); @@ -1505,17 +1505,17 @@ void RunParallelAppend(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... a } template -void RunParallelCombine(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) +void RunParallelCombine(AbstractArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) { - const IArray::ArrayType arrayType = destArray.getArrayType(); + const AbstractArray::ArrayType arrayType = destArray.getArrayType(); DataType dataType = DataType::int32; - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); } - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); if(dataType == DataType::boolean) { RunCombineBoolAppend(destArray, std::forward(args)...); @@ -1529,17 +1529,17 @@ void RunParallelCombine(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... * WARNING: This method can be very memory intensive for larger geometries. Use this method with caution! */ template -void RunParallelCopyUsingIndexList(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) +void RunParallelCopyUsingIndexList(AbstractArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) { - const IArray::ArrayType arrayType = destArray.getArrayType(); + const AbstractArray::ArrayType arrayType = destArray.getArrayType(); DataType dataType = DataType::int32; - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); } - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); if(dataType == DataType::boolean) { RunBoolCopyUsingIndexList(destArray, std::forward(args)...); @@ -1550,17 +1550,17 @@ void RunParallelCopyUsingIndexList(IArray& destArray, ParallelRunnerT&& runner, } template -void RunParallelMapRectToImage(IArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) +void RunParallelMapRectToImage(AbstractArray& destArray, ParallelRunnerT&& runner, ArgsT&&... args) { - const IArray::ArrayType arrayType = destArray.getArrayType(); + const AbstractArray::ArrayType arrayType = destArray.getArrayType(); DataType dataType = DataType::int32; - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); } - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - dataType = dynamic_cast(&destArray)->getDataType(); + dataType = dynamic_cast(&destArray)->getDataType(); if(dataType == DataType::boolean) { RunBoolMapRectToImage(destArray, std::forward(args)...); @@ -1582,7 +1582,7 @@ template class CopyCellDataArray { public: - CopyCellDataArray(const IDataArray& oldCellArray, IDataArray& newCellArray, const std::vector& newEdgesIndex, const std::atomic_bool& shouldCancel) + CopyCellDataArray(const AbstractDataArray& oldCellArray, AbstractDataArray& newCellArray, const std::vector& newEdgesIndex, const std::atomic_bool& shouldCancel) : m_OldCellArray(dynamic_cast&>(oldCellArray)) , m_NewCellArray(dynamic_cast&>(newCellArray)) , m_NewEdgesIndex(newEdgesIndex) diff --git a/src/simplnx/Utilities/DataGroupUtilities.cpp b/src/simplnx/Utilities/DataGroupUtilities.cpp index 7ce17b4277..35a615d90d 100644 --- a/src/simplnx/Utilities/DataGroupUtilities.cpp +++ b/src/simplnx/Utilities/DataGroupUtilities.cpp @@ -19,12 +19,12 @@ bool RemoveInactiveObjects(DataStructure& dataStructure, const DataPath& feature // Loop over all the paths from the feature group and remove the data arrays that do NOT have the // same number of Tuples as the 'activeObjects' vector - std::vector> matchingDataArrayPtrs; + std::vector> matchingDataArrayPtrs; for(const auto& entry : featureDataMap) { - std::shared_ptr dataObject = entry.second; - std::shared_ptr dataArray = std::dynamic_pointer_cast(dataObject); + std::shared_ptr dataObject = entry.second; + std::shared_ptr dataArray = std::dynamic_pointer_cast(dataObject); if(nullptr != dataArray) { if(dataArray->getNumberOfTuples() == activeObjects.size()) @@ -97,7 +97,7 @@ bool RemoveInactiveObjects(DataStructure& dataStructure, const DataPath& feature if(featureIdsChanged) { - auto result = GetAllChildDataPaths(dataStructure, featureDataGroupPath, DataObject::Type::NeighborList); + auto result = GetAllChildDataPaths(dataStructure, featureDataGroupPath, IDataObject::Type::NeighborList); if(result.has_value()) { std::vector neighborListDataPaths = result.value(); @@ -126,16 +126,16 @@ bool RemoveInactiveObjects(DataStructure& dataStructure, const DataPath& feature } // ----------------------------------------------------------------------------- -std::vector> GenerateDataArrayList(const DataStructure& dataStructure, const DataPath& dataArrayPath, const std::vector& ignoredDataPaths) +std::vector> GenerateDataArrayList(const DataStructure& dataStructure, const DataPath& dataArrayPath, const std::vector& ignoredDataPaths) { - std::vector> arrays; - std::set> childArrays; + std::vector> arrays; + std::set> childArrays; DataPath parentPath = dataArrayPath.getParent(); if(parentPath.empty()) { for(const auto& [key, object] : dataStructure.getDataMap()) { - if(auto typePtr = std::dynamic_pointer_cast(object); typePtr != nullptr) + if(auto typePtr = std::dynamic_pointer_cast(object); typePtr != nullptr) { childArrays.insert(typePtr); } @@ -144,7 +144,7 @@ std::vector> GenerateDataArrayList(const DataStructu else { const auto& parent = dataStructure.getDataRefAs(parentPath); - childArrays = parent.findAllChildrenOfType(); + childArrays = parent.findAllChildrenOfType(); } for(const auto& childArray : childArrays) { @@ -173,7 +173,7 @@ std::vector> GenerateDataArrayList(const DataStructu return arrays; } -std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parentGroup, DataObject::Type dataObjectType, +std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parentGroup, AbstractDataObject::Type dataObjectType, const std::vector& ignoredDataPaths) { std::vector childDataObjects; @@ -206,8 +206,8 @@ std::optional> GetAllChildDataPaths(const DataStructure& d break; } } - const DataObject* dataObject = dataStructure.getData(childPath); - if(dataObject != nullptr && !ignore && (dataObjectType == DataObject::Type::DataObject || dataObject->getDataObjectType() == dataObjectType)) + const AbstractDataObject* dataObject = dataStructure.getData(childPath); + if(dataObject != nullptr && !ignore && (dataObjectType == IDataObject::Type::AbstractDataObject || dataObject->getDataObjectType() == dataObjectType)) { childDataObjects.push_back(childPath); } @@ -222,10 +222,10 @@ std::optional> GetAllChildDataPaths(const DataStructure& d std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parent) { std::vector childDataObjects; - const DataObject* dataObject1 = dataStructure.getData(parent); - if(dataObject1 == nullptr || dataObject1->getDataObjectType() == DataObject::Type::DataArray || dataObject1->getDataObjectType() == DataObject::Type::DynamicListArray || - dataObject1->getDataObjectType() == DataObject::Type::NeighborList || dataObject1->getDataObjectType() == DataObject::Type::ScalarData || - dataObject1->getDataObjectType() == DataObject::Type::StringArray) + const AbstractDataObject* dataObject1 = dataStructure.getData(parent); + if(dataObject1 == nullptr || dataObject1->getDataObjectType() == IDataObject::Type::DataArray || dataObject1->getDataObjectType() == IDataObject::Type::DynamicListArray || + dataObject1->getDataObjectType() == IDataObject::Type::NeighborList || dataObject1->getDataObjectType() == IDataObject::Type::ScalarData || + dataObject1->getDataObjectType() == IDataObject::Type::StringArray) { return {}; } @@ -272,7 +272,7 @@ std::optional> GetAllChildArrayDataPaths(const DataStructu { bool ignore = false; DataPath childPath = parentGroup.createChildPath(childName); - const DataObject* dataObject = dataStructure.getData(childPath); + const AbstractDataObject* dataObject = dataStructure.getData(childPath); for(const auto& ignoredPath : ignoredDataPaths) { if(childPath == ignoredPath) @@ -281,7 +281,7 @@ std::optional> GetAllChildArrayDataPaths(const DataStructu break; } } - if(!ignore && dynamic_cast(dataObject) != nullptr) + if(!ignore && dynamic_cast(dataObject) != nullptr) { childDataObjects.push_back(childPath); } @@ -342,7 +342,7 @@ std::optional> GetAllChildDataPathsRecursive(const DataStr return {childDataObjects}; } -std::optional> GetAllChildDataPathsRecursive(const DataStructure& dataStructure, const DataPath& parentGroup, DataObject::Type dataObjectType, +std::optional> GetAllChildDataPathsRecursive(const DataStructure& dataStructure, const DataPath& parentGroup, AbstractDataObject::Type dataObjectType, const std::vector& ignoredDataPaths) { std::vector childDataObjects; @@ -377,8 +377,8 @@ std::optional> GetAllChildDataPathsRecursive(const DataStr } if(!ignore) { - const DataObject* dataObject = dataStructure.getData(childPath); - if(dataObject != nullptr && (dataObjectType == DataObject::Type::DataObject || dataObject->getDataObjectType() == dataObjectType)) + const AbstractDataObject* dataObject = dataStructure.getData(childPath); + if(dataObject != nullptr && (dataObjectType == IDataObject::Type::AbstractDataObject || dataObject->getDataObjectType() == dataObjectType)) { childDataObjects.push_back(childPath); } @@ -413,8 +413,8 @@ bool ContainsDataArrayName(const DataStructure& dataStructure, const DataPath& p for(const auto& childName : childrenNames) { DataPath childPath = parentGroup.createChildPath(childName); - const DataObject* dataObject = dataStructure.getData(childPath); - if(dynamic_cast(dataObject) != nullptr && childName == arrayName) + const AbstractDataObject* dataObject = dataStructure.getData(childPath); + if(dynamic_cast(dataObject) != nullptr && childName == arrayName) { return true; } diff --git a/src/simplnx/Utilities/DataGroupUtilities.hpp b/src/simplnx/Utilities/DataGroupUtilities.hpp index 1591e38714..e7514c0a7a 100644 --- a/src/simplnx/Utilities/DataGroupUtilities.hpp +++ b/src/simplnx/Utilities/DataGroupUtilities.hpp @@ -1,9 +1,9 @@ #pragma once +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/simplnx_export.hpp" @@ -35,7 +35,7 @@ SIMPLNX_EXPORT bool RemoveInactiveObjects(DataStructure& dataStructure, const Da * @param ignoredDataPaths Vector of DataPaths that should be remove from the final vector. * @return */ -SIMPLNX_EXPORT std::vector> GenerateDataArrayList(const DataStructure& dataStructure, const DataPath& dataArrayPath, const std::vector& ignoredDataPaths); +SIMPLNX_EXPORT std::vector> GenerateDataArrayList(const DataStructure& dataStructure, const DataPath& dataArrayPath, const std::vector& ignoredDataPaths); /** * @brief This function will return all the DataPaths within a BaseGroup that are of a certain type @@ -45,7 +45,7 @@ SIMPLNX_EXPORT std::vector> GenerateDataArrayList(co * @param ignoredDataPaths Vector of DataPaths that should be remove from the final vector. * @return std::optional> of child paths that meet the DataObjectType requirement if there no errors during the process. */ -SIMPLNX_EXPORT std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parentGroup, DataObject::Type dataObjectType, +SIMPLNX_EXPORT std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parentGroup, AbstractDataObject::Type dataObjectType, const std::vector& ignoredDataPaths = {}); /** @@ -57,11 +57,11 @@ SIMPLNX_EXPORT std::optional> GetAllChildDataPaths(const D SIMPLNX_EXPORT std::optional> GetAllChildDataPaths(const DataStructure& dataStructure, const DataPath& parent); /** - * @brief This function will return all the DataPaths within a BaseGroup that are of an IArray type + * @brief This function will return all the DataPaths within a BaseGroup that are of an AbstractArray type * @param dataStructure The DataStructure to use * @param parentGroup The parent group whose children you want to get * @param ignoredDataPaths Vector of DataPaths that should be remove from the final vector. - * @return std::optional> of child paths that are an IArray type if there no errors during the process. + * @return std::optional> of child paths that are an AbstractArray type if there no errors during the process. */ SIMPLNX_EXPORT std::optional> GetAllChildArrayDataPaths(const DataStructure& dataStructure, const DataPath& parentGroup, const std::vector& ignoredDataPaths = {}); @@ -70,7 +70,7 @@ SIMPLNX_EXPORT std::optional> GetAllChildArrayDataPaths(co * @param dataStructure The DataStructure to use * @param parentGroup The parent group whose children you want to get * @param ignoredDataPaths Vector of DataPaths that should be remove from the final vector. - * @return std::optional> of child paths that are an IArray type if there no errors during the process. + * @return std::optional> of child paths that are an AbstractArray type if there no errors during the process. */ SIMPLNX_EXPORT std::optional> GetAllChildDataPathsRecursive(const DataStructure& dataStructure, const DataPath& parentGroup, const std::vector& ignoredDataPaths = {}); @@ -80,13 +80,13 @@ SIMPLNX_EXPORT std::optional> GetAllChildDataPathsRecursiv * @param parentGroup The parent group whose children you want to get * @param dataObjectType The type of children you want to get * @param ignoredDataPaths Vector of DataPaths that should be remove from the final vector. - * @return std::optional> of child paths that are an IArray type if there no errors during the process. + * @return std::optional> of child paths that are an AbstractArray type if there no errors during the process. */ -SIMPLNX_EXPORT std::optional> GetAllChildDataPathsRecursive(const DataStructure& dataStructure, const DataPath& parentGroup, DataObject::Type dataObjectType, +SIMPLNX_EXPORT std::optional> GetAllChildDataPathsRecursive(const DataStructure& dataStructure, const DataPath& parentGroup, AbstractDataObject::Type dataObjectType, const std::vector& ignoredDataPaths = {}); /** - * @brief This function will return true if the arrayName is in the list of children of type IDataArray for the given parentGroup + * @brief This function will return true if the arrayName is in the list of children of type AbstractDataArray for the given parentGroup * @param dataStructure The DataStructure to use * @param parentGroup The parent group whose children you want to check against * @param arrayName The target name of the array you want to check for in the parentGroup diff --git a/src/simplnx/Utilities/DataObjectUtilities.hpp b/src/simplnx/Utilities/DataObjectUtilities.hpp index c21d3b501e..7f97eef635 100644 --- a/src/simplnx/Utilities/DataObjectUtilities.hpp +++ b/src/simplnx/Utilities/DataObjectUtilities.hpp @@ -3,26 +3,26 @@ #include "simplnx/Common/StringLiteral.hpp" #include "simplnx/Common/TypeTraits.hpp" #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractArray.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DynamicListArray.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGridGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry1D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" #include "simplnx/DataStructure/Geometry/HexahedralGeom.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/IGridGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry1D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/QuadGeom.hpp" #include "simplnx/DataStructure/Geometry/RectGridGeom.hpp" #include "simplnx/DataStructure/Geometry/TetrahedralGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" -#include "simplnx/DataStructure/IArray.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/DataStructure/Montage/AbstractMontage.hpp" #include "simplnx/DataStructure/Montage/GridMontage.hpp" #include "simplnx/DataStructure/NeighborList.hpp" @@ -44,8 +44,9 @@ namespace nx::core * @param visitedIndex The index into the visited array * @return Either the original 'id' if this was already visited or the new 'id' if it was not visited already. */ -inline constexpr std::optional VisitDataStructureId(std::optional& originalId, const std::pair& updatedId, - std::vector& visited, usize visitedIndex) +inline constexpr std::optional VisitDataStructureId(std::optional& originalId, + const std::pair& updatedId, std::vector& visited, + usize visitedIndex) { if(originalId == updatedId.first && !visited[visitedIndex]) { @@ -56,7 +57,7 @@ inline constexpr std::optional VisitDataStructureId(std::opt } /** - * @brief Returns a string representation of the passed in IGeometry::Type + * @brief Returns a string representation of the passed in AbstractGeometry::Type * @param dataType * @return */ @@ -89,7 +90,7 @@ inline constexpr StringLiteral GeometryTypeToString(IGeometry::Type geomType) return "Hexahedral"; } default: - throw std::runtime_error("nx::core::GeometryTypeToString: Unknown IGeometry::Type"); + throw std::runtime_error("nx::core::GeometryTypeToString: Unknown AbstractGeometry::Type"); } } @@ -107,11 +108,11 @@ inline const std::vector& GetAllGeometryTypesAsStrings() } /** - * @brief Returns a IGeometry::Type for the passed in string representation + * @brief Returns a AbstractGeometry::Type for the passed in string representation * @param geomTypeString * @return */ -inline constexpr IGeometry::Type StringToGeometryType(std::string_view geomTypeString) +inline constexpr AbstractGeometry::Type StringToGeometryType(std::string_view geomTypeString) { if(geomTypeString == GeometryTypeToString(IGeometry::Type::Image).view()) { @@ -147,93 +148,93 @@ inline constexpr IGeometry::Type StringToGeometryType(std::string_view geomTypeS } else { - throw std::runtime_error("nx::core::StringToGeometryType: No known IGeometry::Type matches the given string value."); + throw std::runtime_error("nx::core::StringToGeometryType: No known AbstractGeometry::Type matches the given string value."); } } -inline constexpr StringLiteral DataObjectTypeToString(DataObject::Type dataObjType) +inline constexpr StringLiteral DataObjectTypeToString(AbstractDataObject::Type dataObjType) { switch(dataObjType) { - case nx::core::DataObject::Type::BaseGroup: { + case nx::core::IDataObject::Type::BaseGroup: { return nx::core::BaseGroup::k_TypeName; } - case nx::core::DataObject::Type::DataGroup: { + case nx::core::IDataObject::Type::DataGroup: { return nx::core::DataGroup::k_TypeName; } - case nx::core::DataObject::Type::AttributeMatrix: { + case nx::core::IDataObject::Type::AttributeMatrix: { return nx::core::AttributeMatrix::k_TypeName; } - case nx::core::DataObject::Type::IGeometry: { - return nx::core::IGeometry::k_TypeName; + case nx::core::IDataObject::Type::AbstractGeometry: { + return nx::core::AbstractGeometry::k_TypeName; } - case nx::core::DataObject::Type::IGridGeometry: { - return nx::core::IGridGeometry::k_TypeName; + case nx::core::IDataObject::Type::AbstractGridGeometry: { + return nx::core::AbstractGridGeometry::k_TypeName; } - case nx::core::DataObject::Type::INodeGeometry0D: { - return nx::core::INodeGeometry0D::k_TypeName; + case nx::core::IDataObject::Type::AbstractNodeGeometry0D: { + return nx::core::AbstractNodeGeometry0D::k_TypeName; } - case nx::core::DataObject::Type::INodeGeometry1D: { - return nx::core::INodeGeometry1D::k_TypeName; + case nx::core::IDataObject::Type::AbstractNodeGeometry1D: { + return nx::core::AbstractNodeGeometry1D::k_TypeName; } - case nx::core::DataObject::Type::INodeGeometry2D: { - return nx::core::INodeGeometry2D::k_TypeName; + case nx::core::IDataObject::Type::AbstractNodeGeometry2D: { + return nx::core::AbstractNodeGeometry2D::k_TypeName; } - case nx::core::DataObject::Type::INodeGeometry3D: { - return nx::core::INodeGeometry3D::k_TypeName; + case nx::core::IDataObject::Type::AbstractNodeGeometry3D: { + return nx::core::AbstractNodeGeometry3D::k_TypeName; } - case nx::core::DataObject::Type::ImageGeom: { + case nx::core::IDataObject::Type::ImageGeom: { return nx::core::ImageGeom::k_TypeName; } - case nx::core::DataObject::Type::RectGridGeom: { + case nx::core::IDataObject::Type::RectGridGeom: { return nx::core::RectGridGeom::k_TypeName; } - case nx::core::DataObject::Type::VertexGeom: { + case nx::core::IDataObject::Type::VertexGeom: { return nx::core::VertexGeom::k_TypeName; } - case nx::core::DataObject::Type::EdgeGeom: { + case nx::core::IDataObject::Type::EdgeGeom: { return nx::core::EdgeGeom::k_TypeName; } - case nx::core::DataObject::Type::TriangleGeom: { + case nx::core::IDataObject::Type::TriangleGeom: { return nx::core::TriangleGeom::k_TypeName; } - case nx::core::DataObject::Type::QuadGeom: { + case nx::core::IDataObject::Type::QuadGeom: { return nx::core::QuadGeom::k_TypeName; } - case nx::core::DataObject::Type::TetrahedralGeom: { + case nx::core::IDataObject::Type::TetrahedralGeom: { return nx::core::TetrahedralGeom::k_TypeName; } - case nx::core::DataObject::Type::HexahedralGeom: { + case nx::core::IDataObject::Type::HexahedralGeom: { return nx::core::HexahedralGeom::k_TypeName; } - case nx::core::DataObject::Type::IDataArray: { - return nx::core::IDataArray::k_TypeName; + case nx::core::IDataObject::Type::AbstractDataArray: { + return nx::core::AbstractDataArray::k_TypeName; } - case nx::core::DataObject::Type::DataArray: { + case nx::core::IDataObject::Type::DataArray: { return nx::core::DataArrayConstants::k_TypeName; } - case nx::core::DataObject::Type::INeighborList: { - return nx::core::INeighborList::k_TypeName; + case nx::core::IDataObject::Type::AbstractNeighborList: { + return nx::core::AbstractNeighborList::k_TypeName; } - case nx::core::DataObject::Type::NeighborList: { + case nx::core::IDataObject::Type::NeighborList: { return nx::core::NeighborListConstants::k_TypeName; } - case nx::core::DataObject::Type::ScalarData: { + case nx::core::IDataObject::Type::ScalarData: { return nx::core::ScalarDataConstants::k_TypeName; } - case nx::core::DataObject::Type::StringArray: { + case nx::core::IDataObject::Type::StringArray: { return nx::core::StringArray::k_TypeName; } - case nx::core::DataObject::Type::DynamicListArray: { + case nx::core::IDataObject::Type::DynamicListArray: { return nx::core::DynamicListArrayConstants::k_TypeName; } - case nx::core::DataObject::Type::AbstractMontage: { + case nx::core::IDataObject::Type::AbstractMontage: { return nx::core::AbstractMontage::k_TypeName; } - case nx::core::DataObject::Type::GridMontage: { + case nx::core::IDataObject::Type::GridMontage: { return nx::core::GridMontage::k_TypeName; } - case nx::core::DataObject::Type::Any: { + case nx::core::IDataObject::Type::Any: { return {"Any"}; } default: { @@ -243,25 +244,25 @@ inline constexpr StringLiteral DataObjectTypeToString(DataObject::Type dataObjTy } /** - * @brief Converts IArray::ArrayType to DataObject::Type. ArrayType is a subset of DataObject::Type so this function cannot fail. + * @brief Converts AbstractArray::ArrayType to AbstractDataObject::Type. ArrayType is a subset of AbstractDataObject::Type so this function cannot fail. * @param arrayType * @return */ -inline constexpr DataObject::Type ConvertArrayTypeToDataObjectType(IArray::ArrayType arrayType) +inline constexpr AbstractDataObject::Type ConvertArrayTypeToDataObjectType(AbstractArray::ArrayType arrayType) { switch(arrayType) { - case IArray::ArrayType::DataArray: { - return DataObject::Type::DataArray; + case AbstractArray::ArrayType::DataArray: { + return IDataObject::Type::DataArray; } - case IArray::ArrayType::NeighborListArray: { - return DataObject::Type::NeighborList; + case AbstractArray::ArrayType::NeighborListArray: { + return IDataObject::Type::NeighborList; } - case IArray::ArrayType::StringArray: { - return DataObject::Type::StringArray; + case AbstractArray::ArrayType::StringArray: { + return IDataObject::Type::StringArray; } - case IArray::ArrayType::Any: { - return DataObject::Type::Any; + case AbstractArray::ArrayType::Any: { + return IDataObject::Type::Any; } default: { throw std::runtime_error("nx::core::ConvertArrayTypeToDataObjectType: Invalid ArrayType"); @@ -270,27 +271,27 @@ inline constexpr DataObject::Type ConvertArrayTypeToDataObjectType(IArray::Array } /** - * @brief Converts DataObject::Type to IArray::ArrayType. + * @brief Converts AbstractDataObject::Type to AbstractArray::ArrayType. * @param dataObjectType * @return */ -inline constexpr std::optional ConvertDataObjectTypeToArrayType(DataObject::Type dataObjectType) noexcept +inline constexpr std::optional ConvertDataObjectTypeToArrayType(AbstractDataObject::Type dataObjectType) noexcept { switch(dataObjectType) { - case DataObject::Type::IDataArray: - case DataObject::Type::DataArray: { - return IArray::ArrayType::DataArray; + case IDataObject::Type::AbstractDataArray: + case IDataObject::Type::DataArray: { + return AbstractArray::ArrayType::DataArray; } - case DataObject::Type::INeighborList: - case DataObject::Type::NeighborList: { - return IArray::ArrayType::NeighborListArray; + case IDataObject::Type::AbstractNeighborList: + case IDataObject::Type::NeighborList: { + return AbstractArray::ArrayType::NeighborListArray; } - case DataObject::Type::StringArray: { - return IArray::ArrayType::StringArray; + case IDataObject::Type::StringArray: { + return AbstractArray::ArrayType::StringArray; } - case DataObject::Type::Any: { - return IArray::ArrayType::Any; + case IDataObject::Type::Any: { + return AbstractArray::ArrayType::Any; } default: { return {}; diff --git a/src/simplnx/Utilities/FileUtilities.cpp b/src/simplnx/Utilities/FileUtilities.cpp index 84a9f670c1..aafd14c70b 100644 --- a/src/simplnx/Utilities/FileUtilities.cpp +++ b/src/simplnx/Utilities/FileUtilities.cpp @@ -272,7 +272,7 @@ const int32 k_FileNotOpen = -108; const int32 k_CannotSkipToLine = -115; const int32 k_EmptyLine = -119; -AbstractDataParser::AbstractDataParser(IArray& array, const std::string& columnName, usize columnIndex) +AbstractDataParser::AbstractDataParser(AbstractArray& array, const std::string& columnName, usize columnIndex) : m_Array(array) , m_ColumnName(columnName) , m_ColumnIndex(columnIndex) @@ -289,7 +289,7 @@ usize AbstractDataParser::columnIndex() const return m_ColumnIndex; } -const IArray& AbstractDataParser::array() const +const AbstractArray& AbstractDataParser::array() const { return m_Array; } diff --git a/src/simplnx/Utilities/FileUtilities.hpp b/src/simplnx/Utilities/FileUtilities.hpp index 617ee83d4b..4d73cdd652 100644 --- a/src/simplnx/Utilities/FileUtilities.hpp +++ b/src/simplnx/Utilities/FileUtilities.hpp @@ -95,15 +95,15 @@ class AbstractDataParser [[nodiscard]] usize columnIndex() const; - [[nodiscard]] const IArray& array() const; + [[nodiscard]] const AbstractArray& array() const; virtual Result<> parse(const std::string& token, size_t index) = 0; protected: - AbstractDataParser(IArray& array, const std::string& columnName, usize columnIndex); + AbstractDataParser(AbstractArray& array, const std::string& columnName, usize columnIndex); private: - IArray& m_Array; + AbstractArray& m_Array; usize m_ColumnIndex = 0; std::string m_ColumnName; }; diff --git a/src/simplnx/Utilities/FilterUtilities.cpp b/src/simplnx/Utilities/FilterUtilities.cpp index ddf4804c28..1a04cf61bf 100644 --- a/src/simplnx/Utilities/FilterUtilities.cpp +++ b/src/simplnx/Utilities/FilterUtilities.cpp @@ -64,7 +64,7 @@ IFilter::PreflightResult NeighborListRemovalPreflightCode(const DataStructure& d std::string ss = fmt::format("This filter will REMOVE all arrays of type NeighborList from the feature Attribute Matrix '{}'. These arrays are:\n", featureIdsPath.toString(), featureGroupDataPath.toString()); - auto result = nx::core::GetAllChildDataPaths(dataStructure, featureGroupDataPath, DataObject::Type::NeighborList); + auto result = nx::core::GetAllChildDataPaths(dataStructure, featureGroupDataPath, IDataObject::Type::NeighborList); if(!result.has_value()) { return {nonstd::make_unexpected( diff --git a/src/simplnx/Utilities/FlyingEdges.hpp b/src/simplnx/Utilities/FlyingEdges.hpp index b225b449d5..cb692eddb3 100644 --- a/src/simplnx/Utilities/FlyingEdges.hpp +++ b/src/simplnx/Utilities/FlyingEdges.hpp @@ -1148,9 +1148,9 @@ class FlyingEdgesAlgorithm std::vector m_EdgeCases; // size (m_NX-1)*m_NY*m_NZ std::vector m_CubeCases; // size (m_NX-1)*(m_NY-1)*(m_NZ-1) - AbstractDataStore& m_PointsStore; // - AbstractDataStore& m_TrisStore; // - Float32AbstractDataStore& m_NormalsStore; // The output + AbstractDataStore& m_PointsStore; // + AbstractDataStore& m_TrisStore; // + Float32AbstractDataStore& m_NormalsStore; // The output ///////////////////////////////////////////////////////////// diff --git a/src/simplnx/Utilities/GeometryHelpers.cpp b/src/simplnx/Utilities/GeometryHelpers.cpp index edffdfdc25..177c0a2a3e 100644 --- a/src/simplnx/Utilities/GeometryHelpers.cpp +++ b/src/simplnx/Utilities/GeometryHelpers.cpp @@ -3,14 +3,14 @@ using namespace nx::core; namespace nx::core::GeometryHelpers::Description { -std::string GenerateGeometryInfo(const nx::core::SizeVec3& dims, const nx::core::FloatVec3& spacing, const nx::core::FloatVec3& origin, IGeometry::LengthUnit units) +std::string GenerateGeometryInfo(const nx::core::SizeVec3& dims, const nx::core::FloatVec3& spacing, const nx::core::FloatVec3& origin, AbstractGeometry::LengthUnit units) { std::stringstream description; std::string unitStr; - if(units != IGeometry::LengthUnit::Unknown && units != IGeometry::LengthUnit::Unspecified) + if(units != AbstractGeometry::LengthUnit::Unknown && units != AbstractGeometry::LengthUnit::Unspecified) { - unitStr = IGeometry::LengthUnitToString(units); + unitStr = AbstractGeometry::LengthUnitToString(units); } std::array label = {"X", "Y", "Z"}; @@ -33,23 +33,23 @@ std::vector FindEulerCharacteristicValues(const TriangleGeom& triangleGeo const auto& faceLabels = faceLabelsRef.getDataStoreRef(); const usize numRegions = 1 + *std::max_element(faceLabels.begin(), faceLabels.end()); - using EdgePairType = std::pair; + using EdgePairType = std::pair; using UniqueEdgesType = std::set; - using UniqueVertType = std::set; + using UniqueVertType = std::set; - constexpr IGeometry::MeshIndexType numVertsPerElem = 3; + constexpr AbstractGeometry::MeshIndexType numVertsPerElem = 3; std::vector regionTriangleCount(numRegions, 0); std::vector uniqueEdges(numRegions); std::vector uniqueVerts(numRegions); - for(IGeometry::MeshIndexType tIdx = 0; tIdx < triangleList.getNumberOfTuples(); ++tIdx) + for(AbstractGeometry::MeshIndexType tIdx = 0; tIdx < triangleList.getNumberOfTuples(); ++tIdx) { const usize offset = tIdx * numVertsPerElem; - for(IGeometry::MeshIndexType labelIdx = 0; labelIdx < 2; labelIdx++) + for(AbstractGeometry::MeshIndexType labelIdx = 0; labelIdx < 2; labelIdx++) { - IGeometry::MeshIndexType v0 = 0; - IGeometry::MeshIndexType v1 = 0; + AbstractGeometry::MeshIndexType v0 = 0; + AbstractGeometry::MeshIndexType v1 = 0; const auto regionIdx = faceLabels[tIdx * 2 + labelIdx]; if(regionIdx < 0) @@ -167,7 +167,7 @@ std::vector FindEulerCharacteristicValues(const TriangleGeom& triangleGeo namespace nx::core::GeometryHelpers::Topology { -BoundingBoxFaces FindElementPeriodicFaces(const BoundingBox3Df& boundingBox, const Float32AbstractDataStore& vertices, const std::set& vertexSet) +BoundingBoxFaces FindElementPeriodicFaces(const BoundingBox3Df& boundingBox, const Float32AbstractDataStore& vertices, const std::set& vertexSet) { if(vertexSet.empty()) { @@ -217,7 +217,7 @@ BoundingBoxFaces FindElementPeriodicFaces(const BoundingBox3Df& boundingBox, con return edgeFaces; } -bool AdjustCentroidsForPeriodicFaces(const BoundingBox3Df& boundingBox, const BoundingBoxFaces& faces, Float32AbstractDataStore& centroids, IGeometry::MeshIndexType featureId) +bool AdjustCentroidsForPeriodicFaces(const BoundingBox3Df& boundingBox, const BoundingBoxFaces& faces, Float32AbstractDataStore& centroids, AbstractGeometry::MeshIndexType featureId) { bool isPeriodic = false; const auto minPoint = boundingBox.getMinPoint(); diff --git a/src/simplnx/Utilities/GeometryHelpers.hpp b/src/simplnx/Utilities/GeometryHelpers.hpp index 49de30a025..43692a638b 100644 --- a/src/simplnx/Utilities/GeometryHelpers.hpp +++ b/src/simplnx/Utilities/GeometryHelpers.hpp @@ -4,7 +4,7 @@ #include "simplnx/Common/EulerAngle.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStore.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/Utilities/Math/GeometryMath.hpp" @@ -28,7 +28,7 @@ namespace Description * @param units The units of the geometry * @return */ -SIMPLNX_EXPORT std::string GenerateGeometryInfo(const nx::core::SizeVec3& dims, const nx::core::FloatVec3& spacing, const nx::core::FloatVec3& origin, IGeometry::LengthUnit units); +SIMPLNX_EXPORT std::string GenerateGeometryInfo(const nx::core::SizeVec3& dims, const nx::core::FloatVec3& spacing, const nx::core::FloatVec3& origin, AbstractGeometry::LengthUnit units); } // namespace Description @@ -169,7 +169,7 @@ SIMPLNX_EXPORT std::vector FindEulerCharacteristicValues(const TriangleGe template usize FindNumEdges(const AbstractDataStore& faceStore, usize numVertices = (detail::k_MaxOptimizedValue + 1)) { - // This case may seem niche, but it is designed with Indexing types in mind specifically IGeometry::MeshIndexType + // This case may seem niche, but it is designed with Indexing types in mind specifically AbstractGeometry::MeshIndexType if constexpr(!std::is_signed_v) { if(numVertices < detail::k_MaxOptimizedValue) @@ -238,7 +238,7 @@ void FindElementsContainingVert(const DataArray* elemList, DynamicListArray -ErrorCode FindElementNeighbors(const DataArray* elemList, const DynamicListArray* elemsContainingVert, DynamicListArray* dynamicList, IGeometry::Type geometryType) +ErrorCode FindElementNeighbors(const DataArray* elemList, const DynamicListArray* elemsContainingVert, DynamicListArray* dynamicList, AbstractGeometry::Type geometryType) { auto& elems = *elemList; const usize numElems = elemList->getNumberOfTuples(); @@ -958,7 +958,7 @@ using BoundingBoxFaces = std::unordered_set; * @param vertexSet * @return BoundingBoxFaces */ -BoundingBoxFaces SIMPLNX_EXPORT FindElementPeriodicFaces(const BoundingBox3Df& boundingBox, const Float32AbstractDataStore& vertices, const std::set& vertexSet); +BoundingBoxFaces SIMPLNX_EXPORT FindElementPeriodicFaces(const BoundingBox3Df& boundingBox, const Float32AbstractDataStore& vertices, const std::set& vertexSet); /** * @brief Adjusts centroids for periodic edge cases. The data is assumed to @@ -970,7 +970,7 @@ BoundingBoxFaces SIMPLNX_EXPORT FindElementPeriodicFaces(const BoundingBox3Df& b * @param centroids * @param featureId */ -bool SIMPLNX_EXPORT AdjustCentroidsForPeriodicFaces(const BoundingBox3Df& boundingBox, const BoundingBoxFaces& faces, Float32AbstractDataStore& centroids, IGeometry::MeshIndexType featureId); +bool SIMPLNX_EXPORT AdjustCentroidsForPeriodicFaces(const BoundingBox3Df& boundingBox, const BoundingBoxFaces& faces, Float32AbstractDataStore& centroids, AbstractGeometry::MeshIndexType featureId); bool SIMPLNX_EXPORT AdjustCentroidsForPeriodicFaces(const ImageGeom& imageGeom, const UInt64AbstractDataStore& xRanges, const UInt64AbstractDataStore& yRanges, const UInt64AbstractDataStore& zRanges, Float32AbstractDataStore& centroids); diff --git a/src/simplnx/Utilities/GeometryUtilities.cpp b/src/simplnx/Utilities/GeometryUtilities.cpp index b0c763807b..2fe44b8419 100644 --- a/src/simplnx/Utilities/GeometryUtilities.cpp +++ b/src/simplnx/Utilities/GeometryUtilities.cpp @@ -52,7 +52,7 @@ void GeometryUtilities::FindUniqueIdsImpl::operator()(const Range& range) const convert(range.min(), range.max()); } -Result GeometryUtilities::CalculatePartitionLengthsByPartitionCount(const INodeGeometry0D& geometry, const SizeVec3& numberOfPartitionsPerAxis) +Result GeometryUtilities::CalculatePartitionLengthsByPartitionCount(const AbstractNodeGeometry0D& geometry, const SizeVec3& numberOfPartitionsPerAxis) { BoundingBox3Df boundingBox = geometry.getBoundingBox(); if(!boundingBox.isValid()) @@ -125,7 +125,7 @@ Result GeometryUtilities::CalculatePartitionLengthsByPartitionCount(c return Result{lengthPerPartition}; } -Result GeometryUtilities::CalculateNodeBasedPartitionSchemeOrigin(const INodeGeometry0D& geometry) +Result GeometryUtilities::CalculateNodeBasedPartitionSchemeOrigin(const AbstractNodeGeometry0D& geometry) { BoundingBox3Df boundingBox = geometry.getBoundingBox(); if(!boundingBox.isValid()) @@ -500,8 +500,8 @@ Edge IntersectTriangleWithPlane(const Point3Df& v0, const Point3Df& v1, const Po // ---------------------------------------------------------------------------- // -usize GeometryUtilities::determineBoundsAndNumSlices(float32& minDim, float32& maxDim, usize numTris, AbstractDataStore& tris, - AbstractDataStore& triVerts, uint64 sliceRange, float32 zStart, float32 zEnd, +usize GeometryUtilities::determineBoundsAndNumSlices(float32& minDim, float32& maxDim, usize numTris, AbstractDataStore& tris, + AbstractDataStore& triVerts, uint64 sliceRange, float32 zStart, float32 zEnd, float32 sliceResolution) { for(usize i = 0; i < numTris; i++) @@ -531,8 +531,8 @@ usize GeometryUtilities::determineBoundsAndNumSlices(float32& minDim, float32& m // ---------------------------------------------------------------------------- // -using TriStore = AbstractDataStore; -using VertsStore = AbstractDataStore; +using TriStore = AbstractDataStore; +using VertsStore = AbstractDataStore; inline std::array GetFaceCoordinates(usize triangleId, VertsStore& verts, TriStore& triangleList) { diff --git a/src/simplnx/Utilities/GeometryUtilities.hpp b/src/simplnx/Utilities/GeometryUtilities.hpp index 729111a54d..8fa3ece9f1 100644 --- a/src/simplnx/Utilities/GeometryUtilities.hpp +++ b/src/simplnx/Utilities/GeometryUtilities.hpp @@ -1,8 +1,8 @@ #pragma once #include "simplnx/Common/Range.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry3D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry3D.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" #include "simplnx/DataStructure/Geometry/RectGridGeom.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" @@ -18,7 +18,7 @@ namespace nx::core::GeometryUtilities class SIMPLNX_EXPORT FindUniqueIdsImpl { public: - using VertexStore = nx::core::AbstractDataStore; + using VertexStore = nx::core::AbstractDataStore; FindUniqueIdsImpl(VertexStore& vertexStore, const std::vector>& nodesInBin, nx::core::Int64AbstractDataStore& uniqueIds); void convert(size_t start, size_t end) const; @@ -35,7 +35,7 @@ class SIMPLNX_EXPORT FindUniqueIdsImpl * @param geometry The geometry to be partitioned * @param numberOfPartitionsPerAxis The number of partitions in each axis */ -SIMPLNX_EXPORT Result CalculatePartitionLengthsByPartitionCount(const INodeGeometry0D& geometry, const SizeVec3& numberOfPartitionsPerAxis); +SIMPLNX_EXPORT Result CalculatePartitionLengthsByPartitionCount(const AbstractNodeGeometry0D& geometry, const SizeVec3& numberOfPartitionsPerAxis); /** * @brief Calculates the X,Y,Z partition length for a given Image geometry if the geometry were partitioned into equal numberOfPartitionsPerAxis partitions. @@ -55,7 +55,7 @@ SIMPLNX_EXPORT Result CalculatePartitionLengthsByPartitionCount(const * @brief Calculates the X,Y,Z partition scheme origin for a given node-based geometry using the geometry's bounding box. * @param geometry The geometry whose bounding box origin will be calculated */ -SIMPLNX_EXPORT Result CalculateNodeBasedPartitionSchemeOrigin(const INodeGeometry0D& geometry); +SIMPLNX_EXPORT Result CalculateNodeBasedPartitionSchemeOrigin(const AbstractNodeGeometry0D& geometry); /** * @brief Calculates the X,Y,Z partition length if the given bounding box were partitioned into equal numberOfPartitionsPerAxis partitions. @@ -105,27 +105,27 @@ T ComputeTetrahedronVolume(const std::array& verts, const * @brief Removes duplicate nodes to ensure the vertex list is unique * @param geom The geometry to eliminate the duplicate nodes from. This MUST be a node-based geometry. */ -template ::value>> +template ::value>> Result<> EliminateDuplicateNodes(GeometryType& geom, std::optional scaleFactor = std::nullopt) { usize numXBins = 100; usize numYBins = 100; usize numZBins = 100; - using SharedVertList = AbstractDataStore; + using SharedVertList = AbstractDataStore; SharedVertList& vertices = geom.getVertices()->getDataStoreRef(); - INodeGeometry1D::MeshIndexArrayType* cells = nullptr; - if constexpr(std::is_base_of::value) + AbstractNodeGeometry1D::MeshIndexArrayType* cells = nullptr; + if constexpr(std::is_base_of::value) { cells = geom.getPolyhedra(); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { cells = geom.getFaces(); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { cells = geom.getEdges(); } @@ -134,9 +134,9 @@ Result<> EliminateDuplicateNodes(GeometryType& geom, std::optional scal { return MakeErrorResult(-56800, "EliminateDuplicateNodes Error: Geometry Type was not 1D, 2D or 3D? Did you pass in a vertex geometry?"); } - AbstractDataStore& cellsRef = cells->getDataStoreRef(); + AbstractDataStore& cellsRef = cells->getDataStoreRef(); - IGeometry::MeshIndexType nNodesAll = geom.getNumberOfVertices(); + AbstractGeometry::MeshIndexType nNodesAll = geom.getNumberOfVertices(); size_t nNodes = 0; if(nNodesAll > 0) { @@ -186,7 +186,7 @@ Result<> EliminateDuplicateNodes(GeometryType& geom, std::optional scal // Create array to hold unique node numbers Int64DataStore uniqueIds(ShapeType{nNodes}, ShapeType{1}, {}); - for(IGeometry::MeshIndexType i = 0; i < nNodesAll; i++) + for(AbstractGeometry::MeshIndexType i = 0; i < nNodesAll; i++) { uniqueIds[i] = static_cast(i); } @@ -228,19 +228,19 @@ Result<> EliminateDuplicateNodes(GeometryType& geom, std::optional scal geom.resizeVertexList(uniqueCount); // Update the triangle nodes to reflect the unique ids - IGeometry::MeshIndexType nCells; + AbstractGeometry::MeshIndexType nCells; usize nVerticesPerCell = 0; - if constexpr(std::is_base_of::value) + if constexpr(std::is_base_of::value) { nCells = geom.getNumberOfPolyhedra(); nVerticesPerCell = geom.getNumberOfVerticesPerCell(); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { nCells = geom.getNumberOfFaces(); nVerticesPerCell = geom.getNumberOfVerticesPerFace(); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { nCells = geom.getNumberOfEdges(); nVerticesPerCell = geom.getNumberOfVerticesPerEdge(); @@ -260,15 +260,15 @@ Result<> EliminateDuplicateNodes(GeometryType& geom, std::optional scal } } - if constexpr(std::is_base_of::value) + if constexpr(std::is_base_of::value) { geom.getPolyhedraAttributeMatrix()->resizeTuples({geom.getNumberOfPolyhedra()}); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { geom.getFaceAttributeMatrix()->resizeTuples({geom.getNumberOfFaces()}); } - else if constexpr(std::is_base_of::value) + else if constexpr(std::is_base_of::value) { geom.getEdgeAttributeMatrix()->resizeTuples({geom.getNumberOfEdges()}); } @@ -296,8 +296,9 @@ SIMPLNX_EXPORT Result<> ComputeTriangleAreas(const nx::core::TriangleGeom* trian */ SIMPLNX_EXPORT Result<> ComputeTriangleNormals(const nx::core::TriangleGeom* triangleGeom, Float64AbstractDataStore& normals, const std::atomic_bool& shouldCancel); -SIMPLNX_EXPORT usize determineBoundsAndNumSlices(float32& minDim, float32& maxDim, usize numTris, AbstractDataStore& tris, - AbstractDataStore& triVerts, uint64 sliceRange, float32 zStart, float32 zEnd, float32 sliceResolution); +SIMPLNX_EXPORT usize determineBoundsAndNumSlices(float32& minDim, float32& maxDim, usize numTris, AbstractDataStore& tris, + AbstractDataStore& triVerts, uint64 sliceRange, float32 zStart, float32 zEnd, + float32 sliceResolution); /** * @brief This is the information that is generated by the function and needs to be returned. diff --git a/src/simplnx/Utilities/HistogramUtilities.hpp b/src/simplnx/Utilities/HistogramUtilities.hpp index f4599f5eb4..be4c929f12 100644 --- a/src/simplnx/Utilities/HistogramUtilities.hpp +++ b/src/simplnx/Utilities/HistogramUtilities.hpp @@ -4,7 +4,7 @@ #include "simplnx/Common/Range.hpp" #include "simplnx/Common/Result.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/NeighborList.hpp" #include "simplnx/Utilities/MaskCompareUtilities.hpp" #include "simplnx/Utilities/Math/StatisticsCalculations.hpp" @@ -238,7 +238,7 @@ Result<> GenerateHistogramAtComponent(const AbstractDataStore& inputStore, struct GenerateHistogramFunctor { template - Result<> operator()(const IDataArray* inputArray, IDataArray* binRangesArray, ArgsT&&... args) const + Result<> operator()(const AbstractDataArray* inputArray, AbstractDataArray* binRangesArray, ArgsT&&... args) const { const auto& inputStore = inputArray->template getIDataStoreRefAs>(); @@ -249,7 +249,7 @@ struct GenerateHistogramFunctor } template - Result<> operator()(const IDataArray* inputArray, IDataArray* binRangesArray, std::pair&& rangeMinMax, ArgsT&&... args) const + Result<> operator()(const AbstractDataArray* inputArray, AbstractDataArray* binRangesArray, std::pair&& rangeMinMax, ArgsT&&... args) const { const auto& inputStore = inputArray->template getIDataStoreRefAs>(); @@ -291,7 +291,7 @@ class GenerateHistogramImpl */ GenerateHistogramImpl(const AbstractDataStore& inputStore, AbstractDataStore& binRangesStore, std::pair&& rangeMinMax, const std::atomic_bool& shouldCancel, const int32 numBins, AbstractDataStore& histogramStore, AbstractDataStore& mostPopulatedStore, - const std::unique_ptr& mask, std::atomic& overflow) + const std::unique_ptr& mask, std::atomic& overflow) : m_InputStore(inputStore) , m_ShouldCancel(shouldCancel) , m_NumBins(numBins) @@ -315,7 +315,7 @@ class GenerateHistogramImpl * @param overflow this is an atomic counter for the number of values that fall outside the bin range */ GenerateHistogramImpl(const AbstractDataStore& inputStore, AbstractDataStore& binRangesStore, const std::atomic_bool& shouldCancel, const int32 numBins, - AbstractDataStore& histogramStore, AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, + AbstractDataStore& histogramStore, AbstractDataStore& mostPopulatedStore, const std::unique_ptr& mask, std::atomic& overflow) : m_InputStore(inputStore) , m_ShouldCancel(shouldCancel) @@ -378,7 +378,7 @@ class GenerateHistogramImpl AbstractDataStore& m_BinRangesStore; AbstractDataStore& m_HistogramStore; AbstractDataStore& m_MostPopulatedStore; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; std::atomic& m_Overflow; }; @@ -387,7 +387,7 @@ using FeatureHasDataStats = std::tuple, std::vector, std: template FeatureHasDataStats CalculateFeatureHasDataStats(const AbstractDataStore& inputDataStore, const AbstractDataStore& featureIdsStore, usize startFeatureId, usize endFeatureId, - const std::unique_ptr& mask, const std::function& msgHandler, + const std::unique_ptr& mask, const std::function& msgHandler, const std::atomic_bool& shouldCancel) { std::chrono::steady_clock::time_point initialTime = std::chrono::steady_clock::now(); @@ -472,7 +472,7 @@ class CalculateModalBinRangesImpl * @param shouldCancel this is an atomic value that will determine whether execution ends early */ CalculateModalBinRangesImpl(const AbstractDataStore& inputStore, const AbstractDataStore& binRangesStore, NeighborList& modalBinRanges, - const std::unique_ptr& mask, const std::atomic_bool& shouldCancel) + const std::unique_ptr& mask, const std::atomic_bool& shouldCancel) : m_InputStore(inputStore) , m_ShouldCancel(shouldCancel) , m_BinRangesStore(binRangesStore) @@ -526,7 +526,7 @@ class CalculateModalBinRangesImpl const AbstractDataStore& m_InputStore; const AbstractDataStore& m_BinRangesStore; NeighborList& m_ModalBinRanges; - const std::unique_ptr& m_Mask; + const std::unique_ptr& m_Mask; }; /** @@ -537,7 +537,7 @@ class CalculateModalBinRangesImpl struct CalculateModalBinRangesImplFunctor { template - auto operator()(const IDataArray* inputArray, const IDataArray* binRangesArray, INeighborList* modalBinRangesNL, ArgsT&&... args) + auto operator()(const AbstractDataArray* inputArray, const AbstractDataArray* binRangesArray, AbstractNeighborList* modalBinRangesNL, ArgsT&&... args) { NeighborList& modalBinRanges = *(dynamic_cast*>(modalBinRangesNL)); return CalculateModalBinRangesImpl(inputArray->template getIDataStoreRefAs>(), binRangesArray->template getIDataStoreRefAs>(), modalBinRanges, @@ -553,7 +553,7 @@ struct CalculateModalBinRangesImplFunctor struct InstantiateHistogramImplFunctor { template - auto operator()(const IDataArray* inputArray, IDataArray* binRangesArray, ArgsT&&... args) + auto operator()(const AbstractDataArray* inputArray, AbstractDataArray* binRangesArray, ArgsT&&... args) { return GenerateHistogramImpl(inputArray->template getIDataStoreRefAs>(), binRangesArray->template getIDataStoreRefAs>(), std::forward(args)...); } diff --git a/src/simplnx/Utilities/IArrayThreshold.hpp b/src/simplnx/Utilities/IArrayThreshold.hpp new file mode 100644 index 0000000000..83f47c95dd --- /dev/null +++ b/src/simplnx/Utilities/IArrayThreshold.hpp @@ -0,0 +1,72 @@ +#pragma once + +#include "simplnx/DataStructure/DataPath.hpp" +#include "simplnx/simplnx_export.hpp" + +#include + +#include +#include + +namespace nx::core +{ + +/** + * @brief Pure interface for array threshold operations used in multi-threshold filtering. + */ +class SIMPLNX_EXPORT IArrayThreshold +{ +public: + enum class UnionOperator : uint8 + { + And, + Or + }; + + virtual ~IArrayThreshold() = default; + + IArrayThreshold& operator=(const IArrayThreshold&) = delete; + IArrayThreshold& operator=(IArrayThreshold&&) = delete; + + /** + * @brief Returns whether the threshold result should be inverted. + * @return bool + */ + [[nodiscard]] virtual bool isInverted() const = 0; + + /** + * @brief Sets whether the threshold result should be inverted. + * @param inverted + */ + virtual void setInverted(bool inverted) = 0; + + /** + * @brief Returns the union operator used to combine this threshold with others. + * @return UnionOperator + */ + [[nodiscard]] virtual UnionOperator getUnionOperator() const = 0; + + /** + * @brief Sets the union operator used to combine this threshold with others. + * @param unionType + */ + virtual void setUnionOperator(UnionOperator unionType) = 0; + + /** + * @brief Returns the set of DataPaths required by this threshold. + * @return std::set + */ + [[nodiscard]] virtual std::set getRequiredPaths() const = 0; + + /** + * @brief Serializes this threshold to JSON. + * @return nlohmann::json + */ + [[nodiscard]] virtual nlohmann::json toJson() const = 0; + +protected: + IArrayThreshold() = default; + IArrayThreshold(const IArrayThreshold&) = default; + IArrayThreshold(IArrayThreshold&&) = default; +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/ISegmentFeatures.hpp b/src/simplnx/Utilities/ISegmentFeatures.hpp new file mode 100644 index 0000000000..888ac07453 --- /dev/null +++ b/src/simplnx/Utilities/ISegmentFeatures.hpp @@ -0,0 +1,97 @@ +#pragma once + +#include "simplnx/simplnx_export.hpp" + +#include "simplnx/Common/Result.hpp" +#include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/Parameters/ChoicesParameter.hpp" + +#include + +namespace nx::core +{ + +class AbstractGridGeometry; + +/** + * @class ISegmentFeatures + * @brief Pure interface for segment features algorithms. Defines the contract + * that all segment features implementations must satisfy. + */ +class SIMPLNX_EXPORT ISegmentFeatures +{ +public: + using SeedGenerator = std::mt19937_64; + + enum class NeighborScheme : ChoicesParameter::ValueType + { + Face = 0, + FaceEdgeVertex = 1 + }; + + /* from http://www.newty.de/fpt/functor.html */ + /** + * @brief The CompareFunctor class serves as a functor superclass for specific implementations + * of performing scalar comparisons + */ + class CompareFunctor + { + public: + virtual ~CompareFunctor() = default; + + virtual bool operator()(int64 index, int64 neighIndex, int32 gnum) // call using () operator + { + return false; + } + }; + + virtual ~ISegmentFeatures() = default; + + ISegmentFeatures(const ISegmentFeatures&) = delete; + ISegmentFeatures(ISegmentFeatures&&) = delete; + ISegmentFeatures& operator=(const ISegmentFeatures&) = delete; + ISegmentFeatures& operator=(ISegmentFeatures&&) = delete; + + /** + * @brief execute + * @param gridGeom + * @return + */ + virtual Result<> execute(AbstractGridGeometry* gridGeom) = 0; + + /** + * @brief Returns the seed for the specified values. + * @param gnum + * @param nextSeed + * @return int64 + */ + virtual int64_t getSeed(int32_t gnum, int64 nextSeed) const = 0; + + /** + * @brief Determines the grouping for the specified values. + * @param referencePoint + * @param neighborPoint + * @param gnum + * @return bool + */ + virtual bool determineGrouping(int64_t referencePoint, int64_t neighborPoint, int32_t gnum) const = 0; + + /** + * @brief + * @param featureIds + * @param totalFeatures + */ + virtual void randomizeFeatureIds(Int32Array* featureIds, uint64 totalFeatures) = 0; + + /** + * @brief + * @return + */ + virtual SeedGenerator initializeStaticVoxelSeedGenerator() const = 0; + +protected: + ISegmentFeatures() = default; +}; + +} // namespace nx::core diff --git a/src/simplnx/Utilities/ImageRotationUtilities.cpp b/src/simplnx/Utilities/ImageRotationUtilities.cpp index a69b25ced2..7989c5f363 100644 --- a/src/simplnx/Utilities/ImageRotationUtilities.cpp +++ b/src/simplnx/Utilities/ImageRotationUtilities.cpp @@ -84,21 +84,21 @@ RotateArgs CreateRotationArgs(const ImageGeom& imageGeom, const Matrix4fR& trans FloatVec3 outputSpacing = {DetermineSpacing(spacing, xAxisNew) * transformScale[0], DetermineSpacing(spacing, yAxisNew) * transformScale[1], DetermineSpacing(spacing, zAxisNew) * transformScale[2]}; - USizeVec3 outputDims = {static_cast(std::nearbyint((minMaxCoords[1] - minMaxCoords[0]) / outputSpacing[0])), - static_cast(std::nearbyint((minMaxCoords[3] - minMaxCoords[2]) / outputSpacing[1])), - static_cast(std::nearbyint((minMaxCoords[5] - minMaxCoords[4]) / outputSpacing[2]))}; + USizeVec3 outputDims = {static_cast(std::nearbyint((minMaxCoords[1] - minMaxCoords[0]) / outputSpacing[0])), + static_cast(std::nearbyint((minMaxCoords[3] - minMaxCoords[2]) / outputSpacing[1])), + static_cast(std::nearbyint((minMaxCoords[5] - minMaxCoords[4]) / outputSpacing[2]))}; if(outputDims[0] == 0) { - outputDims[0] = static_cast(1); + outputDims[0] = static_cast(1); } if(outputDims[1] == 0) { - outputDims[1] = static_cast(1); + outputDims[1] = static_cast(1); } if(outputDims[2] == 0) { - outputDims[2] = static_cast(1); + outputDims[2] = static_cast(1); } RotateArgs params; diff --git a/src/simplnx/Utilities/ImageRotationUtilities.hpp b/src/simplnx/Utilities/ImageRotationUtilities.hpp index 24e7bed348..0ba529a771 100644 --- a/src/simplnx/Utilities/ImageRotationUtilities.hpp +++ b/src/simplnx/Utilities/ImageRotationUtilities.hpp @@ -342,7 +342,7 @@ template class RotateImageGeometryWithTrilinearInterpolation { public: - RotateImageGeometryWithTrilinearInterpolation(const IDataArray* sourceArray, IDataArray* targetArray, const RotateArgs& rotateArgs, const Matrix4fR& transformationMatrix, + RotateImageGeometryWithTrilinearInterpolation(const AbstractDataArray* sourceArray, AbstractDataArray* targetArray, const RotateArgs& rotateArgs, const Matrix4fR& transformationMatrix, FilterProgressCallback* filterCallback) : m_SourceArray(sourceArray) , m_TargetArray(targetArray) @@ -505,8 +505,8 @@ class RotateImageGeometryWithTrilinearInterpolation } private: - const IDataArray* m_SourceArray; - IDataArray* m_TargetArray; + const AbstractDataArray* m_SourceArray; + AbstractDataArray* m_TargetArray; ImageRotationUtilities::RotateArgs m_Params; Matrix4fR m_TransformationMatrix; FilterProgressCallback* m_FilterCallback = nullptr; @@ -517,7 +517,7 @@ template class RotateImageGeometryWithNearestNeighbor { public: - RotateImageGeometryWithNearestNeighbor(const IDataArray* sourceArray, IDataArray* targetArray, const RotateArgs& args, const Matrix4fR& transformationMatrix, bool sliceBySlice, + RotateImageGeometryWithNearestNeighbor(const AbstractDataArray* sourceArray, AbstractDataArray* targetArray, const RotateArgs& args, const Matrix4fR& transformationMatrix, bool sliceBySlice, FilterProgressCallback* filterCallback) : m_SourceArray(sourceArray) , m_TargetArray(targetArray) @@ -613,8 +613,8 @@ class RotateImageGeometryWithNearestNeighbor } private: - const IDataArray* m_SourceArray; - IDataArray* m_TargetArray; + const AbstractDataArray* m_SourceArray; + AbstractDataArray* m_TargetArray; ImageRotationUtilities::RotateArgs m_Params; const Matrix4fR& m_TransformationMatrix; bool m_SliceBySlice = false; @@ -627,7 +627,7 @@ class RotateImageGeometryWithNearestNeighbor class ApplyTransformationToNodeGeometry { public: - ApplyTransformationToNodeGeometry(IGeometry::SharedVertexList& verticesPtr, const Matrix4fR& transformationMatrix, FilterProgressCallback* filterCallback) + ApplyTransformationToNodeGeometry(AbstractGeometry::SharedVertexList& verticesPtr, const Matrix4fR& transformationMatrix, FilterProgressCallback* filterCallback) : m_TransformationMatrix(transformationMatrix) , m_Vertices(verticesPtr) , m_FilterCallback(filterCallback) @@ -672,7 +672,7 @@ class ApplyTransformationToNodeGeometry private: const Matrix4fR& m_TransformationMatrix; - IGeometry::SharedVertexList& m_Vertices; + AbstractGeometry::SharedVertexList& m_Vertices; FilterProgressCallback* m_FilterCallback = nullptr; }; } // namespace nx::core::ImageRotationUtilities diff --git a/src/simplnx/Utilities/IntersectionUtilities.hpp b/src/simplnx/Utilities/IntersectionUtilities.hpp index 8954dacc56..ed31e7547d 100644 --- a/src/simplnx/Utilities/IntersectionUtilities.hpp +++ b/src/simplnx/Utilities/IntersectionUtilities.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Constants.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include @@ -33,8 +33,8 @@ inline float clamp(float lo, float hi, float v) inline std::array GetBoundingBoxAtTri(nx::core::TriangleGeom& tri, size_t triId) { - nx::core::IGeometry::SharedTriList& triList = tri.getFacesRef(); - // nx::core::IGeometry::SharedVertexList& vertList = tri.getVerticesRef(); + nx::core::AbstractGeometry::SharedTriList& triList = tri.getFacesRef(); + // nx::core::AbstractGeometry::SharedVertexList& vertList = tri.getVerticesRef(); // nx::core::uint64* Tri = &triList[triId]; std::array triCoords; diff --git a/src/simplnx/Utilities/MaskCompareUtilities.cpp b/src/simplnx/Utilities/MaskCompareUtilities.cpp index f5e1935845..f6c22a0a3c 100644 --- a/src/simplnx/Utilities/MaskCompareUtilities.cpp +++ b/src/simplnx/Utilities/MaskCompareUtilities.cpp @@ -5,15 +5,15 @@ using namespace nx::core; //----------------------------------------------------------------------------- -std::unique_ptr MaskCompareUtilities::InstantiateMaskCompare(DataStructure& dataStructure, const DataPath& maskArrayPath) +std::unique_ptr MaskCompareUtilities::InstantiateMaskCompare(DataStructure& dataStructure, const DataPath& maskArrayPath) { - auto& maskArray = dataStructure.getDataRefAs(maskArrayPath); + auto& maskArray = dataStructure.getDataRefAs(maskArrayPath); return MaskCompareUtilities::InstantiateMaskCompare(maskArray); } //----------------------------------------------------------------------------- -std::unique_ptr MaskCompareUtilities::InstantiateMaskCompare(IDataArray& maskArray) +std::unique_ptr MaskCompareUtilities::InstantiateMaskCompare(AbstractDataArray& maskArray) { switch(maskArray.getDataType()) { diff --git a/src/simplnx/Utilities/MaskCompareUtilities.hpp b/src/simplnx/Utilities/MaskCompareUtilities.hpp index 130ca92034..53ca603282 100644 --- a/src/simplnx/Utilities/MaskCompareUtilities.hpp +++ b/src/simplnx/Utilities/MaskCompareUtilities.hpp @@ -3,8 +3,8 @@ #include "simplnx/simplnx_export.hpp" #include "simplnx/Common/Types.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/AbstractDataStore.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" namespace nx::core::MaskCompareUtilities { @@ -21,9 +21,9 @@ namespace nx::core::MaskCompareUtilities * } * @endcode */ -struct MaskCompare +struct IMaskCompare { - virtual ~MaskCompare() noexcept = default; + virtual ~IMaskCompare() noexcept = default; /** * @brief Both of the values pointed to by the index *must* be `true` or non-zero. If either of the values or @@ -59,7 +59,7 @@ struct MaskCompare virtual usize countTrueValues() const = 0; }; -struct BoolMaskCompare : public MaskCompare +struct BoolMaskCompare : public IMaskCompare { BoolMaskCompare(AbstractDataStore& dataStore) : m_DataStore(dataStore) @@ -99,7 +99,7 @@ struct BoolMaskCompare : public MaskCompare } }; -struct UInt8MaskCompare : public MaskCompare +struct UInt8MaskCompare : public IMaskCompare { UInt8MaskCompare(AbstractDataStore& dataStore) : m_DataStore(dataStore) @@ -156,12 +156,12 @@ struct UInt8MaskCompare : public MaskCompare * @param maskArrayPath The DataPath of the mask array. * @return */ -SIMPLNX_EXPORT std::unique_ptr InstantiateMaskCompare(DataStructure& dataStructure, const DataPath& maskArrayPath); +SIMPLNX_EXPORT std::unique_ptr InstantiateMaskCompare(DataStructure& dataStructure, const DataPath& maskArrayPath); /** * @brief Convenience method to create an instance of the MaskCompare subclass * @param maskArrayPtr A Pointer to the mask array which can be of either `bool` or `uint8` type. * @return */ -SIMPLNX_EXPORT std::unique_ptr InstantiateMaskCompare(IDataArray& maskArrayPtr); -} // namespace nx::core::MaskCompareUtilities \ No newline at end of file +SIMPLNX_EXPORT std::unique_ptr InstantiateMaskCompare(AbstractDataArray& maskArrayPtr); +} // namespace nx::core::MaskCompareUtilities diff --git a/src/simplnx/Utilities/Math/GeometryMath.cpp b/src/simplnx/Utilities/Math/GeometryMath.cpp index aebd9051e8..b89e99359e 100644 --- a/src/simplnx/Utilities/Math/GeometryMath.cpp +++ b/src/simplnx/Utilities/Math/GeometryMath.cpp @@ -23,12 +23,12 @@ float32 nx::core::GeometryMath::AngleBetweenVectors(const nx::core::ZXZEuler& a, return std::acos(cosAng); } -BoundingBox3Df nx::core::GeometryMath::FindBoundingBoxOfVertices(INodeGeometry0D& geom) +BoundingBox3Df nx::core::GeometryMath::FindBoundingBoxOfVertices(AbstractNodeGeometry0D& geom) { FloatVec3 ll = {std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()}; FloatVec3 ur = {std::numeric_limits::min(), std::numeric_limits::min(), std::numeric_limits::min()}; - const IGeometry::SharedVertexList& vertexList = geom.getVerticesRef(); + const AbstractGeometry::SharedVertexList& vertexList = geom.getVerticesRef(); if(vertexList.getDataType() != DataType::float32) { return {ll, ur}; // will be invalid diff --git a/src/simplnx/Utilities/Math/GeometryMath.hpp b/src/simplnx/Utilities/Math/GeometryMath.hpp index 743fb030fc..947b06a756 100644 --- a/src/simplnx/Utilities/Math/GeometryMath.hpp +++ b/src/simplnx/Utilities/Math/GeometryMath.hpp @@ -6,7 +6,7 @@ #include "simplnx/Common/EulerAngle.hpp" #include "simplnx/Common/Ray.hpp" #include "simplnx/Common/Types.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" #include "simplnx/DataStructure/Geometry/TriangleGeom.hpp" #include "simplnx/simplnx_export.hpp" @@ -27,7 +27,7 @@ namespace detail { struct GeometryStoreCache { - GeometryStoreCache(const AbstractDataStore& verticesStore, const AbstractDataStore& facesStore, usize numVertsPerFace) + GeometryStoreCache(const AbstractDataStore& verticesStore, const AbstractDataStore& facesStore, usize numVertsPerFace) : VerticesStoreRef(verticesStore) , FacesStoreRef(facesStore) , NumVertsPerFace(numVertsPerFace) @@ -35,7 +35,7 @@ struct GeometryStoreCache } const AbstractDataStore& VerticesStoreRef; - const AbstractDataStore& FacesStoreRef; + const AbstractDataStore& FacesStoreRef; usize NumVertsPerFace; }; @@ -413,7 +413,7 @@ T GetLengthOfRayInBox(const nx::core::Ray& ray, const nx::core::BoundingBox3D * @param verts * @return nx::core::BoundingBox */ -nx::core::BoundingBox3Df SIMPLNX_EXPORT FindBoundingBoxOfVertices(nx::core::INodeGeometry0D& geom); +nx::core::BoundingBox3Df SIMPLNX_EXPORT FindBoundingBoxOfVertices(nx::core::AbstractNodeGeometry0D& geom); /** * @brief Returns the BoundingBox around the specified face. diff --git a/src/simplnx/Utilities/Meshing/TriangleUtilities.cpp b/src/simplnx/Utilities/Meshing/TriangleUtilities.cpp index 05d7bafa16..40b4db2b28 100644 --- a/src/simplnx/Utilities/Meshing/TriangleUtilities.cpp +++ b/src/simplnx/Utilities/Meshing/TriangleUtilities.cpp @@ -11,9 +11,9 @@ using namespace nx::core; namespace { -using EdgeListT = std::set>; +using EdgeListT = std::set>; -Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, +Result<> ProcessWindingsWithLabels(AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, const Int32AbstractDataStore& faceLabelsStore, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler, int32 maxFeature) { /** @@ -36,7 +36,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& std::vector unmodified(faceLabelsStore.getNumberOfTuples(), false); for(int32 feature = 1; feature < maxFeature + 1; feature++) { - std::queue searchTargets = {}; + std::queue searchTargets = {}; // process base case for(usize i = 0; i < numTuples; i++) @@ -47,7 +47,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& } auto numElem = neighbors.getNumberOfElements(i); - const IGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(i); + const AbstractGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(i); for(uint16 element = 0; element < numElem; element++) { @@ -72,7 +72,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& } // Dequeue a vertex from queue and store it - const IGeometry::MeshIndexType triangle = searchTargets.front(); + const AbstractGeometry::MeshIndexType triangle = searchTargets.front(); searchTargets.pop(); if(visited[triangle]) @@ -87,7 +87,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& } auto numElem = neighbors.getNumberOfElements(triangle); - const IGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(triangle); + const AbstractGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(triangle); std::set localNeighbors = {}; @@ -114,9 +114,9 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& continue; } - std::pair edge1 = std::make_pair(triangles[(neighbor * 3) + 0], triangles[(neighbor * 3) + 1]); - std::pair edge2 = std::make_pair(triangles[(neighbor * 3) + 1], triangles[(neighbor * 3) + 2]); - std::pair edge3 = std::make_pair(triangles[(neighbor * 3) + 2], triangles[(neighbor * 3) + 0]); + std::pair edge1 = std::make_pair(triangles[(neighbor * 3) + 0], triangles[(neighbor * 3) + 1]); + std::pair edge2 = std::make_pair(triangles[(neighbor * 3) + 1], triangles[(neighbor * 3) + 2]); + std::pair edge3 = std::make_pair(triangles[(neighbor * 3) + 2], triangles[(neighbor * 3) + 0]); if(unmodified[neighbor]) { @@ -148,7 +148,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& else { // Flip it - const IGeometry::MeshIndexType tempValue = triangles[(triangle * 3) + 0]; + const AbstractGeometry::MeshIndexType tempValue = triangles[(triangle * 3) + 0]; triangles[(triangle * 3) + 0] = triangles[(triangle * 3) + 2]; triangles[(triangle * 3) + 2] = tempValue; } @@ -164,7 +164,7 @@ Result<> ProcessWindingsWithLabels(INodeGeometry2D::SharedFaceList::store_type& return {}; } -Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, +Result<> ProcessWindingsWithRegions(AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, const Int32AbstractDataStore& regionsStore, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler, int32 maxFeature) { /** @@ -185,7 +185,7 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& std::vector visited(regionsStore.getNumberOfTuples(), false); for(int32 feature = 1; feature < maxFeature + 1; feature++) { - std::queue searchTargets = {}; + std::queue searchTargets = {}; // process base case for(usize i = 0; i < numTuples; i++) @@ -196,7 +196,7 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& } auto numElem = neighbors.getNumberOfElements(i); - const IGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(i); + const AbstractGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(i); for(uint16 element = 0; element < numElem; element++) { @@ -221,7 +221,7 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& } // Dequeue a vertex from queue and store it - const IGeometry::MeshIndexType triangle = searchTargets.front(); + const AbstractGeometry::MeshIndexType triangle = searchTargets.front(); searchTargets.pop(); if(visited[triangle]) @@ -236,7 +236,7 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& } auto numElem = neighbors.getNumberOfElements(triangle); - const IGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(triangle); + const AbstractGeometry::MeshIndexType* neighborListPtr = neighbors.getElementListPointer(triangle); std::set localNeighbors = {}; @@ -275,7 +275,7 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& edgeList.find(std::make_pair(triangles[(triangle * 3) + 2], triangles[(triangle * 3) + 0])) != edgeList.end()) // If true it contains a conflicting edge { // Flip it - const IGeometry::MeshIndexType tempValue = triangles[(triangle * 3) + 0]; + const AbstractGeometry::MeshIndexType tempValue = triangles[(triangle * 3) + 0]; triangles[(triangle * 3) + 0] = triangles[(triangle * 3) + 2]; triangles[(triangle * 3) + 2] = tempValue; } @@ -286,19 +286,20 @@ Result<> ProcessWindingsWithRegions(INodeGeometry2D::SharedFaceList::store_type& } } // namespace -INodeGeometry2D::SharedVertexList::value_type MeshingUtilities::detail::FindTriangleVolume(const std::array& vertIndices, const INodeGeometry2D::SharedVertexList::store_type& vertices) +AbstractNodeGeometry2D::SharedVertexList::value_type MeshingUtilities::detail::FindTriangleVolume(const std::array& vertIndices, + const AbstractNodeGeometry2D::SharedVertexList::store_type& vertices) { const usize vertAIndex = vertIndices[0] * 3; const usize vertBIndex = vertIndices[1] * 3; const usize vertCIndex = vertIndices[2] * 3; // This is a 3x3 matrix laid out in typical "C" order where the columns raster the fastest, then the rows - std::array volumeMatrix = { + std::array volumeMatrix = { vertices[vertBIndex + 0] - vertices[vertAIndex + 0], vertices[vertCIndex + 0] - vertices[vertAIndex + 0], 0.0f - vertices[vertAIndex + 0], vertices[vertBIndex + 1] - vertices[vertAIndex + 1], vertices[vertCIndex + 1] - vertices[vertAIndex + 1], 0.0f - vertices[vertAIndex + 1], vertices[vertBIndex + 2] - vertices[vertAIndex + 2], vertices[vertCIndex + 2] - vertices[vertAIndex + 2], 0.0f - vertices[vertAIndex + 2]}; - const INodeGeometry2D::SharedVertexList::value_type determinant = + const AbstractNodeGeometry2D::SharedVertexList::value_type determinant = (volumeMatrix[MeshingUtilities::detail::k_00] * (volumeMatrix[MeshingUtilities::detail::k_11] * volumeMatrix[MeshingUtilities::detail::k_22] - volumeMatrix[MeshingUtilities::detail::k_12] * volumeMatrix[MeshingUtilities::detail::k_21])) - (volumeMatrix[MeshingUtilities::detail::k_01] * @@ -308,7 +309,7 @@ INodeGeometry2D::SharedVertexList::value_type MeshingUtilities::detail::FindTria return determinant / 6.0f; } -Result<> MeshingUtilities::RepairTriangleWinding(INodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, +Result<> MeshingUtilities::RepairTriangleWinding(AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, const Int32AbstractDataStore& idsStore, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler) { usize numComp = idsStore.getNumberOfComponents(); @@ -334,7 +335,7 @@ Result<> MeshingUtilities::RepairTriangleWinding(INodeGeometry2D::SharedFaceList return ::ProcessWindingsWithRegions(triangles, neighbors, idsStore, shouldCancel, mesgHandler, maxFeature); } -MeshingUtilities::CalculateNormalsImpl::CalculateNormalsImpl(const INodeGeometry2D::SharedFaceList::store_type& triangles, const INodeGeometry2D::SharedVertexList::store_type& verts, +MeshingUtilities::CalculateNormalsImpl::CalculateNormalsImpl(const AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const AbstractNodeGeometry2D::SharedVertexList::store_type& verts, nx::core::Float64AbstractDataStore& normals, const std::atomic_bool& shouldCancel) : m_Triangles(triangles) , m_Vertices(verts) diff --git a/src/simplnx/Utilities/Meshing/TriangleUtilities.hpp b/src/simplnx/Utilities/Meshing/TriangleUtilities.hpp index aa3340de28..d0ce20f4e8 100644 --- a/src/simplnx/Utilities/Meshing/TriangleUtilities.hpp +++ b/src/simplnx/Utilities/Meshing/TriangleUtilities.hpp @@ -2,8 +2,8 @@ #include "simplnx/Common/Range.hpp" #include "simplnx/Common/Result.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry2D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry2D.hpp" #include "simplnx/Filter/IFilter.hpp" namespace nx::core::MeshingUtilities @@ -24,9 +24,9 @@ inline static constexpr usize k_22 = 8; * @brief This function calculates the volume of a supplied triangle * @param vertIndices The indices that make up the points of a triangle * @param vertices The SharedVertexList of the parent geometry - * @returns INodeGeometry2D::SharedVertexList::value_type the calculated volume + * @returns AbstractNodeGeometry2D::SharedVertexList::value_type the calculated volume */ -SIMPLNX_EXPORT INodeGeometry2D::SharedVertexList::value_type FindTriangleVolume(const std::array& vertIndices, const INodeGeometry2D::SharedVertexList::store_type& vertices); +SIMPLNX_EXPORT AbstractNodeGeometry2D::SharedVertexList::value_type FindTriangleVolume(const std::array& vertIndices, const AbstractNodeGeometry2D::SharedVertexList::store_type& vertices); } // namespace detail /** @@ -39,7 +39,7 @@ SIMPLNX_EXPORT INodeGeometry2D::SharedVertexList::value_type FindTriangleVolume( * @param mesgHandler * @returns Result This result will contain the number of triangles that could not be repaired */ -SIMPLNX_EXPORT Result<> RepairTriangleWinding(INodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, +SIMPLNX_EXPORT Result<> RepairTriangleWinding(AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const DynamicListArray& neighbors, const Int32AbstractDataStore& idsStore, const std::atomic_bool& shouldCancel, const IFilter::MessageHandler& mesgHandler); /** @@ -49,7 +49,7 @@ SIMPLNX_EXPORT Result<> RepairTriangleWinding(INodeGeometry2D::SharedFaceList::s class SIMPLNX_EXPORT CalculateNormalsImpl { public: - CalculateNormalsImpl(const INodeGeometry2D::SharedFaceList::store_type& triangles, const INodeGeometry2D::SharedVertexList::store_type& verts, Float64AbstractDataStore& normals, + CalculateNormalsImpl(const AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const AbstractNodeGeometry2D::SharedVertexList::store_type& verts, Float64AbstractDataStore& normals, const std::atomic_bool& shouldCancel); ~CalculateNormalsImpl() = default; @@ -58,8 +58,8 @@ class SIMPLNX_EXPORT CalculateNormalsImpl void operator()(const Range& range) const; private: - const INodeGeometry2D::SharedFaceList::store_type& m_Triangles; - const INodeGeometry2D::SharedVertexList::store_type& m_Vertices; + const AbstractNodeGeometry2D::SharedFaceList::store_type& m_Triangles; + const AbstractNodeGeometry2D::SharedVertexList::store_type& m_Vertices; Float64AbstractDataStore& m_Normals; const std::atomic_bool& m_ShouldCancel; }; @@ -75,8 +75,8 @@ class SIMPLNX_EXPORT CalculateNormalsImpl * @returns Result function result */ template -Result<> CalculateFeatureVolumes(const INodeGeometry2D::SharedFaceList::store_type& triangles, const INodeGeometry2D::SharedVertexList::store_type& verts, const Int32AbstractDataStore& idsStore, - ContainerT& volumes, const std::atomic_bool& shouldCancel) +Result<> CalculateFeatureVolumes(const AbstractNodeGeometry2D::SharedFaceList::store_type& triangles, const AbstractNodeGeometry2D::SharedVertexList::store_type& verts, + const Int32AbstractDataStore& idsStore, ContainerT& volumes, const std::atomic_bool& shouldCancel) { usize volumeSize = volumes.size(); std::array faceVertexIndices = {0, 0, 0}; diff --git a/src/simplnx/Utilities/Meshing/VertexUtilities.cpp b/src/simplnx/Utilities/Meshing/VertexUtilities.cpp index 28a5dcb1f9..1cf99e3b95 100644 --- a/src/simplnx/Utilities/Meshing/VertexUtilities.cpp +++ b/src/simplnx/Utilities/Meshing/VertexUtilities.cpp @@ -5,13 +5,13 @@ using namespace nx::core; namespace { // Uses Hoare's method for speed -IGeometry::MeshIndexType ProcessSection(std::vector& sorted, IGeometry::MeshIndexType begin, IGeometry::MeshIndexType end, - const INodeGeometry0D::SharedVertexList::store_type& vertices, IGeometry::MeshIndexType offset) +AbstractGeometry::MeshIndexType ProcessSection(std::vector& sorted, AbstractGeometry::MeshIndexType begin, AbstractGeometry::MeshIndexType end, + const AbstractNodeGeometry0D::SharedVertexList::store_type& vertices, AbstractGeometry::MeshIndexType offset) { - const INodeGeometry0D::SharedVertexList::value_type threshold = vertices[(sorted[begin] * 3) + offset]; + const AbstractNodeGeometry0D::SharedVertexList::value_type threshold = vertices[(sorted[begin] * 3) + offset]; - IGeometry::MeshIndexType front = begin; - IGeometry::MeshIndexType back = end; + AbstractGeometry::MeshIndexType front = begin; + AbstractGeometry::MeshIndexType back = end; while(true) { @@ -36,15 +36,15 @@ IGeometry::MeshIndexType ProcessSection(std::vector& s } } -void QuickSortVertices(std::vector& sorted, IGeometry::MeshIndexType begin, IGeometry::MeshIndexType end, const INodeGeometry0D::SharedVertexList::store_type& vertices, - IGeometry::MeshIndexType offset, const std::atomic_bool& shouldCancel) +void QuickSortVertices(std::vector& sorted, AbstractGeometry::MeshIndexType begin, AbstractGeometry::MeshIndexType end, + const AbstractNodeGeometry0D::SharedVertexList::store_type& vertices, AbstractGeometry::MeshIndexType offset, const std::atomic_bool& shouldCancel) { if(begin >= end || shouldCancel) { return; } - IGeometry::MeshIndexType next = ProcessSection(sorted, begin, end, vertices, offset); + AbstractGeometry::MeshIndexType next = ProcessSection(sorted, begin, end, vertices, offset); // Recurse QuickSortVertices(sorted, begin, next, vertices, offset, shouldCancel); @@ -52,7 +52,7 @@ void QuickSortVertices(std::vector& sorted, IGeometry: } } // namespace -MeshingUtilities::SortedVerticesList MeshingUtilities::OrderSharedVertices(const nx::core::INodeGeometry0D& geom, const std::atomic_bool& shouldCancel) +MeshingUtilities::SortedVerticesList MeshingUtilities::OrderSharedVertices(const nx::core::AbstractNodeGeometry0D& geom, const std::atomic_bool& shouldCancel) { const BoundingBox3Df& bounds = geom.getBoundingBox(); @@ -62,15 +62,16 @@ MeshingUtilities::SortedVerticesList MeshingUtilities::OrderSharedVertices(const const AxialAlignment axis = static_cast(std::distance(diff.begin(), std::max_element(diff.begin(), diff.end()))); // Getting the verts list by ref here for the validation in the ref function - const INodeGeometry0D::SharedVertexList::store_type& vertexListStore = geom.getVerticesRef().getDataStoreRef(); + const AbstractNodeGeometry0D::SharedVertexList::store_type& vertexListStore = geom.getVerticesRef().getDataStoreRef(); return {.axis = axis, .ordering = std::move(OrderSharedVerticesAlongAxis(axis, vertexListStore, shouldCancel))}; } -std::vector MeshingUtilities::OrderSharedVerticesAlongAxis(nx::core::MeshingUtilities::AxialAlignment axis, const INodeGeometry0D::SharedVertexList::store_type& vertexList, - const std::atomic_bool& shouldCancel) +std::vector MeshingUtilities::OrderSharedVerticesAlongAxis(nx::core::MeshingUtilities::AxialAlignment axis, + const AbstractNodeGeometry0D::SharedVertexList::store_type& vertexList, + const std::atomic_bool& shouldCancel) { - std::vector sorted(vertexList.getNumberOfTuples()); + std::vector sorted(vertexList.getNumberOfTuples()); std::iota(sorted.begin(), sorted.end(), 0); QuickSortVertices(sorted, 0, sorted.size() - 1, vertexList, to_underlying(axis), shouldCancel); @@ -78,12 +79,12 @@ std::vector MeshingUtilities::OrderSharedVerticesAlong return sorted; } -bool MeshingUtilities::HasDuplicateVertices(const IGeometry::SharedVertexList::store_type& verts, const nx::core::MeshingUtilities::SortedVerticesList& sortedVertices) +bool MeshingUtilities::HasDuplicateVertices(const AbstractGeometry::SharedVertexList::store_type& verts, const nx::core::MeshingUtilities::SortedVerticesList& sortedVertices) { - using VertT = INodeGeometry0D::SharedVertexList::value_type; + using VertT = AbstractNodeGeometry0D::SharedVertexList::value_type; // Leverage ordering assumptions to speed up duplicate checks - std::array offset; + std::array offset; switch(sortedVertices.axis) { @@ -103,8 +104,8 @@ bool MeshingUtilities::HasDuplicateVertices(const IGeometry::SharedVertexList::s for(usize i = 1; i < sortedVertices.ordering.size(); i++) { - const IGeometry::MeshIndexType prevIndex = sortedVertices.ordering[i - 1] * 3; - const IGeometry::MeshIndexType currentIndex = sortedVertices.ordering[i] * 3; + const AbstractGeometry::MeshIndexType prevIndex = sortedVertices.ordering[i - 1] * 3; + const AbstractGeometry::MeshIndexType currentIndex = sortedVertices.ordering[i] * 3; if(std::numeric_limits::epsilon() < std::fabs(verts[prevIndex + offset[0]] - verts[currentIndex + offset[0]])) { // value on first axis is different; proceed to next iteration diff --git a/src/simplnx/Utilities/Meshing/VertexUtilities.hpp b/src/simplnx/Utilities/Meshing/VertexUtilities.hpp index 58c689362d..d1f59cd322 100644 --- a/src/simplnx/Utilities/Meshing/VertexUtilities.hpp +++ b/src/simplnx/Utilities/Meshing/VertexUtilities.hpp @@ -1,8 +1,8 @@ #pragma once #include "simplnx/Common/Result.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" -#include "simplnx/DataStructure/Geometry/INodeGeometry0D.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractNodeGeometry0D.hpp" namespace nx::core::MeshingUtilities { @@ -16,7 +16,7 @@ enum SIMPLNX_EXPORT AxialAlignment : uint8 struct SIMPLNX_EXPORT SortedVerticesList { AxialAlignment axis; - std::vector ordering; + std::vector ordering; }; /** @@ -24,16 +24,16 @@ struct SIMPLNX_EXPORT SortedVerticesList * @param geom The input mesh * @returns SortedVerticesList which is a struct containing the sorted indices and the axis they were sorted on */ -SIMPLNX_EXPORT SortedVerticesList OrderSharedVertices(const INodeGeometry0D& geom, const std::atomic_bool& shouldCancel); +SIMPLNX_EXPORT SortedVerticesList OrderSharedVertices(const AbstractNodeGeometry0D& geom, const std::atomic_bool& shouldCancel); /** * @brief This function sorts the vertices along the given axis. It doesn't modify the input mesh, but instead returns an object containing the relevant information * @param axis The axis to sort them by * @param geom The input mesh - * @returns std::vector which is the sorted indices along the given axis + * @returns std::vector which is the sorted indices along the given axis */ -SIMPLNX_EXPORT std::vector OrderSharedVerticesAlongAxis(nx::core::MeshingUtilities::AxialAlignment axis, const INodeGeometry0D::SharedVertexList::store_type& vertexList, - const std::atomic_bool& shouldCancel); +SIMPLNX_EXPORT std::vector OrderSharedVerticesAlongAxis(nx::core::MeshingUtilities::AxialAlignment axis, + const AbstractNodeGeometry0D::SharedVertexList::store_type& vertexList, const std::atomic_bool& shouldCancel); /** * @brief This function attempts to find duplicate vertices. Vertices are all unique if `false` @@ -41,5 +41,5 @@ SIMPLNX_EXPORT std::vector OrderSharedVerticesAlongAxi * @param sortedVertices The object containing a sorted list of vertices and the axis it was sorted on * @returns bool false means vertices are unique */ -SIMPLNX_EXPORT bool HasDuplicateVertices(const IGeometry::SharedVertexList::store_type& verts, const SortedVerticesList& sortedVertices); +SIMPLNX_EXPORT bool HasDuplicateVertices(const AbstractGeometry::SharedVertexList::store_type& verts, const SortedVerticesList& sortedVertices); } // namespace nx::core::MeshingUtilities diff --git a/src/simplnx/Utilities/OStreamUtilities.cpp b/src/simplnx/Utilities/OStreamUtilities.cpp index 7dd87a7c09..a93fd0d945 100644 --- a/src/simplnx/Utilities/OStreamUtilities.cpp +++ b/src/simplnx/Utilities/OStreamUtilities.cpp @@ -30,8 +30,8 @@ const std::array k_DelimiterStrings = {" ", ";", ",", ":", "\t"} struct PrintNeighborList { template - Result<> operator()(std::ostream& outputStrm, INeighborList* inputNeighborList, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, const std::string& delimiter = ",", - bool hasIndex = false, bool hasHeader = false) + Result<> operator()(std::ostream& outputStrm, AbstractNeighborList* inputNeighborList, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, + const std::string& delimiter = ",", bool hasIndex = false, bool hasHeader = false) { auto& neighborList = *dynamic_cast*>(inputNeighborList); auto start = std::chrono::steady_clock::now(); @@ -140,8 +140,8 @@ struct PrintNeighborList struct PrintDataArray { template - Result<> operator()(std::ostream& outputStrm, const IDataArray& inputDataArray, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, const std::string& delimiter = ",", - int32 tuplesPerLine = 0) + Result<> operator()(std::ostream& outputStrm, const AbstractDataArray& inputDataArray, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, + const std::string& delimiter = ",", int32 tuplesPerLine = 0) { const auto& dataStore = inputDataArray.template getIDataStoreRefAs>(); auto start = std::chrono::steady_clock::now(); @@ -283,7 +283,7 @@ class TupleWriter : public ITupleWriter using DataArrayType = DataArray; public: - TupleWriter(const IDataArray& iDataArray, const std::string& delimiter) + TupleWriter(const AbstractDataArray& iDataArray, const std::string& delimiter) : m_Name(iDataArray.getName()) , m_DataStore(iDataArray.template getIDataStoreRefAs>()) , m_Delimiter(delimiter) @@ -349,7 +349,7 @@ class TupleWriter : public ITupleWriter struct AddTupleWriter { template - Result<> operator()(std::vector>& writers, const IDataArray& iDataArray, const std::string& delimiter) + Result<> operator()(std::vector>& writers, const AbstractDataArray& iDataArray, const std::string& delimiter) { writers.push_back(std::make_shared>(iDataArray, delimiter)); return {}; @@ -404,14 +404,14 @@ Result<> PrintDataSetsToMultipleFiles(const std::vector& objectPaths, AtomicFile atomicFile = std::move(atomicFileResult.value()); auto outputFilePath = atomicFile.tempFilePath().string(); - mesgHandler(IFilter::Message::Type::Info, fmt::format("Writing IArray ({}) to output file {}", dataPath.getTargetName(), outputFilePath)); + mesgHandler(IFilter::Message::Type::Info, fmt::format("Writing AbstractArray ({}) to output file {}", dataPath.getTargetName(), outputFilePath)); // Scope file writer in code block to get around file lock on windows (enforce destructor order) { std::ofstream outStrm(outputFilePath, std::ios_base::out | std::ios_base::binary); std::pair result = {0, "PrintDataSetsToMultipleFiles default failure. If you are seeing this error something bad has happened."}; - auto* dataArray = dataStructure.getDataAs(dataPath); + auto* dataArray = dataStructure.getDataAs(dataPath); if(dataArray != nullptr) { if(exportToBinary) @@ -428,7 +428,7 @@ Result<> PrintDataSetsToMultipleFiles(const std::vector& objectPaths, { PrintStringArray(outStrm, *stringArray, mesgHandler, shouldCancel, delimiter); } - auto* neighborList = dataStructure.getDataAs(dataPath); + auto* neighborList = dataStructure.getDataAs(dataPath); if(neighborList != nullptr) { if(exportToBinary) @@ -458,7 +458,7 @@ Result<> PrintDataSetsToMultipleFiles(const std::vector& objectPaths, } /** - * @brief [Single Output][Custom OStream] | Writes one IArray child to some OStream + * @brief [Single Output][Custom OStream] | Writes one AbstractArray child to some OStream * @param outputStrm The already opened output string to write to * @param objectPath The datapath for respective dataObject to be written out * @param dataStructure The simplnx datastructure where *objectPath* datacontainer is stored @@ -471,9 +471,9 @@ Result<> PrintDataSetsToMultipleFiles(const std::vector& objectPaths, void PrintSingleDataObject(std::ostream& outputStrm, const DataPath& objectPath, DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, const std::string& delimiter, bool includeIndex, bool includeHeaders, size_t componentsPerLine) { - mesgHandler(IFilter::Message::Type::Info, fmt::format("Writing IArray ({}) to output stream", objectPath.getTargetName())); + mesgHandler(IFilter::Message::Type::Info, fmt::format("Writing AbstractArray ({}) to output stream", objectPath.getTargetName())); - auto* dataArray = dataStructure.getDataAs(objectPath); + auto* dataArray = dataStructure.getDataAs(objectPath); if(dataArray != nullptr) { ExecuteDataFunction(PrintDataArray{}, dataArray->getDataType(), outputStrm, *dataArray, mesgHandler, shouldCancel, delimiter, componentsPerLine); @@ -483,7 +483,7 @@ void PrintSingleDataObject(std::ostream& outputStrm, const DataPath& objectPath, { PrintStringArray(outputStrm, *stringArray, mesgHandler, shouldCancel, delimiter); } - auto* neighborList = dataStructure.getDataAs(objectPath); + auto* neighborList = dataStructure.getDataAs(objectPath); if(neighborList != nullptr) { ExecuteNeighborFunction(PrintNeighborList{}, neighborList->getDataType(), outputStrm, neighborList, mesgHandler, shouldCancel, delimiter, includeIndex, includeHeaders); @@ -508,7 +508,7 @@ void PrintDataSetsToSingleFile(std::ostream& outputStrm, const std::vector& neighborLists, bool writeNumOfFeatures) { - const auto& firstDataArray = dataStructure.getDataRefAs(objectPaths[0]); + const auto& firstDataArray = dataStructure.getDataRefAs(objectPaths[0]); usize numTuples = firstDataArray.getNumberOfTuples(); auto start = std::chrono::steady_clock::now(); @@ -516,10 +516,10 @@ void PrintDataSetsToSingleFile(std::ostream& outputStrm, const std::vector> writers; for(const auto& selectedArrayPath : objectPaths) { - auto* dataArrayPtr = dataStructure.getDataAs(selectedArrayPath); + auto* dataArrayPtr = dataStructure.getDataAs(selectedArrayPath); if(nullptr != dataArrayPtr) { - const auto& iDataArrayRef = dataStructure.getDataRefAs(selectedArrayPath); + const auto& iDataArrayRef = dataStructure.getDataRefAs(selectedArrayPath); ExecuteDataFunction(AddTupleWriter{}, iDataArrayRef.getDataType(), writers, iDataArrayRef, delimiter); } auto* stringArrayPtr = dataStructure.getDataAs(selectedArrayPath); @@ -540,7 +540,7 @@ void PrintDataSetsToSingleFile(std::ostream& outputStrm, const std::vector(objectPaths.at(0)).getNumberOfTuples(); + featureCount += dataStructure.getDataRefAs(objectPaths.at(0)).getNumberOfTuples(); if(!writeFirstIndex) { featureCount--; @@ -609,7 +609,7 @@ void PrintDataSetsToSingleFile(std::ostream& outputStrm, const std::vector(dataPath); + auto* neighborList = dataStructure.getDataAs(dataPath); if(neighborList != nullptr) { ExecuteNeighborFunction(PrintNeighborList{}, neighborList->getDataType(), outputStrm, neighborList, mesgHandler, shouldCancel, delimiter, includeIndex, includeHeaders); diff --git a/src/simplnx/Utilities/OStreamUtilities.hpp b/src/simplnx/Utilities/OStreamUtilities.hpp index dbe89c176d..c777c863cc 100644 --- a/src/simplnx/Utilities/OStreamUtilities.hpp +++ b/src/simplnx/Utilities/OStreamUtilities.hpp @@ -1,11 +1,11 @@ #pragma once +#include "simplnx/DataStructure/AbstractDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" +#include "simplnx/DataStructure/AbstractNeighborList.hpp" #include "simplnx/DataStructure/DataArray.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DataPath.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" -#include "simplnx/DataStructure/INeighborList.hpp" #include "simplnx/DataStructure/NeighborList.hpp" #include "simplnx/DataStructure/StringArray.hpp" #include "simplnx/Filter/IFilter.hpp" @@ -51,7 +51,7 @@ SIMPLNX_EXPORT Result<> PrintDataSetsToMultipleFiles(const std::vector size_t componentsPerLine = 0); /** - * @brief [Single Output][Custom OStream] | Writes one IArray child to some OStream + * @brief [Single Output][Custom OStream] | Writes one AbstractArray child to some OStream * @param outputStrm The already opened output string to write to * @param objectPath The datapath for respective dataObject to be written out * @param dataStructure The simplnx datastructure where *objectPath* datacontainer is stored diff --git a/src/simplnx/Utilities/IParallelAlgorithm.cpp b/src/simplnx/Utilities/ParallelAlgorithm.cpp similarity index 74% rename from src/simplnx/Utilities/IParallelAlgorithm.cpp rename to src/simplnx/Utilities/ParallelAlgorithm.cpp index dc04752a06..9f664eeee6 100644 --- a/src/simplnx/Utilities/IParallelAlgorithm.cpp +++ b/src/simplnx/Utilities/ParallelAlgorithm.cpp @@ -1,11 +1,11 @@ -#include "IParallelAlgorithm.hpp" +#include "ParallelAlgorithm.hpp" #include "simplnx/Core/Application.hpp" namespace { // ----------------------------------------------------------------------------- -bool CheckStoresInMemory(const nx::core::IParallelAlgorithm::AlgorithmStores& stores) +bool CheckStoresInMemory(const nx::core::ParallelAlgorithm::AlgorithmStores& stores) { if(stores.empty()) { @@ -29,7 +29,7 @@ bool CheckStoresInMemory(const nx::core::IParallelAlgorithm::AlgorithmStores& st } // ----------------------------------------------------------------------------- -bool CheckArraysInMemory(const nx::core::IParallelAlgorithm::AlgorithmArrays& arrays) +bool CheckArraysInMemory(const nx::core::ParallelAlgorithm::AlgorithmArrays& arrays) { if(arrays.empty()) { @@ -56,7 +56,7 @@ bool CheckArraysInMemory(const nx::core::IParallelAlgorithm::AlgorithmArrays& ar namespace nx::core { // ----------------------------------------------------------------------------- -IParallelAlgorithm::IParallelAlgorithm() +ParallelAlgorithm::ParallelAlgorithm() { #ifdef SIMPLNX_ENABLE_MULTICORE // Do not run OOC data in parallel by default. @@ -65,29 +65,29 @@ IParallelAlgorithm::IParallelAlgorithm() } // ----------------------------------------------------------------------------- -IParallelAlgorithm::~IParallelAlgorithm() = default; +ParallelAlgorithm::~ParallelAlgorithm() = default; // ----------------------------------------------------------------------------- -bool IParallelAlgorithm::getParallelizationEnabled() const +bool ParallelAlgorithm::getParallelizationEnabled() const { return m_RunParallel; } // ----------------------------------------------------------------------------- -void IParallelAlgorithm::setParallelizationEnabled(bool doParallel) +void ParallelAlgorithm::setParallelizationEnabled(bool doParallel) { #ifdef SIMPLNX_ENABLE_MULTICORE m_RunParallel = doParallel; #endif } // ----------------------------------------------------------------------------- -void IParallelAlgorithm::requireArraysInMemory(const AlgorithmArrays& arrays) +void ParallelAlgorithm::requireArraysInMemory(const AlgorithmArrays& arrays) { setParallelizationEnabled(CheckArraysInMemory(arrays)); } // ----------------------------------------------------------------------------- -void IParallelAlgorithm::requireStoresInMemory(const AlgorithmStores& stores) +void ParallelAlgorithm::requireStoresInMemory(const AlgorithmStores& stores) { setParallelizationEnabled(::CheckStoresInMemory(stores)); } diff --git a/src/simplnx/Utilities/IParallelAlgorithm.hpp b/src/simplnx/Utilities/ParallelAlgorithm.hpp similarity index 64% rename from src/simplnx/Utilities/IParallelAlgorithm.hpp rename to src/simplnx/Utilities/ParallelAlgorithm.hpp index 1ec99a1dde..b2bd2947ba 100644 --- a/src/simplnx/Utilities/IParallelAlgorithm.hpp +++ b/src/simplnx/Utilities/ParallelAlgorithm.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Types.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/IDataStore.hpp" #include "simplnx/simplnx_export.hpp" @@ -9,16 +9,16 @@ namespace nx::core { -class SIMPLNX_EXPORT IParallelAlgorithm +class SIMPLNX_EXPORT ParallelAlgorithm { public: - using AlgorithmArrays = std::vector; + using AlgorithmArrays = std::vector; using AlgorithmStores = std::vector; - IParallelAlgorithm(const IParallelAlgorithm&) = default; - IParallelAlgorithm(IParallelAlgorithm&&) noexcept = default; - IParallelAlgorithm& operator=(const IParallelAlgorithm&) = default; - IParallelAlgorithm& operator=(IParallelAlgorithm&&) noexcept = default; + ParallelAlgorithm(const ParallelAlgorithm&) = default; + ParallelAlgorithm(ParallelAlgorithm&&) noexcept = default; + ParallelAlgorithm& operator=(const ParallelAlgorithm&) = default; + ParallelAlgorithm& operator=(ParallelAlgorithm&&) noexcept = default; /** * @brief Returns true if parallelization is enabled. Returns false otherwise. @@ -37,8 +37,8 @@ class SIMPLNX_EXPORT IParallelAlgorithm void requireStoresInMemory(const AlgorithmStores& arrays); protected: - IParallelAlgorithm(); - ~IParallelAlgorithm(); + ParallelAlgorithm(); + ~ParallelAlgorithm(); private: #ifdef SIMPLNX_ENABLE_MULTICORE diff --git a/src/simplnx/Utilities/ParallelData2DAlgorithm.hpp b/src/simplnx/Utilities/ParallelData2DAlgorithm.hpp index 226a74c3d7..5eac30af93 100644 --- a/src/simplnx/Utilities/ParallelData2DAlgorithm.hpp +++ b/src/simplnx/Utilities/ParallelData2DAlgorithm.hpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Range2D.hpp" #include "simplnx/Common/Types.hpp" -#include "simplnx/Utilities/IParallelAlgorithm.hpp" +#include "simplnx/Utilities/ParallelAlgorithm.hpp" #include "simplnx/simplnx_export.hpp" #ifdef SIMPLNX_ENABLE_MULTICORE @@ -24,7 +24,7 @@ namespace nx::core * utilizes TBB for parallelization and will fallback to non-parallelization if it is not * available or the parallelization is disabled. */ -class SIMPLNX_EXPORT ParallelData2DAlgorithm : public IParallelAlgorithm +class SIMPLNX_EXPORT ParallelData2DAlgorithm : public ParallelAlgorithm { public: using RangeType = Range2D; diff --git a/src/simplnx/Utilities/ParallelData3DAlgorithm.hpp b/src/simplnx/Utilities/ParallelData3DAlgorithm.hpp index 7288669555..e6f0e78a50 100644 --- a/src/simplnx/Utilities/ParallelData3DAlgorithm.hpp +++ b/src/simplnx/Utilities/ParallelData3DAlgorithm.hpp @@ -2,7 +2,7 @@ #include "simplnx/Common/Range3D.hpp" #include "simplnx/Common/Types.hpp" -#include "simplnx/Utilities/IParallelAlgorithm.hpp" +#include "simplnx/Utilities/ParallelAlgorithm.hpp" #include "simplnx/simplnx_export.hpp" #ifdef SIMPLNX_ENABLE_MULTICORE @@ -23,7 +23,7 @@ namespace nx::core * utilizes TBB for parallelization and will fallback to non-parallelization if it is not * available or the parallelization is disabled. */ -class SIMPLNX_EXPORT ParallelData3DAlgorithm : public IParallelAlgorithm +class SIMPLNX_EXPORT ParallelData3DAlgorithm : public ParallelAlgorithm { public: using RangeType = Range3D; diff --git a/src/simplnx/Utilities/ParallelDataAlgorithm.hpp b/src/simplnx/Utilities/ParallelDataAlgorithm.hpp index 46296b0232..0c0fd3899a 100644 --- a/src/simplnx/Utilities/ParallelDataAlgorithm.hpp +++ b/src/simplnx/Utilities/ParallelDataAlgorithm.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/Range.hpp" -#include "simplnx/Utilities/IParallelAlgorithm.hpp" +#include "simplnx/Utilities/ParallelAlgorithm.hpp" #include "simplnx/simplnx_export.hpp" #ifdef SIMPLNX_ENABLE_MULTICORE @@ -21,7 +21,7 @@ namespace nx::core * utilizes TBB for parallelization and will fallback to non-parallelization if it is not * available or the parallelization is disabled. */ -class SIMPLNX_EXPORT ParallelDataAlgorithm : public IParallelAlgorithm +class SIMPLNX_EXPORT ParallelDataAlgorithm : public ParallelAlgorithm { public: using RangeType = Range; diff --git a/src/simplnx/Utilities/ParallelTaskAlgorithm.hpp b/src/simplnx/Utilities/ParallelTaskAlgorithm.hpp index 5577340cc8..f14f74e869 100644 --- a/src/simplnx/Utilities/ParallelTaskAlgorithm.hpp +++ b/src/simplnx/Utilities/ParallelTaskAlgorithm.hpp @@ -1,6 +1,6 @@ #pragma once -#include "simplnx/Utilities/IParallelAlgorithm.hpp" +#include "simplnx/Utilities/ParallelAlgorithm.hpp" #include "simplnx/simplnx_export.hpp" #ifdef SIMPLNX_ENABLE_MULTICORE @@ -20,7 +20,7 @@ namespace nx::core * TBB for parallelization and will fallback to non-parallelization if it is not available * or the parallelization is disabled. */ -class SIMPLNX_EXPORT ParallelTaskAlgorithm : public IParallelAlgorithm +class SIMPLNX_EXPORT ParallelTaskAlgorithm : public ParallelAlgorithm { public: ParallelTaskAlgorithm(); diff --git a/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.cpp b/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.cpp index 6dc488f790..fc142e1c9e 100644 --- a/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.cpp +++ b/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.cpp @@ -481,8 +481,8 @@ std::string GetXdmfArrayType(usize numComp) return ""; } -void WriteXdmfAttributeDataHelper(std::ostream& out, usize numComp, std::string_view attrType, std::string_view dataContainerName, const IDataArray& array, std::string_view centering, usize precision, - std::string_view xdmfTypeName, std::string_view hdf5FilePath) +void WriteXdmfAttributeDataHelper(std::ostream& out, usize numComp, std::string_view attrType, std::string_view dataContainerName, const AbstractDataArray& array, std::string_view centering, + usize precision, std::string_view xdmfTypeName, std::string_view hdf5FilePath) { ShapeType tupleDims = array.getTupleShape(); @@ -597,7 +597,7 @@ void WriteXdmfAttributeMatrix(std::ostream& out, const AttributeMatrix& attribut { for(const auto& [arrayId, arrayObject] : attributeMatrix) { - const auto* dataArray = dynamic_cast(arrayObject.get()); + const auto* dataArray = dynamic_cast(arrayObject.get()); if(dataArray == nullptr) { continue; @@ -610,7 +610,7 @@ void WriteXdmfAttributeMatrix(std::ostream& out, const AttributeMatrix& attribut } } -void WriteXdmfGridGeometry(std::ostream& out, const IGridGeometry& gridGeometry, std::string_view geomName, std::string_view hdf5FilePath) +void WriteXdmfGridGeometry(std::ostream& out, const AbstractGridGeometry& gridGeometry, std::string_view geomName, std::string_view hdf5FilePath) { const AttributeMatrix* cellData = gridGeometry.getCellData(); if(cellData == nullptr) @@ -620,7 +620,7 @@ void WriteXdmfGridGeometry(std::ostream& out, const IGridGeometry& gridGeometry, WriteXdmfAttributeMatrix(out, *cellData, geomName, hdf5FilePath, "Cell"); } -void WriteXdmfNodeGeometry0D(std::ostream& out, const INodeGeometry0D& nodeGeom0D, std::string_view geomName, std::string_view hdf5FilePath) +void WriteXdmfNodeGeometry0D(std::ostream& out, const AbstractNodeGeometry0D& nodeGeom0D, std::string_view geomName, std::string_view hdf5FilePath) { const AttributeMatrix* vertexData = nodeGeom0D.getVertexAttributeMatrix(); if(vertexData == nullptr) @@ -630,7 +630,7 @@ void WriteXdmfNodeGeometry0D(std::ostream& out, const INodeGeometry0D& nodeGeom0 WriteXdmfAttributeMatrix(out, *vertexData, geomName, hdf5FilePath, "Node"); } -void WriteXdmfNodeGeometry1D(std::ostream& out, const INodeGeometry1D& nodeGeom1D, std::string_view geomName, std::string_view hdf5FilePath) +void WriteXdmfNodeGeometry1D(std::ostream& out, const AbstractNodeGeometry1D& nodeGeom1D, std::string_view geomName, std::string_view hdf5FilePath) { WriteXdmfNodeGeometry0D(out, nodeGeom1D, hdf5FilePath, geomName); @@ -642,7 +642,7 @@ void WriteXdmfNodeGeometry1D(std::ostream& out, const INodeGeometry1D& nodeGeom1 WriteXdmfAttributeMatrix(out, *edgeData, geomName, hdf5FilePath, "Cell"); } -void WriteXdmfNodeGeometry2D(std::ostream& out, const INodeGeometry2D& nodeGeom2D, std::string_view geomName, std::string_view hdf5FilePath) +void WriteXdmfNodeGeometry2D(std::ostream& out, const AbstractNodeGeometry2D& nodeGeom2D, std::string_view geomName, std::string_view hdf5FilePath) { WriteXdmfNodeGeometry1D(out, nodeGeom2D, hdf5FilePath, geomName); @@ -654,7 +654,7 @@ void WriteXdmfNodeGeometry2D(std::ostream& out, const INodeGeometry2D& nodeGeom2 WriteXdmfAttributeMatrix(out, *faceData, geomName, hdf5FilePath, "Cell"); } -void WriteXdmfNodeGeometry3D(std::ostream& out, const INodeGeometry3D& nodeGeom3D, std::string_view geomName, std::string_view hdf5FilePath) +void WriteXdmfNodeGeometry3D(std::ostream& out, const AbstractNodeGeometry3D& nodeGeom3D, std::string_view geomName, std::string_view hdf5FilePath) { WriteXdmfNodeGeometry2D(out, nodeGeom3D, hdf5FilePath, geomName); @@ -674,7 +674,7 @@ void WriteXdmf(std::ostream& out, const DataStructure& dataStructure, std::strin for(const auto& [identifier, object] : dataStructure) { - const auto* geometry = dynamic_cast(object.get()); + const auto* geometry = dynamic_cast(object.get()); if(geometry == nullptr) { continue; @@ -682,7 +682,7 @@ void WriteXdmf(std::ostream& out, const DataStructure& dataStructure, std::strin std::string geomName = geometry->getName(); - IGeometry::Type geomType = geometry->getGeomType(); + AbstractGeometry::Type geomType = geometry->getGeomType(); switch(geomType) { @@ -797,8 +797,8 @@ Result ImportDataStructureV8(const nx::core::HDF5::FileIO& fileRe * @param cDims */ template -Result createLegacyDataArray(DataStructure& dataStructure, DataObject::IdType parentId, const HDF5::DatasetIO& dataArrayReader, const std::vector& tDims, - const std::vector& cDims, bool preflight = false) +Result createLegacyDataArray(DataStructure& dataStructure, AbstractDataObject::IdType parentId, const HDF5::DatasetIO& dataArrayReader, const std::vector& tDims, + const std::vector& cDims, bool preflight = false) { using DataArrayType = DataArray; using EmptyDataStoreType = EmptyDataStore; @@ -818,7 +818,7 @@ Result createLegacyDataArray(DataStructure& dataStructure, DataObje if(result.invalid()) { std::string ss = fmt::format("Error reading HDF5 Data set: {}", dataArrayReader.getName()); - return nx::core::MakeErrorResult(Legacy::k_FailedReadingDataArrayData_Code, ss); + return nx::core::MakeErrorResult(Legacy::k_FailedReadingDataArrayData_Code, ss); } // Insert the DataArray into the DataStructure dataArray = DataArray::Create(dataStructure, daName, std::move(dataStore), parentId); @@ -827,7 +827,7 @@ Result createLegacyDataArray(DataStructure& dataStructure, DataObje if(nullptr == dataArray) { std::string ss = fmt::format("Failed to create DataArray: '{}'", daName); - return nx::core::MakeErrorResult(Legacy::k_FailedCreatingArray_Code, ss); + return nx::core::MakeErrorResult(Legacy::k_FailedCreatingArray_Code, ss); } return {dataArray}; @@ -860,7 +860,7 @@ Result<> readLegacyDataArrayDims(const nx::core::HDF5::DatasetIO& dataArrayReade return {}; } -Result<> readLegacyStringArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& dataArrayReader, DataObject::IdType parentId, bool preflight = false) +Result<> readLegacyStringArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& dataArrayReader, AbstractDataObject::IdType parentId, bool preflight = false) { const std::string daName = dataArrayReader.getName(); @@ -907,13 +907,13 @@ Result<> finishImportingLegacyStringArray(DataStructure& dataStructure, const nx return {}; } -Result readLegacyDataArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& dataArrayReader, DataObject::IdType parentId, bool preflight = false) +Result readLegacyDataArray(DataStructure& dataStructure, const nx::core::HDF5::DatasetIO& dataArrayReader, AbstractDataObject::IdType parentId, bool preflight = false) { auto dataTypeResult = dataArrayReader.getDataType(); if(dataTypeResult.invalid()) { auto errors = dataTypeResult.errors(); - return MakeErrorResult(errors[0].code, errors[0].message); + return MakeErrorResult(errors[0].code, errors[0].message); } auto dataType = std::move(dataTypeResult.value()); @@ -923,10 +923,10 @@ Result readLegacyDataArray(DataStructure& dataStructure, const nx:: if(dimsResult.invalid()) { auto& error = dimsResult.errors()[0]; - return MakeErrorResult(error.code, error.message); + return MakeErrorResult(error.code, error.message); } - Result daResult; + Result daResult; switch(dataType) { case DataType::float32: @@ -954,7 +954,7 @@ Result readLegacyDataArray(DataStructure& dataStructure, const nx:: auto typeTagResult = dataArrayReader.readStringAttribute(Constants::k_ObjectTypeTag); if(typeTagResult.invalid()) { - return ConvertInvalidResult(std::move(typeTagResult)); + return ConvertInvalidResult(std::move(typeTagResult)); } typeTag = std::move(typeTagResult.value()); if(typeTag == "DataArray") @@ -1068,10 +1068,10 @@ Result<> finishImportingLegacyDataArray(DataStructure& dataStructure, const HDF5 return {}; } -Result readLegacyNodeConnectivityList(DataStructure& dataStructure, IGeometry* geometry, const HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight = false) +Result readLegacyNodeConnectivityList(DataStructure& dataStructure, AbstractGeometry* geometry, const HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight = false) { HDF5::DatasetIO dataArrayReader = geomGroup.openDataset(arrayName); - DataObject::IdType parentId = geometry->getId(); + AbstractDataObject::IdType parentId = geometry->getId(); ShapeType tDims; ShapeType cDims; @@ -1094,7 +1094,7 @@ Result readLegacyNodeConnectivityList(DataStructure& dataStructure } template -Result<> createLegacyNeighborList(DataStructure& dataStructure, DataObject ::IdType parentId, const nx::core::HDF5::GroupIO& parentReader, const nx::core::HDF5::DatasetIO& datasetReader, +Result<> createLegacyNeighborList(DataStructure& dataStructure, AbstractDataObject ::IdType parentId, const nx::core::HDF5::GroupIO& parentReader, const nx::core::HDF5::DatasetIO& datasetReader, const ShapeType& tupleDims) { auto listStore = HDF5::NeighborListIO::ReadHdf5Data(parentReader, datasetReader); @@ -1107,7 +1107,7 @@ Result<> createLegacyNeighborList(DataStructure& dataStructure, DataObject ::IdT return {}; } -Result<> readLegacyNeighborList(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& parentReader, const nx::core::HDF5::DatasetIO& datasetReader, DataObject::IdType parentId) +Result<> readLegacyNeighborList(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& parentReader, const nx::core::HDF5::DatasetIO& datasetReader, AbstractDataObject::IdType parentId) { auto dataTypeResult = datasetReader.getDataType(); if(dataTypeResult.invalid()) @@ -1282,9 +1282,9 @@ Result<> finishImportingLegacyArray(DataStructure& dataStructure, const nx::core } } -Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& amGroupReader, DataObject& parent, bool preflight = false, bool importChildren = true) +Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& amGroupReader, AbstractDataObject& parent, bool preflight = false, bool importChildren = true) { - DataObject::IdType parentId = parent.getId(); + AbstractDataObject::IdType parentId = parent.getId(); const std::string amName = amGroupReader.getName(); auto tDimsResult = amGroupReader.readVectorAttribute("TupleDimensions"); @@ -1350,7 +1350,7 @@ Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core: switch(amType) { case 0: { - auto* nodeGeom0D = dynamic_cast(&parent); + auto* nodeGeom0D = dynamic_cast(&parent); if(nodeGeom0D != nullptr) { nodeGeom0D->setVertexAttributeMatrix(*attributeMatrix); @@ -1358,7 +1358,7 @@ Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core: break; } case 1: { - auto* nodeGeom1D = dynamic_cast(&parent); + auto* nodeGeom1D = dynamic_cast(&parent); if(nodeGeom1D != nullptr) { nodeGeom1D->setEdgeAttributeMatrix(*attributeMatrix); @@ -1366,7 +1366,7 @@ Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core: break; } case 2: { - auto* nodeGeom2D = dynamic_cast(&parent); + auto* nodeGeom2D = dynamic_cast(&parent); if(nodeGeom2D != nullptr) { nodeGeom2D->setFaceAttributeMatrix(*attributeMatrix); @@ -1374,7 +1374,7 @@ Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core: break; } case 3: { - auto* gridGeom = dynamic_cast(&parent); + auto* gridGeom = dynamic_cast(&parent); if(gridGeom != nullptr) { gridGeom->setCellData(*attributeMatrix); @@ -1386,7 +1386,7 @@ Result<> readLegacyAttributeMatrix(DataStructure& dataStructure, const nx::core: } // Begin legacy geometry import methods -void readGenericGeomDims(IGeometry* geom, const nx::core::HDF5::GroupIO& geomGroup) +void readGenericGeomDims(AbstractGeometry* geom, const nx::core::HDF5::GroupIO& geomGroup) { int32 sDims = 0; if(auto sDimsResult = geomGroup.readScalarAttribute("SpatialDimensionality"); sDimsResult.valid()) @@ -1404,29 +1404,29 @@ void readGenericGeomDims(IGeometry* geom, const nx::core::HDF5::GroupIO& geomGro geom->setUnitDimensionality(uDims); } -Result readLegacyGeomArray(DataStructure& dataStructure, IGeometry* geometry, const nx::core::HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight) +Result readLegacyGeomArray(DataStructure& dataStructure, AbstractGeometry* geometry, const nx::core::HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight) { auto dataArraySet = geomGroup.openDataset(arrayName); return readLegacyDataArray(dataStructure, dataArraySet, geometry->getId(), preflight); } template -Result readLegacyGeomArrayAs(DataStructure& dataStructure, IGeometry* geometry, const nx::core::HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight) +Result readLegacyGeomArrayAs(DataStructure& dataStructure, AbstractGeometry* geometry, const nx::core::HDF5::GroupIO& geomGroup, const std::string& arrayName, bool preflight) { - Result result = readLegacyGeomArray(dataStructure, geometry, geomGroup, arrayName, preflight); + Result result = readLegacyGeomArray(dataStructure, geometry, geomGroup, arrayName, preflight); if(result.invalid()) { auto& error = result.errors()[0]; return nx::core::MakeErrorResult(error.code, error.message); } - IDataArray* iArray = result.value(); + AbstractDataArray* iArray = result.value(); T* dataArray = dynamic_cast(iArray); Result<> voidResult = ConvertResult(std::move(result)); return ConvertResultTo(std::move(voidResult), std::move(dataArray)); } -DataObject* readLegacyVertexGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyVertexGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto* geom = VertexGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1436,7 +1436,7 @@ DataObject* readLegacyVertexGeom(DataStructure& dataStructure, const nx::core::H return geom; } -DataObject* readLegacyTriangleGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyTriangleGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = TriangleGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1449,7 +1449,7 @@ DataObject* readLegacyTriangleGeom(DataStructure& dataStructure, const nx::core: return geom; } -DataObject* readLegacyTetrahedralGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyTetrahedralGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = TetrahedralGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1462,7 +1462,7 @@ DataObject* readLegacyTetrahedralGeom(DataStructure& dataStructure, const nx::co return geom; } -DataObject* readLegacyRectGridGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyRectGridGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = RectGridGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1483,7 +1483,7 @@ DataObject* readLegacyRectGridGeom(DataStructure& dataStructure, const nx::core: return geom; } -DataObject* readLegacyQuadGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyQuadGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = QuadGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1496,7 +1496,7 @@ DataObject* readLegacyQuadGeom(DataStructure& dataStructure, const nx::core::HDF return geom; } -DataObject* readLegacyHexGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyHexGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = HexahedralGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1509,7 +1509,7 @@ DataObject* readLegacyHexGeom(DataStructure& dataStructure, const nx::core::HDF5 return geom; } -DataObject* readLegacyEdgeGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) +AbstractDataObject* readLegacyEdgeGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name, bool preflight) { auto geom = EdgeGeom::Create(dataStructure, name); readGenericGeomDims(geom, geomGroup); @@ -1522,7 +1522,7 @@ DataObject* readLegacyEdgeGeom(DataStructure& dataStructure, const nx::core::HDF return geom; } -DataObject* readLegacyImageGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name) +AbstractDataObject* readLegacyImageGeom(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& geomGroup, const std::string& name) { auto geom = ImageGeom::Create(dataStructure, name); auto image = dynamic_cast(geom); @@ -1556,7 +1556,7 @@ DataObject* readLegacyImageGeom(DataStructure& dataStructure, const nx::core::HD Result<> readLegacyDataContainer(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& dcGroup, bool preflight = false, bool importChildren = true) { - DataObject* container = nullptr; + AbstractDataObject* container = nullptr; const std::string dcName = dcGroup.getName(); // Check for geometry @@ -1631,7 +1631,7 @@ Result<> readLegacyDataContainer(DataStructure& dataStructure, const nx::core::H return nx::core::MergeResults(amResults); } -Result<> finishImportingLegacyImageGeom(DataStructure& dataStructure, IGeometry* geometry, const HDF5::GroupIO& geometryReader) +Result<> finishImportingLegacyImageGeom(DataStructure& dataStructure, AbstractGeometry* geometry, const HDF5::GroupIO& geometryReader) { auto* imageGeom = dynamic_cast(geometry); if(imageGeom == nullptr) @@ -1642,7 +1642,7 @@ Result<> finishImportingLegacyImageGeom(DataStructure& dataStructure, IGeometry* return {}; } -Result<> finishImportingLegacyEdgeGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyEdgeGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* edgeGeom = dynamic_cast(geometryPtr); if(edgeGeom == nullptr) @@ -1654,7 +1654,7 @@ Result<> finishImportingLegacyEdgeGeom(DataStructure& dataStructure, IGeometry* return {}; } -Result<> finishImportingLegacyHexGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyHexGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* hexGeom = dynamic_cast(geometryPtr); if(hexGeom == nullptr) @@ -1666,7 +1666,7 @@ Result<> finishImportingLegacyHexGeom(DataStructure& dataStructure, IGeometry* g return {}; } -Result<> finishImportingLegacyQuadGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyQuadGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* quadGeom = dynamic_cast(geometryPtr); if(quadGeom == nullptr) @@ -1678,7 +1678,7 @@ Result<> finishImportingLegacyQuadGeom(DataStructure& dataStructure, IGeometry* return {}; } -Result<> finishImportingLegacyRectGridGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyRectGridGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* rectGridGeom = dynamic_cast(geometryPtr); if(rectGridGeom == nullptr) @@ -1698,7 +1698,7 @@ Result<> finishImportingLegacyRectGridGeom(DataStructure& dataStructure, IGeomet return {}; } -Result<> finishImportingLegacyTetrahedralGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyTetrahedralGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* tetrahedralGeom = dynamic_cast(geometryPtr); if(tetrahedralGeom == nullptr) @@ -1710,7 +1710,7 @@ Result<> finishImportingLegacyTetrahedralGeom(DataStructure& dataStructure, IGeo return {}; } -Result<> finishImportingLegacyTriangleGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyTriangleGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* triangleGeom = dynamic_cast(geometryPtr); if(triangleGeom == nullptr) @@ -1722,7 +1722,7 @@ Result<> finishImportingLegacyTriangleGeom(DataStructure& dataStructure, IGeomet return {}; } -Result<> finishImportingLegacyVertexGeom(DataStructure& dataStructure, IGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) +Result<> finishImportingLegacyVertexGeom(DataStructure& dataStructure, AbstractGeometry* geometryPtr, const HDF5::GroupIO& geomGroup) { auto* vertexGeom = dynamic_cast(geometryPtr); if(vertexGeom == nullptr) @@ -1743,7 +1743,7 @@ Result<> finishImportingLegacyDataContainer(DataStructure& dataStructure, const auto geomGroup = dcGroup.openGroup(Legacy::GeometryTag.c_str()); if(geomGroup.isValid()) { - auto* geometryPtr = dataStructure.getDataAs(dataPath); + auto* geometryPtr = dataStructure.getDataAs(dataPath); if(geometryPtr == nullptr) { return MakeErrorResult(-502679, fmt::format("Failed to finish importing of geometry at path '{}'. Existing geometry not found.", dataPath.toString())); @@ -1793,7 +1793,7 @@ Result<> finishImportingLegacyDataContainer(DataStructure& dataStructure, const return {}; } -Result>> ImportLegacyDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) +Result>> ImportLegacyDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) { DataStructure dataStructure; auto dcaGroup = fileReader.openGroup(k_LegacyDataStructureGroupTag); @@ -1821,23 +1821,23 @@ Result>> ImportLegacyDataObjectFromFile( break; } default: - return MakeErrorResult>>(-59040, - fmt::format("Failed to import DataObject at path '{}'. DataPath not supported by legacy DataStructure.", dataPath.toString())); + return MakeErrorResult>>( + -59040, fmt::format("Failed to import DataObject at path '{}'. DataPath not supported by legacy DataStructure.", dataPath.toString())); } if(result.invalid()) { - return ConvertInvalidResult>>(std::move(result)); + return ConvertInvalidResult>>(std::move(result)); } const DataMap& dataMap = dataStructure.getDataMap(); if(dataMap.getSize() == 0) { - return MakeErrorResult>>(-69040, fmt::format("Failed to import DataObject at path '{}'", dataPath.toString())); + return MakeErrorResult>>(-69040, fmt::format("Failed to import DataObject at path '{}'", dataPath.toString())); } auto item = dataMap.begin(); - return {std::vector>{(*item).second}}; + return {std::vector>{(*item).second}}; } Result<> FinishImportingLegacyDataObject(DataStructure& dataStructure, const nx::core::HDF5::GroupIO& parentReader, const DataPath& dataPath) @@ -1971,7 +1971,7 @@ Result DREAM3D::ImportPipelineJsonFromFile(const std::filesystem return ImportPipelineJsonFromFile(fileReader); } -Result> DREAM3D::ImportDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) +Result> DREAM3D::ImportDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath) { const auto fileVersion = GetFileVersion(fileReader); if(fileVersion == k_CurrentFileVersion) @@ -1983,27 +1983,27 @@ Result> DREAM3D::ImportDataObjectFromFile(const nx:: auto result = ImportLegacyDataObjectFromFile(fileReader, dataPath); if(result.invalid()) { - return ConvertInvalidResult>(std::move(result)); + return ConvertInvalidResult>(std::move(result)); } - std::vector> value = result.value(); + std::vector> value = result.value(); if(value.size() != 0) { - return MakeErrorResult>(-48264, fmt::format("Error extracting a single DataObject from legacy DREAM3D file at path '{}'", dataPath.toString())); + return MakeErrorResult>(-48264, fmt::format("Error extracting a single DataObject from legacy DREAM3D file at path '{}'", dataPath.toString())); } return {result.value().front()}; } - return MakeErrorResult>(-523242, fmt::format("Error extracting a single DataObject from legacy DREAM3D file at path '{}'", dataPath.toString())); + return MakeErrorResult>(-523242, fmt::format("Error extracting a single DataObject from legacy DREAM3D file at path '{}'", dataPath.toString())); } -Result>> DREAM3D::ImportSelectDataObjectsFromFile(const nx::core::HDF5::FileIO& fileReader, const std::vector& dataPaths) +Result>> DREAM3D::ImportSelectDataObjectsFromFile(const nx::core::HDF5::FileIO& fileReader, const std::vector& dataPaths) { - std::vector> dataObjects; + std::vector> dataObjects; for(const DataPath& dataPath : dataPaths) { auto importResult = ImportDataObjectFromFile(fileReader, dataPath); if(importResult.invalid()) { - return ConvertInvalidResult>>(std::move(importResult)); + return ConvertInvalidResult>>(std::move(importResult)); } dataObjects.push_back(std::move(importResult.value())); } @@ -2018,7 +2018,7 @@ Result<> DREAM3D::FinishImportingObject(DataStructure& importStructure, DataStru return MakeErrorResult(-6200, fmt::format("DataStructure Object Path '{}' does not exist for importing.", dataPath.toString())); } const auto importObject = importStructure.getSharedData(dataPath); - const auto importData = std::shared_ptr(importObject->shallowCopy()); + const auto importData = std::shared_ptr(importObject->shallowCopy()); // Clear all children before inserting into the DataStructure if(const auto importGroup = std::dynamic_pointer_cast(importData); importGroup != nullptr) { diff --git a/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.hpp b/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.hpp index 7ca661751c..c9a51c15c6 100644 --- a/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.hpp +++ b/src/simplnx/Utilities/Parsing/DREAM3D/Dream3dIO.hpp @@ -118,9 +118,9 @@ SIMPLNX_EXPORT Result<> AppendFile(const std::filesystem::path& path, const Data */ SIMPLNX_EXPORT Result ImportDataStructureFromFile(const nx::core::HDF5::FileIO& fileReader, bool preflight); -SIMPLNX_EXPORT Result> ImportDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath); +SIMPLNX_EXPORT Result> ImportDataObjectFromFile(const nx::core::HDF5::FileIO& fileReader, const DataPath& dataPath); -SIMPLNX_EXPORT Result>> ImportSelectDataObjectsFromFile(const nx::core::HDF5::FileIO& fileReader, const std::vector& dataPaths); +SIMPLNX_EXPORT Result>> ImportSelectDataObjectsFromFile(const nx::core::HDF5::FileIO& fileReader, const std::vector& dataPaths); SIMPLNX_EXPORT Result<> FinishImportingObject(DataStructure& importStructure, DataStructure& dataStructure, const DataPath& dataPath, const nx::core::HDF5::FileIO& fileReader, bool preflight); diff --git a/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.cpp b/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.cpp new file mode 100644 index 0000000000..31bdcb9c3d --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.cpp @@ -0,0 +1,18 @@ +#include "AbstractJsonPipelineParser.hpp" + +using namespace nx::core; + +AbstractJsonPipelineParser::AbstractJsonPipelineParser(FilterList* filterList) +: m_FilterList(filterList) +{ +} +AbstractJsonPipelineParser::AbstractJsonPipelineParser(const AbstractJsonPipelineParser& other) +: m_FilterList(other.m_FilterList) +{ +} +AbstractJsonPipelineParser::AbstractJsonPipelineParser(AbstractJsonPipelineParser&& other) noexcept +: m_FilterList(std::move(other.m_FilterList)) +{ +} + +AbstractJsonPipelineParser::~AbstractJsonPipelineParser() = default; diff --git a/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp b/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp new file mode 100644 index 0000000000..913ec43294 --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp" + +namespace nx::core +{ +class FilterList; + +/** + * @brief Abstract base class for JSON pipeline parsers. Provides storage for the FilterList. + */ +class AbstractJsonPipelineParser : public IJsonPipelineParser +{ +public: + ~AbstractJsonPipelineParser() override; + +protected: + /** + * @brief + * @param filterList + */ + AbstractJsonPipelineParser(FilterList* filterList); + + /** + * @brief + * @param other + */ + AbstractJsonPipelineParser(const AbstractJsonPipelineParser& other); + + /** + * @brief + * @param other + */ + AbstractJsonPipelineParser(AbstractJsonPipelineParser&& other) noexcept; + + /** + * @brief + * @return FilterList* + */ + FilterList* getFilterList() const; + +private: + FilterList* m_FilterList; +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp b/src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp new file mode 100644 index 0000000000..9fbdd660e2 --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/IJsonPipelineParser.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include + +namespace nx::core +{ +class Pipeline; + +/** + * @brief Pure interface for JSON pipeline parsing. + */ +class IJsonPipelineParser +{ +public: + virtual ~IJsonPipelineParser() = default; + + IJsonPipelineParser& operator=(const IJsonPipelineParser&) = delete; + IJsonPipelineParser& operator=(IJsonPipelineParser&&) = delete; + + /** + * @param json + * @return Pipeline* + */ + virtual Pipeline* fromJson(const std::string& json) const = 0; + + /** + * @param pipeline + * @return std::string + */ + virtual std::string toJson(Pipeline* pipeline) const = 0; + +protected: + IJsonPipelineParser() = default; + IJsonPipelineParser(const IJsonPipelineParser&) = default; + IJsonPipelineParser(IJsonPipelineParser&&) = default; +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.cpp b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.cpp new file mode 100644 index 0000000000..2829b05454 --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.cpp @@ -0,0 +1,18 @@ +#include "JsonPipelineParserV6.hpp" + +using namespace nx::core; + +JsonPipelineParserV6::JsonPipelineParserV6(FilterList* filterList) +: AbstractJsonPipelineParser(filterList) +{ +} +JsonPipelineParserV6::JsonPipelineParserV6(const JsonPipelineParserV6& other) +: AbstractJsonPipelineParser(other) +{ +} +JsonPipelineParserV6::JsonPipelineParserV6(JsonPipelineParserV6&& other) noexcept +: AbstractJsonPipelineParser(std::move(other)) +{ +} + +JsonPipelineParserV6::~JsonPipelineParserV6() = default; diff --git a/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.hpp b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.hpp new file mode 100644 index 0000000000..a811bfbe53 --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV6.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp" + +namespace nx::core +{ + +/** + * class JsonPipelineParserV6 + * + */ + +class JsonPipelineParserV6 : virtual public AbstractJsonPipelineParser +{ +public: + /** + * @brief + * @param filterList + */ + JsonPipelineParserV6(FilterList* filterList); + + /** + * @brief + * @param other + */ + JsonPipelineParserV6(const JsonPipelineParserV6& other); + + /** + * @brief + * @param other + */ + JsonPipelineParserV6(JsonPipelineParserV6&& other) noexcept; + + ~JsonPipelineParserV6() override; + + /** + * @param json + * @return Pipeline* + */ + Pipeline* fromJson(const std::string& json) const override; + + /** + * @param Pipeline* + * @return std::string + */ + std::string toJson(Pipeline* pipeline) const override; + +protected: +private: +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.cpp b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.cpp new file mode 100644 index 0000000000..810fa5bbfe --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.cpp @@ -0,0 +1,18 @@ +#include "JsonPipelineParserV7.hpp" + +using namespace nx::core; + +JsonPipelineParserV7::JsonPipelineParserV7(FilterList* filterList) +: AbstractJsonPipelineParser(filterList) +{ +} +JsonPipelineParserV7::JsonPipelineParserV7(const JsonPipelineParserV7& other) +: AbstractJsonPipelineParser(other) +{ +} +JsonPipelineParserV7::JsonPipelineParserV7(JsonPipelineParserV7&& other) noexcept +: AbstractJsonPipelineParser(std::move(other)) +{ +} + +JsonPipelineParserV7::~JsonPipelineParserV7() = default; diff --git a/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.hpp b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.hpp new file mode 100644 index 0000000000..4841525130 --- /dev/null +++ b/src/simplnx/Utilities/Parsing/JSON/JsonPipelineParserV7.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "simplnx/Utilities/Parsing/JSON/AbstractJsonPipelineParser.hpp" + +namespace nx::core +{ + +/** + * class JsonPipelineParserV7 + * + */ + +class JsonPipelineParserV7 : virtual public AbstractJsonPipelineParser +{ +public: + /** + * @brief + * @param filterList + */ + JsonPipelineParserV7(FilterList* filterList); + + /** + * @brief + * @param other + */ + JsonPipelineParserV7(const JsonPipelineParserV7& other); + + /** + * @brief + * @param other + */ + JsonPipelineParserV7(JsonPipelineParserV7&& other) noexcept; + + ~JsonPipelineParserV7() override; + + /** + * @param json + * @return Pipeline* + */ + Pipeline* fromJson(const std::string& json) const override; + + /** + * @param pipeline* + * @return std::string + */ + std::string toJson(Pipeline* pipeline) const override; + +protected: +private: +}; +} // namespace nx::core diff --git a/src/simplnx/Utilities/SampleSurfaceMesh.hpp b/src/simplnx/Utilities/SampleSurfaceMesh.hpp index d4c05d39cf..f43a8203fb 100644 --- a/src/simplnx/Utilities/SampleSurfaceMesh.hpp +++ b/src/simplnx/Utilities/SampleSurfaceMesh.hpp @@ -1,10 +1,10 @@ #pragma once #include "simplnx/Common/Array.hpp" +#include "simplnx/DataStructure/AbstractDataArray.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/Geometry/VertexGeom.hpp" -#include "simplnx/DataStructure/IDataArray.hpp" #include "simplnx/Filter/Arguments.hpp" #include "simplnx/Filter/IFilter.hpp" #include "simplnx/Parameters/VectorParameter.hpp" diff --git a/src/simplnx/Utilities/SamplingUtils.hpp b/src/simplnx/Utilities/SamplingUtils.hpp index 750284e8d1..cabee8ed56 100644 --- a/src/simplnx/Utilities/SamplingUtils.hpp +++ b/src/simplnx/Utilities/SamplingUtils.hpp @@ -18,7 +18,7 @@ inline Result<> RenumberFeatures(DataStructure& dataStructure, const DataPath& n usize totalPoints = destImageGeom.getNumberOfCells(); - auto& featureIdsArray = dataStructure.getDataRefAs(featureIdsArrayPath); + auto& featureIdsArray = dataStructure.getDataRefAs(featureIdsArrayPath); usize totalFeatures = destCellFeatureAM.getNumberOfTuples(); std::vector activeObjects(totalFeatures, false); if(0 == totalFeatures) diff --git a/src/simplnx/Utilities/StringUtilities.hpp b/src/simplnx/Utilities/StringUtilities.hpp index 0c021c54a8..50e8824b91 100644 --- a/src/simplnx/Utilities/StringUtilities.hpp +++ b/src/simplnx/Utilities/StringUtilities.hpp @@ -88,9 +88,9 @@ void tokenize(InputIt first, InputIt last, ForwardIt s_first, ForwardIt s_last, template struct SplitTypeOptions { - static inline constexpr bool AllowConsecutiveAsEmpty = ConsecutiveAsEmptyV; - static inline constexpr bool AllowEmptyInital = EmptyInitialV; - static inline constexpr bool AllowEmptyFinal = EmptyFinalV; + static constexpr bool AllowConsecutiveAsEmpty = ConsecutiveAsEmptyV; + static constexpr bool AllowEmptyInital = EmptyInitialV; + static constexpr bool AllowEmptyFinal = EmptyFinalV; }; using SplitIgnoreEmpty = SplitTypeOptions; diff --git a/src/simplnx/Utilities/TemplateHelpers.hpp b/src/simplnx/Utilities/TemplateHelpers.hpp index 308f23ccad..04f29f987f 100644 --- a/src/simplnx/Utilities/TemplateHelpers.hpp +++ b/src/simplnx/Utilities/TemplateHelpers.hpp @@ -1,7 +1,7 @@ #pragma once #include "simplnx/Common/SimplnxConstants.hpp" -#include "simplnx/DataStructure/DataObject.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include #include @@ -134,7 +134,7 @@ * @brief This macro includes the 'bool' type. */ #define EXECUTE_FUNCTION_TEMPLATE2(observableObj, templateName, inputDataPath, ...) \ - auto* inputData = m_DataStructure.getDataAs(inputDataPath); \ + auto* inputData = m_DataStructure.getDataAs(inputDataPath); \ if(TemplateHelpers::CanDynamicCast()(inputData)) \ { \ templateName(__VA_ARGS__); \ @@ -193,13 +193,13 @@ namespace nx::core namespace TemplateHelpers { /** - * @brief This class (functor) simply returns true or false if the IDataArray can be downcast to a certain DataArray type + * @brief This class (functor) simply returns true or false if the AbstractDataArray can be downcast to a certain DataArray type * parameterized by the template parameter T. */ template struct CanDynamicCast { - bool operator()(const DataObject* p) const + bool operator()(const AbstractDataObject* p) const { return dynamic_cast(p) != nullptr; } diff --git a/test/AppTest.cpp b/test/AppTest.cpp index 434c4fb63e..fca2844e71 100644 --- a/test/AppTest.cpp +++ b/test/AppTest.cpp @@ -239,16 +239,16 @@ TEST_CASE("Application::getDataType", "[Application]") SECTION("Default data types are registered") { - REQUIRE(app->getDataType("DataGroup") == DataObject::Type::DataGroup); - REQUIRE(app->getDataType("AttributeMatrix") == DataObject::Type::AttributeMatrix); - REQUIRE(app->getDataType("Image Geom") == DataObject::Type::ImageGeom); - REQUIRE(app->getDataType("Vertex Geom") == DataObject::Type::VertexGeom); + REQUIRE(app->getDataType("DataGroup") == IDataObject::Type::DataGroup); + REQUIRE(app->getDataType("AttributeMatrix") == IDataObject::Type::AttributeMatrix); + REQUIRE(app->getDataType("Image Geom") == IDataObject::Type::ImageGeom); + REQUIRE(app->getDataType("Vertex Geom") == IDataObject::Type::VertexGeom); } SECTION("Unknown data type returns DataObject") { auto type = app->getDataType("NonExistentType"); - REQUIRE(type == DataObject::Type::DataObject); + REQUIRE(type == IDataObject::Type::AbstractDataObject); } } @@ -258,15 +258,15 @@ TEST_CASE("Application::addDataType", "[Application]") SECTION("Add custom data type") { - app->addDataType(DataObject::Type::DataGroup, "CustomType"); - REQUIRE(app->getDataType("CustomType") == DataObject::Type::DataGroup); + app->addDataType(IDataObject::Type::DataGroup, "CustomType"); + REQUIRE(app->getDataType("CustomType") == IDataObject::Type::DataGroup); } SECTION("Override existing data type") { auto originalType = app->getDataType("DataGroup"); - app->addDataType(DataObject::Type::ImageGeom, "DataGroup"); - REQUIRE(app->getDataType("DataGroup") == DataObject::Type::ImageGeom); + app->addDataType(IDataObject::Type::ImageGeom, "DataGroup"); + REQUIRE(app->getDataType("DataGroup") == IDataObject::Type::ImageGeom); // Restore original app->addDataType(originalType, "DataGroup"); } diff --git a/test/DataArrayTest.cpp b/test/DataArrayTest.cpp index 12e81095d8..bc06c1194a 100644 --- a/test/DataArrayTest.cpp +++ b/test/DataArrayTest.cpp @@ -458,7 +458,7 @@ void TestNeighborListArrayToFromString(DataStructure& datastructure, co REQUIRE(ok); } -TEST_CASE("IArray ToFromString") +TEST_CASE("AbstractArray ToFromString") { DataStructure datastructure; diff --git a/test/DataStructObserver.hpp b/test/DataStructObserver.hpp index d489b39488..7997147533 100644 --- a/test/DataStructObserver.hpp +++ b/test/DataStructObserver.hpp @@ -7,7 +7,7 @@ namespace nx::core { -class DataObject; +class AbstractDataObject; class DataStructure; class BaseGroup; class DataAddedMessage; diff --git a/test/DataStructTest.cpp b/test/DataStructTest.cpp index 1a69352fb1..89e4a293af 100644 --- a/test/DataStructTest.cpp +++ b/test/DataStructTest.cpp @@ -50,20 +50,20 @@ TEST_CASE("SimplnxCore::DataObjectType Check") { UnitTest::LoadPlugins(); - static_assert(DataObject::Type::IGeometry == static_cast(8)); - static_assert(DataObject::Type::IGridGeometry == static_cast(9)); - static_assert(DataObject::Type::RectGridGeom == static_cast(10)); - static_assert(DataObject::Type::ImageGeom == static_cast(11)); - static_assert(DataObject::Type::INodeGeometry0D == static_cast(12)); - static_assert(DataObject::Type::VertexGeom == static_cast(13)); - static_assert(DataObject::Type::INodeGeometry1D == static_cast(14)); - static_assert(DataObject::Type::EdgeGeom == static_cast(15)); - static_assert(DataObject::Type::INodeGeometry2D == static_cast(16)); - static_assert(DataObject::Type::QuadGeom == static_cast(17)); - static_assert(DataObject::Type::TriangleGeom == static_cast(18)); - static_assert(DataObject::Type::INodeGeometry3D == static_cast(19)); - static_assert(DataObject::Type::HexahedralGeom == static_cast(20)); - static_assert(DataObject::Type::TetrahedralGeom == static_cast(21)); + static_assert(IDataObject::Type::AbstractGeometry == static_cast(8)); + static_assert(IDataObject::Type::AbstractGridGeometry == static_cast(9)); + static_assert(IDataObject::Type::RectGridGeom == static_cast(10)); + static_assert(IDataObject::Type::ImageGeom == static_cast(11)); + static_assert(IDataObject::Type::AbstractNodeGeometry0D == static_cast(12)); + static_assert(IDataObject::Type::VertexGeom == static_cast(13)); + static_assert(IDataObject::Type::AbstractNodeGeometry1D == static_cast(14)); + static_assert(IDataObject::Type::EdgeGeom == static_cast(15)); + static_assert(IDataObject::Type::AbstractNodeGeometry2D == static_cast(16)); + static_assert(IDataObject::Type::QuadGeom == static_cast(17)); + static_assert(IDataObject::Type::TriangleGeom == static_cast(18)); + static_assert(IDataObject::Type::AbstractNodeGeometry3D == static_cast(19)); + static_assert(IDataObject::Type::HexahedralGeom == static_cast(20)); + static_assert(IDataObject::Type::TetrahedralGeom == static_cast(21)); } // This test will ensure we don't run into runtime exceptions trying to run the functions @@ -716,8 +716,8 @@ TEST_CASE("DataStructureCopyTest") REQUIRE(dataStrCopy.getData(child2Id)); REQUIRE(dataStrCopy.getData(grandchildId)); - DataObject* data = dataStr.getData(groupId); - DataObject* dataCopy = dataStrCopy.getData(groupId); + AbstractDataObject* data = dataStr.getData(groupId); + AbstractDataObject* dataCopy = dataStrCopy.getData(groupId); REQUIRE(dataStrCopy.getData(groupId) != dataStr.getData(groupId)); REQUIRE(dataStrCopy.getData(child1Id) != dataStr.getData(child1Id)); REQUIRE(dataStrCopy.getData(child2Id) != dataStr.getData(child2Id)); @@ -895,7 +895,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcImageGeoPath({Constants::k_ImageGeometry}); const DataPath destImageGeoPath({Constants::k_ImageGeometry.str() + "_COPY"}); auto* data = dataStruct.getData(srcImageGeoPath); - std::shared_ptr imageGeoCopy = data->deepCopy(destImageGeoPath); + std::shared_ptr imageGeoCopy = data->deepCopy(destImageGeoPath); auto allSrcImageGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcImageGeoPath).value(); auto destImageGeoResults = GetAllChildDataPathsRecursive(dataStruct, destImageGeoPath); @@ -948,7 +948,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcRectGeoPath({k_RectGridGeo}); const DataPath destRectGeoPath({k_RectGridGeo.str() + "_COPY"}); auto* data = dataStruct.getData(srcRectGeoPath); - std::shared_ptr rectGeoCopy = data->deepCopy(destRectGeoPath); + std::shared_ptr rectGeoCopy = data->deepCopy(destRectGeoPath); auto allSrcRectGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcRectGeoPath).value(); auto destRectGeoResults = GetAllChildDataPathsRecursive(dataStruct, destRectGeoPath); @@ -987,7 +987,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({Constants::k_VertexGeometry}); const DataPath destGeoPath({Constants::k_VertexGeometry.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1023,7 +1023,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({k_EdgeGeo}); const DataPath destGeoPath({k_EdgeGeo.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1090,7 +1090,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({Constants::k_TriangleGeometryName}); const DataPath destGeoPath({Constants::k_TriangleGeometryName.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1155,7 +1155,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({k_QuadGeo}); const DataPath destGeoPath({k_QuadGeo.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1220,7 +1220,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({k_TetGeo}); const DataPath destGeoPath({k_TetGeo.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1295,7 +1295,7 @@ TEST_CASE("DataObjectsDeepCopyTest") const DataPath srcGeoPath({k_HexGeo}); const DataPath destGeoPath({k_HexGeo.str() + "_COPY"}); auto* data = dataStruct.getData(srcGeoPath); - std::shared_ptr geoCopy = data->deepCopy(destGeoPath); + std::shared_ptr geoCopy = data->deepCopy(destGeoPath); auto allSrcGeoDataPaths = GetAllChildDataPathsRecursive(dataStruct, srcGeoPath).value(); auto destGeoResults = GetAllChildDataPathsRecursive(dataStruct, destGeoPath); @@ -1375,14 +1375,14 @@ TEST_CASE("DataObjectsDeepCopyTest") auto* dataGroup = dataStruct.getData(srcGroupPath); auto* nlArray = dataStruct.getData(srcArrayPath); - std::shared_ptr copyToChildGeo = imageGeo->deepCopy(srcGroupPath); + std::shared_ptr copyToChildGeo = imageGeo->deepCopy(srcGroupPath); REQUIRE(copyToChildGeo == nullptr); REQUIRE(badCopyDataStruct.getDataAs(srcGroupPath) == nullptr); - std::shared_ptr copyGroupToSelfGeo = dataGroup->deepCopy(srcGroupPath); + std::shared_ptr copyGroupToSelfGeo = dataGroup->deepCopy(srcGroupPath); REQUIRE(copyGroupToSelfGeo == nullptr); - std::shared_ptr copyArrayToSelfGeo = nlArray->deepCopy(srcArrayPath); + std::shared_ptr copyArrayToSelfGeo = nlArray->deepCopy(srcArrayPath); REQUIRE(copyArrayToSelfGeo == nullptr); } } diff --git a/test/GeometryTest.cpp b/test/GeometryTest.cpp index 469240c597..54f3a93539 100644 --- a/test/GeometryTest.cpp +++ b/test/GeometryTest.cpp @@ -19,13 +19,13 @@ using namespace nx::core; //////////////////////////////////// // Begin generic geometry testing // //////////////////////////////////// -void testAbstractGeometry(IGeometry* geom) +void testAbstractGeometry(AbstractGeometry* geom) { SECTION("abstract geometry") { SECTION("units") { - const auto units = IGeometry::LengthUnit::Fathom; + const auto units = AbstractGeometry::LengthUnit::Fathom; geom->setUnits(units); REQUIRE(geom->getUnits() == units); } @@ -42,7 +42,7 @@ void testAbstractGeometry(IGeometry* geom) } } -void testGeom2D(INodeGeometry2D* geom) +void testGeom2D(AbstractNodeGeometry2D* geom) { SECTION("abstract geometry 2D") { @@ -88,7 +88,7 @@ void testGeom2D(INodeGeometry2D* geom) } } -void testGeom3D(INodeGeometry3D* geom) +void testGeom3D(AbstractNodeGeometry3D* geom) { SECTION("abstract geometry 3D") { @@ -135,7 +135,7 @@ void testGeom3D(INodeGeometry3D* geom) } } -void testGeomGrid(IGridGeometry* geom) +void testGeomGrid(AbstractGridGeometry* geom) { SECTION("abstract geometry grid") { diff --git a/test/GeometryTestUtilities.hpp b/test/GeometryTestUtilities.hpp index 0b9ce547ac..c1dc090c1f 100644 --- a/test/GeometryTestUtilities.hpp +++ b/test/GeometryTestUtilities.hpp @@ -2,7 +2,7 @@ #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/DataStructure.hpp" -#include "simplnx/DataStructure/Geometry/IGeometry.hpp" +#include "simplnx/DataStructure/Geometry/AbstractGeometry.hpp" #include @@ -18,31 +18,31 @@ T* createGeom(DataStructure& dataStructure) return output; } -static const IGeometry::SharedVertexList* createVertexList(IGeometry* geom) +static const AbstractGeometry::SharedVertexList* createVertexList(AbstractGeometry* geom) { auto dataStructure = geom->getDataStructure(); auto dataStore = std::make_unique>(std::vector{0}, std::vector{3}, 0.0f); - auto dataArr = IGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), geom->getId()); + auto dataArr = AbstractGeometry::SharedVertexList::Create(*dataStructure, "Vertices", std::move(dataStore), geom->getId()); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } -static const IGeometry::SharedEdgeList* createEdgeList(IGeometry* geom) +static const AbstractGeometry::SharedEdgeList* createEdgeList(AbstractGeometry* geom) { auto dataStructure = geom->getDataStructure(); - auto dataStore = std::make_unique>(std::vector{0}, std::vector{2}, 0); - auto dataArr = IGeometry::SharedEdgeList::Create(*dataStructure, "Edges", std::move(dataStore), geom->getId()); + auto dataStore = std::make_unique>(std::vector{0}, std::vector{2}, 0); + auto dataArr = AbstractGeometry::SharedEdgeList::Create(*dataStructure, "Edges", std::move(dataStore), geom->getId()); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } -static const IGeometry::SharedFaceList* createFaceList(IGeometry* geom) +static const AbstractGeometry::SharedFaceList* createFaceList(AbstractGeometry* geom) { auto dataStructure = geom->getDataStructure(); - auto dataStore = std::make_unique>(std::vector{0}, std::vector{4}, 0); - auto dataArr = IGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), geom->getId()); + auto dataStore = std::make_unique>(std::vector{0}, std::vector{4}, 0); + auto dataArr = AbstractGeometry::SharedFaceList::Create(*dataStructure, "Faces", std::move(dataStore), geom->getId()); REQUIRE(dataArr != nullptr); - return dynamic_cast(dataArr); + return dynamic_cast(dataArr); } } // namespace nx::core diff --git a/test/H5Test.cpp b/test/H5Test.cpp index aa3d9bdcb1..d92aa07e80 100644 --- a/test/H5Test.cpp +++ b/test/H5Test.cpp @@ -1,8 +1,8 @@ #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/AttributeMatrix.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" @@ -104,7 +104,7 @@ DataStructure GetTestDataStructure() } template -DataArray* CreateTestDataArray(const std::string& name, DataStructure& dataStructure, ShapeType tupleShape, ShapeType componentShape, DataObject::IdType parentId) +DataArray* CreateTestDataArray(const std::string& name, DataStructure& dataStructure, ShapeType tupleShape, ShapeType componentShape, AbstractDataObject::IdType parentId) { using DataStoreType = DataStore; using ArrayType = DataArray; @@ -209,7 +209,7 @@ void CreateTriangleGeometry(DataStructure& dataStructure) { // Create a Triangle Geometry DataGroup* geometryGroup = DataGroup::Create(dataStructure, k_TriangleGroupName); - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; auto triangleGeom = TriangleGeom::Create(dataStructure, "[Geometry] Triangle", geometryGroup->getId()); // Create a Path in the DataStructure to place the geometry @@ -223,7 +223,7 @@ void CreateTriangleGeometry(DataStructure& dataStructure) // size these to 1 because the Csv parser will resize them to the appropriate number of typles nx::core::Result result = ArrayCreationUtilities::CreateArray(dataStructure, {faceCount}, {3}, path, IDataAction::Mode::Execute); REQUIRE(result.valid()); - auto* dataArray = dataStructure.getDataAs(path); + auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { throw std::runtime_error(fmt::format("DataPath does not point to a DataArray. DataPath: '{}'", path.toString())); @@ -251,7 +251,7 @@ void CreateQuadGeometry(DataStructure& dataStructure) { // Create a Triangle Geometry DataGroup* geometryGroup = DataGroup::Create(dataStructure, k_QuadGroupName); - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; auto geometry = QuadGeom::Create(dataStructure, "[Geometry] Quad", geometryGroup->getId()); // Create a Path in the DataStructure to place the geometry @@ -265,7 +265,7 @@ void CreateQuadGeometry(DataStructure& dataStructure) // size these to 1 because the Csv parser will resize them to the appropriate number of typles nx::core::Result result = ArrayCreationUtilities::CreateArray(dataStructure, {faceCount}, {4}, path, IDataAction::Mode::Execute); REQUIRE(result.valid()); - auto* dataArray = dataStructure.getDataAs(path); + auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { throw std::runtime_error(fmt::format("DataPath does not point to a DataArray. DataPath: '{}'", path.toString())); @@ -293,7 +293,7 @@ void CreateEdgeGeometry(DataStructure& dataStructure) { // Create a Triangle Geometry DataGroup* geometryGroup = DataGroup::Create(dataStructure, k_EdgeGroupName); - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; auto geometry = EdgeGeom::Create(dataStructure, "[Geometry] Edge", geometryGroup->getId()); // Create a Path in the DataStructure to place the geometry @@ -307,7 +307,7 @@ void CreateEdgeGeometry(DataStructure& dataStructure) // size these to 1 because the Csv parser will resize them to the appropriate number of typles nx::core::Result result = ArrayCreationUtilities::CreateArray(dataStructure, {faceCount}, {2}, path, IDataAction::Mode::Execute); REQUIRE(result.valid()); - auto* dataArray = dataStructure.getDataAs(path); + auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { throw std::runtime_error(fmt::format("DataPath does not point to a DataArray. DataPath: '{}'", path.toString())); @@ -335,7 +335,7 @@ void CreateTetrahedralGeometry(DataStructure& dataStructure) { // Create a Tetrahedral Geometry DataGroup* geometryGroup = DataGroup::Create(dataStructure, k_TetraGroupName); - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; auto geometry = TetrahedralGeom::Create(dataStructure, "[Geometry] Tetrahedral", geometryGroup->getId()); // Create a Path in the DataStructure to place the geometry @@ -349,7 +349,7 @@ void CreateTetrahedralGeometry(DataStructure& dataStructure) // size these to 1 because the Csv parser will resize them to the appropriate number of typles nx::core::Result result = ArrayCreationUtilities::CreateArray(dataStructure, {faceCount}, {4}, path, IDataAction::Mode::Execute); REQUIRE(result.valid()); - auto* dataArray = dataStructure.getDataAs(path); + auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { throw std::runtime_error(fmt::format("DataPath does not point to a DataArray. DataPath: '{}'", path.toString())); @@ -377,7 +377,7 @@ void CreateHexahedralGeometry(DataStructure& dataStructure) { // Create a Hexahedral Geometry DataGroup* geometryGroup = DataGroup::Create(dataStructure, k_HexaGroupName); - using MeshIndexType = IGeometry::MeshIndexType; + using MeshIndexType = AbstractGeometry::MeshIndexType; auto geometry = TetrahedralGeom::Create(dataStructure, "[Geometry] Hexahedral", geometryGroup->getId()); // Create a Path in the DataStructure to place the geometry @@ -391,7 +391,7 @@ void CreateHexahedralGeometry(DataStructure& dataStructure) // size these to 1 because the Csv parser will resize them to the appropriate number of typles nx::core::Result result = ArrayCreationUtilities::CreateArray(dataStructure, {faceCount}, {8}, path, IDataAction::Mode::Execute); REQUIRE(result.valid()); - auto* dataArray = dataStructure.getDataAs(path); + auto* dataArray = dataStructure.getDataAs(path); if(dataArray == nullptr) { throw std::runtime_error(fmt::format("DataPath does not point to a DataArray. DataPath: '{}'", path.toString())); @@ -476,7 +476,7 @@ DataStructure CreateNodeBasedGeometries() struct VertexGeomData { - std::optional verticesId; + std::optional verticesId; bool operator==(const VertexGeomData& rhs) const { @@ -486,8 +486,8 @@ struct VertexGeomData struct EdgeGeomData { - std::optional verticesId; - std::optional edgesId; + std::optional verticesId; + std::optional edgesId; bool operator==(const EdgeGeomData& rhs) const { @@ -497,9 +497,9 @@ struct EdgeGeomData struct TriangleGeomData { - std::optional verticesId; - std::optional edgesId; - std::optional trianglesId; + std::optional verticesId; + std::optional edgesId; + std::optional trianglesId; bool operator==(const TriangleGeomData& rhs) const { @@ -509,9 +509,9 @@ struct TriangleGeomData struct QuadGeomData { - std::optional verticesId; - std::optional edgesId; - std::optional quadsId; + std::optional verticesId; + std::optional edgesId; + std::optional quadsId; bool operator==(const QuadGeomData& rhs) const { @@ -685,7 +685,7 @@ TEST_CASE("ImageGeometryIO") const CreateImageGeometryAction::SpacingType spacing = {1.0f, 1.0f, 1.0f}; DataStructure originalDataStructure; - auto action = CreateImageGeometryAction(imageGeomPath, dims, origin, spacing, cellDataName, IGeometry::LengthUnit::Micrometer); + auto action = CreateImageGeometryAction(imageGeomPath, dims, origin, spacing, cellDataName, AbstractGeometry::LengthUnit::Micrometer); Result<> actionResult = action.apply(originalDataStructure, IDataAction::Mode::Execute); SIMPLNX_RESULT_REQUIRE_VALID(actionResult); @@ -896,7 +896,7 @@ TEST_CASE("xdmf") { DataStructure dataStructure; auto* vertexGeom = VertexGeom::Create(dataStructure, "VertexGeom"); - DataObject::IdType geomId = vertexGeom->getId(); + AbstractDataObject::IdType geomId = vertexGeom->getId(); constexpr usize numVerts = 100; std::random_device randomDevice; std::mt19937 generator(randomDevice()); @@ -1043,7 +1043,7 @@ TEST_CASE("DataStructureAppend") DataStructure exemplarDataStructure = std::move(readResult.value()); usize currentTopLevelSize = baseDataStructure.getTopLevelData().size(); - for(const DataObject* object : exemplarDataStructure.getTopLevelData()) + for(const AbstractDataObject* object : exemplarDataStructure.getTopLevelData()) { REQUIRE(object != nullptr); DataPath path({object->getName()}); @@ -1062,11 +1062,11 @@ TEST_CASE("DataStructureAppend") REQUIRE(appendedDataStructure.containsData(originalArrayPath)); REQUIRE(appendedDataStructure.containsData(path)); - const DataObject& appendedOriginalArray = appendedDataStructure.getDataRef(originalArrayPath); + const AbstractDataObject& appendedOriginalArray = appendedDataStructure.getDataRef(originalArrayPath); REQUIRE(UnitTest::Comparison::CompareDataObject(originalArray, appendedOriginalArray)); - const DataObject& appendedObject = appendedDataStructure.getDataRef(path); - const DataObject& exemplarObject = exemplarDataStructure.getDataRef(path); + const AbstractDataObject& appendedObject = appendedDataStructure.getDataRef(path); + const AbstractDataObject& exemplarObject = exemplarDataStructure.getDataRef(path); REQUIRE(UnitTest::Comparison::CompareDataObject(exemplarObject, appendedObject)); diff --git a/test/PipelineSaveTest.cpp b/test/PipelineSaveTest.cpp index 6ec7aee7cc..cea18a4a3d 100644 --- a/test/PipelineSaveTest.cpp +++ b/test/PipelineSaveTest.cpp @@ -1,4 +1,5 @@ #include "simplnx/Core/Application.hpp" +#include "simplnx/Filter/AbstractFilter.hpp" #include "simplnx/Pipeline/Pipeline.hpp" #include "simplnx/Pipeline/PlaceholderFilter.hpp" @@ -12,7 +13,7 @@ using namespace nx::core; namespace { -class TestFilter : public IFilter +class TestFilter : public AbstractFilter { public: static constexpr Uuid k_ID = *Uuid::FromString("d01ad5c2-6897-4380-89f1-6d0760b78a22"); diff --git a/test/UnitTestCommon/include/simplnx/UnitTest/DataObjectComparison.hpp b/test/UnitTestCommon/include/simplnx/UnitTest/DataObjectComparison.hpp index b478802bb7..46571ecfea 100644 --- a/test/UnitTestCommon/include/simplnx/UnitTest/DataObjectComparison.hpp +++ b/test/UnitTestCommon/include/simplnx/UnitTest/DataObjectComparison.hpp @@ -12,7 +12,7 @@ namespace nx::core::UnitTest::Comparison { -inline bool CompareDataObject(const DataObject& exemplarObject, const DataObject& testObject); +inline bool CompareDataObject(const AbstractDataObject& exemplarObject, const AbstractDataObject& testObject); inline bool CompareBaseGroup(const BaseGroup& exemplarObject, const BaseGroup& testObject) { @@ -28,8 +28,8 @@ inline bool CompareBaseGroup(const BaseGroup& exemplarObject, const BaseGroup& t { return false; } - const DataObject* exemplarChild = exemplarObject[childName]; - const DataObject* testChild = testObject[childName]; + const AbstractDataObject* exemplarChild = exemplarObject[childName]; + const AbstractDataObject* testChild = testObject[childName]; // Recursive. Could have issues with a deeply nested DataStructure if(!CompareDataObject(*exemplarChild, *testChild)) { @@ -40,12 +40,12 @@ inline bool CompareBaseGroup(const BaseGroup& exemplarObject, const BaseGroup& t return true; } -inline bool CompareIArray(const IArray& exemplarObject, const IArray& testObject) +inline bool CompareIArray(const AbstractArray& exemplarObject, const AbstractArray& testObject) { return testObject.getTupleShape() == exemplarObject.getTupleShape() && testObject.getComponentShape() == exemplarObject.getComponentShape(); } -inline bool CompareINeighborList(const INeighborList& exemplarObject, const INeighborList& testObject) +inline bool CompareINeighborList(const AbstractNeighborList& exemplarObject, const AbstractNeighborList& testObject) { if(testObject.getDataType() != exemplarObject.getDataType()) { @@ -73,13 +73,13 @@ bool CompareNeighborListValues(const NeighborList& exemplarObject, const Neig struct CompareNeighborListFunctor { template - bool operator()(const INeighborList& exemplarObject, const INeighborList& testObject) const + bool operator()(const AbstractNeighborList& exemplarObject, const AbstractNeighborList& testObject) const { return CompareNeighborListValues(dynamic_cast&>(exemplarObject), dynamic_cast&>(testObject)); } }; -inline bool CompareNeighborList(const INeighborList& exemplarObject, const INeighborList& testObject) +inline bool CompareNeighborList(const AbstractNeighborList& exemplarObject, const AbstractNeighborList& testObject) { if(!CompareINeighborList(exemplarObject, testObject)) { @@ -91,7 +91,7 @@ inline bool CompareNeighborList(const INeighborList& exemplarObject, const INeig return ExecuteNeighborFunction(CompareNeighborListFunctor{}, dataType, exemplarObject, testObject); } -inline bool CompareIDataArray(const IDataArray& exemplarObject, const IDataArray& testObject) +inline bool CompareIDataArray(const AbstractDataArray& exemplarObject, const AbstractDataArray& testObject) { if(testObject.getDataType() != exemplarObject.getDataType()) { @@ -119,13 +119,13 @@ bool CompareDataArrayValues(const DataArray& exemplarObject, const DataArray< struct CompareDataArrayFunctor { template - bool operator()(const IDataArray& exemplarObject, const IDataArray& testObject) const + bool operator()(const AbstractDataArray& exemplarObject, const AbstractDataArray& testObject) const { return CompareDataArrayValues(dynamic_cast&>(exemplarObject), dynamic_cast&>(testObject)); } }; -inline bool CompareDataArray(const IDataArray& exemplarObject, const IDataArray& testObject) +inline bool CompareDataArray(const AbstractDataArray& exemplarObject, const AbstractDataArray& testObject) { if(!CompareIDataArray(exemplarObject, testObject)) { @@ -166,7 +166,7 @@ inline bool CompareAttributeMatrix(const AttributeMatrix& exemplarObject, const return CompareBaseGroup(exemplarObject, testObject); } -inline bool CheckOptionalObject(const DataObject* exemplarObject, const DataObject* testObject) +inline bool CheckOptionalObject(const AbstractDataObject* exemplarObject, const AbstractDataObject* testObject) { if((exemplarObject == nullptr && testObject != nullptr) || (exemplarObject != nullptr && testObject == nullptr)) { @@ -179,7 +179,7 @@ inline bool CheckOptionalObject(const DataObject* exemplarObject, const DataObje return true; } -inline bool CompareIGeometry(const IGeometry& exemplarObject, const IGeometry& testObject) +inline bool CompareIGeometry(const AbstractGeometry& exemplarObject, const AbstractGeometry& testObject) { if(exemplarObject.getSpatialDimensionality() != testObject.getSpatialDimensionality()) { @@ -201,7 +201,7 @@ inline bool CompareIGeometry(const IGeometry& exemplarObject, const IGeometry& t return CompareBaseGroup(exemplarObject, testObject); } -inline bool CompareIGridGeometry(const IGridGeometry& exemplarObject, const IGridGeometry& testObject) +inline bool CompareIGridGeometry(const AbstractGridGeometry& exemplarObject, const AbstractGridGeometry& testObject) { if(testObject.getDimensions() != exemplarObject.getDimensions()) { @@ -249,7 +249,7 @@ inline bool CompareRectGridGeom(const RectGridGeom& exemplarObject, const RectGr return CompareIGridGeometry(exemplarObject, testObject); } -inline bool CompareINodeGeometry0D(const INodeGeometry0D& exemplarObject, const INodeGeometry0D& testObject) +inline bool CompareINodeGeometry0D(const AbstractNodeGeometry0D& exemplarObject, const AbstractNodeGeometry0D& testObject) { if(!CheckOptionalObject(exemplarObject.getVertices(), testObject.getVertices())) { @@ -267,7 +267,7 @@ inline bool CompareVertexGeom(const VertexGeom& exemplarObject, const VertexGeom return CompareINodeGeometry0D(exemplarObject, testObject); } -inline bool CompareINodeGeometry1D(const INodeGeometry1D& exemplarObject, const INodeGeometry1D& testObject) +inline bool CompareINodeGeometry1D(const AbstractNodeGeometry1D& exemplarObject, const AbstractNodeGeometry1D& testObject) { if(!CheckOptionalObject(exemplarObject.getEdges(), testObject.getEdges())) { @@ -298,7 +298,7 @@ inline bool CompareEdgeGeom(const EdgeGeom& exemplarObject, const EdgeGeom& test return CompareINodeGeometry1D(exemplarObject, testObject); } -inline bool CompareINodeGeometry2D(const INodeGeometry2D& exemplarObject, const INodeGeometry2D& testObject) +inline bool CompareINodeGeometry2D(const AbstractNodeGeometry2D& exemplarObject, const AbstractNodeGeometry2D& testObject) { if(!CheckOptionalObject(exemplarObject.getFaces(), testObject.getFaces())) { @@ -326,7 +326,7 @@ inline bool CompareQuadGeom(const QuadGeom& exemplarObject, const QuadGeom& test return CompareINodeGeometry2D(exemplarObject, testObject); } -inline bool CompareINodeGeometry3D(const INodeGeometry3D& exemplarObject, const INodeGeometry3D& testObject) +inline bool CompareINodeGeometry3D(const AbstractNodeGeometry3D& exemplarObject, const AbstractNodeGeometry3D& testObject) { if(!CheckOptionalObject(exemplarObject.getPolyhedra(), testObject.getPolyhedra())) { @@ -354,14 +354,14 @@ inline bool CompareHexahedralGeom(const HexahedralGeom& exemplarObject, const He return CompareINodeGeometry3D(exemplarObject, testObject); } -inline bool CompareDataObject(const DataObject& exemplarObject, const DataObject& testObject) +inline bool CompareDataObject(const AbstractDataObject& exemplarObject, const AbstractDataObject& testObject) { if(testObject.getName() != exemplarObject.getName()) { return false; } - DataObject::Type testObjectType = testObject.getDataObjectType(); + AbstractDataObject::Type testObjectType = testObject.getDataObjectType(); if(testObjectType != testObject.getDataObjectType()) { @@ -375,44 +375,44 @@ inline bool CompareDataObject(const DataObject& exemplarObject, const DataObject switch(testObjectType) { - case DataObject::Type::AttributeMatrix: { + case IDataObject::Type::AttributeMatrix: { return CompareAttributeMatrix(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::DataGroup: { + case IDataObject::Type::DataGroup: { return CompareBaseGroup(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::DataArray: { - return CompareDataArray(dynamic_cast(exemplarObject), dynamic_cast(testObject)); + case IDataObject::Type::DataArray: { + return CompareDataArray(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::TetrahedralGeom: { + case IDataObject::Type::TetrahedralGeom: { return CompareTetrahedralGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::HexahedralGeom: { + case IDataObject::Type::HexahedralGeom: { return CompareHexahedralGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::TriangleGeom: { + case IDataObject::Type::TriangleGeom: { return CompareTriangleGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::QuadGeom: { + case IDataObject::Type::QuadGeom: { return CompareQuadGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::EdgeGeom: { + case IDataObject::Type::EdgeGeom: { return CompareEdgeGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::VertexGeom: { + case IDataObject::Type::VertexGeom: { return CompareVertexGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::ImageGeom: { + case IDataObject::Type::ImageGeom: { return CompareImageGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::RectGridGeom: { + case IDataObject::Type::RectGridGeom: { return CompareRectGridGeom(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::StringArray: { + case IDataObject::Type::StringArray: { return CompareStringArray(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } - case DataObject::Type::NeighborList: { - return CompareNeighborList(dynamic_cast(exemplarObject), dynamic_cast(testObject)); + case IDataObject::Type::NeighborList: { + return CompareNeighborList(dynamic_cast(exemplarObject), dynamic_cast(testObject)); } default: { throw std::runtime_error(fmt::format("Equality not implemented for {}", testObject.getTypeName())); diff --git a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp index 08585e74d2..457ea41520 100644 --- a/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp +++ b/test/UnitTestCommon/include/simplnx/UnitTest/UnitTestCommon.hpp @@ -3,8 +3,8 @@ #include "simplnx/Common/Result.hpp" #include "simplnx/Common/StringLiteral.hpp" #include "simplnx/Core/Application.hpp" +#include "simplnx/DataStructure/AbstractDataObject.hpp" #include "simplnx/DataStructure/DataGroup.hpp" -#include "simplnx/DataStructure/DataObject.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/DataStructure/Geometry/EdgeGeom.hpp" @@ -413,13 +413,13 @@ inline void CompareImageGeometry(const DataStructure& dataStructure, const DataP * @param geom2 * @returns bool true if equivalent */ -inline bool CompareIGeometry(const IGeometry* geom1, const IGeometry* geom2) +inline bool CompareIGeometry(const AbstractGeometry* geom1, const AbstractGeometry* geom2) { REQUIRE(geom1->getGeomType() == geom2->getGeomType()); REQUIRE(geom1->getSpatialDimensionality() == geom2->getSpatialDimensionality()); REQUIRE(geom1->getUnitDimensionality() == geom2->getUnitDimensionality()); REQUIRE(geom1->getNumberOfCells() == geom2->getNumberOfCells()); - REQUIRE(geom1->findAllChildrenOfType().size() == geom2->findAllChildrenOfType().size()); + REQUIRE(geom1->findAllChildrenOfType().size() == geom2->findAllChildrenOfType().size()); REQUIRE(geom1->getParametricCenter() == geom2->getParametricCenter()); return true; @@ -456,13 +456,13 @@ inline void CompareMontage(const AbstractMontage& exemplar, const AbstractMontag } /** - * @brief Compares IDataArray + * @brief Compares AbstractDataArray * @tparam T * @param left * @param right */ template -void CompareDataArrays(const IDataArray& left, const IDataArray& right, usize start = 0) +void CompareDataArrays(const AbstractDataArray& left, const AbstractDataArray& right, usize start = 0) { const auto& oldDataStore = left.template getIDataStoreRefAs>(); const auto& newDataStore = right.template getIDataStoreRefAs>(); @@ -504,7 +504,7 @@ void CompareDataArrays(const IDataArray& left, const IDataArray& right, usize st struct CompareArraysFunctor { template - void operator()(const IDataArray& left, const IDataArray& right) const + void operator()(const AbstractDataArray& left, const AbstractDataArray& right) const { CompareDataArrays(left, right); } @@ -519,7 +519,7 @@ struct CompareArraysFunctor * @param component */ template -void CompareDataArraysByComponent(const IDataArray& left, const IDataArray& right, const usize startTuple = 0, const usize component = 0) +void CompareDataArraysByComponent(const AbstractDataArray& left, const AbstractDataArray& right, const usize startTuple = 0, const usize component = 0) { const auto& oldDataStore = left.template getIDataStoreRefAs>(); const auto& newDataStore = right.template getIDataStoreRefAs>(); @@ -698,7 +698,7 @@ void CompareNeighborListFloatArraysWithNans(const DataStructure& dataStructure, * @param computedData */ template -void CompareNeighborLists(const INeighborList* exemplaryData, const INeighborList* computedData) +void CompareNeighborLists(const AbstractNeighborList* exemplaryData, const AbstractNeighborList* computedData) { if constexpr(std::is_same_v) { @@ -794,7 +794,7 @@ void CompareNeighborLists(const DataStructure& dataStructure, const DataPath& ex struct CompareNeighborListsFunctor { template - void operator()(const INeighborList* left, const INeighborList* right) const + void operator()(const AbstractNeighborList* left, const AbstractNeighborList* right) const { CompareNeighborLists(left, right); } @@ -893,10 +893,10 @@ void CompareDynamicListArrays(const DataStructure& dataStructure, const DataPath } template -void CompareArrays(const IArray* generatedArray, const IArray* exemplarArray) +void CompareArrays(const AbstractArray* generatedArray, const AbstractArray* exemplarArray) { - const IArray::ArrayType arrayType = generatedArray->getArrayType(); - const IArray::ArrayType exemplarArrayType = exemplarArray->getArrayType(); + const AbstractArray::ArrayType arrayType = generatedArray->getArrayType(); + const AbstractArray::ArrayType exemplarArrayType = exemplarArray->getArrayType(); if(arrayType != exemplarArrayType) { std::cout << fmt::format("Generated array {} and exemplar array {} do not have the same array type: {} vs {}. Data Will not be compared.", generatedArray->getName(), exemplarArray->getName(), @@ -906,10 +906,10 @@ void CompareArrays(const IArray* generatedArray, const IArray* exemplarArray) } DataType type; - if(arrayType == IArray::ArrayType::DataArray) + if(arrayType == AbstractArray::ArrayType::DataArray) { - const auto* generatedDataArray = dynamic_cast(generatedArray); - const auto* exemplarDataArray = dynamic_cast(exemplarArray); + const auto* generatedDataArray = dynamic_cast(generatedArray); + const auto* exemplarDataArray = dynamic_cast(exemplarArray); type = generatedDataArray->getDataType(); DataType exemplarType = exemplarDataArray->getDataType(); @@ -922,10 +922,10 @@ void CompareArrays(const IArray* generatedArray, const IArray* exemplarArray) } CompareDataArrays(*exemplarDataArray, *generatedDataArray); } - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - const auto* generatedDataArray = dynamic_cast(generatedArray); - const auto* exemplarDataArray = dynamic_cast(exemplarArray); + const auto* generatedDataArray = dynamic_cast(generatedArray); + const auto* exemplarDataArray = dynamic_cast(exemplarArray); type = generatedDataArray->getDataType(); DataType exemplarType = exemplarDataArray->getDataType(); if(type != exemplarType) @@ -937,7 +937,7 @@ void CompareArrays(const IArray* generatedArray, const IArray* exemplarArray) } CompareNeighborLists(exemplarDataArray, generatedDataArray); } - if(arrayType == IArray::ArrayType::StringArray) + if(arrayType == AbstractArray::ArrayType::StringArray) { const auto* generatedDataArray = dynamic_cast(generatedArray); const auto* exemplarDataArray = dynamic_cast(exemplarArray); @@ -1018,8 +1018,8 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat } case nx::core::BaseGroup::GroupType::HexahedralGeom: case nx::core::BaseGroup::GroupType::TetrahedralGeom: { - const auto* geomA = dynamic_cast(parentA); - const auto* geomB = dynamic_cast(parentB); + const auto* geomA = dynamic_cast(parentA); + const auto* geomB = dynamic_cast(parentB); REQUIRE(geomA != nullptr); REQUIRE(geomB != nullptr); REQUIRE(geomA->getVertices() != nullptr); @@ -1041,8 +1041,8 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat } case nx::core::BaseGroup::GroupType::QuadGeom: case nx::core::BaseGroup::GroupType::TriangleGeom: { - const auto* geomA = dynamic_cast(parentA); - const auto* geomB = dynamic_cast(parentB); + const auto* geomA = dynamic_cast(parentA); + const auto* geomB = dynamic_cast(parentB); REQUIRE(geomA != nullptr); REQUIRE(geomB != nullptr); REQUIRE(geomA->getVertices() != nullptr); @@ -1105,33 +1105,33 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat REQUIRE(childrenNamesA[i] == childrenNamesB[i]); DataPath childPath = parentGroup.createChildPath(childrenNamesA[i]); - const DataObject* objectA = dataStructureA.getData(childPath); - const DataObject* objectB = dataStructureB.getData(childPath); + const AbstractDataObject* objectA = dataStructureA.getData(childPath); + const AbstractDataObject* objectB = dataStructureB.getData(childPath); REQUIRE(objectA != nullptr); REQUIRE(objectB != nullptr); - const DataObject::Type objectADataObjectType = objectA->getDataObjectType(); + const AbstractDataObject::Type objectADataObjectType = objectA->getDataObjectType(); REQUIRE(objectADataObjectType == objectB->getDataObjectType()); switch(objectADataObjectType) { - case nx::core::DataObject::Type::DynamicListArray: { + case nx::core::IDataObject::Type::DynamicListArray: { // TODO: ?? break; } - case nx::core::DataObject::Type::ScalarData: { + case nx::core::IDataObject::Type::ScalarData: { // TODO: ?? std::cout << objectA->getTypeName() << ": " << objectA->getName() << std::endl; break; } - case nx::core::DataObject::Type::AbstractMontage: { + case nx::core::IDataObject::Type::AbstractMontage: { // TODO: ?? break; } - case nx::core::DataObject::Type::IDataArray: - case nx::core::DataObject::Type::DataArray: { - const auto* dataArrayA = dynamic_cast(objectA); - const auto* dataArrayB = dynamic_cast(objectB); + case nx::core::IDataObject::Type::AbstractDataArray: + case nx::core::IDataObject::Type::DataArray: { + const auto* dataArrayA = dynamic_cast(objectA); + const auto* dataArrayB = dynamic_cast(objectB); REQUIRE(dataArrayA != nullptr); REQUIRE(dataArrayB != nullptr); REQUIRE(dataArrayA->getDataType() == dataArrayB->getDataType()); @@ -1142,7 +1142,7 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat break; } - case nx::core::DataObject::Type::StringArray: { + case nx::core::IDataObject::Type::StringArray: { const auto* stringArrayA = dynamic_cast(objectA); const auto* stringArrayB = dynamic_cast(objectB); REQUIRE(stringArrayA != nullptr); @@ -1150,10 +1150,10 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat CompareStringArrays(*stringArrayA, *stringArrayB); break; } - case nx::core::DataObject::Type::INeighborList: - case nx::core::DataObject::Type::NeighborList: { - const auto* neighborlistA = dynamic_cast(objectA); - const auto* neighborlistB = dynamic_cast(objectB); + case nx::core::IDataObject::Type::AbstractNeighborList: + case nx::core::IDataObject::Type::NeighborList: { + const auto* neighborlistA = dynamic_cast(objectA); + const auto* neighborlistB = dynamic_cast(objectB); REQUIRE(neighborlistA != nullptr); REQUIRE(neighborlistB != nullptr); // std::cout << "DEBUG TEST: neighborlist array A DataType = " << DataTypeToString(neighborlistA->getDataType()) << "\tneighborlist B DataType = " << @@ -1165,19 +1165,19 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat break; } - case nx::core::DataObject::Type::VertexGeom: - case nx::core::DataObject::Type::EdgeGeom: - case nx::core::DataObject::Type::RectGridGeom: - case nx::core::DataObject::Type::ImageGeom: - case nx::core::DataObject::Type::INodeGeometry2D: - case nx::core::DataObject::Type::QuadGeom: - case nx::core::DataObject::Type::TriangleGeom: - case nx::core::DataObject::Type::INodeGeometry3D: - case nx::core::DataObject::Type::HexahedralGeom: - case nx::core::DataObject::Type::TetrahedralGeom: - case nx::core::DataObject::Type::AttributeMatrix: - case nx::core::DataObject::Type::DataGroup: - case nx::core::DataObject::Type::BaseGroup: { + case nx::core::IDataObject::Type::VertexGeom: + case nx::core::IDataObject::Type::EdgeGeom: + case nx::core::IDataObject::Type::RectGridGeom: + case nx::core::IDataObject::Type::ImageGeom: + case nx::core::IDataObject::Type::AbstractNodeGeometry2D: + case nx::core::IDataObject::Type::QuadGeom: + case nx::core::IDataObject::Type::TriangleGeom: + case nx::core::IDataObject::Type::AbstractNodeGeometry3D: + case nx::core::IDataObject::Type::HexahedralGeom: + case nx::core::IDataObject::Type::TetrahedralGeom: + case nx::core::IDataObject::Type::AttributeMatrix: + case nx::core::IDataObject::Type::DataGroup: + case nx::core::IDataObject::Type::BaseGroup: { CompareDataStructures(dataStructureA, dataStructureB, childPath); break; } @@ -1206,11 +1206,11 @@ inline void CompareDataStructures(const DataStructure& dataStructureA, const Dat * @param tupleShape The tuple dimensions of the data. If you want to mimic an image then your shape should be {height, width} slowest to fastest dimension * @param componentShape The component dimensions of the data. If you want to mimic an RGB image then your component would be {3}, * if you want to store a 3Rx4C matrix then it would be {3, 4}. - * @param parentId The DataObject that will own the DataArray instance. + * @param parentId The AbstractDataObject that will own the DataArray instance. * @return */ template -DataArray* CreateTestDataArray(DataStructure& dataStructure, const std::string& name, const ShapeType& tupleShape, const ShapeType& componentShape, DataObject::IdType parentId = {}) +DataArray* CreateTestDataArray(DataStructure& dataStructure, const std::string& name, const ShapeType& tupleShape, const ShapeType& componentShape, AbstractDataObject::IdType parentId = {}) { using DataStoreType = DataStore; using ArrayType = DataArray; @@ -1221,7 +1221,7 @@ DataArray* CreateTestDataArray(DataStructure& dataStructure, const std::strin } template -NeighborList* CreateTestNeighborList(DataStructure& dataStructure, const std::string& name, usize numTuples, DataObject::IdType parentId) +NeighborList* CreateTestNeighborList(DataStructure& dataStructure, const std::string& name, usize numTuples, AbstractDataObject::IdType parentId) { using NeighborListType = NeighborList; auto* neighborList = NeighborListType::Create(dataStructure, name, {numTuples}, parentId); @@ -1368,8 +1368,8 @@ inline void CompareExemplarToGenerateAttributeMatrix(const DataStructure& exempl DataPath computedDataArrayPath = computedAttributeMatrix.createChildPath(exemplarArrayPath.second->getName()); INFO(fmt::format("Exemplar Array:'{}' Computed Array: '{}'", exemplarDataArrayPath.toString(), computedDataArrayPath.toString())); - const auto* exemplarArrayPtr = exemplarDataStructure.getDataAs(exemplarDataArrayPath); - const auto* computedArrayPtr = computedDataStructure.getDataAs(computedDataArrayPath); + const auto* exemplarArrayPtr = exemplarDataStructure.getDataAs(exemplarDataArrayPath); + const auto* computedArrayPtr = computedDataStructure.getDataAs(computedDataArrayPath); // Check to see if there is something to compare against in the exemplar file. if(nullptr == exemplarArrayPtr && !allMustMatch) @@ -1388,14 +1388,14 @@ inline void CompareExemplarToGenerateAttributeMatrix(const DataStructure& exempl } DataType type = DataType::int8; - const IArray::ArrayType arrayType = computedArrayPtr->getArrayType(); - if(arrayType == IArray::ArrayType::DataArray) + const AbstractArray::ArrayType arrayType = computedArrayPtr->getArrayType(); + if(arrayType == AbstractArray::ArrayType::DataArray) { - type = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath).getDataType(); + type = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath).getDataType(); } - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - type = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath).getDataType(); + type = exemplarDataStructure.getDataRefAs(exemplarDataArrayPath).getDataType(); } switch(type) @@ -1465,12 +1465,12 @@ inline void CompareExemplarToGeneratedData(const DataStructure& dataStructure, c for(const auto& cellArrayPath : selectedCellArrays) { - const auto* generatedArray = dataStructure.getDataAs(cellArrayPath); + const auto* generatedArray = dataStructure.getDataAs(cellArrayPath); // Now generate the path to the exemplar data set in the exemplar data structure. std::vector generatedPathVector = cellArrayPath.getPathVector(); generatedPathVector[0] = exemplarDataContainerName; DataPath exemplarDataArrayPath(generatedPathVector); - const auto* exemplarArray = exemplarDataStructure.getDataAs(exemplarDataArrayPath); + const auto* exemplarArray = exemplarDataStructure.getDataAs(exemplarDataArrayPath); // Check to see if there is something to compare against in the exemplar file. if(nullptr == exemplarArray) @@ -1479,14 +1479,14 @@ inline void CompareExemplarToGeneratedData(const DataStructure& dataStructure, c } DataType type = DataType::int8; - const IArray::ArrayType arrayType = generatedArray->getArrayType(); - if(arrayType == IArray::ArrayType::DataArray) + const AbstractArray::ArrayType arrayType = generatedArray->getArrayType(); + if(arrayType == AbstractArray::ArrayType::DataArray) { - type = dataStructure.getDataRefAs(cellArrayPath).getDataType(); + type = dataStructure.getDataRefAs(cellArrayPath).getDataType(); } - if(arrayType == IArray::ArrayType::NeighborListArray) + if(arrayType == AbstractArray::ArrayType::NeighborListArray) { - type = dataStructure.getDataRefAs(cellArrayPath).getDataType(); + type = dataStructure.getDataRefAs(cellArrayPath).getDataType(); } switch(type) @@ -1654,7 +1654,7 @@ inline DataStructure CreateComplexMultiLevelDataGraph() inline void CheckArraysInheritTupleDims(const DataStructure& dataStructure, const std::vector& ignoredPaths = {}) { - std::optional> amPathsOpt = GetAllChildDataPathsRecursive(dataStructure, {}, DataObject::Type::AttributeMatrix); + std::optional> amPathsOpt = GetAllChildDataPathsRecursive(dataStructure, {}, IDataObject::Type::AttributeMatrix); REQUIRE(amPathsOpt.has_value()); for(const auto& amPath : amPathsOpt.value()) { @@ -1663,7 +1663,7 @@ inline void CheckArraysInheritTupleDims(const DataStructure& dataStructure, cons REQUIRE(daPathsOpt.has_value()); for(const auto& daPath : daPathsOpt.value()) { - const auto& arr = dataStructure.getDataAs(daPath); + const auto& arr = dataStructure.getDataAs(daPath); REQUIRE(attrMatrix.getShape() == arr->getTupleShape()); } } diff --git a/wrapping/python/CxPybind/CxPybind/CxPybind.hpp b/wrapping/python/CxPybind/CxPybind/CxPybind.hpp index 167ecbf8ec..2888d0a586 100644 --- a/wrapping/python/CxPybind/CxPybind/CxPybind.hpp +++ b/wrapping/python/CxPybind/CxPybind/CxPybind.hpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -146,7 +147,7 @@ class PythonPlugin; class Internals { public: - static inline constexpr StringLiteral k_Key = "SIMPLNX_INTERNAL"; + static constexpr StringLiteral k_Key = "SIMPLNX_INTERNAL"; Internals() : m_App(Application::GetOrCreateInstance()) @@ -391,7 +392,7 @@ auto BindFilter(py::handle scope, const Internals& internals) { using namespace pybind11::literals; - py::class_ filter(scope, FilterTraits::className.c_str()); + py::class_ filter(scope, FilterTraits::className.c_str()); filter.def(py::init<>()); { @@ -517,13 +518,13 @@ inline auto MakeAtomicBoolProxyGuard(std::shared_ptr& proxy) return MakeScopeGuard([&proxy]() noexcept { proxy->reset(); }); } -class PyFilter : public IFilter +class PyFilter : public AbstractFilter { public: PyFilter() = delete; PyFilter(py::object object) - : IFilter() + : AbstractFilter() , m_Object(std::move(object)) { py::gil_scoped_acquire gil;