.. role:: ts-api-decorator

##########
LineMarkup
##########

.. js:module:: Markup.Line
   :noindex:

.. container:: ts-api-section

   .. js:class:: LineMarkup

      This class is for 3D line markup items.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Markup.Line.LineMarkup.constructor`



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-class

   * :js:attr:`~Markup.Line.LineMarkup.className`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Markup.Line.LineMarkup.draw`
   * :js:meth:`~Markup.Line.LineMarkup.getClassName`
   * :js:meth:`~Markup.Line.LineMarkup.getFirstNodeId`
   * :js:meth:`~Markup.Line.LineMarkup.getFirstPoint`
   * :js:meth:`~Markup.Line.LineMarkup.getId`
   * :js:meth:`~Markup.Line.LineMarkup.getLineColor`
   * :js:meth:`~Markup.Line.LineMarkup.getLineOpacity`
   * :js:meth:`~Markup.Line.LineMarkup.getLinePattern`
   * :js:meth:`~Markup.Line.LineMarkup.getLinePatternLength`
   * :js:meth:`~Markup.Line.LineMarkup.getLinePatternLengthUnit`
   * :js:meth:`~Markup.Line.LineMarkup.getNodeId`
   * :js:meth:`~Markup.Line.LineMarkup.getSecondNodeId`
   * :js:meth:`~Markup.Line.LineMarkup.getSecondPoint`
   * :js:meth:`~Markup.Line.LineMarkup.hit`
   * :js:meth:`~Markup.Line.LineMarkup.hitWithTolerance`
   * :js:meth:`~Markup.Line.LineMarkup.onDeselect`
   * :js:meth:`~Markup.Line.LineMarkup.onSelect`
   * :js:meth:`~Markup.Line.LineMarkup.remove`
   * :js:meth:`~Markup.Line.LineMarkup.removeLine`
   * :js:meth:`~Markup.Line.LineMarkup.setFirstNodeId`
   * :js:meth:`~Markup.Line.LineMarkup.setFirstPoint`
   * :js:meth:`~Markup.Line.LineMarkup.setId`
   * :js:meth:`~Markup.Line.LineMarkup.setLineColor`
   * :js:meth:`~Markup.Line.LineMarkup.setLineOpacity`
   * :js:meth:`~Markup.Line.LineMarkup.setLinePattern`
   * :js:meth:`~Markup.Line.LineMarkup.setSecondNodeId`
   * :js:meth:`~Markup.Line.LineMarkup.setSecondPoint`
   * :js:meth:`~Markup.Line.LineMarkup.toJson`
   * :js:meth:`~Markup.Line.LineMarkup.updateLine`
   * :js:meth:`~Markup.Line.LineMarkup.fromJson`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: LineMarkup.constructor( viewer, firstPoint, secondPoint, firstNodeId, secondNodeId)

      :param viewer: None
      :type viewer: WebViewer
      :param firstPoint: None
      :type firstPoint: null | Point3
      :param secondPoint: None
      :type secondPoint: null | Point3
      :param firstNodeId: None
      :type firstNodeId: null | number
      :param secondNodeId: None
      :type secondNodeId: null | number


      :rtype: LineMarkup



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: LineMarkup.className

      :type: string





Methods
=======

.. rst-class:: ts-api-section

draw
----

.. js:method:: LineMarkup.draw( _renderer, _view)

   :param _renderer: None
   :type _renderer: MarkupRenderer
   :param _view: None
   :type _view: View


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


   :rtype: void

.. rst-class:: ts-api-section

getClassName
------------

.. js:method:: LineMarkup.getClassName()



   Returns the class name for this markup item.


   :rtype: string

.. rst-class:: ts-api-section

getFirstNodeId
--------------

.. js:method:: LineMarkup.getFirstNodeId()



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


   :rtype: null | number

.. rst-class:: ts-api-section

getFirstPoint
-------------

.. js:method:: LineMarkup.getFirstPoint()



   Gets the first point on the line.

   :returns: the first point, or null if none is set.


   :rtype: null | Point3

.. rst-class:: ts-api-section

getId
-----

.. js:method:: LineMarkup.getId()



   Returns a unique markup id for this line.


   :rtype: string

.. rst-class:: ts-api-section

getLineColor
------------

.. js:method:: LineMarkup.getLineColor()



   Gets the line color.


   :rtype: Color

.. rst-class:: ts-api-section

getLineOpacity
--------------

.. js:method:: LineMarkup.getLineOpacity()



   Gets the line opacity.


   :rtype: number

.. rst-class:: ts-api-section

getLinePattern
--------------

.. js:method:: LineMarkup.getLinePattern()



   Gets the line pattern.


   :rtype: null | LinePattern

.. rst-class:: ts-api-section

getLinePatternLength
--------------------

