[vtkusers] vtkPoints ...how to work with them.

Giancarlo Amati ilferraresebono at hotmail.it
Thu Feb 18 06:38:23 EST 2010


Bill,

Thanks for the suggestion. Very appreciated.
that might solve some other bugs I had.

Giancarlo

> Date: Wed, 17 Feb 2010 11:17:56 -0500
> Subject: Re: [vtkusers] vtkPoints ...how to work with them.
> From: bill.lorensen at gmail.com
> To: ilferraresebono at hotmail.it
> CC: vtkusers at vtk.org
> 
> Not related to your error, but,
> vtkSmartPointer<vtkTransformPolyDataFilter> pdF =
> vtkTransformPolyDataFilter::New();
> should be
> vtkSmartPointer<vtkTransformPolyDataFilter> pdF =
> vtkSmartPointer<vtkTransformPolyDataFilter>::New();
> 
> With the current code, you will generate memory leaks.
> 
> On Tue, Feb 16, 2010 at 2:09 PM, Giancarlo Amati
> <ilferraresebono at hotmail.it> wrote:
> > Hello everybody, this is my code:
> >
> > vtkSmartPointer<vtkTransformPolyDataFilter> pdF =
> > vtkTransformPolyDataFilter::New();
> >         pdF->SetInputConnection(pdNorm->GetOutputPort());
> >         pdF->SetTransform(perspT);
> >         pdF->Update();
> >
> >
> >  vtkSmartPointer<vtkPolyData> T_persp_pd = pdF->GetOutput();
> >         T_persp_pd->Update();
> >
> >  vtkSmartPointer<vtkPoints> T_pdPoints = T_persp_pd->GetPoints();
> >         cout << "N points: " << T_persp_pd->GetNumberOfPoints();
> >
> >
> >         //Normalize the points
> >         for( int i = 0; i<T_persp_pd->GetNumberOfPoints(); i++) {
> >             double p[3];
> >             T_persp_pd->GetPoints()->GetPoint(i,p);
> >             cout<< "POints i: " << i << " " << p[0] << endl;
> >             p[0] = p[0]/p[2];
> >             p[1] = p[1]/p[2];
> >             p[2] = p[2]/p[2];
> >         }
> >
> > when I print out the 3D vector p, I always get: -1.INF0000000000 which is
> > clearly a mistake. What's the problem in my code?
> >
> > thanks a lot!
> > Giancarlo
> >
> > ________________________________
> > Troppe caselle di posta? Gestiscile da Hotmail!
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
 		 	   		  
_________________________________________________________________
Tutto lo spazio che ti serve, lo trovi su Hotmail
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100218/415cbbe9/attachment.htm>


More information about the vtkusers mailing list