[vtkusers] Automatically change radius of sphere when a variable changes its value

Ken Martin ken.martin at kitware.com
Fri Aug 4 11:04:55 EDT 2017


If you already have 100 actors try option 1 and see if that meets your
needs.

On Fri, Aug 4, 2017 at 10:59 AM, M. Jordan <mjordan at live.at> wrote:

> Ideally I would like to change 100 spheres depending on an array of
> doubles (all spheres are changing radius).
> Moreover, I have to change the opacity and color of every sphere
> individually, whereby i need 100 actors.
>
> Any idea which solution ist the best for my problem?
> Thank you very much for your help!
> ------------------------------
> *Von:* Ken Martin <ken.martin at kitware.com>
> *Gesendet:* Freitag, 04. August 2017 16:28
> *An:* M. Jordan
> *Cc:* vtkusers at vtk.org
> *Betreff:* Re: [vtkusers] Automatically change radius of sphere when a
> variable changes its value
>
> 1) actor->SetScale(...) instead of changing the sphere source
>
> or
>
> 2) use a Glyph3DMapper with a scale array to control the scale of each
> sphere
>
> or
>
> 3) vtkOpenGLSphereMapper with a scale array
>
> Which solution works best depends on the specifics of your use case, ala
> is only one sphere changing radius?, are they all?, are they all changing
> by the same amount? one actor? 100 actors? etc.
>
>
>
>
>
>
> On Fri, Aug 4, 2017 at 10:00 AM, M. Jordan <mjordan at live.at> wrote:
>
>> Hello,
>>
>> I have a scene with many spheres (about 100) in my QVTK-Widget.
>> Now I would like to achieve that the radii of the spheres change
>> automatically when a variable changes its value.
>>
>> Right now I add the spheres to the scene, start a timer and in the timer
>> callback I change the radius of the SphereSources depending on the
>> variable. Finally, I call qvtkwidget->update(); to update the spheres in
>> my scene.
>>
>> It works, but i would like to improve the speed. Any ideas how to update
>> spheres faster? Is there any possibility to only "re-render" one sphere and
>> not the whole scene?
>>
>> Thank you!
>>
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Ken Martin PhD
> Distinguished Engineer
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park NY 12065
>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee.  Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message.  Thank you.
>



-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170804/aef76359/attachment.html>


More information about the vtkusers mailing list