Using std::vector<> (and other goodies) in the public API

The wrapper knows that a method returns a new object, from the VTK_NEWINSTANCE wrapper hint.

This is super helpful. Thank you. Much easier than using a smart pointer.

To make getting/setting scalar arrays more Python-friendly, I don’t think we would need STL either. Instead, the wrapper should be able to convert a vtkDoubleArray to/from a Python array. @dgobbi could confirm.

Hmmm. This is a possibility but it doesn’t help on the C++ side at all. If we want to make the C++ API more convenient, vector<> is the way to go. Also, returning a vtkDoubleArray would be an issue unless we wrap that in a way that has a Python container API, which is more intrusive IMO. Currently, I don’t have a better example than the variable size argument use case. I’ll think about it more.

I would be happy to see more STL in VTK API, such as std::string instead of char* or std::vector instead of C pointers.

std::string is supported for both Python & Java wrapping btw. There are some classes that use std:string in their public API. Maybe in VTK 10 (X?), we should do a big backwards compatibility break and clean it all :slight_smile: