new BoundInfoRecorder()
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 -
clear(context)
-
Clear bound infos in a context.
Parameters:
Name Type Description context
Object -
clearAll()
-
Clear bound infos in all context.
-
clearOnRenderer(context, renderer)
-
Clear recorded info of renderer on context.
Parameters:
Name Type Description context
Object renderer
Object -
getAllBoundInfosOfContext(context) → {Array}
-
Returns an bound info array in a certain context.
Parameters:
Name Type Description context
Object 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 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 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 Returns:
- Type
- Object
-
getContainerBox(context) → {Hash}
-
Returns a minimal box that can contains all drawn elements in context.
Parameters:
Name Type Description context
Object Returns:
- Type
- Hash
-
getInfo(context, obj) → {Object}
-
Returns recorded info item of obj in context.
Parameters:
Name Type Description context
Object obj
Object 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 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 -
remove(context, obj, parentObj)
-
Remove an info item in map.
Parameters:
Name Type Description context
Object obj
Object parentObj
Object
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.