summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua65
1 files changed, 65 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
new file mode 100644
index 00000000000..748eee9429a
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
@@ -0,0 +1,65 @@
+-- Copyright 2011 by Jannis Pohlmann
+-- Copyright 2012 by Till Tantau
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+-- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+
+
+
+--- The Cluser class defines a model of a cluster inside a graph.
+--
+--
+
+local Cluster = {}
+Cluster.__index = Cluster
+
+
+-- Namespace
+
+
+
+--- TODO Jannis: Add documentation for this class.
+--
+function Cluster.new(name)
+ local cluster = {
+ name = name,
+ nodes = {},
+ contains_node = {},
+ }
+ setmetatable(cluster, Cluster)
+ return cluster
+end
+
+
+
+function Cluster:getName()
+ return self.name
+end
+
+
+
+function Cluster:addNode(node)
+ if not self:findNode(node) then
+ self.contains_node[node] = true
+ self.nodes[#self.nodes + 1] = node
+ end
+end
+
+
+
+function Cluster:findNode(node)
+ return self.contains_node[node]
+end
+
+
+
+
+-- Done
+
+return Cluster \ No newline at end of file