[vtkusers] How to display a bouding box around a dataset?

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Apr 7 08:39:22 EDT 2011


The reason for that is because you did not add any mapper/actor on the
dataset itself. The outline filter is a filter in the sense that it
take a dataset as input and give a wire box as the output. So if you
want to see your dataset, you have to add it to the renderer with the
help of a mapper/actor.

Seb

On Thu, Apr 7, 2011 at 3:05 AM, LEGUAY Romain <romain.leguay at gmail.com> wrote:
> Good morning everyone!
> I work with a VTK wrapping Java.
> I try to display the bounding box around a dataSet.
> I use a vtkOutlineFilter but I obtain just a box without the dataSet.
> Moreover, the box dimension is different from the dataSet's bounds.
>
> This is a sample of my code:
>
> vtkOutlineFilter boundingBox = new vtkOutlineFilter();
> boundingBox.SetInput(myDataSet.getVtkDataSet());
> boundingBox.Update();
>
> vtkDataSet dataSet = boundingBox.GetOutput();
>
>
> After this I display this new dataSet with this:
>
> vtkMapper mapper = new vtkDataSetMapper();
> ((vtkDataSetMapper) mapper).SetInput(dataSet);
>
> vtkActor actor = new vtkActor();
> actor.GetProperty().EdgeVisibilityOn();
> actor.SetMapper(mapper);
>
> vtkPanel panel = new vtkPanel();
> vtkRenderer renderer = panel.GetRenderer();
> renderer.AddActor(actor);
>
>
> Does anyone have any idea why I don't get a beautiful box around my dataSet?
>
> Thanks.
>
> Romain
>
> _______________________________________________
> 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