refactor: rename Network to NetworkPanel
This commit is contained in:
@@ -46,7 +46,7 @@ set(GUI_SOURCES
|
||||
src/Gui/Viewport/GLPoints.cpp
|
||||
src/Gui/Network/NetworkGraphicsView.cpp
|
||||
src/Gui/Network/NetworkGraphicsScene.cpp
|
||||
src/Gui/Network/Network.cpp
|
||||
src/Gui/Network/NetworkPanel.cpp
|
||||
src/Gui/Network/NodeGraphic.cpp
|
||||
src/Gui/Network/SocketGraphic.cpp
|
||||
src/Gui/Network/NodeEdgeGraphic.cpp
|
||||
|
||||
2
build.sh
2
build.sh
@@ -2,5 +2,5 @@
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Build -G Ninja ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ..
|
||||
ninja
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetPanel.h"
|
||||
#include "Gui/ParametersPanel/ParametersPanel.h"
|
||||
#include "Gui/Viewport/Viewport.h"
|
||||
#include "Gui/Network/Network.h"
|
||||
#include "Gui/Network/NetworkPanel.h"
|
||||
#include <qnamespace.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qsplitter.h>
|
||||
@@ -27,7 +27,7 @@ EnzoUI::EnzoUI()
|
||||
setStyleSheet("background-color:#1d2021;");
|
||||
|
||||
Viewport* viewport = new Viewport();
|
||||
Network* network = new Network();
|
||||
NetworkPanel* network = new NetworkPanel();
|
||||
ParametersPanel* parametersPanel = new ParametersPanel();
|
||||
GeometrySpreadsheetPanel* geometrySpreadsheetPanel = new GeometrySpreadsheetPanel();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Gui/Network/NetworkGraphicsView.h"
|
||||
#include <QGraphicsItem>
|
||||
#include "Gui/Network/Network.h"
|
||||
#include "Gui/Network/NetworkPanel.h"
|
||||
#include <QCoreApplication>
|
||||
#include "Gui/Network/NetworkGraphicsScene.h"
|
||||
#include "Gui/Network/SocketGraphic.h"
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <qobject.h>
|
||||
#include <typeinfo>
|
||||
|
||||
NetworkGraphicsView::NetworkGraphicsView(QWidget *parent, Network* network, QGraphicsScene* scene)
|
||||
NetworkGraphicsView::NetworkGraphicsView(QWidget *parent, NetworkPanel* network, QGraphicsScene* scene)
|
||||
: QGraphicsView(parent), scene_{scene}, network_{network}
|
||||
{
|
||||
setScene(scene_);
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsScene>
|
||||
|
||||
class Network;
|
||||
class NetworkPanel;
|
||||
|
||||
class NetworkGraphicsView
|
||||
: public QGraphicsView
|
||||
{
|
||||
public:
|
||||
NetworkGraphicsView(QWidget *parent = nullptr, Network* network=nullptr, QGraphicsScene* scene = nullptr);
|
||||
NetworkGraphicsView(QWidget *parent = nullptr, NetworkPanel* network=nullptr, QGraphicsScene* scene = nullptr);
|
||||
QSize sizeHint() const override { return QSize(-1, -1); }
|
||||
private:
|
||||
QPointF panStartPos;
|
||||
void initUI();
|
||||
QGraphicsScene* scene_;
|
||||
Network* network_;
|
||||
NetworkPanel* network_;
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent *mouseEvent) override;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Gui/Network/Network.h"
|
||||
#include "Gui/Network/NetworkPanel.h"
|
||||
#include "Engine/Operator/GeometryConnection.h"
|
||||
#include "Engine/Operator/GeometryOperator.h"
|
||||
#include "Engine/Operator/OperatorTable.h"
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using namespace enzo;
|
||||
|
||||
Network::Network(QWidget* parent)
|
||||
NetworkPanel::NetworkPanel(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ Network::Network(QWidget* parent)
|
||||
|
||||
}
|
||||
|
||||
void Network::resizeEvent(QResizeEvent *event)
|
||||
void NetworkPanel::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QPainterPath path;
|
||||
constexpr float radius = 10;
|
||||
@@ -56,7 +56,7 @@ void Network::resizeEvent(QResizeEvent *event)
|
||||
this->setMask(region);
|
||||
}
|
||||
|
||||
void Network::deleteEdge(QGraphicsItem* edge)
|
||||
void NetworkPanel::deleteEdge(QGraphicsItem* edge)
|
||||
{
|
||||
std::cout << "----\ndeleting edge\n";
|
||||
if(!edge) return;
|
||||
@@ -71,7 +71,7 @@ void Network::deleteEdge(QGraphicsItem* edge)
|
||||
std::cout << "finished deleting edge\n----\n";
|
||||
}
|
||||
|
||||
void Network::mousePressEvent(QMouseEvent *event)
|
||||
void NetworkPanel::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if( event->buttons() & Qt::LeftButton)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ void Network::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
}
|
||||
|
||||
void Network::leftMousePressed(QMouseEvent *event)
|
||||
void NetworkPanel::leftMousePressed(QMouseEvent *event)
|
||||
{
|
||||
std::cout << "LEFT MOUSE PRESSED\n";
|
||||
Qt::KeyboardModifiers mods = event->modifiers();
|
||||
@@ -127,7 +127,7 @@ void Network::leftMousePressed(QMouseEvent *event)
|
||||
|
||||
|
||||
|
||||
void Network::socketClicked(SocketGraphic* socket, QMouseEvent *event)
|
||||
void NetworkPanel::socketClicked(SocketGraphic* socket, QMouseEvent *event)
|
||||
{
|
||||
std::cout << "socket clicked\n";
|
||||
// clicked first socket
|
||||
@@ -168,7 +168,7 @@ void Network::socketClicked(SocketGraphic* socket, QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void Network::destroyFloatingEdge()
|
||||
void NetworkPanel::destroyFloatingEdge()
|
||||
{
|
||||
if(floatingEdge_)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ void Network::destroyFloatingEdge()
|
||||
|
||||
|
||||
|
||||
void Network::mouseMoved(QMouseEvent *event)
|
||||
void NetworkPanel::mouseMoved(QMouseEvent *event)
|
||||
{
|
||||
// cache and reset prev hover items
|
||||
std::unordered_set<QGraphicsItem*> prevHoverItems = prevHoverItems_;
|
||||
@@ -256,7 +256,7 @@ void Network::mouseMoved(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void Network::moveNodes(QPointF pos)
|
||||
void NetworkPanel::moveNodes(QPointF pos)
|
||||
{
|
||||
|
||||
for(auto node : moveNodeBuffer)
|
||||
@@ -266,7 +266,7 @@ void Network::moveNodes(QPointF pos)
|
||||
}
|
||||
|
||||
|
||||
void Network::keyPressEvent(QKeyEvent *event)
|
||||
void NetworkPanel::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
// modifiers
|
||||
Qt::KeyboardModifiers mods = event->modifiers();
|
||||
@@ -339,7 +339,7 @@ void Network::keyPressEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
NodeGraphic* Network::createNode(op::OpInfo opInfo)
|
||||
NodeGraphic* NetworkPanel::createNode(op::OpInfo opInfo)
|
||||
{
|
||||
if(nt::OpId id = enzo::nt::nm().addOperator(opInfo))
|
||||
{
|
||||
@@ -359,7 +359,7 @@ NodeGraphic* Network::createNode(op::OpInfo opInfo)
|
||||
}
|
||||
|
||||
|
||||
void Network::keyReleaseEvent(QKeyEvent *event)
|
||||
void NetworkPanel::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
// modifiers
|
||||
Qt::KeyboardModifiers mods = event->modifiers();
|
||||
@@ -379,7 +379,7 @@ void Network::keyReleaseEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void Network::mouseReleaseEvent(QMouseEvent *event)
|
||||
void NetworkPanel::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
// std::cout << "----\nMOUSE RELEASED\n---\n";
|
||||
QList<QGraphicsItem*> hoverItems = view_->items(event->pos());
|
||||
@@ -440,4 +440,4 @@ void Network::mouseReleaseEvent(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
bool Network::focusNextPrevChild(bool) { return false; }
|
||||
bool NetworkPanel::focusNextPrevChild(bool) { return false; }
|
||||
@@ -19,11 +19,11 @@
|
||||
#include <unordered_set>
|
||||
#include "Gui/Network/TabMenu.h"
|
||||
|
||||
class Network
|
||||
class NetworkPanel
|
||||
: public QWidget
|
||||
{
|
||||
public:
|
||||
Network(QWidget* parent = nullptr);
|
||||
NetworkPanel(QWidget* parent = nullptr);
|
||||
void socketClicked(SocketGraphic* socket, QMouseEvent *event);
|
||||
void mouseMoved(QMouseEvent *event);
|
||||
QSize sizeHint() const override { return QSize(-1, -1); }
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QSvgWidget>
|
||||
#include "Gui/Network/TabMenu.h"
|
||||
#include "Engine/Operator/OperatorTable.h"
|
||||
#include "Gui/Network/Network.h"
|
||||
#include "Gui/Network/NetworkPanel.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <iostream>
|
||||
@@ -178,7 +178,7 @@ void enzo::ui::TabMenu::createNode(std::string nodeName)
|
||||
// check valid result
|
||||
if(!opInfo.has_value()) {throw std::runtime_error("Couldn't find op info for: " + nodeName);}
|
||||
|
||||
static_cast<Network*>(parentWidget())->createNode(opInfo.value());
|
||||
static_cast<NetworkPanel*>(parentWidget())->createNode(opInfo.value());
|
||||
}
|
||||
|
||||
void enzo::ui::TabMenu::nodeClicked()
|
||||
|
||||
Reference in New Issue
Block a user