<div>Thank you David.</div><div><br></div>I have been working on a set of documents to help migration to VTK 6. One thing that I noticed while working on these is that the way we access this sort of meta-data is fairly inconsistent. There are some convenience functions in vtkDataObject, vtkStreamingDemandDrivenPipeline etc. to set/get meta-data and some of them are accessed directly. I am too burned out to tackle this right now but it is something to think about...<div>
<br></div><div>-berk<br><br><div class="gmail_quote">On Wed, Mar 28, 2012 at 7:25 PM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Adding a hint for Get(vtkInformationIntegerVectorKey *) turned out to<br>
be straightforward.. I have a patch in gerrit that allows Get to be used<br>
with all IntegerVector and DoubleVector keys so that WHOLE_EXTENT,<br>
SPACING, ORIGIN, etc. can be used from the wrappers.  I&#39;ll probably<br>
merge tomorrow.<br>
<br>
A more general solution, i.e. one that also encompasses IntegerPointer<br>
keys (yikes!) will have to wait...<br>
<span class="HOEnZb"><font color="#888888"><br>
 - david<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Wed, Mar 28, 2012 at 3:46 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt; You mean a generic &quot;pointer&quot; object that can be used from Python.<br>
&gt;<br>
&gt; In Python 3, there is a special object called &quot;memoryview&quot; that can be<br>
&gt; used for this purpose, so that&#39;s the direction that I&#39;ve considered<br>
&gt; going.  I&#39;d like to avoid generic pointer wrapping, because it makes<br>
&gt; it too easy to crash the program from python.  I know that SWIG wraps<br>
&gt; pointers, but I&#39;ve made a conscious choice not to do the same for the<br>
&gt; VTK wrappers.<br>
&gt;<br>
&gt;  - David<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Mar 28, 2012 at 3:32 PM, Pat Marion &lt;<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>&gt; wrote:<br>
&gt;&gt; Hi David,<br>
&gt;&gt;<br>
&gt;&gt; What about making a generic way to access these kinds of arrays, given a<br>
&gt;&gt; length argument, using ctypes or numpy?<br>
&gt;&gt;<br>
&gt;&gt; Something like:<br>
&gt;&gt;<br>
&gt;&gt; length = info.Length(key)<br>
&gt;&gt; myarray = vtk.array_from_pointer(info.Get(key), length)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Pat<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Mar 28, 2012 at 4:08 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hmm, I just noticed something in my own code.  The following method<br>
&gt;&gt;&gt; isn&#39;t wrapped, because it returns a bare pointer.  As a result the<br>
&gt;&gt;&gt; WHOLE_EXTENT key can&#39;t be used with Get:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; int * vtkInformation::Get(vtkInformationIntegerVectorKey *);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But I think that I can add a wrapper hint to get it working... the<br>
&gt;&gt;&gt; wrappers can internally query the Length() method to figure out what<br>
&gt;&gt;&gt; number of values to return.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  - David<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Fri, Mar 23, 2012 at 10:44 AM, Philippe Pebay<br>
&gt;&gt;&gt; &lt;<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>&gt; wrote:<br>
&gt;&gt;&gt; &gt; Thanks Bill.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Philippe<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; On Fri, Mar 23, 2012 at 4:49 PM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;<br>
&gt;&gt;&gt; &gt; wrote:<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; This page has a suggested replacement.<br>
&gt;&gt;&gt; &gt;&gt; <a href="http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve" target="_blank">http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve</a><br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; On Fri, Mar 23, 2012 at 8:23 AM, Philippe Pebay<br>
&gt;&gt;&gt; &gt;&gt; &lt;<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>&gt; wrote:<br>
&gt;&gt;&gt; &gt;&gt; &gt; Hello all<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; GetOutput().GetWholeExtent() does not work any longer in VTK 6. I<br>
&gt;&gt;&gt; &gt;&gt; &gt; have q<br>
&gt;&gt;&gt; &gt;&gt; &gt; boatload of vtkpython scripts using this! Does anyone know what the<br>
&gt;&gt;&gt; &gt;&gt; &gt; quick<br>
&gt;&gt;&gt; &gt;&gt; &gt; fix is?<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Thanks<br>
&gt;&gt;&gt; &gt;&gt; &gt; Philippe<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br></div>