Corner Stitching in Swift @ Base Labs - Krakow

Post on 30-Jun-2015

70 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Corner Stitching is technique for representing and interacting with 2D layouts with “Manhattan” features, that enables linear time algorithms for searching, creation, deletion, or compaction. Corner Stitching was first introduced by John K. Ousterhout in 1982. In the context of my thesis, I’ve ported the original algorithms from pseudo code written in Pascal to Smalltalk, and more recently I’ve been working on a SWIFT implementation, which I will briefly discuss in this lighting talk.

Transcript

Corner Stitching in SwiftLightning Talk @ Base Labs

Fernando Olivero

2D Space2D Shapes

Fixed Layout

Row

Column

Grid

Flow

Custom Layout

let point = CGPoint (10,200)

layout.shapeAt(point) ==

let layout =

Layout Protocol

let point = CGPoint (10,200)

layout.shapeAt(point) ==

let shape =

let layout =

Layout Protocol

shape.neighbours() == [ ]

Dynamic ?

Empty space after DELETE ?

Overlapping on INSERT?

Layout Protocol

shapeAt(aPoint)

neighboursOf(aShape)

remove(aShape)

insertShapeAt(aFrame)

Array<Shapes>

Array<Array<Shapes>>

Array<Shapes>

Data Structure

Fixed Layout

Custom Layout

Layout Protocol

Data Structure

Custom Layout

Layout Protocol

Data Structure

O(1) ?O(n) ?0(2^n)?

O(n) ?O(n^2) ?

Solid Tile

Empty Tile

Maximal horizontal rule1

2

as Tall aspossible

NeighboursOf(aShape)

O(#neighbours)

ShapeAt(aPoint)

InsertAt(aFrame,with:aValue)

On Average O(#AreaHeight)

TilesBelow(anArea)

On Average O(#AreaHeight)

Goodies I : Snowplow

O(#Tiles)

Goodies II : Compaction

O(#Tiles)

Goodies III : Routing

DEMO

Corner Stitching in SwiftLightning Talk @ Base Labs

Fernando Olivero

top related