feat(geometrySpreadsheet): connect attribute buttons

This commit is contained in:
parker
2025-08-10 19:13:08 +01:00
parent 750dfea9a0
commit b245e5333e
9 changed files with 116 additions and 26 deletions

View File

@@ -1,10 +1,12 @@
#include "Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetPanel.h"
#include "Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetMenuBar.h"
#include "Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetModel.h"
#include "Engine/Network/NetworkManager.h"
#include <QTableWidget>
#include <QTreeWidget>
#include <QLabel>
#include <qframe.h>
#include <qpushbutton.h>
#include <qtablewidget.h>
#include <QPainterPath>
@@ -26,16 +28,31 @@ GeometrySpreadsheetPanel::GeometrySpreadsheetPanel(QWidget *parent, Qt::WindowFl
)");
view_->setFrameStyle(QFrame::NoFrame);
model_ = new GeometrySpreadsheetModel({"hello", "world"});
model_ = new GeometrySpreadsheetModel();
view_->setModel(model_);
menuBar_ = new GeometrySpreadsheetMenuBar();
// connect buttons
connect(menuBar_->modeSelection->pointButton, &QPushButton::clicked, this, [this](){model_->setOwner(enzo::ga::AttributeOwner::POINT);});
connect(menuBar_->modeSelection->vertexButton, &QPushButton::clicked, this, [this](){model_->setOwner(enzo::ga::AttributeOwner::VERTEX);});
connect(menuBar_->modeSelection->primitiveButton, &QPushButton::clicked, this, [this](){model_->setOwner(enzo::ga::AttributeOwner::PRIMITIVE);});
connect(menuBar_->modeSelection->globalButton, &QPushButton::clicked, this, [this](){model_->setOwner(enzo::ga::AttributeOwner::GLOBAL);});
// set default
menuBar_->modeSelection->pointButton->click();
mainLayout_->addWidget(new GeometrySpreadsheetMenuBar());
mainLayout_->addWidget(menuBar_);
mainLayout_->addWidget(view_);
setLayout(mainLayout_);
}
void GeometrySpreadsheetPanel::setNode(enzo::nt::OpId opId)
{
menuBar_->setNode(opId);
}
void GeometrySpreadsheetPanel::geometryChanged(enzo::geo::Geometry& geometry)
{
model_->geometryChanged(geometry);