[Paraview] Plugin selecting points and fitting sphere to them

Yumin Yuan yumin.yuan at kitware.com
Thu Apr 5 09:47:41 EDT 2012


Hi Peter,

If I understand you correctly, what you can do is to derive the filter
from vtkPolyDataAlgorithm, and set up two inputs for the filter, one
for the model, one for the selection. You can look at
vtkExtractSelectedPolyDataIds to see how to set it up.

Then, on Paraview side, you need to set the model-source as input0 and
its selection as input1 to your filter.

First, create myfilter with the model-source (reader or filter to
output the model),

Then get the selection source, (you may want to do this where you are
handling the selection-finished signal from paraview)

  vtkSMSourceProxy* selectionSource =
vtkSMSourceProxy::SafeDownCast(mymodelSource)->GetSelectionInput(0);

Then,

vtkSMSourceProxy::SafeDownCast(myfilter)->SetSelectionInput(0,
selectionSource, 0);


HTH
Yumin



On Wed, Apr 4, 2012 at 3:55 PM, Boettcher, Prof. Dr. Peter
<Boettcher at kleintierklinik.uni-leipzig.de> wrote:
> Hi All
>
>
>
> I would like get access to points of a 3D model selected with the rubber
> band and fit a sphere to them. So the output of the plugin would be of type
> polydata. Therefore I would have to derive my filter-class from
> vtkPolyDataFilter. But now I have no access to the selection. When using a
> filter derived from vtkPVExtractSelection the selection is already set up
> but now I have the problem to add a polydata for the output.
>
>
>
> Any help would be much appreciated.
>
>
>
> Regards, Peter.
>
>
>
>
>
>
>
> ---------------------------------------------------------
>
> Prof. Dr. Peter Böttcher, DipECVS
>
> European Veterinary Specialist in Surgery
>
> Fachtierarzt für Kleintierchirurgie
>
> Klinik für Kleintiere
>
> Universität Leipzig
>
> An den Tierkliniken 23
>
> D-04103 Leipzig (Germany)
>
> Tel: +49-341-9738700
>
> Fax: +49-341-9738799
>
> Email: boettcher at kleintierklinik.uni-leipzig.de
>
>
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list