.. js:method:: LineMarkup.getLinePatternLength()



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


   :rtype: null | number

.. rst-class:: ts-api-section

getLinePatternLengthUnit
------------------------

.. js:method:: LineMarkup.getLinePatternLengthUnit()



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


   :rtype: null | LinePatternLengthUnit

.. rst-class:: ts-api-section

getNodeId
---------

.. js:method:: LineMarkup.getNodeId()



   Gets the node id associated with the line markup.


   :rtype: null | number

.. rst-class:: ts-api-section

getSecondNodeId
---------------

.. js:method:: LineMarkup.getSecondNodeId()



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


   :rtype: null | number

.. rst-class:: ts-api-section

getSecondPoint
--------------

.. js:method:: LineMarkup.getSecondPoint()



   Gets the second point on the line.

   :returns: the second point, or null if none is set.


   :rtype: null | Point3

.. rst-class:: ts-api-section

hit
---

.. js:method:: LineMarkup.hit( _point, _view)

   :param _point: None
   :type _point: Point2
   :param _view: None
   :type _view: View


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

   :returns: boolean value indicating whether this item was picked


   :rtype: boolean

.. rst-class:: ts-api-section

hitWithTolerance
----------------

.. js:method:: LineMarkup.hitWithTolerance( _point, _view, _pickTolerance)

   :param _point: None
   :type _point: Point2
   :param _view: None
   :type _view: View
   :param _pickTolerance: None
   :type _pickTolerance: number


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

   :returns: boolean value indicating whether this item was picked


   :rtype: boolean

.. rst-class:: ts-api-section

onDeselect
----------

.. js:method:: LineMarkup.onDeselect()



   Called when this markup item is deselected by the system


   :rtype: void

.. rst-class:: ts-api-section

onSelect
--------

.. js:method:: LineMarkup.onSelect()



   Called when this markup item is selected by the system.


   :rtype: void

.. rst-class:: ts-api-section

remove
------

.. js:method:: LineMarkup.remove()



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


   :rtype: void

.. rst-class:: ts-api-section

removeLine
----------

.. js:method:: LineMarkup.removeLine()



   Removes the line geometry from the scene.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setFirstNodeId
--------------

.. js:method:: LineMarkup.setFirstNodeId( nodeId)

   :param nodeId: None
   :type nodeId: null | number


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


   :rtype: void

.. rst-class:: ts-api-section

setFirstPoint
-------------

.. js:method:: LineMarkup.setFirstPoint( firstPoint)

   :param firstPoint: None
   :type firstPoint: null | Point3


   Sets the first point on the line.


   :rtype: void

.. rst-class:: ts-api-section

setId
-----

.. js:method:: LineMarkup.setId( id)

   :param id: None
   :type id: string


   Sets a markup id for this line.


   :rtype: void

.. rst-class:: ts-api-section

setLineColor
------------

.. js:method:: LineMarkup.setLineColor( color)

   :param color: None
   :type color: Color


   Sets the line color.


   :rtype: void

.. rst-class:: ts-api-section

setLineOpacity
--------------

.. js:method:: LineMarkup.setLineOpacity( opacity)

   :param opacity: None
   :type opacity: number


   Sets the line opacity.


   :rtype: void

.. rst-class:: ts-api-section

setLinePattern
--------------

.. js:method:: LineMarkup.setLinePattern( pattern, patternLength, patternLengthUnit)

   :param pattern: The line pattern.
   :type pattern: LinePattern
   :param patternLength: The length of a single repetition of the line pattern.
   :type patternLength: number
   :param patternLengthUnit: The unit in which the pattern length is measured.
   :type patternLengthUnit: LinePatternLengthUnit


   Sets the line pattern.


   :rtype: void

.. rst-class:: ts-api-section

setSecondNodeId
---------------

.. js:method:: LineMarkup.setSecondNodeId( nodeId)

   :param nodeId: None
   :type nodeId: null | number


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


   :rtype: void

.. rst-class:: ts-api-section

setSecondPoint
--------------

.. js:method:: LineMarkup.setSecondPoint( secondPoint)

   :param secondPoint: None
   :type secondPoint: null | Point3


   Sets the second point on the line.


   :rtype: void

.. rst-class:: ts-api-section

toJson
------

.. js:method:: LineMarkup.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

.. rst-class:: ts-api-section

updateLine
----------

.. js:method:: LineMarkup.updateLine()



   Draws updated line geometry in the scene.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

:ts-api-decorator:`static` fromJson
-----------------------------------

.. js:method:: LineMarkup.fromJson( objData, viewer)

   :param objData: None
   :type objData: any
   :param viewer: None
   :type viewer: WebViewer


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

   :returns: The prepared object.


   :rtype: Promise <LineMarkup>

