[vtk-developers] vtkPlane non-static wrappers

Francois Bertel francois.bertel at kitware.com
Mon Feb 1 22:54:32 EST 2010


That would be more object-oriented for sure. Go for it.

Just be careful that you cannot just pass the normal of the object to
the static method as I don't see in the documentation of the class any
class invariant stating that the magnitude of the normal has to be 1.
On the contrary, the static method DistanceToPlane() explicitly has
the magnitude of the normal to be 1  as a pre-condition.


On Mon, Feb 1, 2010 at 9:51 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Anyone mind if I add:
> double  DistanceToPlane (double x[3])
> void  ProjectPoint (double x[3], double xproj[3])
> void  GeneralizedProjectPoint (double x[3], double origin[3], double
> normal[3], double xproj[3])
> int  IntersectWithLine (double p1[3], double p2[3], double &t, double x[3])
> as convenience functions to:
> static double DistanceToPlane (double x[3], double n[3], double p0[3])
> static void ProjectPoint (double x[3], double origin[3], double normal[3],
> double xproj[3])
> static void GeneralizedProjectPoint (double x[3], double origin[3], double
> normal[3], double xproj[3])
> static int IntersectWithLine (double p1[3], double p2[3], double n[3],
> double p0[3], double &t, double x[3])
> The non-static functions would simply call the static functions and pass the
> instantiated plane object's normal and origin. This is the same idea that I
> added with vtkTriangle::ComputeArea()
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list