Class: BoundInfoRecorder

Kekule.Render. BoundInfoRecorder

new BoundInfoRecorder()

Source:

Methods

add(context, obj, parentObj, boundInfo, renderer)

Add an info item to list.
Parameters:
Name Type Description
context Object
obj Object
parentObj Object
boundInfo Object
renderer Object
Source:

clear(context)

Clear bound infos in a context.
Parameters:
Name Type Description
context Object
Source:

clearAll()

Clear bound infos in all context.
Source:

clearOnRenderer(context, renderer)

Clear recorded info of renderer on context.
Parameters:
Name Type Description
context Object
renderer Object
Source:

getAllBoundInfosOfContext(context) → {Array}

Returns an bound info array in a certain context.
Parameters:
Name Type Description
context Object
Source:
Returns:
Type
Array

getAllRecordedInfoOfContext(context) → {Array}

Returns an array that contains bound / obj / parentObj / renderer information in a certain context.
Parameters:
Name Type Description
context Object
Source:
Returns:
Type
Array

getBelongedInfos(context, objOrParentObj) → {Array}

Returns recorded info items based on object, or based on all children of parent object.
Parameters:
Name Type Description
context Object
objOrParentObj Object
Source:
Returns:
Type
Array

getBound(context, obj) → {Object}

Returns recorded bound info of obj in context. If direct bound not found, this method will return the container box of all bound info of obj's children.
Parameters:
Name Type Description
context Object
obj Object
Source:
Returns:
Type
Object

getContainerBox(context) → {Hash}

Returns a minimal box that can contains all drawn elements in context.
Parameters:
Name Type Description
context Object
Source:
Returns:
Type
Hash

getInfo(context, obj) → {Object}

Returns recorded info item of obj in context.
Parameters:
Name Type Description
context Object
obj Object
Source:
Returns:
Type
Object

getIntersectionInfos(context, coord, refCoord, inflation) → {Array}

Get all intersected bound and related informations on coord.
Parameters:
Name Type Description
context Object
coord Hash
refCoord Hash This value is used in 3D mode. Passes null to it in 2D mode.
inflation Int
Source:
Returns:
Type
Array

modify(context, obj, parentObj, boundInfo, renderer)

Modify bound info in list.
Parameters:
Name Type Description
context Object
obj Object
parentObj Object
boundInfo Object
renderer Object
Source:

remove(context, obj, parentObj)

Remove an info item in map.
Parameters:
Name Type Description
context Object
obj Object
parentObj Object
Source:

Events

updateBasicDrawObject

Invoked when a basic object (node, connector, glyph...) is drawn, updated or removed by renderer. event param of it has fields: {obj, parentObj, boundInfo, updateType} where boundInfo provides the bound box information of this object on context. It has the following fields: { context: drawing context object obj: drawn object parentObj: parent of drawn object boundInfo: a hash containing info of bound, including fields: { shapeType: value from Kekule.Render.MetaShapeType or Kekule.Render.Meta3DShapeType. coords: [Array of coords] } updateType: add, modify or remove } boundInfo may also be a array for complex situation (such as multicenter bond): [boundInfo1, boundInfo2, boundInfo3...]. Note that in removed event, boundInfo may be null.
Source: