GuilloteneAllocator

class GuilloteneAllocator implements AreaAllocator

Summary


Methods from GuilloteneAllocator

PIXI.Rectangle & AreaPtr
allocate(width: number, height: number, rect: PIXI.Rectangle)

Allocates an area of the given width and height.

void
free(areaPtr: AreaPtr)
AreaNode
protected findArea(aw: number, ah: number)

Finds an area node with minimum width aw and minimum height ah.

AreaNode
protected findAreaRecursive(rootArea: AreaNode, aw: number, ah: number)

The recursive implementation for AreaAllocator#findArea.

AreaField
protected getAreaField(node: AreaNode)

Returns the area data for the node.

AreaNode[]
protected getChildren(node: AreaNode)

Returns the children of the passed node, if any.

PIXI.Rectangle
protected getFrame(node: AreaNode, rect: PIXI.Rectangle)

Returns the rectangle covered by the area node.

AreaNode
protected getParent(node: AreaNode)

Returns the parent of the area node.

boolean
protected hasChildren(node: AreaNode)

Returns whether the given node has any children.

SPLIT_ORIENTATION
protected splitOrientation(host: PIXI.Rectangle, hole: PIXI.Rectangle)

Returns the orientation of the primary split of host.

Public Methods


allocate GuilloteneAllocator.ts:59
allocate(width: number, height: number, rect: PIXI.Rectangle) → {PIXI.Rectangle & AreaPtr}

Allocates an area of the given width and height.

Parameters:
Name Type Attributes Description
width number

The width required for the allocated area.

height number

The height required for the allocated area.

rect PIXI.Rectangle

<optional>

An optional Rectangle instance to put the resulting area frame into.

Returns:
Type Description
PIXI.Rectangle & AreaPtr

The rectangle frame of the area allocated.

free GuilloteneAllocator.ts:92
free(areaPtr: AreaPtr) → {void}

Frees the area represented by the given area pointer. The original rectangle returned by GuilloteneAllocator#allocate included this pointer (the __mem_area property).

Parameters:
Name Type Description
areaPtr AreaPtr
Returns:
Type Description
void

Protected Methods


findArea GuilloteneAllocator.ts:209
protected findArea(aw: number, ah: number) → {AreaNode}

Finds an area node with minimum width aw and minimum height ah.

Parameters:
Name Type Description
aw number
ah number
Returns:
Type Description
AreaNode
findAreaRecursive GuilloteneAllocator.ts:220
protected findAreaRecursive(rootArea: AreaNode, aw: number, ah: number) → {AreaNode}

The recursive implementation for AreaAllocator#findArea.

Parameters:
Name Type Description
rootArea AreaNode
aw number
ah number
Returns:
Type Description
AreaNode
getAreaField GuilloteneAllocator.ts:116
protected getAreaField(node: AreaNode) → {AreaField}

Returns the area data for the node.

Parameters:
Name Type Description
node AreaNode
Returns:
Type Description
AreaField

The area data for the node.

getChildren GuilloteneAllocator.ts:189
protected getChildren(node: AreaNode) → {AreaNode[]}

Returns the children of the passed node, if any.

Parameters:
Name Type Description
node AreaNode
Returns:
Type Description
AreaNode[]
getFrame GuilloteneAllocator.ts:127
protected getFrame(node: AreaNode, rect: PIXI.Rectangle) → {PIXI.Rectangle}

Returns the rectangle covered by the area node.

Parameters:
Name Type Attributes Description
node AreaNode

The node whose covered rectangular area is needed.

rect PIXI.Rectangle

<optional>

An optional Rectangle instance to put the data in.

Returns:
Type Description
PIXI.Rectangle

The rectangle covered by node.

getParent GuilloteneAllocator.ts:167
protected getParent(node: AreaNode) → {AreaNode}

Returns the parent of the area node.

Parameters:
Name Type Description
node AreaNode
Returns:
Type Description
AreaNode

The parent of node

hasChildren GuilloteneAllocator.ts:178
protected hasChildren(node: AreaNode) → {boolean}

Returns whether the given node has any children.

Parameters:
Name Type Description
node AreaNode
Returns:
Type Description
boolean

Whether the given node has any children.

splitOrientation GuilloteneAllocator.ts:290
protected splitOrientation(host: PIXI.Rectangle, hole: PIXI.Rectangle) → {SPLIT_ORIENTATION}

Returns the orientation of the primary split of host.

Parameters:
Name Type Description
host PIXI.Rectangle
hole PIXI.Rectangle
Returns:
Type Description
SPLIT_ORIENTATION

Powered by webdoc!