[vtk-developers] Multiple inheritance

Todd Martin nztoddler at yahoo.com
Mon Jul 2 01:44:22 EDT 2018


Single inheritance languages like Java and C# utilize interfaces extensively. Python 2.7+ handles the same concept with abstract base classes, ABCs.

Is there any interest in supporting interfaces in VTK via multiple inheritance from abstract classes (which do not inherit from vtkObject) while retaining the single inheritance model?

In my view there are good reasons to do so. For example vtkCell has methods like GetNumberOfEdges(), GetEdge(), GetNumberOfFaces(), GetFace() etc. which really only apply to multi-dimensional cells (both linear and non-linear); i.e. not points and lines. These methods are forced on the base class design by a single inheritance structure and the linear/non-linear cell sub-types. In my view it would be better if they were distributed across the sub-classes via the concept of interfaces. So I'm suggesting a limited use of multiple inheritance here, not a free-for-all approach. What do others think about this?

For an example please see this merge request Add missing size hints and bug fix point arrays for non-linear cells (!4372) · Merge Requests · VTK / VTK

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
Add missing size hints and bug fix point arrays for non-linear cells (!4...

I've added size hints for concrete public methods GetParametricCoords(), GetEdgePoints() and GetFacePoints() in ...
 |

 |

 |




Todd Martin, PhD.
Freelance Engineer/Software Architect.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20180702/16885903/attachment.html>


More information about the vtk-developers mailing list