[vtkusers] PoinInPolygon arguments

Jothybasu K Selvaraj jothybasu at gmail.com
Mon Apr 12 05:56:57 EDT 2010


Hi David,

I need a bit of clarification as I am not much familiar with c++.


double n[3];* // you have declared the variable n*

 polygon->ComputeNormal(
polygon->GetPoints()->GetNumberOfPoints(),
static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
*n);// How do you set this as an input to an argument as it doesn't hold any
value*

Did you mistyped or am I misinterpreted?

Thanks,

Jothy




On Thu, Apr 8, 2010 at 12:43 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Tue, Apr 6, 2010 at 11:33 AM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> > n is the normal to the face of the polygon
> > numPts is the number of points in the polygon
> > pts is an array of xyz points
>
>
> The call was pretty nasty:
>
>
>  double n[3];
>  polygon->ComputeNormal(polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> n);
>
>  double bounds[6];
>  polygon->GetPoints()->GetBounds(bounds);
>
>  cout << "test x in polygon? " << polygon->PointInPolygon(x,
> polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> bounds, n) << endl;
>
> I just wrote a convenience function and submitted it to the developers
> mailing list. If it is approved, in the future you can simply call
>
> cout << "test x in polygon? " << polygon->PointInPolygon(x) << endl;
>
> Thanks,
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100412/e95e46ed/attachment.htm>


More information about the vtkusers mailing list