MarkupItem

class wv.Markup.MarkupItem()

This is a base class for all markup items that are overlayed over the viewer. Inherit from this class or provide an identical interface when creating custom markup items.

Constructors

wv.Markup.MarkupItem.constructor()
MarkupItem(): MarkupItem

Returns: MarkupItem

Properties

wv.Markup.MarkupItem.uniqueId
uniqueId: string

Methods

wv.Markup.MarkupItem.draw()
draw(_renderer: MarkupRenderer, _view: IView): void

Called when the markup item should be redrawn on a specific view. This most typically happens when the scene is rendered.

Parameters

_renderer: MarkupRenderer

renderer engine to draw.

_view: IView

the view to draw on.

Returns: void

wv.Markup.MarkupItem.getClassName()
getClassName(): string

Gets the fully qualified class name for this markup item. E.g. “Communicator.Markup.Redline.RedlineCircle”

Returns: string

fully qualified class name
wv.Markup.MarkupItem.hit()
hit(_point: Point2, _view: IView): boolean

Called when a hit test is performed on this markup item.

Parameters

_point: Point2

position in window where the hit test is being performed.

_view: IView

the projection where the hit test occurred.

Returns: boolean

boolean value indicating whether this item was picked
wv.Markup.MarkupItem.hitWithTolerance()
hitWithTolerance(_point: Point2, _view: IView, _pickTolerance: number): boolean

Called when a hit test is performed on this markup item.

Parameters

_point: Point2

position in window where the hit test is being performed.

_view: IView

the projection where the hit test occurred.

_pickTolerance: number

amount of tolerance allowed for a hit in pixels.

Returns: boolean

boolean value indicating whether this item was picked
wv.Markup.MarkupItem.onDeselect()
onDeselect(): void

Called when this markup item is deselected by the system

Returns: void

wv.Markup.MarkupItem.onSelect()
onSelect(_view: IView): void

Called when this markup item is selected by the system from a given view.

Parameters

_view: IView

the view where the selection occurred

Returns: void

wv.Markup.MarkupItem.remove()
remove(_view: (None | IView)): void

Called when the MarkupItem is removed from a view from the system. Any cleanup that needs to be done should be performed in this method.

Parameters

_view: (None | IView)

the view to remove from, null if removed from everywhere.

Returns: void

wv.Markup.MarkupItem.toJson()
toJson(): object

Creates an object ready for JSON serialization.

Returns: object

The prepared object.