[vtkusers] drawing with OpenGL primitives within Paint() in a sub-class of vtkContextItem

Allie Vacanti allison.vacanti at kitware.com
Wed Nov 14 10:15:48 EST 2018


There's nothing stopping you from doing this, but it is generally
considered bad design. The ContextItems are expected to go through the
Context2D painter interface, since that can draw to a variety of backends
(PDF, SVG, etc) that aren't OpenGL. You'll lose the ability to have this
flexibility when you bypass the painter.

But if it's for a one-off application that doesn't care about other
backends, it should be fine. Your best bet is have a look at the
vtkOpenGLContextDevice2D source code and see the conventions it uses and
try to match them within your item's Paint() method.

HTH,
Allie

On Wed, Nov 14, 2018 at 6:09 AM Paul Douglas Hahn <pdhahn at compintensehpc.com>
wrote:

> Does anyone know if it is feasible to call OpenGL2 primitives directly
> within the overridden Paint() method of a sub-class of vtkContextItem
> (i.e., as found in Rendering/Context2D)? I am using VTK 8.1 specifically.
>
> If so, is there an example somewhere?
>
> Thanks!
>
> --
>
>
> _______________________________________________
> 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:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181114/168a0282/attachment.html>


More information about the vtkusers mailing list