Skip to content

API: Major refactoring of all codes to use a strict COM style of Interface/AbstractBaseClass, Concrete Class#1537

Draft
imikejackson wants to merge 12 commits intoBlueQuartzSoftware:developfrom
imikejackson:topic/api_rewriting_interface
Draft

API: Major refactoring of all codes to use a strict COM style of Interface/AbstractBaseClass, Concrete Class#1537
imikejackson wants to merge 12 commits intoBlueQuartzSoftware:developfrom
imikejackson:topic/api_rewriting_interface

Conversation

@imikejackson
Copy link
Contributor

Major Refactoring of the SIMPLNX code base

The point of this PR is to create pure virtual Interfaces, Abstract classes and concreate classes where needed. Extract pure virtual where needed and create the intermediate abstract clases where needed. The entire point of this exercise is to create a clean COM style of interface for outsiders to use.

Phase 1:

  • Add Code_Review/Phase1_Interface_Review.md documenting existing interface class usage across the codebase.

Phase 2:

-Extract ISegmentFeatures interface from SegmentFeatures and rename to AbstractSegmentFeatures. ISegmentFeatures defines the pure virtual contract (execute, getSeed, determineGrouping, randomizeFeatureIds, initializeStaticVoxelSeedGenerator) along with SeedGenerator, NeighborScheme, and CompareFunctor types. AbstractSegmentFeatures provides the concrete implementations and inherits from ISegmentFeatures. All subclasses (ScalarSegmentFeatures, EBSDSegmentFeatures, CAxisSegmentFeatures) updated to inherit from AbstractSegmentFeatures.

Also includes: IParallelAlgorithm renamed to ParallelAlgorithm, MaskCompare utilities updates, and various algorithm fixes from the develop branch.

@imikejackson imikejackson marked this pull request as draft February 19, 2026 00:45
@imikejackson imikejackson force-pushed the topic/api_rewriting_interface branch 4 times, most recently from 49b13be to 659b1d4 Compare February 19, 2026 19:02
imikejackson and others added 11 commits February 19, 2026 14:03
Phase 1: Add Code_Review/Phase1_Interface_Review.md documenting existing
interface class usage across the codebase.

Phase 2: Extract ISegmentFeatures interface from SegmentFeatures and
rename to AbstractSegmentFeatures. ISegmentFeatures defines the pure
virtual contract (execute, getSeed, determineGrouping, randomizeFeatureIds,
initializeStaticVoxelSeedGenerator) along with SeedGenerator, NeighborScheme,
and CompareFunctor types. AbstractSegmentFeatures provides the concrete
implementations and inherits from ISegmentFeatures. All subclasses
(ScalarSegmentFeatures, EBSDSegmentFeatures, CAxisSegmentFeatures) updated
to inherit from AbstractSegmentFeatures.

Also includes: IParallelAlgorithm renamed to ParallelAlgorithm, MaskCompare
utilities updates, and various algorithm fixes from the develop branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 22e0b2d)
…r interface

