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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

pdhahn
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
Reply | Threaded
Open this post in threaded view
|

Re: drawing with OpenGL primitives within Paint() in a sub-class of vtkContextItem

Allie Vacanti
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 <[hidden email]> 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

_______________________________________________
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