summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
committerKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
commit90ae413a94da014dbf7a6a8ab584f7c668483a5a (patch)
tree4e0528a2b2fb2004988e7fc804ea2f1354f1f5d5 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
parent800cc56380d1edfe567a6a66bef13e8950eb2b0c (diff)
pgf 3.0.0
git-svn-id: svn://tug.org/texlive/trunk@33057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua72
1 files changed, 72 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
new file mode 100644
index 00000000000..b813ccab603
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
@@ -0,0 +1,72 @@
+-- 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.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+
+
+
+
+-- Declare the gd namespace
+
+local gd = {}
+require("pgf").gd = gd
+
+
+
+
+
+
+
+-- Deprecated:
+--
+--
+-- Helping function for creating new algorithm classes
+--
+-- This function creates a new algorithm class. This class will have a
+-- new method, that takes a graph and, optionally, a parent algorithm
+-- as inputs. They will be stored in the "graph" and "parent_algorithm"
+-- fields, respectively.
+--
+-- @param info This table is used to configure the new class. It has
+-- the following fields: First, there is the "properties" table. If
+-- this table is present, it will be used as the default table. Second,
+-- it can have a graph_parameters table. This table will be used in the
+-- constructor to preload graph parameters from the pgf layer. For
+-- this, each entry of the table should be of the form
+--
+-- key = 'string'
+--
+-- What happens is that upon the creation of a new algorithm object,
+-- for each key we lookup the graph option 'string' and
+-- store its value in the key of the new algorithm object.
+--
+-- @return A table that is a class with a new function setup.
+
+function gd.new_algorithm_class (class)
+ class.__index = class
+ class.new =
+ function (initial)
+
+ -- Create new object
+ local obj = {}
+ for k,v in pairs(initial) do
+ obj[k] = v
+ end
+ setmetatable(obj, class)
+
+ return obj
+ end
+ class.preconditions = {}
+ class.postconditions = {}
+
+ return class
+end
+
+
+return gd \ No newline at end of file