[vtk-developers] Best fit plane function location

David Doria daviddoria+vtk at gmail.com
Mon Jan 25 10:59:49 EST 2010


On Mon, Jan 25, 2010 at 10:57 AM, David Cole <david.cole at kitware.com> wrote:
> To clarify: are you (1) eliminating the dependency on vtkDataSet in the
> method signature or (2) putting the method someplace that is allowed to
> depend on vtkDataSet?
>
>
> On Mon, Jan 25, 2010 at 10:40 AM, David Doria <daviddoria+vtk at gmail.com>
> wrote:
>>
>> 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

It would eliminate the dependency on vtkDataSet in the signature.

Thanks,

David



More information about the vtk-developers mailing list