Configurator Constructor

Constructor of the configurator object.

Signatures

  • Paramate.Configurator(object options)

Details

The function sets up the main configurator object.

Example

 configurator = new Paramate.Configurator({
   APIHub: 'http://api.paramate.trinckle.com',
   APIKey: '64c82bb593e5a2b9af693a603200e57e',
   configuratorId: 'd700e591-bf96-4201-be1a-5eceae28afbb',
   onAfterConfigure: UpdateConfigurator
 });
 

Throw

error

Throws an error if options.APIKey or options.configuratorId is not defined.

Parameters

options

Object containing parameters for the configurator.

options.APIHub

URL of the API Hub. (default: "https://api.paramate.trinckle.com")

options.APIKey

The API Key of the user.

options.configuratorId

The ID of the configurator.

options.proxy

URL of the proxy request handler for secured requests.

options.viewPort

The viewport object (see viewport constructor or viewport for WebGL constructor).

options.controls

The controls object (see constructor for manually generated controls or constructor for auto-controls ).

options.onBeforeConfigure

Function to be called before configuration starts.

options.onAfterConfigure

Function to be called after configuration finished.

options.onAfterConfigureRedraw

Function to be called after a configuration and the subsequent redrawing finished.

options.onConfigureError

Function to be called if an error occured during configuration.

options.undoLevel

Number defining how many steps of undo is possible. It is recommended to keep it as low as possible especially for configurators with uploaded files, because of file upload limits and memory consumption in general. default: 0

options.debug

An object defining debugging. {"on": true/false, "log": function, "error": function} The log and error functions get called with the result (status, statusText, response) of the HTTP request. In case of a successful request only the log function is called. When an error occures the log and error functions are both called. By default it is turned off, but if it is turned on by default the log functions is the console.log and the error function is the browser alert function.

Return value

A configurator object.