Module: ApiInterfaceV1

ShapeDiver 3D Viewer Application, copyright (c) 2018 ShapeDiver GmbH

ApiInterfaceV1.js

Content

  • Abstract definition of the ShapeDiver 3D Viewer API V1
  • This version of the API is backwards compatible with the API of the viewer V1
Author:

Type Definitions

CameraLocation

A camera location and target

Type:
  • Object
Properties:
Name Type Description
position module:ApiInterfaceV1~Point3d

camera position

target module:ApiInterfaceV1~Point3d

camera target

Color

Color including alpha value defined by an array of 4 numbers between 0 and 255 [red, green, blue, alpha]. Further supported are all formats accepted by href="http://www.npmjs.com/package/tinycolor2">www.npmjs.com/package/tinycolor2 tinycolor.

Type:
  • Array.<Number> | String | Number

ExportDefinition

Definition of an export

Type:
  • Object
Properties:
Name Type Description
id String

unique id of export

plugin String

plugin runtime id of export

name String

name of export

type String

type of export, currently we support 'email', 'download', and 'shapeways'

ExportRequestObject

Data required for requesting an export

Type:
  • Object
Properties:
Name Type Argument Description
id String <optional>

id of export, takes precedence over idOrName and name

idOrName String <optional>

id or name of export, takes precedence over name

name String <optional>

name of export, last priority after id and idOrName

plugin String <optional>

runtime id of plugin the export belongs to

ModelDataItem

Model data item

Type:
  • Object
Properties:
Name Type Description
name String

name of the data item

id String

id of the data item

plugin String

plugin runtime id this item belongs to

data *

the data

ParameterDefinition

Parameter definition

Type:
  • Object
Properties:
Name Type Argument Description
id String

unique id of the parameter (unique within a plugin instance)

name String <optional>

name of the parameter

note String <optional>

description of the parameter

type module:ApiInterfaceV1~ParameterType <optional>

type of the parameter

decimalplaces Number <optional>

number of decimal places for type Float

choices Array.<String> <optional>

choices for type StringList

defval Number | String | Boolean

default value, represented as string

value Number | String | Boolean

current value of the parameter

group String <optional>

group of the parameter for visualization purposes

max String <optional>

maximum value for numeric types, max length for type String

min String <optional>

minimum value for numeric types

plugin String <optional>

optional runtime id of plugin the parameter belongs to

visualization module:ApiInterfaceV1~ParameterVisualization <optional>

how to visualize the parameter

ParameterType

Parameter type, see module:ApiInterfaceV1~ApiInterfaceV1#TYPE for values

Type:
  • String

ParameterUpdateObject

Parameter update object

Type:
  • Object
Properties:
Name Type Argument Description
id String <optional>

id of parameter, takes precedence over idOrName and name

idOrName String <optional>

id or name of parameter, takes precedence over name

name String <optional>

name of parameter, last priority after id and idOrName

plugin String <optional>

optional runtime id of plugin the parameter belongs to

value *

Parameter value to set

ParameterValueObject

Object describing a parameter value

Type:
  • Object
Properties:
Name Type Argument Description
id String

id of parameter

name String <optional>

optional name of parameter

plugin String

runtime id of plugin the parameter belongs to

value *

Parameter value

ParameterVisualization

Parameter visualization, see module:ApiInterfaceV1~ApiInterfaceV1#VISUALIZATION for values

Type:
  • String

Point3d

A 3d point

Type:
  • Object
Properties:
Name Type Description
x Number

x coordinate

y Number

x coordinate

z Number

x coordinate

ProcessCallback(topic, message)

Parameters:
Name Type Description
topic String

process message topic, typically 'process.TOKEN' where TOKEN is the process token which was used to register the callback

message Object

process message

ProcessCallbackToken

Type:
  • Object

ViewerStatusCode

Viewer status code format, see module:ApiInterfaceV1~ApiInterfaceV1#STATUSCODE for values

Type:
  • Number

ViewerStatusObject

Object describing the viewer status

Type:
  • Object
Properties:
Name Type Description
statusCode module:ApiInterfaceV1~ViewerStatusCode

numeric status code

statusText String

textual representation of status code

statusInfo String

further information

ShapeDiver 3D Viewer, Copyright © 2015-2019 ShapeDiver GmbH. Documentation generated by JSDoc 3.5.5 on Wed May 22nd 2019 using the DocStrap template.