mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
Interface mockup 15
This commit is contained in:
@@ -725,7 +725,7 @@ void ViewportWindow::initGL() {
|
||||
|
||||
gl_->glEnable(GL_DEPTH_TEST);
|
||||
gl_->glEnable(GL_MULTISAMPLE);
|
||||
gl_->glClearColor(0.18f, 0.20f, 0.22f, 1.0f);
|
||||
gl_->glClearColor(background_color_.redF(), background_color_.greenF(), background_color_.blueF(), 1.0f);
|
||||
gl_->glCullFace(GL_BACK);
|
||||
if (AppSettings::instance().backfaceCulling()) gl_->glEnable(GL_CULL_FACE);
|
||||
else gl_->glDisable(GL_CULL_FACE);
|
||||
@@ -768,6 +768,18 @@ void ViewportWindow::initGL() {
|
||||
emit initialized();
|
||||
}
|
||||
|
||||
void ViewportWindow::setBackgroundColor(const QColor& color) {
|
||||
if (!color.isValid()) return;
|
||||
const QColor normalized = color.toRgb();
|
||||
if (background_color_ == normalized) return;
|
||||
background_color_ = normalized;
|
||||
if (gl_initialized_ && gl_) {
|
||||
context_->makeCurrent(this);
|
||||
gl_->glClearColor(background_color_.redF(), background_color_.greenF(), background_color_.blueF(), 1.0f);
|
||||
requestUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewportWindow::enqueuePendingOperation(PendingOperation op) {
|
||||
pending_ops_.push_back(std::move(op));
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QWindow>
|
||||
#include <QOpenGLContext>
|
||||
#include <QtOpenGL/QOpenGLFunctions_4_5_Core>
|
||||
#include <QColor>
|
||||
#include <QElapsedTimer>
|
||||
#include <QMatrix4x4>
|
||||
#include <QVector3D>
|
||||
@@ -312,6 +313,7 @@ public:
|
||||
void setFederatedFalseOrigin(const Eigen::Matrix4d& matrix_meters);
|
||||
void setModelCoordinateOperation(uint32_t model_id, const Eigen::Matrix4d& matrix_meters);
|
||||
void setModelTransformation(uint32_t model_id, const Eigen::Matrix4d& matrix_meters);
|
||||
void setBackgroundColor(const QColor& color);
|
||||
|
||||
// Selection. The viewport owns a SelectionState that tracks both
|
||||
// the multi-set and the "active" (last single-clicked) id. External
|
||||
@@ -607,6 +609,7 @@ private:
|
||||
QOpenGLContext* context_ = nullptr;
|
||||
QOpenGLFunctions_4_5_Core* gl_ = nullptr;
|
||||
bool gl_initialized_ = false;
|
||||
QColor background_color_ = QColor("#202329");
|
||||
std::deque<PendingOperation> pending_ops_;
|
||||
|
||||
// Shaders
|
||||
|
||||
Reference in New Issue
Block a user