# Class: Shape

## Constructor

#### new Shape(ownerDisplayName, filled, isMine, color, alpha, width)

  Shape extends AvayaClientServices.Services.Collaboration.AbstractShape. It contains the information
  about points that the shape consists of.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ownerDisplayName` | String |
  `filled` | Boolean |
  `isMine` | Boolean |
  `color` | Number |
  `alpha` | number |
  `width` | number |

## Members

#### <protected> _color :number

  Color in HEX translated to DEC.

  ##### Type:

  - number
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_color

#### <protected> _id :number

  Shape unique id.

  ##### Type:

  - number
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_id

#### <protected> _isMine :boolean

  Determines whether the shape belongs to the current user.

  ##### Type:

  - boolean
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_isMine

#### <protected> _ownerDisplayName :string

  Display name of the shape owner.

  ##### Type:

  - string
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_ownerDisplayName

#### <protected> _primitiveShapeSize :Number|undefined

  Size of primitive shape

  ##### Type:

  - Number | undefined
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_primitiveShapeSize

#### <protected> _status :AvayaClientServices.Services.Collaboration.SelectionStatus

  Shape status as defined in AvayaClientServices.Services.Collaboration.SelectionStatus.

  ##### Type:

  - AvayaClientServices.Services.Collaboration.SelectionStatus
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_status

#### <protected> _translation :AvayaClientServices.Services.Collaboration.Point

  Shape position.

  ##### Type:

  - AvayaClientServices.Services.Collaboration.Point
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_translation

#### <protected> _width :number

  Shape width.

  ##### Type:

  - number
  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#_width

## Methods

#### addLinePoint(point) → {AvayaClientServices.Base.Promise}

  Adds a new line point to the shape. It extends the shape (e.g. adds the new point for Live Drawing shape).
  The line will be drawn from the previous point to the one received in this function.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `point` | AvayaClientServices.Services.Collaboration.Point | Coordinates of added point.

  ##### Returns:

  { AvayaClientServices.Base.Promise }

#### addMovePoint(point) → {void}

  Adds a new move point (starting point) to the shape.
  This is not related to the shape translation. It will not move the whole shape.
  This is just a starting point for our shape.
  The line will NOT be drawn from the previous point to the one received in this function.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `point` | AvayaClientServices.Services.Collaboration.Point | Coordinates of added point.

  ##### Returns:

  { void }

#### finishDrawing() → {AvayaClientServices.Base.Promise.<(Boolean|Undefined)>}

  Finishes drawing process.
  When the user draws on the whiteboard, this function is being invoked both at the end of the live drawing tool, rectangle and polygon tool.
  When the user receives the whiteboard sharing, this function is being invoked at the end of the live drawing tool.

  ##### Returns:

  { AvayaClientServices.Base.Promise.<(Boolean|Undefined)> }

#### getAlpha() → {number}

  Gets an alpha of the shape.
  The alpha channel controls the transparency or opacity of a color.
  Its value is represented as an integer: full transparency is 0, whereas full opacity is 100.

  ##### Returns:

  { number }

#### getColor() → {Number}

  Returns the shape color as a decimal number. When converted to hexadecimal, it's standard HEX color.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getColor

  ##### Returns:

  { Number }

#### getId() → {String}

  Returns shape id.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getId

  ##### Returns:

  { String }

#### getOwnerDisplayName() → {String}

  Returns the name of the user who created the shape.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getOwnerDisplayName

  ##### Returns:

  { String }

#### getPoints() → {Array.<{isMove: Boolean, point: AvayaClientServices.Services.Collaboration.Point}>}

  Returns the array of points.
  Array consists of objects with two properties: isMove (boolean) and point (coordinates).

  ##### Returns:

  { Array.<{isMove: Boolean, point: AvayaClientServices.Services.Collaboration.Point}> }

#### getPrimitiveShapeSize() → {void}

  Returns the primitive shape size of shape.

  ##### Returns:

  { void }

#### getStatus() → {AvayaClientServices.Services.Collaboration.SelectionStatus}

  Gets shape status as defined in AvayaClientServices.Services.Collaboration.SelectionStatus.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getStatus

  ##### Returns:

  { AvayaClientServices.Services.Collaboration.SelectionStatus }

  Shape status.

#### getTranslation() → {AvayaClientServices.Services.Collaboration.Point}

  Returns shape translation (position).
  Translation is an offset value relative to the first position of the shape.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getTranslation

  ##### Returns:

  { AvayaClientServices.Services.Collaboration.Point }

#### getWidth() → {Number}

  Returns shape width.
  Value in pixels.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#getWidth

  ##### Returns:

  { Number }

  Width of shape.

#### isFilled() → {Boolean}

  Determines whether the shape is filled or not.

  ##### Returns:

  { Boolean }

  Returns true if shape is filled, false otherwise.

#### isFinished() → {boolean}

  Determines whether drawing of shape has been finished.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#isFinished

  ##### Returns:

  { boolean }

#### isMine() → {Boolean}

  Determines whether the shape has been created by the local user.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#isMine

  ##### Returns:

  { Boolean }

  Returns true if the shape belongs to the local user, false otherwise.

#### setFilled(filled) → {void}

  Sets the shape fill status.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `filled` | Boolean | Returns true if shape is filled, false otherwise.

  ##### Returns:

  { void }

#### setTranslation(point) → {void}

  Sets shape translation (position).
  Sets the new offset value relative to the first position of the shape.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `point` | AvayaClientServices.Services.Collaboration.Point | New position of shape.

  Inherited From:
    - AvayaClientServices.Services.Collaboration.AbstractShape#setTranslation

  ##### Returns:

  { void }

#### updatePoints(points) → {void}

  Adds the array of new multiple points to the shape.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `points` | Array.<{isMove: Boolean, point: AvayaClientServices.Services.Collaboration.Point}> |

  ##### Returns:

  { void }