[vtk-developers] Add FindCell(double[3]) to vtkImageData

Andy Bauer andy.bauer at kitware.com
Tue Apr 13 12:15:27 EDT 2010

Hi David,

The reason you're getting the compiler warning is that the FindCell that
you've declared in the derived class hides the virtual FindCell class in the
base class because they have the same name but different signatures.  You'd
have to do something like imageData->Superclass::FindCell(x, cell,
cellId,...); in order to call the base class directly or play around with
the derived class definition.

Read http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9for
more info.

With all this said, you'll want to rename your simplified FindCell function.


Date: Mon, 12 Apr 2010 18:56:00 -0400
From: David Doria <daviddoria+vtk at gmail.com <daviddoria%2Bvtk at gmail.com>>
Subject: [vtk-developers] Add FindCell(double[3]) to vtkImageData
To: VTK Developers <vtk-developers at vtk.org>
       <o2rc19fcadc1004121556l11f1a847ld4e9c7a75efc2a1d at mail.gmail.com>
Content-Type: text/plain; charset=windows-1252

After some discussion with David Gobbi on the users list, we have
decided that it seems reasonable to add a function


which calls the more complex:
virtual vtkIdType       FindCell (double x[3], vtkCell *cell, vtkIdType
cellId, double tol2, int &subId, double pcoords[3], double *weights)

with some reasonable defaults.

Here are the files with the new function FindCell(double[3])

It works, but I get this warning:

In file included from /home/doriad/src/VTK/Filtering/vtkUniformGrid.cxx:15:
/home/doriad/src/VTK/Filtering/vtkImageData.h:69: warning: ?virtual
vtkIdType vtkImageData::FindCell(double*)? was hidden
/home/doriad/src/VTK/Filtering/vtkUniformGrid.h:55: warning:   by

After some googling it looked like there is indeed something that can
be done to fix this, but I don't understand exactly what is happening.

Please take a look at these files and let us know what you think.


David D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20100413/b4a1a09b/attachment.htm>

More information about the vtk-developers mailing list