удалено: build/.qt/QtDeploySupport.cmake
удалено: build/.qt/QtDeployTargets.cmake удалено: build/CMakeCache.txt удалено: build/CMakeFiles/4.1.2/CMakeCXXCompiler.cmake удалено: build/CMakeFiles/4.1.2/CMakeDetermineCompilerABI_CXX.bin удалено: build/CMakeFiles/4.1.2/CMakeSystem.cmake удалено: build/CMakeFiles/4.1.2/CompilerIdCXX/CMakeCXXCompilerId.cpp удалено: build/CMakeFiles/4.1.2/CompilerIdCXX/a.out удалено: build/CMakeFiles/CMakeConfigureLog.yaml удалено: build/CMakeFiles/CMakeDirectoryInformation.cmake удалено: build/CMakeFiles/CMakeRuleHashes.txt удалено: build/CMakeFiles/InstallScripts.json удалено: build/CMakeFiles/Makefile.cmake удалено: build/CMakeFiles/Makefile2 удалено: build/CMakeFiles/TargetDirectories.txt удалено: build/CMakeFiles/cmake.check_cache удалено: build/CMakeFiles/idef0_editor.dir/DependInfo.cmake удалено: build/CMakeFiles/idef0_editor.dir/build.make удалено: build/CMakeFiles/idef0_editor.dir/cmake_clean.cmake удалено: build/CMakeFiles/idef0_editor.dir/compiler_depend.internal удалено: build/CMakeFiles/idef0_editor.dir/compiler_depend.make удалено: build/CMakeFiles/idef0_editor.dir/compiler_depend.ts удалено: build/CMakeFiles/idef0_editor.dir/depend.make удалено: build/CMakeFiles/idef0_editor.dir/flags.make удалено: build/CMakeFiles/idef0_editor.dir/idef0_editor_autogen/mocs_compilation.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/idef0_editor_autogen/mocs_compilation.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/link.d удалено: build/CMakeFiles/idef0_editor.dir/link.txt удалено: build/CMakeFiles/idef0_editor.dir/progress.make удалено: build/CMakeFiles/idef0_editor.dir/src/MainWindow.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/MainWindow.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/src/items/ArrowItem.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/items/ArrowItem.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/src/items/BlockItem.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/items/BlockItem.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/src/items/DiagramScene.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/items/DiagramScene.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/src/items/JunctionItem.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/items/JunctionItem.cpp.o.d удалено: build/CMakeFiles/idef0_editor.dir/src/main.cpp.o удалено: build/CMakeFiles/idef0_editor.dir/src/main.cpp.o.d удалено: build/CMakeFiles/idef0_editor_autogen.dir/AutogenInfo.json удалено: build/CMakeFiles/idef0_editor_autogen.dir/AutogenUsed.txt удалено: build/CMakeFiles/idef0_editor_autogen.dir/DependInfo.cmake удалено: build/CMakeFiles/idef0_editor_autogen.dir/ParseCache.txt удалено: build/CMakeFiles/idef0_editor_autogen.dir/build.make удалено: build/CMakeFiles/idef0_editor_autogen.dir/cmake_clean.cmake удалено: build/CMakeFiles/idef0_editor_autogen.dir/compiler_depend.internal удалено: build/CMakeFiles/idef0_editor_autogen.dir/compiler_depend.make удалено: build/CMakeFiles/idef0_editor_autogen.dir/compiler_depend.ts удалено: build/CMakeFiles/idef0_editor_autogen.dir/progress.make удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/DependInfo.cmake удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/build.make удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/cmake_clean.cmake удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/compiler_depend.make удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/compiler_depend.ts удалено: build/CMakeFiles/idef0_editor_autogen_timestamp_deps.dir/progress.make удалено: build/CMakeFiles/progress.marks удалено: build/Makefile удалено: build/cmake_install.cmake удалено: build/idef0_editor удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_BlockItem.cpp удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_BlockItem.cpp.d удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_DiagramScene.cpp удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_DiagramScene.cpp.d удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_JunctionItem.cpp удалено: build/idef0_editor_autogen/DWIBBXP2LJ/moc_JunctionItem.cpp.d удалено: build/idef0_editor_autogen/UVLADIE3JM/moc_MainWindow.cpp удалено: build/idef0_editor_autogen/UVLADIE3JM/moc_MainWindow.cpp.d удалено: build/idef0_editor_autogen/deps удалено: build/idef0_editor_autogen/moc_predefs.h удалено: build/idef0_editor_autogen/mocs_compilation.cpp удалено: build/idef0_editor_autogen/timestamp удалено: codex изменено: src/items/ArrowItem.cpp изменено: src/items/ArrowItem.h изменено: src/items/BlockItem.h изменено: src/items/DiagramScene.cpp изменено: src/items/DiagramScene.h
This commit is contained in:
parent
53afa3f728
commit
abdbae5a11
79 changed files with 218 additions and 46399 deletions
|
|
@ -14,6 +14,9 @@ public:
|
|||
BlockItem* createBlockAt(const QPointF& scenePos);
|
||||
BlockItem* createBlockWithId(const QPointF& scenePos, int id, const QString& title);
|
||||
void requestSnapshot();
|
||||
bool goDownIntoSelected();
|
||||
bool goDownIntoBlock(BlockItem* b);
|
||||
bool goUp();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent* e) override;
|
||||
|
|
@ -22,23 +25,6 @@ protected:
|
|||
void keyPressEvent(QKeyEvent* e) override;
|
||||
|
||||
private:
|
||||
ArrowItem* m_dragArrow = nullptr;
|
||||
QPointer<BlockItem> m_dragFromBlock;
|
||||
QPointer<JunctionItem> m_dragFromJunction;
|
||||
BlockItem::Port m_dragFromPort = BlockItem::Port::Output;
|
||||
int m_nextBlockId = 1;
|
||||
int m_nextJunctionId = 1;
|
||||
bool m_snapshotScheduled = false;
|
||||
bool m_restoringSnapshot = false;
|
||||
bool m_itemDragActive = false;
|
||||
QHash<QGraphicsItem*, QPointF> m_pressPositions;
|
||||
|
||||
bool tryStartArrowDrag(const QPointF& scenePos);
|
||||
bool tryFinishArrowDrag(const QPointF& scenePos);
|
||||
bool tryBranchAtArrow(const QPointF& scenePos);
|
||||
void cancelCurrentDrag();
|
||||
void deleteSelection();
|
||||
|
||||
struct Snapshot {
|
||||
struct Endpoint {
|
||||
enum class Kind { None, Block, Junction, Scene } kind = Kind::None;
|
||||
|
|
@ -63,6 +49,28 @@ private:
|
|||
QVector<Arrow> arrows;
|
||||
};
|
||||
|
||||
struct HierNode { int blockId; Snapshot snapshot; };
|
||||
|
||||
ArrowItem* m_dragArrow = nullptr;
|
||||
QPointer<BlockItem> m_dragFromBlock;
|
||||
QPointer<JunctionItem> m_dragFromJunction;
|
||||
BlockItem::Port m_dragFromPort = BlockItem::Port::Output;
|
||||
int m_nextBlockId = 1;
|
||||
int m_nextJunctionId = 1;
|
||||
bool m_snapshotScheduled = false;
|
||||
bool m_restoringSnapshot = false;
|
||||
bool m_itemDragActive = false;
|
||||
QHash<QGraphicsItem*, QPointF> m_pressPositions;
|
||||
int m_currentBlockId = -1;
|
||||
QVector<HierNode> m_hierarchy;
|
||||
QHash<int, Snapshot> m_children; // blockId -> saved child diagram
|
||||
|
||||
bool tryStartArrowDrag(const QPointF& scenePos);
|
||||
bool tryFinishArrowDrag(const QPointF& scenePos);
|
||||
bool tryBranchAtArrow(const QPointF& scenePos);
|
||||
void cancelCurrentDrag();
|
||||
void deleteSelection();
|
||||
|
||||
QVector<Snapshot> m_history;
|
||||
int m_historyIndex = -1;
|
||||
|
||||
|
|
@ -72,6 +80,8 @@ private:
|
|||
void scheduleSnapshot();
|
||||
void undo();
|
||||
void maybeSnapshotMovedItems();
|
||||
void resetHistory(const Snapshot& base);
|
||||
void ensureFrame();
|
||||
|
||||
enum class Edge { None, Left, Right, Top, Bottom };
|
||||
Edge hitTestEdge(const QPointF& scenePos, QPointF* outScenePoint = nullptr) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue