Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. 2D vtk Renders in QT
Qt 6.11 is out! See what's new in the release blog

2D vtk Renders in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 605 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlexanderAlexander
    wrote on last edited by
    #1

    I am unable to do 2D vtk renders in QT without having override errors: https://forum.qt.io/topic/104344/can-t-use-vtk-charts-in-qt-no-override-found-for-vtkcontextdevice2d

    While trying to solve this I have been reading about the vtkContextView and vtkGenericOpenGLRenderWindow classes.

    vtkGenericOpenGLRenderWindow:
    "vtkGenericOpenGLRenderWindow provides a skeleton for implementing a render window using one's own OpenGL context and drawable. To be effective, one must register an observer for WindowMakeCurrentEvent, WindowIsCurrentEvent and WindowFrameEvent."

    vtkContextView:
    "This class is derived from vtkRenderViewBase and provides a view of a vtkContextScene, with a default interactor style, renderer etc. It is the simplest way to create a vtkRenderWindow and display a 2D scene inside of it."

    I do not understand how the vtkContextView works with OpenGL and was wondering if someone could help explain their relation to one another, and how the context view works. Also, is there any other way to do 2D vtk renders without the using the context view? I cannot find any exmaples of 2D vtk renders in QT, any advice on how to do 2D renders of vtk in QT will be greatly appreciated.

    Current Attempt to render 2D vtk chart:
    vtkNew<vtkGenericOpenGLRenderWindow> renderWindowRight;
    view->SetRenderWindow(renderWindowRight);
    this->qvtkWidgetRight->SetRenderWindow(renderWindowRight);

    Additional Code in main file:
    QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());

    Additional Info: Win64 on 64bit machine, vtk8.2.0, Qt5.13.0, compiled/built in MCVS2017(Release x64) with cmake3.15.0

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved