# Class: PlanningInstance

## vcs.vcm.widgets.planning.PlanningInstance

### Members

#### _id{string}

  The documents id on the server

#### comments{vcs.vcm.widgets.planning.PlanningComment}

  This plannings comments as GeoJSON FeatureCollection

#### description{string}

#### flights{Array.<vcs.vcm.util.flight.FlightInstance>}

#### hiddenObjects{Array.<string>}

  An array of building IDs hidden by this planning

#### lastUpdated{vcs.vcm.widgets.planning.PlanningInstance.EditingInfo}

  The last editing user, and the last edited date

#### loaded{boolean}

  TODO
    - Promise interface as with `vcs.vcm.widgets.planning.PlanningObjectDrawing`

#### name{string}

#### owner{vcs.vcm.widgets.planning.PlanningInstance.EditingInfo}

  The owner of this planning, aka the creator, and the creation date.

#### permissions{Array.<string>}

  This users permission to this planning, can be Planning.[read|edit|delete|share|publish]

#### planningObjects{Array.<vcs.vcm.widgets.planning.PlanningObject>}

  This plannings planning objects

#### properties{Object.<*>}

#### public{boolean}

  Whether this planning is visible to everybody or not

#### sharedUsers{Array.<Object>}

  The users and the respective permissions, for all users with which this planning has been shared

#### viewpoints{Array.<vcs.vcm.widgets.planning.PlanningInstance.ViewPointOptions>}

  The viewpoints options associated with this planning

### Methods

#### deletePlanningObject(planningObject, callback){Promise}

  Delete a planning object from its instance

  Name | Type | Description
  --- | --- | ---
  `planningObject` | vcs.vcm.widgets.planning.PlanningObject |
  `callback` | function |

  TODO
    - Promise interface

#### getSharedUsers(){Promise}

  Gets the shared actors for this planning instance from the server and sets the to this.sharedUsers

#### gotoViewpoint(index)

  Name | Type | Description
  --- | --- | ---
  `index` | number |

#### isLocked(){boolean}

  Check whether the instance is locked

#### load(dontJumpToViewpoint)

  loads and shows this planning instance

  Name | Type | Description
  --- | --- | ---
  `dontJumpToViewpoint` | boolean |

#### lock(){Promise}

  locks this planning, so it can be edited.

#### publishPlanning(){Promise}

  Toggles the published state of a document

#### save(){Promise}

  Saves the changes done to a planning instance.

#### setHiddenObjectsToLayer(layer, toHighlight, toUnhighlight)

  Adds or removes the hidden objects to a layer

  Name | Type | Description
  --- | --- | ---
  `layer` | vcs.vcm.layer.Layer |
  `toHighlight` | Object |
  `toUnhighlight` | string |

  ##### Throws:

  vcs.vcm.util.InvalidArgument

#### setHiddenObjectsToLayers(toHighlight, toUnhighlight)

  Adds or removes the hidden objects

  Name | Type | Description
  --- | --- | ---
  `toHighlight` | Object |
  `toUnhighlight` | string |

  ##### Throws:

  vcs.vcm.util.InvalidArgument

#### sharePlanning(planningInstanceId, actorId, permissions){Promise}

  Shares or unshares the planning instance with an actor. To unshare, do not pass permissions

  Name | Type | Description
  --- | --- | ---
  `planningInstanceId` | string |
  `actorId` | string |
  `permissions` | Array.<string> | null permissionLevel revokes the permission instead of setting it

#### unLoad()

  unloads and hides this planning instance

#### unlock(){Promise}

  unlocks the planning, so other users can edit it

#### uploadNewDrawing(){Promise}

  Uploads an empty drawing to the server, so the drawing object can be edited

  Deprecated
    - v3.6

#### uploadNewModel(inputData, progress, converterOptions){Promise}

  Uploads a new model for this planning instance. Use an object with 'percentage' property to track progress

  Name | Type | Description
  --- | --- | ---
  `inputData` | FormData | the models file data as FormData
  `progress` | Object | object with a 'percentage' attribute
  `converterOptions` | vcs.vcm.widgets.planning.PlanningInstance.ConverterOptions |

  ##### Throws:

  vcs.vcm.util.InvalidArgument

#### userHasPermission(permission){boolean}

  Checks whether the user has a certain permission for this instance

  Name | Type | Description
  --- | --- | ---
  `permission` | string |

  ##### Throws:

  vcs.vcm.util.InvalidArgument

### Type Definitions

#### vcs.vcm.widgets.planning.PlanningInstance.ConverterOptions{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `projection` | string | undefined |
  `terrain` | string | undefined |
  `mapping` | Object | undefined |
  `inject` | Array.<string> | undefined |

#### vcs.vcm.widgets.planning.PlanningInstance.EditingInfo{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `user` | string |
  `on` | Date |