<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Bill,<br><br>Thanks for the suggestion. Very appreciated.<br>that might solve some other bugs I had.<br><br>Giancarlo<br><br>> Date: Wed, 17 Feb 2010 11:17:56 -0500<br>> Subject: Re: [vtkusers] vtkPoints ...how to work with them.<br>> From: bill.lorensen@gmail.com<br>> To: ilferraresebono@hotmail.it<br>> CC: vtkusers@vtk.org<br>> <br>> Not related to your error, but,<br>> vtkSmartPointer<vtkTransformPolyDataFilter> pdF =<br>> vtkTransformPolyDataFilter::New();<br>> should be<br>> vtkSmartPointer<vtkTransformPolyDataFilter> pdF =<br>> vtkSmartPointer<vtkTransformPolyDataFilter>::New();<br>> <br>> With the current code, you will generate memory leaks.<br>> <br>> On Tue, Feb 16, 2010 at 2:09 PM, Giancarlo Amati<br>> <ilferraresebono@hotmail.it> wrote:<br>> > Hello everybody, this is my code:<br>> ><br>> > vtkSmartPointer<vtkTransformPolyDataFilter> pdF =<br>> > vtkTransformPolyDataFilter::New();<br>> > pdF->SetInputConnection(pdNorm->GetOutputPort());<br>> > pdF->SetTransform(perspT);<br>> > pdF->Update();<br>> ><br>> ><br>> > vtkSmartPointer<vtkPolyData> T_persp_pd = pdF->GetOutput();<br>> > T_persp_pd->Update();<br>> ><br>> > vtkSmartPointer<vtkPoints> T_pdPoints = T_persp_pd->GetPoints();<br>> > cout << "N points: " << T_persp_pd->GetNumberOfPoints();<br>> ><br>> ><br>> > //Normalize the points<br>> > for( int i = 0; i<T_persp_pd->GetNumberOfPoints(); i++) {<br>> > double p[3];<br>> > T_persp_pd->GetPoints()->GetPoint(i,p);<br>> > cout<< "POints i: " << i << " " << p[0] << endl;<br>> > p[0] = p[0]/p[2];<br>> > p[1] = p[1]/p[2];<br>> > p[2] = p[2]/p[2];<br>> > }<br>> ><br>> > when I print out the 3D vector p, I always get: -1.INF0000000000 which is<br>> > clearly a mistake. What's the problem in my code?<br>> ><br>> > thanks a lot!<br>> > Giancarlo<br>> ><br>> > ________________________________<br>> > Troppe caselle di posta? Gestiscile da Hotmail!<br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the VTK FAQ at:<br>> > http://www.vtk.org/Wiki/VTK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.vtk.org/mailman/listinfo/vtkusers<br>> ><br>> ><br>                                            <br /><hr />Troppe caselle di posta? <a href='http://www.windowslive.it/hotmail/GestisciAltriAccount.aspx' target='_new'>Gestiscile da Hotmail!</a></body>
</html>