[vtkusers] Selected cells not visible

Alex Malyushytskyy alexmalvtk at gmail.com
Mon Feb 11 20:30:36 EST 2013


I can't help you with Java,
but it looks like you missing a few operations and doing it different than
http://www.cmake.org/Wiki/VTK/Examples/Cxx/Filtering/ExtractVisibleCells example

For example
selector.SetArea(temp[0], temp[2], temp[1], temp[3]);
isn't it supposed to be
selector.SetArea(temp[2], temp[3], temp[0], temp[1]);
according to the example?

what is rect4PolySelection?

and I have not found equivalent of the following line iun your code
      selector->SetFieldAssociation(vtkDataObject::FIELD_ASSOCIATION_CELLS);

Hope it helps,
    Alex

On Mon, Feb 11, 2013 at 9:14 AM, -Daniel- <ich_daniel at habmalnefrage.de> wrote:
> Hello vtk-users,
>
> I use vtkExtractVisibleCells to select cells from a polydata.
> My selection found more than one node, but it isn't visible.
>
>
> *Java-Code:*/
> vtkPolyData poly = (vtkPolyData) getObjects().get(0).getPolydata();
> poly.Update();
>
> vtkHardwareSelector selector = new vtkHardwareSelector();
> selector.SetRenderer(getView_volume().GetRenderer());
>
> int[] temp = rect4PolySelection;        // int[4]
>
> selector.SetArea(temp[0], temp[2], temp[1], temp[3]);
>
> vtkSelection selection = selector.Select();
> System.out.println("nodes: "+selection.GetNumberOfNodes() );
>
> vtkExtractSelection extractSelection = new vtkExtractSelection();
> extractSelection.SetInput(0, poly);
> extractSelection.SetInput(1, selection);
> extractSelection.Update();
>
> vtkDataSetMapper mapper = new vtkDataSetMapper();
> mapper.SetInputConnection(extractSelection.GetOutputPort());
>
> vtkActor actor = new vtkActor();
> actor.SetMapper(mapper);
> actor.GetProperty().SetColor(0.1, 0, 0.8);
>
> getView_volume().GetRenderer().AddActor(actor);/
>
>
> What's wrong? Can someone help me?
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Selected-cells-not-visible-tp5718419.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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