## module:Wire(appInstance, fromId, toId, refreshopt)

Wire represents connection of two Connectors.

#### new module:Wire(appInstance, fromId, toId, refreshopt)
`modules/editorElements/Wire.js`, `line 14`

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `appInstance` | App |  |  | instance of App
  `fromId` | string |  |  | id of the first connector this wire will be connected to
  `toId` | string |  |  | id of the second connector this wire will be connected to
  `refresh` | Boolean | <optional> | true | if `true`, the App will refresh after creating this wire

### Extends

- NetworkElement

### Members

#### exportData
`modules/editorElements/Wire.js`, `line 89`

  get data of this wire as a JSON-ready object

#### state
`modules/editorElements/Wire.js`, `line 113`

  get the current Logic.state of this wire

### Methods

#### findRoute(start, end) → {PolyLinePoints}
`modules/editorElements/Wire.js`, `line 229`

  find a nice route for the wire

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `start` | Object | object containing numeric attributes `x` and `y` that represent the first endpoint of the wire in grid pixel
  `end` | Object | object containing numeric attributes `x` and `y` that represent the second endpoint of the wire in grid pixels

  ##### Returns:

  PolyLinePoints -

  [description]

#### generateInconvenientNodes() → {Set}
`modules/editorElements/Wire.js`, `line 260`

  generate a set of nodes, that are inconvenient for wiring, but can be used, just are not preferred

  ##### Returns:

  Set -

  set of nodes (objects containing x and y coordinates) that are not preferred for wiring

#### get() → {jQuery.element}
`modules/editorElements/Wire.js`, `line 130`

  get the jQuery element for this wire

  ##### Returns:

  jQuery.element

#### getTemporaryWirePoints() → {PolyLinePoints}
`modules/editorElements/Wire.js`, `line 138`

  get the PolyLine points for a temporary wire placement connecting the two connectors

  ##### Returns:

  PolyLinePoints -

  new instance of PolyLinePoints

#### routeWire()
`modules/editorElements/Wire.js`, `line 161`

  route the wire using the modified A* wire routing algorithm

#### setState(state)
`modules/editorElements/Wire.js`, `line 100`

  set the state of this wire to match the state of the input connector it is connected to

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `state` | Logic.state | [description]

#### setWirePath(points)
`modules/editorElements/Wire.js`, `line 194`

  set the wire to follow the specified points

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `points` | PolyLinePoints | instance of PolyLinePoints

#### temporaryWire()
`modules/editorElements/Wire.js`, `line 148`

  route the wire using the temporary wire points

#### updateWireState()
`modules/editorElements/Wire.js`, `line 120`

  update the state of this wire