Transform IFilter from an abstract base class into a pure virtual interface.
Create AbstractFilter to hold all concrete implementations (preflight,
execute, toJson, fromJson, defaultTags, getDefaultArguments) and the
template method pattern (preflightImpl/executeImpl). All ~300 concrete
filters now inherit from AbstractFilter. Nested types (Message,
MessageHandler, PreflightResult, ExecuteResult, etc.) remain on IFilter
as the public API contract, minimizing changes to algorithm/utility code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add pure IPipelineNode interface defining the public contract for all
pipeline nodes (identity, operations, state queries). Signal/observer
mechanisms stay on AbstractPipelineNode since they use AbstractPipelineNode*
in callbacks. NodeType enum and RenamedPath/RenamedPaths types move to the
interface but remain accessible via inheritance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  New files created:
  - src/simplnx/Plugin/IPlugin.hpp - Pure interface with all 11 public methods as pure virtual (getName, getDescription, getId,
  getVendor, containsFilterId, createFilter, getFilterHandles, getFilterCount, getDataIOManagers, getSimplToSimplnxMap,
  setOocTempDirectory), plus the 6 nested types (IdType, FilterContainerType, IOManagerPointer, IOManagersContainerType, SIMPLData,
  SIMPLMapType)
  - src/simplnx/Plugin/IPlugin.cpp - Destructor-only implementation

  Files modified:
  - src/simplnx/Plugin/AbstractPlugin.hpp - Now inherits from IPlugin, removed all type aliases and SIMPLData struct (moved to
  interface, still accessible via inheritance), added override to all 11 overriding methods
  - CMakeLists.txt - Added IPlugin.hpp to both header lists and IPlugin.cpp to sources
  - src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp - Added IPlugin include, pybind11 binding, and registered AbstractPlugin as
  inheriting from IPlugin

  Files requiring NO changes:
  - All 8 plugin classes (SimplnxCore, OrientationAnalysis, ITK, TestOne, TestTwo, SimplnxReview, TestPlugin, PythonPlugin) - they
  inherit AbstractPlugin, no change needed
  - PluginLoader, FilterList, Application, Preferences - use AbstractPlugin* which still works
  - CreatePluginFunc/DestroyPluginFunc typedefs and SIMPLNX_DEF_PLUGIN_IMPL macro - stay on AbstractPlugin.hpp
  - All DREAM3DNX files - use AbstractPlugin*
…interfaces

Renamed 6 geometry classes from I* to Abstract* prefix and extracted
standalone pure virtual interfaces above them:
- IGeometry → AbstractGeometry (+ new IGeometry interface)
- IGridGeometry → AbstractGridGeometry (+ new IGridGeometry interface)
- INodeGeometry0D-3D → AbstractNodeGeometry0D-3D (+ new interfaces)

Interfaces are standalone (no inheritance hierarchy) to avoid diamond
inheritance. Type aliases, enums, and string constants live on the
interfaces so scope resolution (e.g. IGeometry::Type) works unchanged.
k_TypeName strings preserved for serialization compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Created IDataStructure pure virtual interface with all non-template
public methods from DataStructure. DataStructure now inherits from
IDataStructure with override on all implemented methods. Template
convenience methods (getDataAs, getDataRefAs, etc.) remain on
DataStructure only since C++ templates cannot be virtual.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…diagram

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nterfaces

Move concrete method implementations from IDataStore (getSize, size,
empty, getDataFormat) and IListStore (size) down to their respective
Abstract* template classes. All three interfaces now have only pure
virtual methods. Updated class hierarchy diagram and review document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move toJson(), fromJson(), construct() implementations and
toJsonImpl()/fromJsonImpl() template-method hooks from IParameter
down to AbstractParameter. IParameter is now a pure interface with
14 pure virtual methods and zero concrete methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ect hierarchy

- Extract IArrayThreshold pure interface, rename old class to AbstractArrayThreshold
- Refactor IJsonPipelineParser to pure interface, create AbstractJsonPipelineParser
- Rename IArray -> AbstractArray (k_TypeName "IArray" preserved for serialization)
- Rename IDataArray -> AbstractDataArray (k_TypeName "IDataArray" preserved)
- Rename INeighborList -> AbstractNeighborList (k_TypeName "INeighborList" preserved)
- Update DataObject::Type enum members (numeric values unchanged)
- Update Phase_8_Interface_Review.md and Phase_8_Class_Hierarchy.dot
- All 1106/1107 tests pass (1 expected failure: ExecuteProcessFilter)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… remove dead JSON code

Phase 12: Renamed IDataIOManager to AbstractDataIOManager across 14 source files
and CMakeLists.txt. The class has 3 data members, ~9 concrete methods, and only
1 pure virtual (formatName()), so it is an abstract base class, not a pure interface.

Phase 13: Removed the dead src/simplnx/Utilities/Parsing/JSON/ directory (15 files)
which was not compiled (absent from CMakeLists.txt) and not referenced from any
compiled source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@imikejackson imikejackson force-pushed the topic/api_rewriting_interface branch from 659b1d4 to e9353d2 Compare February 19, 2026 19:03
…lasses

Add IArray, IDataArray, and INeighborList as aliases for AbstractArray,
AbstractDataArray, and AbstractNeighborList in the Python bindings so
existing scripts continue to work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments