GUI Milestone 8b
This commit is contained in:
parent
3a8450cb70
commit
4a248e5622
6 changed files with 682 additions and 37 deletions
|
|
@ -69,8 +69,18 @@ public:
|
|||
|
||||
uint32_t findPwNodeIdByName(const std::string &name) const;
|
||||
|
||||
struct ViewState {
|
||||
double scale;
|
||||
double centerX;
|
||||
double centerY;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
void saveLayout(const QString &path) const;
|
||||
void saveLayout(const QString &path, const ViewState &viewState) const;
|
||||
bool loadLayout(const QString &path);
|
||||
ViewState savedViewState() const;
|
||||
void clearSavedPositions();
|
||||
void autoArrange();
|
||||
|
||||
private:
|
||||
|
|
@ -91,6 +101,7 @@ private:
|
|||
std::unordered_map<QtNodes::NodeId, QPointF> m_positions;
|
||||
std::unordered_map<QtNodes::NodeId, QSize> m_sizes;
|
||||
std::unordered_set<QtNodes::NodeId> m_ghostNodes;
|
||||
std::unordered_set<QtNodes::ConnectionId> m_ghostConnections;
|
||||
|
||||
static constexpr double kHorizontalGap = 40.0;
|
||||
static constexpr double kVerticalGap = 30.0;
|
||||
|
|
@ -101,6 +112,15 @@ private:
|
|||
|
||||
bool m_refreshing = false;
|
||||
|
||||
struct PendingGhostConnection {
|
||||
std::string outNodeName;
|
||||
std::string outPortName;
|
||||
std::string inNodeName;
|
||||
std::string inPortName;
|
||||
};
|
||||
|
||||
std::unordered_map<std::string, QPointF> m_pendingPositions;
|
||||
std::unordered_map<std::string, QPointF> m_savedPositions;
|
||||
std::vector<PendingGhostConnection> m_pendingGhostConnections;
|
||||
ViewState m_savedViewState{};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue