<div dir="ltr">You need to use the vtkInformationIterator class.<div><br></div><div>Best,</div><div>-berk</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 4:29 PM, Sunrise <span dir="ltr"><<a href="mailto:helios.corona@gmail.com" target="_blank">helios.corona@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry if the question that I asked was not clear. I would like to ask a<br>
similar question:<br>
<br>
Given a vtkInformation object, how can we know what key-value pairs are<br>
appended into it?<br>
<br>
Thanks.<br>
<div class="HOEnZb"><div class="h5"><br>
On 04/21/2013 08:09 PM, Sunrise wrote:<br>
> I would like to find /search for keys appended in vtkInformation object<br>
> and then access their values. But, it seems that if we do not have key<br>
> pointers, we can not inquiry the vtkInformaton that which key-pairs it<br>
> contains!<br>
><br>
> Assume I have vtkInformation *inputInfo object in Filter2, that coming<br>
> from previous filter (Filter1) in a pipeline. Filter1 added some<br>
> key/value pairs of type vtkInformationDoubleVectorkey into outputInfo<br>
> object. Now, in the new filter (Filter2) I want to access DoubleVector key.<br>
><br>
> In Filter1 header, a key is defined with a static function:<br>
> static vtkInformationDoubleVectorKey * MyKey();<br>
><br>
> key-value pair is appended to outputInfo with:<br>
> outputInfo->Set(Filter1::MyKey(),someValues,someLength);<br>
><br>
> So in Filter2 by calling Filter1::MyKey(), I can access the key values via:<br>
> values = inputInfo->Get(Filter1::MyKey());<br>
><br>
> But, the problem is that Filter1 could be one of more general filters<br>
> that create their own key. Filter2 is not restricted to be connected<br>
> just to Filter1, downstream of Filter2 can be FilterX. So I do not know<br>
> which FilterX generated key for DoubleVector type in inputInfo. "All the<br>
> Filter2 should know is that in inputInfo there is a key-value pair with<br>
> DoubleVector type".<br>
><br>
> Also I don't want to create a superclass for my filters and generate<br>
> keys at there (something that vtkStreamingDemandDrivenPipeline does for<br>
> its keys).<br>
><br>
> I looked at this thread<br>
><br>
> <a href="http://vtk.1045678.n5.nabble.com/vtkInformation-access-with-equivalent-keys-td5545920.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkInformation-access-with-equivalent-keys-td5545920.html</a><br>
><br>
> to figure out how can I access keys with other similar key-types. The<br>
> answer suggests to use CopyEntries method. If you look at source code<br>
> for vtkInformation::CopyEntries(...), you will see that keys in info<br>
> should be know again in order to use CopyEntries.<br>
><br>
> Any idea would be appreciated.<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>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>