summaryrefslogtreecommitdiff
path: root/tikzit/src/common/Graph.h
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-03-10 13:37:44 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-03-10 13:37:44 +0000
commite6636042890e1dbfc442dfa0fedd9797c7cb8eff (patch)
tree20ce19e671bdd0e43fceed86172a41724c94926f /tikzit/src/common/Graph.h
parent0cd05a572e48b1e649ecdc8b24920c497e40466e (diff)
Make common code KVC compliant, and implement NSCopying where relevant
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@420 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/common/Graph.h')
-rw-r--r--tikzit/src/common/Graph.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/tikzit/src/common/Graph.h b/tikzit/src/common/Graph.h
index e629464..c680219 100644
--- a/tikzit/src/common/Graph.h
+++ b/tikzit/src/common/Graph.h
@@ -44,7 +44,7 @@
Graph changes can be re-done by calling applyGraphChange. They can be undone
by calling applyGraphChange on [change inverse].
*/
-@interface Graph : NSObject {
+@interface Graph : NSObject <NSCopying> {
NSRecursiveLock *graphLock;
BOOL dirty; // keep track of when inEdges and outEdges need an update
NSMutableArray *nodes;
@@ -63,6 +63,13 @@
*/
@property (copy) GraphElementData *data;
+// KVC methods
+- (void) insertObject:(GraphElementProperty*)gep
+ inDataAtIndex:(NSUInteger)index;
+- (void) removeObjectFromDataAtIndex:(NSUInteger)index;
+- (void) replaceObjectInDataAtIndex:(NSUInteger)index
+ withObject:(GraphElementProperty*)gep;
+
/*!
@property nodes
@brief The set of nodes.
@@ -129,6 +136,14 @@
- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds;
/*!
+ @brief Gives a copy of the full subgraph with the given nodes.
+ @param nds a set of nodes.
+ @param zone an allocation zone
+ @result A subgraph.
+ */
+- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds zone:(NSZone*)zone;
+
+/*!
@brief Gives a set of edge-arrays that partition all of the edges in the graph.
@result An NSet of NSArrays of edges.
*/
@@ -313,6 +328,8 @@
*/
+ (NSMapTable*)nodeTableForNodes:(NSSet*)nds;
++ (NSMapTable*)nodeTableForNodes:(NSSet*)nds withZone:(NSZone*)zone;
+
/*!
@brief Copy the edge set and return a table of copies, whose
keys are the original edges. This is used to save the state
@@ -322,6 +339,8 @@
*/
+ (NSMapTable*)edgeTableForEdges:(NSSet*)es;
++ (NSMapTable*)edgeTableForEdges:(NSSet*)es withZone:(NSZone*)zone;
+
/*!
@brief Compute the bounds for a set of nodes.
@param nds an enumerable collection of nodes.