Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
CamiTK Community Edition
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CamiTK
CamiTK Community Edition
Commits
5d9bb71d
Commit
5d9bb71d
authored
Jul 29, 2019
by
Emmanuel Promayon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIXED retrocompatibility with VTK6 and VTK7
parent
4a4c47ec
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
85 deletions
+5
-85
sdk/libraries/core/viewer/RendererWidget.cpp
sdk/libraries/core/viewer/RendererWidget.cpp
+3
-85
sdk/libraries/core/viewer/vtkInteractorStylePick.cpp
sdk/libraries/core/viewer/vtkInteractorStylePick.cpp
+2
-0
No files found.
sdk/libraries/core/viewer/RendererWidget.cpp
View file @
5d9bb71d
...
...
@@ -32,6 +32,7 @@
// // -- QT stuff
#include <QApplication>
#include <QKeyEvent>
#include <QProcessEnvironment>
// -- VTK stuff
// ---- Interactor
...
...
@@ -95,94 +96,11 @@
#include <QSurfaceFormat>
// On some OpenGL drivers (e.g. Mesa 13), the OpenGL context has to be requested before hand
//#include <QOpenGLContext>
//#include <QGLFormat>
//#include <QDebug>
//#include <QWindow>
static
void
initialize
()
{
CAMITK_INFO_ALT
(
"Initializing OpenGL Context..."
);
/*
auto format = QVTKOpenGLNativeWidget::defaultFormat();
format.setProfile(QSurfaceFormat::CompatibilityProfile);
QSurfaceFormat::setDefaultFormat(format);
*/
CAMITK_TRACE_ALT
(
"Initializing OpenGL Context..."
);
// needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat
::
setDefaultFormat
(
QVTKOpenGLWidget
::
defaultFormat
());
// recommended: disable multisampling for older version of OpenGL ES
// vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples(0);
//
// auto defaultFormat = QVTKOpenGLWidget::defaultFormat();
// defaultFormat.setSamples(0);
// QSurfaceFormat::setDefaultFormat(defaultFormat);
//
// #ifdef Q_OS_OSX
// QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
// #endif
//
// QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QSurfaceFormat
::
setDefaultFormat
(
QVTKOpenGLWidget
::
defaultFormat
());
}
//
// QGLFormat glFormat;
// glFormat.setVersion(3, 2);
// glFormat.setProfile(QGLFormat::NoProfile);
// glFormat.setSampleBuffers(true);
// glFormat.setDefaultFormat(glFormat);
// glFormat.setSwapInterval(1);
//
// glFormat.setDepthBufferSize(8);
// glFormat.setSamples(8);
// glFormat.setAlphaBufferSize(8);
// glFormat.setStencilBufferSize(8);
// /*QGLWidget widget(glFormat);
// widget.makeCurrent();
// */
// /*
// auto window = windowHandle();
//
// if (window != nullptr) {
// QSurfaceFormat surfaceFormat = window->format();
// surfaceFormat.setDepthBufferSize(8);
// surfaceFormat.setSamples(8);
// surfaceFormat.setAlphaBufferSize(8);
// surfaceFormat.setStencilBufferSize(8);
// //surfaceFormat.setStereo(1);
// window->setFormat(surfaceFormat);
// }
// else {
// qWarning("Can't set surface format: No associated QWindow");
// }
//
// const QGLContext *context = widget.context();
//
// glewExperimental = GL_TRUE;
// if (glewInit() != GLEW_OK) {
// qWarning("Failed to initialize GLEW\n");
// }
// */
//
// QSurfaceFormat surfaceFormat;
// surfaceFormat.setVersion(3,2);
// surfaceFormat.setDepthBufferSize(8);
// surfaceFormat.setSamples(8);
// surfaceFormat.setAlphaBufferSize(8);
// surfaceFormat.setStencilBufferSize(8);
//
// QOpenGLContext context;
// context.setFormat(surfaceFormat);
// context.create();
//
// qDebug() << "Context valid: " << context.isValid();
// qDebug() << "Really used OpenGl: " << context.format().majorVersion() << "." << context.format().minorVersion();
// qDebug() << "OpenGl information: VENDOR: " << (const char*)glGetString(GL_VENDOR);
// qDebug() << " RENDERDER: " << (const char*)glGetString(GL_RENDERER);
// qDebug() << " VERSION: " << (const char*)glGetString(GL_VERSION);
// qDebug() << " GLSL VERSION: " << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
//
// }
Q_COREAPP_STARTUP_FUNCTION
(
initialize
)
...
...
sdk/libraries/core/viewer/vtkInteractorStylePick.cpp
View file @
5d9bb71d
...
...
@@ -29,6 +29,8 @@
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkUnsignedCharArray.h>
#include <vtkObjectFactory.h> // for the New macros
// ---- Picking
#include <vtkPicker.h>
#include <vtkAreaPicker.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment