Skip to main content

Class: InkModel

InkModel.InkModel(typeopt, rootIDopt)

Provides hierarchical representation of ink data model

Constructor

new InkModel(typeopt, rootIDopt)

Parameters:
NameTypeAttributesDefaultDescription
typeInkModel.InkTree.Type<optional>STROKEInk model type
rootIDstring.<GUID><optional>auto generated GUIDRoot node ID
Properties:
NameTypeAttributesDefaultDescription
idstring<optional>External identifier
versionstring<optional>UIM version, available only when model is decoded
disableSensorDataIntegrityboolean<optional>trueWhen stroke is removed from the model, stroke sensor data will be kept by default,to keep integrity between strokes and sensor data, this flag should be false
unitScaleFactorfloat<optional>1Conversion factor for strokes points - DIP conversions, when 1, conversion is not needed
transformCommon.MatrixInk model transform matrix, could be set on demand
sensorDataArray.<InkInput.SensorData>Ink model sensor input, use setter to register not stroke related sensor data (like hover data for example)
strokesArray.<Stroke>
propsobject.<string, any><optional>User defined model properties
knowledgeGraphSemantics.TripleStoreInk model knowledge

Extends

Methods

addPath(path, parentopt, indexopt) → InkModel.InkPath

Shorthand of createElement + appendChild

Parameters:
NameTypeAttributesDefaultDescription
pathStroke|InkInput.SensorData
parentInkModel.InkGroup<optional>rootWhere to add path
indexint<optional>children.lengthNode position
Returns:

InkPath node

Type

InkModel.InkPath

clone() → InkModel

Provides copy of the current instance

Returns:

Ink model copy

Type

InkModel

createElement(content, viewopt, fragmentopt) → InkModel.InkPath

Creates path nodes for underlying model

Parameters:
NameTypeAttributesDescription
contentStroke|InkInput.SensorData
viewInkModel.View<optional>Model underlying view
fragmentPathBuilding.SplineFragment<optional>applicable only in views
Returns:

InkPath node

Type

InkModel.InkPath

createGroup(idopt) → InkModel.InkGroup

Creates group nodes for underlying model

Parameters:
NameTypeAttributesDefaultDescription
idstring.<GUID><optional>auto generated GUIDInkGroup ID
Returns:

InkGroup node

Type

InkModel.InkGroup

createView(name, rootIDopt) → InkModel.View

Parameters:
NameTypeAttributesDefaultDescription
nameURIView descriptor
rootIDstring.<GUID><optional>auto generated GUIDRoot node name
Returns:

Underlying view

Type

InkModel.View

getBrush(name) → Rendering.Brush

Get brush related with model

Parameters:
NameTypeDescription
nameURIBrush identifier
Returns:

Type

Rendering.Brush

getNode(id) → InkModel.InkNode

Get ink DOM element

Parameters:
NameTypeDescription
idstringInkNode identifier (it could be internal id or it's uri)
Returns:

Type

InkModel.InkNode

getPath(id) → Stroke|InkInput.SensorData

Get path registerd in the model structure.InkPath could be a Stroke or SensorData data, depends from the model type.

Parameters:
NameTypeDescription
idstringInkPath identifier
Returns:

Type

Stroke|InkInput.SensorData

getSensorData(id) → InkInput.SensorData

Get sensor data

Parameters:
NameTypeDescription
idstringSensorData identifier
Returns:

Type

InkInput.SensorData

getStroke(id) → Stroke

Get stroke registerd in the model structure.This method is applicable only for models with type STROKE.

Parameters:
NameTypeDescription
idstringStroke identifier
Returns:

Type

Stroke

removePath(path)

Shorthand of element lookup + remove

Parameters:
NameTypeDescription
pathStroke|InkInput.SensorData

removeView(name)

Parameters:
NameTypeDescription
nameURIView descriptor

replacePath(stroke, strokes, autoGroupopt)

Replace stroke node with few ones

Parameters:
NameTypeAttributesDefaultDescription
strokeStrokeSource stroke
strokesArray.<Stroke>Source stroke fragmented data
autoGroupboolean<optional>falseMake group node for replacement

Home