[vtk-developers] Cell Tree Locator Update

Biddiscombe, John A. biddisco at cscs.ch
Fri Jul 29 08:22:55 EDT 2011


It's very sad that we can't use the "using" syntax thanks to the borland and other old compilers, but that's life. (I've patched my version (patch attached), but can't push to Gerrit as I'm using the vtk branch from paraview, not the vtk one from vtk <sigh>)

The crash is reproducible on my system too. I must confess I didn't try the test before as I was more interested in findcell stuff and querying cells inside regions etc at the mo.

Stepping through the code I can see that a condition is being missed in the split part of the algorithm, but I'm not quite sure yet how to fix it or why it is occurring.

It is worth noting that the CellTreeLocator should come with a very large health warning : This class will not work on all datasets. It will only work when a true disjoint partitioning is available. They don't mention that much in the paper (or I didn't pick up on it). One reason for the extra node in the ModifiedBSPTree is to handle cells which can't be partitioned into either side.

Consider a chess board - imagine 64 quad cells in the dataset. No problem. Now add one more cell which is the whole board (ie the hull of the 64 mini quads). This will break the CellTreeLocator - cells which overlap other cells can't (always) be partitioned nicely. For most datasets this isn't going to be a problem as most datasets are well behaved, but when I worked on lidar data and triangulating buildings from it many years ago, I often found long skinny triangles which could not be binned in either half and the extra node solved it nicely.

Anyway, it occurs to me that the test uses 2D polygons (tessellated sphere) in 3D space and it may be the bounds check is flawed for this case in the split algorithm and needs to be improved. One 2D cell might be axis aligned and cause a file somewhere ...

When I get time I'll look into it, but if anyone else fixes it first please tell me so that I can not waste any time on it.

JB


-----Original Message-----
From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-bounces at vtk.org] On Behalf Of David Gobbi
Sent: 29 July 2011 02:36
To: David Doria
Cc: VTK Developers; Andy Bauer
Subject: Re: [vtk-developers] Cell Tree Locator Update

On Thu, Jul 28, 2011 at 6:11 PM, David Doria <daviddoria at gmail.com> wrote:
>
>> /home/acbauer/CODE/VTK/VTK/Filtering/vtkAbstractCellLocator.h:107: warning:
>> `virtual int vtkAbstractCellLocator::IntersectWithLine(double*, do
>> uble*, double, double&, double*, double*, int&, vtkIdType&)' was hidden
>
> I think these "function was hidden" are fixed by saying "using
> functionName;" in the subclass, as I've done here:
> http://review.source.kitware.com/#patch,sidebyside,1862,1,Filtering/vtkKdTreePointLocator.h
>
> If there is a better way to fix them, I'd like to know about it.

That trick will not work on Visual Studio 7.1, which is still a
supported compiler for VTK.  It also breaks the wrappers.

If a VTK class overrides one version of IntersectWithLine, then it
should override all of them.  If need be, you can just define all the
unneeded ones as inline methods that calls the superclass methods.

 - David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-hidden-methods-for-IntersectWithLine.patch
Type: application/octet-stream
Size: 2450 bytes
Desc: 0001-Fix-hidden-methods-for-IntersectWithLine.patch
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110729/7ba9c3c1/attachment-0001.obj>


More information about the vtk-developers mailing list