[Paraview] D3 filter and PkdTrees: how to tell if D3 previously executed?, PkdTree point locators

Christine Corbett Moran corbett at physik.uzh.ch
Thu Nov 12 17:49:19 EST 2009


Hi Burlen,

Yes this helps, thanks. Although I was hoping not to have to modify
D3, more because of the desire to keep a simple user friendly
architecture for my plugin than laziness in the face of such a simple
change.

Based on your response, my current plan of action for my now three and
growing filters using PKdTrees is to override D3 to retain/pass its
presence/PKdTree downstream, requesting that the any user of my plugin
use my D3 version instead of the default. If my modified D3 has been
run, I'll use its PKdTree within my filter, if not, I'll first
internally run my modified D3 filter, being sure to pass its results
downstream at the end.

But if anyone has a cleaner solution or an answer to my original
questions I'd love to hear from you. I've now read every source code
file using or referring to KdTrees/PKdTrees in VTK/ParaView  at least
twice, but my original questions still stand.

Cheers,
Christine

On Wed, Nov 11, 2009 at 7:19 PM, burlen <burlen.loring at gmail.com> wrote:
> HI, I can only address the questions, 1) and 4). They can be solved using
> vtkInformationKey's
>
>> 1. How do I tell if D3 has been executed previously in the pipeline?
>>
>
>> 4. If I run D3 and/or build a KdTree within my filter it would be nice
>> to save this for possible use by filters downstream. I see that D3 has
>> a SetRetainKdTree, which may be what I am looking for in that regard,
>> but if I build my own KdTree with associated locator is there a way to
>> retain it/access it downstream?
>
> One may pass information downstream via vtkInformationKey objects.
>
> If you wanted to know weather there is a certain filter upstream, then that
> filter can leave a trace of its presence in the pipeline information as its
> RequestData is executed. It will add a vtkInformationKey to the output
> information. downstream filters then look for this specific key. If present
> it's evidence that the other filter is in the pipeline upstream.
>
> You can pass almost anything you like downstream including vtk objects
> between readers,sources, and filters using the vtkInformationKey's. For
> example you may use vtkInformtionObjectBaseKey to pass a vtkPKdTree
> downstream between two filters.
>
> You'll have to modify vtkDistributedDataFilter, adding the keys you need.
>
> Hope this helps,
>
> Burlen
>
>
> Christine Corbett Moran wrote:
>>
>> Hi,
>>
>> I'm now playing around with creating some filters which use PkdTrees
>> internally, mainly for their point locator capabilities. As the
>> filters I'm interested in creating work best with spatial locality, I
>> want to execute D3 if running in parallel and it has not previously
>> been executed. I had four primary questions.
>>
>> 1. How do I tell if D3 has been executed previously in the pipeline?
>> 2. It seems that I must first build a locator from points before
>> calling e.g. FindClosestNPoints even though D3 takes in the same data
>> set as input to build its KdTree. Does this mean
>> BuildLocatorFromPoints(input) builds a different sort (and, in turn,
>> new) KdTree than D3->SetInput(input) .... D3->Update()? Should I not
>> even bother trying to get the KdTree from D3 and simply create a new
>> one?
>> 3. If I build my own PkDtree is this accomplished by creating a new
>> one on each process, and for my locator calling
>> BuildLocatorFromPoints(input) on each process, or should I do
>> something special on e.g. the root process?
>> 4. If I run D3 and/or build a KdTree within my filter it would be nice
>> to save this for possible use by filters downstream. I see that D3 has
>> a SetRetainKdTree, which may be what I am looking for in that regard,
>> but if I build my own KdTree with associated locator is there a way to
>> retain it/access it downstream?
>>
>> Christine
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
>


More information about the ParaView mailing list