[vtk-developers] Best fit plane function location
David Doria
daviddoria+vtk at gmail.com
Mon Jan 25 10:40:46 EST 2010
On Mon, Jan 25, 2010 at 9:56 AM, Biddiscombe, John A. <biddisco at cscs.ch> wrote:
> erratum : Should have read something like
>
> if (vtkPointSet::SafeDownCast(dataset)) {
> BestFit(vtkPointSet::SafeDownCast(dataset)->GetPoints())
> }
> else {
> copy stuff
> }
>
>> -----Original Message-----
>> From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-bounces at vtk.org]
>> On Behalf Of Biddiscombe, John A.
>> Sent: 25 January 2010 15:52
>> To: David Doria
>> Cc: VTK Developers
>> Subject: Re: [vtk-developers] Best fit plane function location
>>
>> if (dataset->IsTypeOf(vtkPoints)) {
>> BestFit(vtkPoints::SafeDownCast(dataset)->GetPoints())
>> }
>> else {
>> copy stuff
>> }
>>
>>
>> > void vtkTextureMapToPlane::ComputeNormal(vtkDataSet *input)
>> > {
>> > vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
>> > for(unsigned int i = 0; i < input->GetNumberOfPoints(); i++)
>> > {
>> > double p[3];
>> > input->GetPoint(i, p);
>> > points->InsertNextPoint(p);
>> > }
>> >
>> > ... BestFit(points)...
>> >
>> > like I had originally?
>> >
>> > Thanks,
>> >
>> > David
Yep, that would work. Everyone OK with that?
Thanks,
David
More information about the vtk-developers
mailing list