# LineMarkup

class Markup.Line.LineMarkup()

  This class is for 3D line markup items.

Constructors

- `constructor()`

Properties

- `className`

Methods

- `draw()`

- `getClassName()`

- `getFirstNodeId()`

- `getFirstPoint()`

- `getId()`

- `getLineColor()`

- `getLineOpacity()`

- `getLinePattern()`

- `getLinePatternLength()`

- `getLinePatternLengthUnit()`

- `getNodeId()`

- `getSecondNodeId()`

- `getSecondPoint()`

- `hit()`

- `hitWithTolerance()`

- `onDeselect()`

- `onSelect()`

- `remove()`

- `removeLine()`

- `setFirstNodeId()`

- `setFirstPoint()`

- `setId()`

- `setLineColor()`

- `setLineOpacity()`

- `setLinePattern()`

- `setSecondNodeId()`

- `setSecondPoint()`

- `toJson()`

- `updateLine()`

- `fromJson()`

## Constructors

LineMarkup.constructor(viewer, firstPoint, secondPoint, firstNodeId, secondNodeId)
  Arguments

    - viewer (`WebViewer()`) – None

    - firstPoint (`null | Point3()`) – None

    - secondPoint (`null | Point3()`) – None

    - firstNodeId (`null | number()`) – None

    - secondNodeId (`null | number()`) – None

  Return type

    LineMarkup

## Properties

LineMarkup.className
  Type

    string

## Methods

### draw

LineMarkup.draw(_renderer, _view)
  Arguments

    - _renderer (`MarkupRenderer()`) – None

    - _view (`View()`) – None

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

  Return type

    void

### getClassName

LineMarkup.getClassName()

  Returns the class name for this markup item.

  Return type

    string

### getFirstNodeId

LineMarkup.getFirstNodeId()

  Gets the NodeId of the part associated with the first line point

  Return type

    null | number

### getFirstPoint

LineMarkup.getFirstPoint()

  Gets the first point on the line.

  Returns

    the first point, or null if none is set.

  Return type

    null | Point3

### getId

LineMarkup.getId()

  Returns a unique markup id for this line.

  Return type

    string

### getLineColor

LineMarkup.getLineColor()

  Gets the line color.

  Return type

    Color

### getLineOpacity

LineMarkup.getLineOpacity()

  Gets the line opacity.

  Return type

    number

### getLinePattern

LineMarkup.getLinePattern()

  Gets the line pattern.

  Return type

    null | LinePattern

### getLinePatternLength

LineMarkup.getLinePatternLength()

  Gets the length of a single repetition of the line pattern.

  Return type

    null | number

### getLinePatternLengthUnit

LineMarkup.getLinePatternLengthUnit()

  Gets the unit in which the line pattern length is measured.

  Return type

    null | LinePatternLengthUnit

### getNodeId

LineMarkup.getNodeId()

  Gets the node id associated with the line markup.

  Return type

    null | number

### getSecondNodeId

LineMarkup.getSecondNodeId()

  Gets the NodeId of the part associated with the second line point

  Return type

    null | number

### getSecondPoint

LineMarkup.getSecondPoint()

  Gets the second point on the line.

  Returns

    the second point, or null if none is set.

  Return type

    null | Point3

### hit

LineMarkup.hit(_point, _view)
  Arguments

    - _point (`Point2()`) – None

    - _view (`View()`) – None

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

  Returns

    boolean value indicating whether this item was picked

  Return type

    boolean

### hitWithTolerance

LineMarkup.hitWithTolerance(_point, _view, _pickTolerance)
  Arguments

    - _point (`Point2()`) – None

    - _view (`View()`) – None

    - _pickTolerance (`number()`) – None

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

  Returns

    boolean value indicating whether this item was picked

  Return type

    boolean

### onDeselect

LineMarkup.onDeselect()

  Called when this markup item is deselected by the system

  Return type

    void

### onSelect

LineMarkup.onSelect()

  Called when this markup item is selected by the system.

  Return type

    void

### remove

LineMarkup.remove()

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

  Return type

    void

### removeLine

LineMarkup.removeLine()

  Removes the line geometry from the scene.

  Return type

    Promise <void>

### setFirstNodeId

LineMarkup.setFirstNodeId(nodeId)
  Arguments

    - nodeId (`null | number()`) – None

  Sets the NodeId of the part associated with the first line point

  Return type

    void

### setFirstPoint

LineMarkup.setFirstPoint(firstPoint)
  Arguments

    - firstPoint (`null | Point3()`) – None

  Sets the first point on the line.

  Return type

    void

### setId

LineMarkup.setId(id)
  Arguments

    - id (`string()`) – None

  Sets a markup id for this line.

  Return type

    void

### setLineColor

LineMarkup.setLineColor(color)
  Arguments

    - color (`Color()`) – None

  Sets the line color.

  Return type

    void

### setLineOpacity

LineMarkup.setLineOpacity(opacity)
  Arguments

    - opacity (`number()`) – None

  Sets the line opacity.

  Return type

    void

### setLinePattern

LineMarkup.setLinePattern(pattern, patternLength, patternLengthUnit)
  Arguments

    - pattern (`LinePattern()`) – The line pattern.

    - patternLength (`number()`) – The length of a single repetition of the line pattern.

    - patternLengthUnit (`LinePatternLengthUnit()`) – The unit in which the pattern length is measured.

  Sets the line pattern.

  Return type

    void

### setSecondNodeId

LineMarkup.setSecondNodeId(nodeId)
  Arguments

    - nodeId (`null | number()`) – None

  Sets the NodeId of the part associated with the second line point

  Return type

    void

### setSecondPoint

LineMarkup.setSecondPoint(secondPoint)
  Arguments

    - secondPoint (`null | Point3()`) – None

  Sets the second point on the line.

  Return type

    void

### toJson

LineMarkup.toJson()

  Creates an object ready for JSON serialization.

  Returns

    The prepared object.

  Return type

    object

### updateLine

LineMarkup.updateLine()

  Draws updated line geometry in the scene.

  Return type

    Promise <void>

### static fromJson

LineMarkup.fromJson(objData, viewer)
  Arguments

    - objData (`any()`) – None

    - viewer (`WebViewer()`) – None

  Creates a new [[LineMarkup]] from an object given by [[toJson]].

  Returns

    The prepared object.

  Return type

    Promise <LineMarkup>