[vtkusers] Pick & delete cell

Alex Malyushytskyy alexmalvtk at gmail.com
Wed Feb 27 20:34:48 EST 2013


I believe you can't obtain polydata when making shallow copy of
unstructured grid.
Filter has to be invoked.

Check vtkGeometryFilter .

Alex

On Wed, Feb 27, 2013 at 11:02 AM, David Doria <daviddoria at gmail.com> wrote:
> On Wed, Feb 27, 2013 at 9:49 AM, Massinissa Bandou
> <Massinissa.Bandou at usherbrooke.ca> wrote:
>> Hi David,
>> Sorry for late response, I tried the vtkExtractSelection by displaying the
>> unselected cells:
>>  selectionNode->GetProperties()->Set(vtkSelectionNode::INVERSE(),1);
>>             extractSelection->Update();
>>
>> I hope this is what you mean directly from the polydata.
>> But it seems not working because I still see the junctions/points or
>> vertices and the cells if I "delete" a couple of neighboring cells.
>> I don't know how you can delete the cells directly from the polydata??
>>
>>
>> Thank you for your help!
>>
>> Massi
>
> I meant try replacing
>
>   vtkSmartPointer<vtkUnstructuredGrid> selected =
>     vtkSmartPointer<vtkUnstructuredGrid>::New();
>   selected->ShallowCopy(extractSelection->GetOutput());
>
> with:
>
>   vtkSmartPointer<vtkPolyData> selected =
>     vtkSmartPointer<vtkPolyData>::New();
>   selected->ShallowCopy(extractSelection->GetOutput());
>
> I tried it, but the output
>
>   std::cout << "There are " << selected->GetNumberOfCells()
>             << " cells in the selection." << std::endl;
>
> says that there are 0 cells in the selection when a vtkPolyData is
> used, but 10 cells when a vtkUnstructuredGrid is used.
>
> If anyone could explain why this is, that would be helpful. That is,
> can we modify the example to use vtkPolyData, or is there a reason
> that the cells cannot be copied into a vtkPolyData even though they
> are 2D cells?
>
> David
> _______________________________________________
> 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



More information about the vtkusers mailing list