<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"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></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'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 <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
> You mean a generic "pointer" object that can be used from Python.<br>
><br>
> In Python 3, there is a special object called "memoryview" that can be<br>
> used for this purpose, so that's the direction that I've considered<br>
> going. I'd like to avoid generic pointer wrapping, because it makes<br>
> it too easy to crash the program from python. I know that SWIG wraps<br>
> pointers, but I've made a conscious choice not to do the same for the<br>
> VTK wrappers.<br>
><br>
> - David<br>
><br>
><br>
> On Wed, Mar 28, 2012 at 3:32 PM, Pat Marion <<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>> wrote:<br>
>> Hi David,<br>
>><br>
>> What about making a generic way to access these kinds of arrays, given a<br>
>> length argument, using ctypes or numpy?<br>
>><br>
>> Something like:<br>
>><br>
>> length = info.Length(key)<br>
>> myarray = vtk.array_from_pointer(info.Get(key), length)<br>
>><br>
>><br>
>> Pat<br>
>><br>
>><br>
>> On Wed, Mar 28, 2012 at 4:08 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
>>><br>
>>> Hmm, I just noticed something in my own code. The following method<br>
>>> isn't wrapped, because it returns a bare pointer. As a result the<br>
>>> WHOLE_EXTENT key can't be used with Get:<br>
>>><br>
>>> int * vtkInformation::Get(vtkInformationIntegerVectorKey *);<br>
>>><br>
>>> But I think that I can add a wrapper hint to get it working... the<br>
>>> wrappers can internally query the Length() method to figure out what<br>
>>> number of values to return.<br>
>>><br>
>>> - David<br>
>>><br>
>>><br>
>>> On Fri, Mar 23, 2012 at 10:44 AM, Philippe Pebay<br>
>>> <<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>> wrote:<br>
>>> > Thanks Bill.<br>
>>> ><br>
>>> > Philippe<br>
>>> ><br>
>>> ><br>
>>> > On Fri, Mar 23, 2012 at 4:49 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> This page has a suggested replacement.<br>
>>> >> <a href="http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve" target="_blank">http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve</a><br>
>>> >><br>
>>> >> On Fri, Mar 23, 2012 at 8:23 AM, Philippe Pebay<br>
>>> >> <<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>> wrote:<br>
>>> >> > Hello all<br>
>>> >> ><br>
>>> >> > GetOutput().GetWholeExtent() does not work any longer in VTK 6. I<br>
>>> >> > have q<br>
>>> >> > boatload of vtkpython scripts using this! Does anyone know what the<br>
>>> >> > quick<br>
>>> >> > fix is?<br>
>>> >> ><br>
>>> >> > Thanks<br>
>>> >> > Philippe<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<br>
>>> <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>
>><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>