mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
Updated to use Qt6; Created initial structure of the viewer with OpenGL widget
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "IfcViewerWidget.h"
|
||||
|
||||
IfcViewerWidget::IfcViewerWidget(QWidget *parent)
|
||||
: QOpenGLWidget(parent)
|
||||
{}
|
||||
|
||||
void IfcViewerWidget::initializeGL()
|
||||
{
|
||||
// Set up the rendering context, load shaders and other resources, etc.:
|
||||
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
|
||||
f->glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
void IfcViewerWidget::resizeGL(int w, int h)
|
||||
{
|
||||
// Update projection matrix and other size related settings:
|
||||
m_projection.setToIdentity();
|
||||
m_projection.perspective(45.0f, w / float(h), 0.01f, 100.0f);
|
||||
}
|
||||
|
||||
void IfcViewerWidget::paintGL()
|
||||
{
|
||||
// Render geometries from the parsed IFC file
|
||||
// Draw the scene:
|
||||
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
|
||||
f->glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
Reference in New Issue
Block a user