<div class="gmail_quote">On Tue, Apr 13, 2010 at 12:21 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Tue, Apr 13, 2010 at 12:15 PM, Andy Bauer <<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>> wrote:<br>
> Hi David,<br>
><br>
> The reason you're getting the compiler warning is that the FindCell that<br>
> you've declared in the derived class hides the virtual FindCell class in the<br>
> base class because they have the same name but different signatures.  You'd<br>
> have to do something like imageData->Superclass::FindCell(x, cell,<br>
> cellId,...); in order to call the base class directly or play around with<br>
> the derived class definition.<br>
><br>
> Read <a href="http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9" target="_blank">http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9</a><br>
> for more info.<br>
><br>
> With all this said, you'll want to rename your simplified FindCell function.<br>
><br>
> Andy<br>
<br>
I see, thanks for that link.<br>
<br>
So what do we name it? FindCellSimple()?<br>
<br>
or maybe something like<br>
<br>
bool IsInsideCell(double p[3], vtkIdType& cellId)<br>
<br>
vtkIdType PointInsideCell(double p[3])<br>
<br>
Other thoughts?<br>
<br>
<br></blockquote><div><br>Alternatively, if you do not want to rename it because FindCell is really the perfect name for it, then simply add the other FindCell signature at the derived level as well, and do the simple "call parent class" implementation for it. That converts it to an "overload" instead of a "hide"... at the expense of having to re-implement the method in question.<br>
<br>But if you can rename it reasonably, then that's probably the better way to go.<br><br></div></div>