Automatically change radius of sphere when a variable changes its value

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Automatically change radius of sphere when a variable changes its value

Tom08

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Ken Martin
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 <[hidden email]> 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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Ken Martin
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 <[hidden email]> 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 <[hidden email]>
Gesendet: Freitag, 04. August 2017 16:28
An: M. Jordan
Cc: [hidden email]
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 <[hidden email]> 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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Tom08
In reply to this post by Ken Martin

Hello,

i tried to use the ->SetScale() options but it turned out that this changes the position as well.
My goal is to find the fastest way to change the radius of the spheres, without affecting their positions.
Any idea how to solve this issue?

Thank you very much!




Von: Ken Martin <[hidden email]>
Gesendet: Freitag, 04. August 2017 16:28
An: M. Jordan
Cc: [hidden email]
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 <[hidden email]> 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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Ken Martin
Position your spheres using the Actor's SetPosition, I am guessing you are changing the spheres' centers in the SphereSource which is the issue.

On Mon, Aug 7, 2017 at 8:30 AM, M. Jordan <[hidden email]> wrote:

Hello,

i tried to use the ->SetScale() options but it turned out that this changes the position as well.
My goal is to find the fastest way to change the radius of the spheres, without affecting their positions.
Any idea how to solve this issue?

Thank you very much!




Von: Ken Martin <[hidden email]>
Gesendet: Freitag, 04. August 2017 16:28
An: M. Jordan
Cc: [hidden email]
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 <[hidden email]> 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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Tom08

Thank you! Now it works.

My scene also includes a big polydata object which does not change by time.

Nevertheless, if the object is visible, the time to re-render the scene increases enormously.
So updating the spheres is not the time issue.

Is it possible to only update the spheres and not the polydata object?



Von: Ken Martin <[hidden email]>
Gesendet: Montag, 07. August 2017 15:16
An: M. Jordan
Cc: [hidden email]
Betreff: Re: [vtkusers] Automatically change radius of sphere when a variable changes its value
 
Position your spheres using the Actor's SetPosition, I am guessing you are changing the spheres' centers in the SphereSource which is the issue.

On Mon, Aug 7, 2017 at 8:30 AM, M. Jordan <[hidden email]> wrote:

Hello,

i tried to use the ->SetScale() options but it turned out that this changes the position as well.
My goal is to find the fastest way to change the radius of the spheres, without affecting their positions.
Any idea how to solve this issue?

Thank you very much!




Von: Ken Martin <[hidden email]>
Gesendet: Freitag, 04. August 2017 16:28
An: M. Jordan
Cc: [hidden email]
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 <[hidden email]> 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.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically change radius of sphere when a variable changes its value

Ken Martin
Sounds like it might be valuable to have someone should look at what you are trying to accomplish overall and suggest the best approaches etc. Kitware does offer support contracts to that end as part of their support offerings. Others of course may jump in as well.

On Tue, Aug 8, 2017 at 3:40 AM, M. Jordan <[hidden email]> wrote:

Thank you! Now it works.

My scene also includes a big polydata object which does not change by time.

Nevertheless, if the object is visible, the time to re-render the scene increases enormously.
So updating the spheres is not the time issue.

Is it possible to only update the spheres and not the polydata object?



Von: Ken Martin <[hidden email]>
Gesendet: Montag, 07. August 2017 15:16
An: M. Jordan
Cc: [hidden email]
Betreff: Re: [vtkusers] Automatically change radius of sphere when a variable changes its value
 
Position your spheres using the Actor's SetPosition, I am guessing you are changing the spheres' centers in the SphereSource which is the issue.

On Mon, Aug 7, 2017 at 8:30 AM, M. Jordan <[hidden email]> wrote:

Hello,

i tried to use the ->SetScale() options but it turned out that this changes the position as well.
My goal is to find the fastest way to change the radius of the spheres, without affecting their positions.
Any idea how to solve this issue?

Thank you very much!




Von: Ken Martin <[hidden email]>
Gesendet: Freitag, 04. August 2017 16:28
An: M. Jordan
Cc: [hidden email]
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 <[hidden email]> 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.



--
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.

_______________________________________________
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
Loading...