ConfiguratorCsr

ConfiguratorCsr

Class that defines an interactive Configurator instance to be used in connection with the main Ripe owner to provide an interactive configuration experience inside a DOM.

Constructor

new ConfiguratorCsr(owner, element, options)

Source:
Parameters:
Name Type Description
owner Object The owner (customizer instance) for this configurator.
element Object The DOM element that is considered to be the target for the configurator, it's going to have its own inner HTML changed.
options Object The options to be used to configure the configurator instance to be created.

Methods

_destroyDebug()

Completely cleanup and destroy debug tools.
Source:

_destroyInitialsResources()

Completely cleanup and destroy CSR initials.
Source:

_destroyScene()

Completely cleanup and destroy the scene.
Source:

_initConfigDefaults(options)

Initializes this CSR configurator instance configuration by applying the default config values.
Source:
Parameters:
Name Type Description
options Object Set of options to override the defaults.

_unloadCsrRenderedInitialsResources()

Free resources used by the csr initials.
Source:

_unloadDebugResources()

Free debug tools resources.
Source:

_unloadSceneResources()

Free resources used by the scene.
Source:

cancel(options) → {Boolean}

This function is called (by the owner) whenever the current operation in the child should be canceled this way a Configurator is not updated.
Source:
Parameters:
Name Type Description
options Object Set of optional parameters to adjust the Configurator.
Returns:
Type:
Boolean
If an effective operation has been performed or if instead no cancel logic was executed.

changeFrame(frame, options)

Rotates the model to match the PRC frame.
Source:
Parameters:
Name Type Description
frame Object The new PRC frame to display using the extended and canonical format for the frame description (eg: side-3).
options Object Set of optional parameters to adjust the change frame, such as: - 'duration' - The duration of the animation in milliseconds (defaults to 'null'). - 'stepDuration' - If defined the total duration of the animation is calculated using the amount of steps times the number of steps, instead of using the 'duration' field (defaults to 'null'). - 'revolutionDuration' - If defined the step duration is calculated by dividing the revolution duration by the number of frames in the view (defaults to 'null'). - 'preventDrag' - If drag actions during an animated change of frames should be ignored (defaults to 'true'). - 'safe' - If requested then the operation is only performed in case the configurator is not in the an equivalent state (default to 'true').

deinit()

The Configurator deinitializer, to be called (by the owner) when it should stop responding to updates so that any necessary cleanup operations can be executed.
Source:

flushPending(tail)

Executes pending operations that were not performed so as to not conflict with the tasks already being executed. The main reason for collision is the loading operation being executed (long duration operation).
Source:
Parameters:
Name Type Description
tail Boolean If only the last pending operation should be flushed, meaning that the others are discarded.

init()

The Configurator initializer, which is called whenever the Configurator is going to become active. Sets the various values for the Configurator taking into owner's default values.
Source:

resize(size)

Resizes the configurator's DOM element to 'size' pixels. You can also specify the width and height, the size applied is the more specific one.
Source:
Parameters:
Name Type Description
size Number The number of pixels to resize to.

setPostRender(callback)

Sets the callback function for the post render call.
Source:
Parameters:
Name Type Description
callback function The function to be called.

syncFromPRC(prcConfigurator)

Syncs the CSR configurator state to a PRC configurator state.
Source:
Parameters:
Name Type Description
prcConfigurator ConfiguratorPrc The PRC configurator.

unsetPostRender()

Clears the post render callback registry.
Source:

update(state, options) → {Boolean}

This function is called (by the owner) whenever its state changes so that the Configurator can update itself for the new state. This method is "protected" by unique signature validation in order to avoid extra render and frame loading operations. Operations are available to force the update operation even if the signature is the same as the one previously set.
Source:
Parameters:
Name Type Description
state Object An object containing the new state of the owner.
options Object Set of optional parameters to adjust the Configurator update.
Returns:
Type:
Boolean
If an effective operation has been performed by the update operation.

updateOptions(options, update)

Updates configurator current options with the ones provided.
Source:
Parameters:
Name Type Description
options Object Set of optional parameters to adjust the Configurator.
update Boolean If an update operation should be executed after the options updated operation has been performed.