[vtk-developers] Adding ComputeArea() to vtkTriangle

David Cole david.cole at kitware.com
Tue Dec 22 10:18:03 EST 2009

On Tue, Dec 22, 2009 at 9:53 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> Per Ken's suggestion, I am trying to implement a virtual double
> ComputeSize() function for vtkCell.  There are a lot of cells! Many of which
> I have no idea how to get their size. Is it acceptable to somehow commit
> these changes without having all of them implemented? Something like a
> filler "return 0" and a comment "this function has not yet been
> implemented"?
> The idea would be that then the framework is setup, so when a developer who
> is familiar with the particular cell subclass sees the missing
> implementation, they could easily fill it in.
> Thoughts?
I don't think you should commit stuff that's half-(or any other fraction
less than 1)-done unless there is somebody who will commit to pounding out
the remainder in the very short term (days).

If you can't do all existing subclasses, than it might be a better strategy
to develop patches against CVS HEAD and attach them to an issue in the bug
tracker until such time as the patch is complete.

Otherwise, we'll end up with a half-done thing in the next release.

One good idea for ensuring completeness on a task like this is to give the
base class virtual a no-op implementation (return -1 even) but to put a
"vtkErrorMacro" in it so that when it does get called, the developer who
encounters it knows immediately what must be done to eliminate it.

A message like:
"vtkCell subclass is missing a ComputeSize implementation, please add to "
<< classname

would be a great way to do it incrementally via patches in the bug tracker.

David Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091222/7645442b/attachment.html>

More information about the vtk-developers mailing list