# MarkupItem

class `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.

  ## Index

  Constructors

  - `constructor`

  Properties

  - `uniqueId`

  Methods

  - `draw`
  - `getClassName`
  - `hit`
  - `hitWithTolerance`
  - `onDeselect`
  - `onSelect`
  - `remove`
  - `toJson`

## Constructors

`Markup.MarkupItem.``constructor`()
  MarkupItem(): `MarkupItem`

  Returns: `MarkupItem`

## Properties

`Markup.MarkupItem.``uniqueId`
  uniqueId: string

## Methods

`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`

  > _view: `IView`

  Returns: void

`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

`Markup.MarkupItem.``hit`()
  hit(_point: `Point2`, _view: `IView`): boolean

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

  Parameters

  > _point: `Point2`

  > _view: `IView`

  Returns: boolean

  > boolean value indicating whether this item was picked

`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`

  > _view: `IView`

  > _pickTolerance: number

  Returns: boolean

  > boolean value indicating whether this item was picked

`Markup.MarkupItem.``onDeselect`()
  onDeselect(): void

  Called when this markup item is deselected by the system

  Returns: void

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

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

  Parameters

  > _view: `IView`

  Returns: void

`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`)

  Returns: void

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

  Creates an object ready for JSON serialization.

  Returns: object

  > The prepared object.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...