[vtk-developers] Proposed CenterOfMass function for vtkPoints

David Doria daviddoria+vtk at gmail.com
Thu Apr 1 08:35:31 EDT 2010


On Thu, Apr 1, 2010 at 6:18 AM, Will Schroeder
<will.schroeder at kitware.com> wrote:
> I see what you are doing but of course it is not really the center of
> mass, also it is not consistent with the names of the methods
> GetBounds(), GetCenter() that exist in vtkDataSet, so I think the
> method is misnamed. However, I am not sure what to call it...maybe
> GetWeightedCenter(), GetComputedCenter(), GetPointsCenter()? Also, you
> may want to cache the computation like GetBounds() does (it first does
> a mtime check against the compute time).


John,

Good idea - done.

Will,

- Why is it not the center of mass (assuming all the points have "unit" mass)?

- I typically don't like functions named Get* that are not simple
accessors, but if that's what it needs to be, that's fine.
GetPointsCenter() seems to be the best I've heard so far.

- Done - I cached the computation.

- When making changes like this, is there anyway to try them out
without completely recompiling VTK?

The new files are attached.

Thanks,

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPoints.cxx
Type: text/x-c++src
Size: 7277 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100401/595da0ab/attachment-0001.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPoints.h
Type: text/x-chdr
Size: 7639 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100401/595da0ab/attachment-0001.h>


More information about the vtk-developers mailing list