Remove attraction points

This commit is contained in:
Robert Machmer 2016-01-02 15:18:50 +01:00
parent 78050c9af7
commit 4bf0d0473d

View File

@ -11,8 +11,6 @@ function Graph.new()
local edges = {};
local edgeIDs = 0;
local attractionPoint;
local minX, maxX, minY, maxY;
-- ------------------------------------------------
@ -90,18 +88,6 @@ function Graph.new()
self:removeEdges( node );
end
---
-- Adds a global attraction point.
-- This point won't show up in the graph itself and can not be interacted
-- with. Instead it only has the purpose to attract all nodes in the graph.
-- This can be useful if you have unconnected nodes and want to prevent
-- them from floating away.
-- @param ncx - The x-coordinate of the attraction point.
-- @param ncy - The y-coordinate of the attraction point.
function self:addAttractionPoint( ncx, ncy )
attractionPoint = Node.new( 'center', ncx, ncy );
end
---
-- Adds a new edge between two nodes.
-- @param origin - The node from which the edge originates.
@ -144,10 +130,6 @@ function Graph.new()
resetBoundaries();
for _, nodeA in pairs( nodes ) do
if attractionPoint then
nodeA:attractTo( attractionPoint );
end
if not nodeA:isAnchor() then
for _, nodeB in pairs( nodes ) do
if nodeA ~= nodeB then