You are reading the documentation for the version 2 of the ShapeDiver viewer API. Free support for this viewer version will be discontinued on June 1st, 2024.

Please refer to the version 3 documentation here. See also the migration guide from version 2 to version 3 here.

Class: ParametricViewer

SDVApp. ParametricViewer

new ParametricViewer(settings)

Constructor for the ShapeDiver Viewer Application

The constructor accepts a settings object consisting of

  • browser user interface settings,
  • viewer settings which are passed on to the constructor of the core ShapeDiver Viewer, and
  • settings specific to this constructor.

In case the viewer is embedded using iframe embed code provided by ShapeDiver, these settings can be passed by means of query string parameters of the iframe URL. As an example append &showControlsInitial=true to the iframe's src attribute in order to show the parameter controls panel on initialisation.

The browser user interface is implemented by means of JavaScript apps making use of the core ShapeDiver Viewer API v2. Browser user interface settings are ignored in case the viewer is not operated inside a browser, e.g. in case it is operated as part of a React Native app.

Parameters:
Name Type Description
settings Object

settings object, containing browser UI settings, and viewer application settings

Properties
Name Type Argument Default Description
useQueryStringParameters Boolean <optional>
false

constructor setting - if true, the constructor tries to read settings from the query string, existing settings will not be overridden

forceQueryStringParameters Boolean <optional>
false

constructor setting - if true, the constructor tries to read settings from the query string existing settings will be overridden

anchorElements Boolean <optional>
true

browser UI setting - choose whether the default handler for creating DOM elements representing anchors shall be instantiated

brandedMode Boolean <optional>
true

browser UI setting - choose whether ShapeDiver branding shall be shown during initial loading

busyGraphic String <optional>

browser UI setting - optional URL to an image which shall be shown instead of the busy spinner

containerControls Element <optional>

browser UI setting - optional container to use for creating parameter controls, may be undefined in which case a DOM element whose id is domElementIdPrefix+'-controls' will be looked for

containerSettings Element <optional>

browser UI setting - optional container to use for creating settings controls, may be undefined in which case a DOM element whose id is domElementIdPrefix+'-settings' will be looked for

createButtons Boolean <optional>
true

browser UI setting - choose whether standard buttons will be created for the viewport

domElementIdPrefix String <optional>
'sdv-container'

browser UI setting - prefix to use for lookup of dom elements

editMode Boolean <optional>
false

browser UI setting - choose whether the parameter controls should be initialized in edit mode

exportModal Boolean <optional>
true

browser UI setting - choose whether a modal dialog for export handling shall be instantiated

showControlsButton Boolean <optional>
true

browser UI setting - choose whether a button for showing/hiding the parameter controls shall be shown

showControlsInitial Boolean <optional>
false

browser UI setting - choose whether the parameter controls shall be shown initially

showSettingsButton Boolean <optional>
true

browser UI setting - choose whether a button for showing/hiding the settings controls shall be shown

showSettingsInitial Boolean <optional>
false

browser UI setting - choose whether the settings controls shall be shown initially

showZoomButton Boolean <optional>
true

browser UI setting - choose whether a button for zooming shall be shown

zoomButtonResetsCamera Boolean <optional>
false

browser UI setting - choose whether the zoom button shall reset the camera to its default position

showFullscreenButton Boolean <optional>
true

browser UI setting - choose whether a button for to/from fullscreen mode shall be shown

showInitialSpinner Boolean <optional>
true

browser UI setting - choose whether an initial loading spinner shall be shown

showBusySpinner Boolean <optional>
true

browser UI setting - choose whether a busy mode spinner or the optional custom busyGraphic shall be shown

viewportOverlays Boolean <optional>
true

browser UI setting - choose whether viewport overlays will be created at all (buttons, spinners, progress bar)

apiversion String <optional>
'2'

constructor setting - major version of the API to return by default

blurSceneWhenBusy Boolean <optional>
true

viewer setting - choose whether to blur the scene during updates are busy

container * <optional>

viewer setting - Container to use for creating the viewport, may be undefined in which case a DOM element whose id is domElementIdPrefix+'-viewport' will be looked for. An array of containers may be passed to create multiple viewports.

deferGeometryLoading Boolean <optional>
false

viewer setting - true: tell the CommPlugin instance created by the constructor to not load any geometry until first parameter update or refresh, false: load default geometry

commPluginRuntimeId String <optional>
'CommPlugin_1'

viewer setting - runtime id to use for the CommPlugin instance created by the constructor

loggingLevel Number <optional>
-1

viewer setting - general logging level: NONE(-1), ERROR(0), WARN(1), INFO(2), DEBUG(3)

messageLoggingLevel Number <optional>
-1

viewer setting - message logging level: NONE(-1), ERROR(0), WARN(1), INFO(2), DEBUG(3)

modelViewUrl String <optional>
'us-east-1'

constructor setting - optional model view url to pass to the default CommPlugin, a leading 'https://' will be prefixed if not in place, 'us-east-1' and 'eu-central-1' may be used as abbreviations for ShapeDiver's default systems

showSceneMode Number <optional>
2

viewer setting - when to fade in the scene: ON_SHOW(1), ON_FIRST_PLUGIN(2), ON_ALL_PLUGINS(3)

ticket String <optional>
''

constructor setting - optional model view ticket to be used for immediately instantiating a CommPlugin instance. No CommPlugin instance will be registered by the constructor if this is empty. Further CommPlugin instances can be initialized after the constructor has finished, using the API v2 function registerCommPluginAsync.

authorization String <optional>
''

constructor setting - optional authorization token to include with requests to the model view interface (prepend 'Bearer ' yourself if necessary)

Returns:
Type Description
Object

An instance of ApiObjectV1 or ApiObjectV2 depending on settings.apiversion.

ShapeDiver 3D Viewer, Copyright © 2015-2018 ShapeDiver GmbH. Documentation generated by JSDoc 3.5.5 on Thu Mar 7th 2019 using the DocStrap template.