[vtk-developers] vtkPlane DeepCopy?

David Gobbi david.gobbi at gmail.com
Sat Dec 5 17:33:03 EST 2009


On Sat, Dec 5, 2009 at 3:21 PM, David Doria <daviddoria+vtk at gmail.com> wrote:

> I know what you mean, but if you do already have a vtkPlane for some
> reason, you shouldn't have to get the data out of it before using
> functions on it, right?? Couldn't we just make
>
> void vtkPlane::DistanceToPoint(double point[3])
> {
>  double n[3];
>  double o[3];
>  this->GetNormal(n);
>  this->GetOrigin(o);
>  return vtkPlane::DistanceToPlane(point, n, o);
> }
>
> for cases like this? It would alleviate many giant blocks of code like
> this in my (and I'd assume most people's?) code to do simple, "one
> line" things.
>
> Also, as usual I will try to be the voice of new users (my constant
> overarching motivation) - a new user (i.e. someone who doesn't
> know/care about the "heavy weight-ness") would be very confused why
> they can make a plane but not do anything reasonable with it; this
> type of function would certainly ease some of that confusion.

Please learn to care about the "weight" of your code soon!!!  I beg
you!  Just in case I ever use some of your software in the future!  It
seems that having only these static methods will help to keep new
users from developing bad habits.

Also, you don't need such a long code block.  It is perfectly fine to
do the following:

vtkPlane::DistanceToPlane(point, plane->GetNormal(), plane->GetOrigin());

   David



More information about the vtk-developers mailing list