[vtkusers] how to construct vktCell with vtkPoints

Emmanouil Moschidis moshman65 at yahoo.com
Wed May 2 12:28:15 EDT 2007


Uhm not sure but maybe you need to check something like vtkContourFilter ?
I don't know what you want to do... i play mostly with vtkTransformPolyDataFiler 
or vtkTransformFilter. They both return structured polydata. 

ѧ־ Ñî <shulo1978 at hotmail.com> wrote: 
Thank you. It does work. By the way, do you know any filter like 
threshfilter can filter vtkPolyData but return structured polydata instead 
of unstructured? Cheers

>From: Emmanouil Moschidis 
>To: "ѧ־" "Ñî" 
>CC: vtkusers at vtk.org
>Subject: Re: [vtkusers] how to construct vktCell with vtkPoints
>Date: Tue, 1 May 2007 04:38:33 -0700 (PDT)
>
>Hi
>this is a piece of code that should work...
>
>     vtkPoints *cloudPoints=new vtkPoints;
>     vtkCellArray *cloudCells=new vtkCellArray;
>     vtkPolyData *cloudPData=new vtkPolyData;
>
>
>     cloudPoints->SetDataTypeToDouble();
>     cloudPoints->SetNumberOfPoints(numberOfVTKPoints);
>
>
>     for(int i=0; i<(numberOfVTKCells*3); i++)
>     {
>         
>cloudPoints->SetPoint(i,vtkStoredPointsBuffer[i].getX(),vtkStoredPointsBuffer[i].getY(),vtkStoredPointsBuffer[i].getZ());
>
>     }
>
>
>     cloudCells->InsertNextCell(numberOfVTKPoints);
>
>
>     for (int i=0; i
>     {
>         cloudCells->InsertCellPoint(i);
>     }
>
>
>     cloudPData->SetPoints(cloudPoints);
>     cloudPData->SetLines(cloudCells);
>
>
>the only weird thing you may see is these getX(), getY(), getZ() methods. 
>The reason why i use these methods is that i store my points in 
>std::vector

>where Point3D is a custom class for 3D points (in your case you use 
>vtkPoints).
>
>Try it and tell me if it worked. I am not 100% this is the correct way 
>though
>
>Good luck :-)
>
>
>
>ѧ־ Ñî  wrote: Hi all, I extract vtkpoints from a 
>polydata and want to reconstruct them
>back into vtkCell. Can anyone give me some hint to do this? The points are
>taken out based on some conditions so I can't use getCell from vtkpolydata
>to take the cell straignthaway. Thank you!
>
>_________________________________________________________________
>Could you be the guest MSN Movies presenter? Click Here to Audition
>http://www.lightscameraaudition.co.uk
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>---------------------------------
>Ahhh...imagining that irresistible "new car" smell?
>  Check outnew cars at Yahoo! Autos.

_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile.  
https://livemessenger.mobile.uk.msn.com/




       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070502/f568f3fa/attachment.htm>


More information about the vtkusers mailing list