# quickRender

**URL:** <https://discuss.avogadro.cc/t/quickrender/1854>\
**Category:** Development\
**Created:** [April 28, 2010, 4:34pm UTC](https://discuss.avogadro.cc/t/quickrender/1854 "2010-04-28T16:34:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mickael\_Gadroy](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@Mickael\_Gadroy](https://discuss.avogadro.cc/u/Mickael_Gadroy)\
**Post date:** [April 28, 2010, 4:34pm UTC](https://discuss.avogadro.cc/t/quickrender/1854/1 "2010-04-28T16:34:13Z")

</div>

Hi all,

I am writing a extension plugin that manipulates atoms and the camera. It  
works with one atom. But when I load a large molecule (~5000 atoms), it  
lags. It’s like the quick rendering was not activated. While manipulating  
with the mouse is suitable.  
I am inspired by existing code of Avogadro (navigate.cpp/.h), and I saw  
nothing that “activate/manipulate” the quick rendering.  
So, when is it activated ? (Just when use tool plugin?)

Regards.  
Mickaël Gadroy

---

<div class="post-metadata">

**Author:** ![Konstantin\_Tokarev](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/k/ecd19e/32.png) [@Konstantin\_Tokarev](https://discuss.avogadro.cc/u/Konstantin_Tokarev)\
**Post date:** [April 28, 2010, 4:37pm UTC](https://discuss.avogadro.cc/t/quickrender/1854/2 "2010-04-28T16:37:03Z")

</div>

28.04.10, 18:34, “Mickaël Gadroy” [mickael.gadroy@gmail.com](mailto:mickael.gadroy@gmail.com):

> Hi all,
> 
> I am writing a extension plugin that manipulates atoms and the camera. It works with one atom. But when I load a large molecule (~5000 atoms), it lags. It’s like the quick rendering was not activated. While manipulating with the mouse is suitable.  
> I am inspired by existing code of Avogadro (navigate.cpp/.h), and I saw nothing that “activate/manipulate” the quick rendering.  
> So, when is it activated ? (Just when use tool plugin?)

Use GLWidget::setQuickRender(bool enabled)

> Regards.  
> Mickaël Gadroy

–  
Regards,  
Konstantin

---

<div class="post-metadata">

**Author:** ![mhanwell](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/mhanwell/32/16_2.png) [@mhanwell](https://discuss.avogadro.cc/u/mhanwell)\
**Post date:** [April 28, 2010, 5:10pm UTC](https://discuss.avogadro.cc/t/quickrender/1854/3 "2010-04-28T17:10:49Z")

</div>

On Wednesday 28 April 2010 12:34:13 Mickaël Gadroy wrote:

> Hi all,
> 
> I am writing a extension plugin that manipulates atoms and the camera. It  
> works with one atom. But when I load a large molecule (~5000 atoms), it  
> lags. It’s like the quick rendering was not activated. While manipulating  
> with the mouse is suitable.  
> I am inspired by existing code of Avogadro (navigate.cpp/.h), and I saw  
> nothing that “activate/manipulate” the quick rendering.  
> So, when is it activated ? (Just when use tool plugin?)

It is activated by GLWidget in the mouse event functions when quick render is  
set to on. So, from an extension quick rendering would not be active. I am not  
sure that the current code accounts for that situation, and the auto-rotate  
tool suffers from the same limitation (quick rendering is not used).

The setQuickRender method actually sets whether quick rendering _can be_ used,  
but more logic is present to decide _when_ to use it. It is effectively only  
turned on when the mouse is down, see the logic in GLWidget::mouseMoveEvent.  
It could probably be extended for more cases without too much trouble, but I  
was trying to solve the issue of interactivity when I worked on this code.

Hope that helps,

Marcus

---

<div class="post-metadata">

**Author:** ![Mickael\_Gadroy](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@Mickael\_Gadroy](https://discuss.avogadro.cc/u/Mickael_Gadroy)\
**Post date:** [April 29, 2010, 7:39am UTC](https://discuss.avogadro.cc/t/quickrender/1854/4 "2010-04-29T07:39:37Z")

</div>

Thank you for the clarification. This is exactly what I wanted to know. I  
will try to redirect my signals plus a few changes.

Mickaël Gadroy
