summaryrefslogtreecommitdiff
path: root/tikzit/src/common/GraphChange.h
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-30 15:33:15 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-30 15:33:15 +0000
commita7184527c392a02cf34b85f7f40f9d59348dfb26 (patch)
tree63449c8886cbadf998bbc5bcead8af645e716983 /tikzit/src/common/GraphChange.h
parent31ff43125b0629b688a36c2a97c233ec878b3fbc (diff)
Undo/redo support for ordering changes
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@404 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/common/GraphChange.h')
-rw-r--r--tikzit/src/common/GraphChange.h47
1 files changed, 46 insertions, 1 deletions
diff --git a/tikzit/src/common/GraphChange.h b/tikzit/src/common/GraphChange.h
index 73a912a..cb4ca09 100644
--- a/tikzit/src/common/GraphChange.h
+++ b/tikzit/src/common/GraphChange.h
@@ -34,7 +34,9 @@ typedef enum {
NodesShift,
NodesFlip,
BoundingBoxChange,
- GraphPropertyChange
+ GraphPropertyChange,
+ NodeOrderChange,
+ EdgeOrderChange
} ChangeType;
/*!
@@ -66,6 +68,9 @@ typedef enum {
NSMapTable *oldEdgeTable, *nwEdgeTable;
NSRect oldBoundingBox, nwBoundingBox;
GraphElementData *oldGraphData, *nwGraphData;
+
+ NSArray *oldNodeOrder, *newNodeOrder;
+ NSArray *oldEdgeOrder, *newEdgeOrder;
}
/*!
@@ -183,6 +188,30 @@ typedef enum {
@property (copy) GraphElementData *nwGraphData;
/*!
+ @property oldNodeOrder
+ @brief The old node list.
+ */
+@property (copy) NSArray *oldNodeOrder;
+
+/*!
+ @property newNodeOrder
+ @brief The new node list.
+ */
+@property (copy) NSArray *newNodeOrder;
+
+/*!
+ @property oldEdgeOrder
+ @brief The old edge list.
+ */
+@property (copy) NSArray *oldEdgeOrder;
+
+/*!
+ @property newEdgeOrder
+ @brief The new edge list.
+ */
+@property (copy) NSArray *newEdgeOrder;
+
+/*!
@brief Invert a GraphChange.
@details Invert a GraphChange. Calling [graph applyGraphChange:[[graph msg:...] invert]]
should leave the graph unchanged for any method of Graph that returns a
@@ -287,6 +316,22 @@ typedef enum {
*/
+ (GraphChange*)propertyChangeOfGraphFrom:(GraphElementData*)oldData to:(GraphElementData*)newData;
+/*!
+ @brief Construct a node order change
+ @param old The old ordering
+ @param new The new ordering
+ @result A node order change
+ */
++ (GraphChange*)nodeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected;
+
+/*!
+ @brief Construct an edge order change
+ @param old The old ordering
+ @param new The new ordering
+ @result A edge order change
+ */
++ (GraphChange*)edgeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected;
+
@end
// vi:ft=objc:noet:ts=4:sts=4:sw=4