[vtk-developers] Convenience functions for vtkPolygon

David Doria daviddoria+vtk at gmail.com
Mon Apr 12 10:12:28 EDT 2010


On Wed, Apr 7, 2010 at 7:46 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I have added an objected oriented convenience function,
> void vtkPolygon::ComputeNormal(double normal[3]);
>
> which simply calls an existing static function in vtkPolygon with the
> data from an instantiated polygon (you may remember a similar case
> with ComputeArea several months ago).
>
> The result is instead of this:
> double n[3];
>  polygon->ComputeNormal(polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> n);
>
> we can use
>
> double n[3];
> polygon->ComputeNormal(n);
>
> I also added an object oriented convenience function for
> PointInPolygon, which allows replacing a call like this:
>
> polygon->PointInPolygon(x, polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> bounds, n);
>
> to this:
>
> polygon->PointInPolygon(x);
>
> The new files are available here:
> http://www.rpi.edu/~doriad/VTK_List/vtkPolygon/
>
> Please let me know if these changes can be committed.
>
> Thanks,
>
> David
>

Ah, I see what happened - these changes were so revolutionary that
everyone was left speechless!

Thanks,

David



More information about the vtk-developers mailing list