[vtkusers] PoinInPolygon arguments
Jothybasu K Selvaraj
jothybasu at gmail.com
Mon Apr 12 07:29:52 EDT 2010
When I call ComputeNormal I get an error " method requires a vtk object"
Actually my polygon is from vtkCutter, it cut a slice from the sphere.Should
I convert it to some other type?
Thanks,
Jothy
polygon->ComputeNormal(contour->GetPoints()->
GetNumberOfPoints(),
static_cast<double*>(contour->GetPoints()->GetData()->GetVoidPointer(0)),
On Mon, Apr 12, 2010 at 10:56 AM, Jothybasu K Selvaraj
<jothybasu at gmail.com>wrote:
> 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/1403126f/attachment.htm>
More information about the vtkusers
mailing list