[vtk-developers] [EXTERNAL] Re: Tcl wrapping and output array arguments
Gerrick.Bivins at halliburton.com
Tue Mar 24 09:58:55 EDT 2015
+1 to the “pure getter/setters” idea.
This would also greatly benefit “bean heads” like myself (Java devs).
From: vtk-developers [mailto:vtk-developers-bounces at vtk.org] On Behalf Of David Lonie
Sent: Tuesday, March 24, 2015 8:27 AM
To: David Gobbi
Cc: VTK Developers
Subject: [EXTERNAL] Re: [vtk-developers] Tcl wrapping and output array arguments
On Mon, Mar 23, 2015 at 5:51 PM, David Gobbi <david.gobbi at gmail.com<mailto:david.gobbi at gmail.com>> wrote:
It's apparent to me that part of the difficulty surrounding this change is
due to the name of the method. Why not use a new name?
bool ComputeBoundsForViewport(vtkViewport *, double bounds);
I confess that I have an ulterior motive. I like all Get() or Set() methods
to get/set a property that depends only on the the object itself. Here,
the Bounds depend on both the object and on a second object. So I
don't consider this method to be a "getter" in the strict sense, hence
"ComputeBounds" rather than "GetBounds".
Basically, I like it when Get methods are associated with properties/traits
of the object. Eventually, VTK's wrappers might associate Set/Get
methods with Python properties. In fact, this idea can already be seen
in action in tvtk, Enthought's Traited VTK.
Hmm, and this also wouldn't require the 'using' wrapper support right away...I like it! The distinction between Get/Compute makes sense.
The name is a bit long, and "ForViewport" is implied by the arguments. I'd like ComputeBounds, but that's already a virtual on many of these classes.
Now I'm leaning towards
vtkBoundingBox ComputeBoundingBox(vtkViewport *)
That would also:
- eliminate the output-array-arg issues with the Tcl wrappers (Yay!)
- encourage use of the vtkBoundingBox class, which is a really nice API for working with a bounding box that leads to much, much more consistent and readable usage (there are a few approaches used for, e.g. invalid bounds, that aren't always consistent).
It needs a couple hints to be wrapped properly, but that's not nearly as much trouble :)
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers