RemoteModel

class cee.ug.RemoteModel()

A remote server CAE model that can be displayed in the client viewer.

The RemoteModel is the controller of the visualization of the CAE model. Using this class you can specify which results to show on the model, set part settings as well as create cutting planes, isosurfaces, isovolumes and particle traces.

Use openModel to open a CAE model residing on the server. Once the optional callback passed to openModel is called, the ModelDirectory will have been populated and you can configure the initial view of the model. If a callback is not provided to openModel then the first state is shown.

Example: Minimal app, open default model on server:

var mySocket = io('http://localhost:8998', {reconnection:false});
var canvas = document.getElementById("myGlCanvas");

mySession = new cee.CloudSession();

myViewer = mySession.addViewer(canvas);
if (!myViewer) {
    return alert("No WebGL support");
}

myModel = new cee.ug.RemoteModel(mySocket);
var myView = myViewer.addView();
myView.addModel(myModel);

myModel.openModel("");

function myAnimationFrameCallback(highResTimestamp) {
    mySession.handleAnimationFrameCallback(highResTimestamp);
    requestAnimationFrame(myAnimationFrameCallback);
}

requestAnimationFrame(myAnimationFrameCallback);

The ModelSpec is the object you use to specify what to show in the remote model. Here you set which state(s) and results (scalar, vector, displacements) to display. You can setup a state animation by setting ModelSpec.stateIdArray or setup a mode shape animation with ModelSpec.modeShapeFrameCount and ModelSpec.modeShapeAnimationType Animation is controlled by the Animation class which can be accessed with animation

You can access PartSettings objects with getPartSettingsById and use them to set various part attributes such visibility, color, opacity and draw style.

You can control how results are rendered with ScalarSettings VectorSettings and DisplacementSettings objects, which can be accessed with getScalarSettingsById getVectorSettingsById and getDisplacementSettingsById respectively.

For volumetric models, you can add any number of cutting plane, isosurface, isovolume and particle trace group objects to gain insight into the result distribution (e.g. flow field) within the model. The settings of these items can be controlled with the CuttingPlane Isosurface Isovolume and ParticleTraceGroup objects. Use getCuttingPlaneById getIsosurfaceById getIsovolumeById and getParticleTraceGroupById to access such objects.

Picking is also done in the RemoteModel. Use rayIntersect to perform picking on the remote server model. This method takes a callback which is called when the picking result is available.

See the example in Examples/BuildYourFirstApp/3-FirstPostProcessor and 4-FeatureExtraction for how to use the RemoteModel

Example: Show the last state with the first scalar result and modify part settings

// Get the model and the model directory from the RemoteModel
var modelDir = myModel.modelDirectory;

// Show the last state in the analysis
var modelSpec = myModel.modelSpec;
modelSpec.stateIdArray =
      [modelDir.stateInfoArray[modelDir.stateInfoArray.length - 1].id];


// Show the first scalar as filled contours (if any)
if (modelDir.scalarResultArray.length > 0) {
    modelSpec.fringesResultId = modelDir.scalarResultArray[0].id;
}

// Modify the part settings: First part transparent, the rest with element mesh
for (var i = 0; i < myModel.partCount; ++i) {
    var partSettings = myModel.getPartSettingsAt(i);

    if (i == 0) {
        partSettings.drawStyle = cee.ug.DrawStyle.SURFACE;
        partSettings.opacity = 0.5;
    } else {
        partSettings.drawStyle = cee.ug.DrawStyle.SURFACE_MESH;
    }
}

This code sample produces the following image in the 3D Viewer:

image0

Constructors

Methods


Constructors

constructor

cee.ug.RemoteModel.constructor(socketIOClient_socketInstance)

Creates a RemoteModel.

Arguments
  • socketIOClient_socketInstance (any) –

Return type

cee.ug.RemoteModel

A socket connection to a live UgServer must be provided.

Example:

var mySocket = io('http://localhost:8998', {reconnection:false});
var myModel = new cee.ug.RemoteModel(mySocket, "");

Accessors

cee.ug.RemoteModel.animation

The animation control for this RemoteModel.

cee.ug.RemoteModel.currentFrameIndex

The step to show in the view.

Use this property to specify a single step of the currently specified animation to show in the viewer. The given zero-based index must be between 0 and frameCount - 1.

Setting the current frame index will stop the animation if it is running.

cee.ug.RemoteModel.currentStepText

A description of the current step (e.g. time stamp, load case number, etc)

cee.ug.RemoteModel.cuttingPlaneCount

The number of cutting planes in the model.

cee.ug.RemoteModel.displacementSettingsCount

The number of displacement settings in the model.

cee.ug.RemoteModel.frameCount

The number of steps/frames in the viewer.

The value of this property will be 1 if a model is loaded but contains no animation. If an animation has been setup then the value will be the number of animation steps.

cee.ug.RemoteModel.isosurfaceCount

The number of isosurfaces in the model.

cee.ug.RemoteModel.isovolumeCount

The number of isovolumes in the model.

cee.ug.RemoteModel.mirrorSettings

The mirror/symmetry settings for this RemoteModel

See MirrorSettings for more info.

cee.ug.RemoteModel.modelDirectory

The current ModelDirectory This contains a table of contents of what is available to display in the analysis on the server (time steps, results, etc).

The ModelDirectory is available once the callback passed to openModel is called.

cee.ug.RemoteModel.modelInfoString

Information about this model.

cee.ug.RemoteModel.modelSettings

The model settings for this RemoteModel

See ModelSettings for more info.

cee.ug.RemoteModel.modelSpec

The specification of what to show in the remote model.

The ModelSpec controls what is shown in the RemoteModel (states, results, mode-shape animation).

cee.ug.RemoteModel.name

Name of the geometry model.

Mainly used for debugging.

cee.ug.RemoteModel.partCount

The number of parts in the model.

cee.ug.RemoteModel.particleTraceGroupCount

The number of particle trace groups in the model.

cee.ug.RemoteModel.scalarSettingsCount

The number of scalar settings in the model.

cee.ug.RemoteModel.vectorSettingsCount

The number of vector settings in the model.

Methods

addCuttingPlane

cee.ug.RemoteModel.addCuttingPlane()

Adds a CuttingPlane to the remote model.

Return type

cee.ug.CuttingPlane

Returns

Returns the new CuttingPlane

This will add a new cutting plane to the model. The cutting plane will be assigned an id by the model.

Note: Maximum number of clipping planes is 12

addIsosurface

cee.ug.RemoteModel.addIsosurface()

Adds an Isosurface to the remote model.

Return type

cee.ug.Isosurface

Returns

Returns the new Isosurface

This will add a new isosurface to the model. The isosurface will be assigned an id by the model.

The default settings are: * Isosurface.isoScalarResultId the fringes result or the first available scalar * Isosurface.mapScalarResultId same as above * Isosurface.isoValue the middle of the range if known, else 0.5

addIsovolume

cee.ug.RemoteModel.addIsovolume()

Adds an Isovolume to the remote model.

Return type

cee.ug.Isovolume

Returns

Returns the new Isovolume

This will add a new isovolume to the model. The isovolume will be assigned an id by the model.

The default settings are: * Isovolume.isoScalarResultId the fringes result or the first available scalar * Isovolume.mapScalarResultId same as above * Isovolume.minimumIsoValue the minimum of the range if known, else 0 * Isovolume.maximumIsoValue the middle of the range if known, else 0.5

addNextServerUpdateCompletedCallback

cee.ug.RemoteModel.addNextServerUpdateCompletedCallback(serverVisuaizationUpdateCompleteCallback)

Adds a one-shot callback that will be called once the next server visualization update is complete.

Arguments
Return type

void

Whenever you change something in a RemoteModel, the pending changes will immediately be registered client-side, but will not be dispatched to the remote server until later. This server update typically happens in response to requestAnimationFrame() processing. The callback registered by this function will only be triggered once the next server update has been dispatched and has completed.

Please note that the callback will only be called once.

addParticleTraceGroup

cee.ug.RemoteModel.addParticleTraceGroup()

Adds a ParticleTraceGroup to the remote model.

Return type

cee.ug.ParticleTraceGroup

Returns

Returns the new ParticleTraceGroup

This will add a new particle trace group to the model. The group will be assigned an id by the model.

appendModel

cee.ug.RemoteModel.appendModel(modelKey, appendCompletedCallback)

Append the model with the given model key to the current model opened with openModel()

Arguments
Return type

void

The models needs to be compatible. The requirement is that they have the same number of geometries and parts (i.e. same total number of parts).

This is useful if the simulation results are split into multiple runs, e.g. if the simulation was stopped and then continued with the same model but computing new time steps / increments.

DEPRECATED. Will method will be removed in EnvisionWeb version 3.1

applyVTFxCase

cee.ug.RemoteModel.applyVTFxCase(caseId, applyCameraSettings, openCompletedCallback)

Apply the VTFx case with the given id to the model.

Arguments
Return type

void

The list of available VTFx cases with name and id can be found in ModelDirectory.vtfxCaseInfoArray

Use applyCameraSettings to control if the camera settings from the case should be applied (true) or if you want to keep the current camera settings unchanged (false)

clientSideRayIntersect

cee.ug.RemoteModel.clientSideRayIntersect(ray)

Performs a client-side (not on server) ray pick.

Arguments
  • ray (cee.Ray) –

Return type

cee.ug.ClientSideHitItem

This might be faster or slower than a server pick request, depending on model size, latency, server capabilities and client capabilities. Note that this picking only considers visible surface geometry.

If something was hit, returns a ClientSideHitItem object containing information about the hit. Returns null if nothing was hit

closeModel

cee.ug.RemoteModel.closeModel()

Closes the model, cleaning up on both the server and the client.

Return type

void

createResultCalculator

cee.ug.RemoteModel.createResultCalculator(calculatorId, resultIdString, initString, callback)

Create a new result calculator result based on the given specification.

Arguments
  • calculatorId (string) – The ID of the calculator as provided in the CRC_FrameworkServices::registerCalculatorFunc()

  • resultIdString (string) – The idString of the result to create. This should be unique. The idString of all results can be found in the ResultInfo of the result in the ModelDirectory

  • initString (string) – The initialization string passed to the CRCResultCalculator::initialize() method

  • callback (cee.ug.CreateResultCalculatorCallback) – An optional callback function triggered when the new result is available. From this method you can locate the newly created result in the model directory (using the calculatorId and resultIdString) and then e.g. apply it to the model.

Return type

void

Result calculators are created with the Result Calculator Framework and loaded as .dll/.so/.dylib on the server. A calculator can be initialized with an initString. This string contains the configuration of the calculator (e.g. a mathematical expression).

createTrianglePicker

cee.ug.RemoteModel.createTrianglePicker(view)

Creates a RemoteModelTrianglePicker for this model and the specified view.

Arguments
  • view (cee.View) –

Return type

cee.ug.RemoteModelTrianglePicker

createVisibleObjectPicker

cee.ug.RemoteModel.createVisibleObjectPicker(view)

Creates a VisibleObjectPicker for this model and the specified view.

Arguments
  • view (cee.View) –

Return type

cee.ug.VisibleObjectPicker

This support class is used to get information about the visible items in the model. It can do a regionIntersect() given a rectangle and return the parts/objects that are visible in that region.

It can also find all the visible triangles in a rectangle or on a set of points and return them as VisibleObjectItem objects.

See VisibleObjectPicker for more information.

deleteAllCuttingPlanes

cee.ug.RemoteModel.deleteAllCuttingPlanes()

Deletes all CuttingPlane from the model.

Return type

void

deleteAllIsosurfaces

cee.ug.RemoteModel.deleteAllIsosurfaces()

Deletes all Isosurface from the model.

Return type

void

deleteAllIsovolumes

cee.ug.RemoteModel.deleteAllIsovolumes()

Delete all Isovolume from the model.

Return type

void

deleteAllParticleTraceGroups

cee.ug.RemoteModel.deleteAllParticleTraceGroups()

Deletes all ParticleTraceGroup from the model.

Return type

void

deleteCuttingPlaneById

cee.ug.RemoteModel.deleteCuttingPlaneById(id)

Deletes the CuttingPlane with the given id from the model.

Arguments
  • id (number) –

Return type

void

deleteIsosurfaceById

cee.ug.RemoteModel.deleteIsosurfaceById(id)

Deletes the Isosurface with the given id from the model.

Arguments
  • id (number) –

Return type

void

deleteIsovolumeById

cee.ug.RemoteModel.deleteIsovolumeById(id)

Deletes the Isovolume with the given id from the model.

Arguments
  • id (number) –

Return type

void

deleteParticleTraceGroupById

cee.ug.RemoteModel.deleteParticleTraceGroupById(id)

Deletes the ParticleTraceGroup with the given id from the model.

Arguments
  • id (number) –

Return type

void

deleteResultCalculator

cee.ug.RemoteModel.deleteResultCalculator(calculatorId, resultIdString)

Delete the result calculator with the given calculator id and result idString

Arguments
  • calculatorId (string) –

  • resultIdString (string) –

Return type

void

enablePreloading

cee.ug.RemoteModel.enablePreloading(enable)

Enables pre-loading of data.

Arguments
  • enable (boolean) –

Return type

void

If enabled, the server will stream all data specified in ModelSpec.stateIdArray to prepare the client for an animation or for stepping through the states.

If not enabled (default), data will only be streamed when needed (i.e. when a step is going to be displayed).

executeDataSourceRequest

cee.ug.RemoteModel.executeDataSourceRequest(message, data, callback)

Send a request to the server data source (Data Provider).

Arguments
Return type

void

Note: Only one request can be in flight at any given time, so calling this method while a request is being processed will throw. To make sure you do not do that, use the isDataSourceRequestInProgress() method to check for any ongoing requests.

getBoundingBox

cee.ug.RemoteModel.getBoundingBox()

Returns the BoundingBox (in world coordinates) of the current contents of the RemoteModel

Return type

cee.BoundingBox

getClientSidePartBoundingBox

cee.ug.RemoteModel.getClientSidePartBoundingBox(geometryIndex, partId)

Returns the BoundingBox (in world coordinates) of the given part in the current frame.

Arguments
  • geometryIndex (number) –

  • partId (number) –

Return type

cee.BoundingBox

The bounding box returned is the bounding box of the specified part in the current frame, provided that the part is visible and present on the client.

getCuttingPlaneArray

cee.ug.RemoteModel.getCuttingPlaneArray()

Returns all CuttingPlane in the model.

Return type

ReadonlyArray[cee.ug.CuttingPlane]

getCuttingPlaneAt

cee.ug.RemoteModel.getCuttingPlaneAt(index)

Returns the CuttingPlane at the given index.

Arguments
  • index (number) –

Return type

cee.ug.CuttingPlane

The index must be between 0 and cuttingPlaneCount - 1.

Use the returned object to modify the settings of the cutting plane.

getCuttingPlaneById

cee.ug.RemoteModel.getCuttingPlaneById(id)

Returns the CuttingPlane with the given id, or null if no match is found.

Arguments
  • id (number) –

Return type

cee.ug.CuttingPlane

Use the returned object to modify the settings of the cutting plane.

getDisplacementResultMaximumLength

cee.ug.RemoteModel.getDisplacementResultMaximumLength(resultId)

Returns the maximum length for all items currently loaded in the RemoteModel for the given displacement result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the displacement results in ModelDirectory.displacementResultArray

getDisplacementResultMinimumLength

cee.ug.RemoteModel.getDisplacementResultMinimumLength(resultId)

Returns the minimum length for all items currently loaded in the RemoteModel for the given displacement result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the displacement results in ModelDirectory.displacementResultArray

getDisplacementSettingsArray

cee.ug.RemoteModel.getDisplacementSettingsArray()

Returns DisplacementSettings all displacement results in the model.

Return type

ReadonlyArray[cee.ug.DisplacementSettings]

getDisplacementSettingsAt

cee.ug.RemoteModel.getDisplacementSettingsAt(resultIndex)

Returns the DisplacementSettings for the result at the given index.

Arguments
  • resultIndex (number) –

Return type

cee.ug.DisplacementSettings

The index must be between 0 and displacementSettingsCount - 1.

Use the returned object to modify the settings of the displacement result.

getDisplacementSettingsById

cee.ug.RemoteModel.getDisplacementSettingsById(resultId)

Returns the DisplacementSettings for the result with the given result id, or null if no match is found.

Arguments
  • resultId (number) –

Return type

cee.ug.DisplacementSettings

The resultId must refer to one of the displacement results in ModelDirectory.displacementResultArray

Use the returned object to modify the settings of the displacement result.

getElementCount

cee.ug.RemoteModel.getElementCount(frameIndex)

Returns the total number of elements in the given frame

Arguments
  • frameIndex (number) –

Return type

number

frameIndex must be <0..frameCount-1>

getIsosurfaceArray

cee.ug.RemoteModel.getIsosurfaceArray()

Returns all Isosurface in the model.

Return type

ReadonlyArray[cee.ug.Isosurface]

getIsosurfaceAt

cee.ug.RemoteModel.getIsosurfaceAt(index)

Returns the Isosurface at the given index.

Arguments
  • index (number) –

Return type

cee.ug.Isosurface

The index must be between 0 and isosurfaceCount - 1.

getIsosurfaceById

cee.ug.RemoteModel.getIsosurfaceById(id)

Returns the Isosurface with the given id, or null if no match is found.

Arguments
  • id (number) –

Return type

cee.ug.Isosurface

getIsovolumeArray

cee.ug.RemoteModel.getIsovolumeArray()

Returns all the Isovolume in the model.

Return type

ReadonlyArray[cee.ug.Isovolume]

getIsovolumeAt

cee.ug.RemoteModel.getIsovolumeAt(index)

Returns the Isovolume at the given index.

Arguments
  • index (number) –

Return type

cee.ug.Isovolume

The index must be between 0 and isovolumeCount - 1.

getIsovolumeById

cee.ug.RemoteModel.getIsovolumeById(id)

Returns the Isovolume with the given id, or null if no match is found.

Arguments
  • id (number) –

Return type

cee.ug.Isovolume

getNodeCount

cee.ug.RemoteModel.getNodeCount(frameIndex)

Returns the total number of nodes in the given frame

Arguments
  • frameIndex (number) –

Return type

number

index must be <0..frameCount-1>

getPartSettingsArray

cee.ug.RemoteModel.getPartSettingsArray()

Returns PartSettings for all parts in the model.

Return type

ReadonlyArray[cee.ug.PartSettings]

getPartSettingsAt

cee.ug.RemoteModel.getPartSettingsAt(partIndex)

Returns part settings for the part at the given index.

Arguments
  • partIndex (number) –

Return type

cee.ug.PartSettings

The index must be between 0 and partCount - 1.

getPartSettingsById

cee.ug.RemoteModel.getPartSettingsById(geometryIndex, partId)

Returns the part settings for the part with the given geometry index and part id.

Arguments
  • geometryIndex (number) – The index of the geometry the part belongs to. In most cases there is only one geometry and this parameter should be 0.

  • partId (number) – The id of the part to find.

Return type

cee.ug.PartSettings

getParticleTraceGroupArray

cee.ug.RemoteModel.getParticleTraceGroupArray()

Returns all ParticleTraceGroup in the model.

Return type

ReadonlyArray[cee.ug.ParticleTraceGroup]

getParticleTraceGroupAt

cee.ug.RemoteModel.getParticleTraceGroupAt(index)

Returns the ParticleTraceGroup at the given index.

Arguments
  • index (number) –

Return type

cee.ug.ParticleTraceGroup

The index must be between 0 and particleTraceGroupCount - 1.

getParticleTraceGroupById

cee.ug.RemoteModel.getParticleTraceGroupById(id)

Returns the ParticleTraceGroup with the given id, or null if no match was found.

Arguments
  • id (number) –

Return type

cee.ug.ParticleTraceGroup

getScalarResultMaximumValue

cee.ug.RemoteModel.getScalarResultMaximumValue(resultId)

Returns the maximum value for all items currently loaded in the RemoteModel for the given scalar result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the scalar results in ModelDirectory.scalarResultArray

Note: This method only works for results that are currently in use in the client. If you need the maximum value of any scalar result, you can use the QueryResultMinMax class.

getScalarResultMinimumValue

cee.ug.RemoteModel.getScalarResultMinimumValue(resultId)

Returns the minimum value for all items currently loaded in the RemoteModel for the given scalar result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the scalar results in ModelDirectory.scalarResultArray

Note: This method only works for results that are currently in use in the client. If you need the minimum value of any scalar result, you can use the QueryResultMinMax class.

getScalarSettingsArray

cee.ug.RemoteModel.getScalarSettingsArray()

Returns ScalarSettings for all scalar results in the model.

Return type

ReadonlyArray[cee.ug.ScalarSettings]

getScalarSettingsAt

cee.ug.RemoteModel.getScalarSettingsAt(resultIndex)

Returns the ScalarSettings for the result at the given index.

Arguments
  • resultIndex (number) –

Return type

cee.ug.ScalarSettings

The index must be between 0 and scalarSettingsCount - 1.

Use the returned object to modify the settings of the scalar result

getScalarSettingsById

cee.ug.RemoteModel.getScalarSettingsById(resultId)

Returns the ScalarSettings for the result with the given result id, or null if no match is found.

Arguments
  • resultId (number) –

Return type

cee.ug.ScalarSettings

The resultId must refer to one of the scalar results in ModelDirectory.scalarResultArray

Use the returned object to modify the settings of the scalar result

getVectorResultMaximumLength

cee.ug.RemoteModel.getVectorResultMaximumLength(resultId)

Returns the maximum length for all items currently loaded in the RemoteModel for the given vector result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the vector results in ModelDirectory.vectorResultArray

getVectorResultMinimumLength

cee.ug.RemoteModel.getVectorResultMinimumLength(resultId)

Returns the minimum length for all items currently loaded in the RemoteModel for the given vector result.

Arguments
  • resultId (number) –

Return type

number

Returns

Returns undefined if the result has not been loaded or if the resultId is invalid.

The resultId must refer to one of the vector results in ModelDirectory.vectorResultArray

getVectorSettingsArray

cee.ug.RemoteModel.getVectorSettingsArray()

Returns VectorSettings for all vector results in the model.

Return type

ReadonlyArray[cee.ug.VectorSettings]

getVectorSettingsAt

cee.ug.RemoteModel.getVectorSettingsAt(resultIndex)

Returns the VectorSettings for the result at the given index.

Arguments
  • resultIndex (number) –

Return type

cee.ug.VectorSettings

The index must be between 0 and vectorSettingsCount - 1.

Use the returned object to modify the settings of the vector result

getVectorSettingsById

cee.ug.RemoteModel.getVectorSettingsById(resultId)

Returns the VectorSettings for the result with the given result id, or null if no match is found.

Arguments
  • resultId (number) –

Return type

cee.ug.VectorSettings

The resultId must refer to one of the vector results in ModelDirectory.vectorResultArray

Use the returned object to modify the settings of the vector result

isDataSourceRequestInProgress

cee.ug.RemoteModel.isDataSourceRequestInProgress()

Returns true if a executeDataSourceRequest call is in progress.

Return type

boolean

Use this to check before calling executeDataSourceRequest, as this will throw if a request is in flight

isPointCoveredBySurface

cee.ug.RemoteModel.isPointCoveredBySurface(point, view)

Determines whether the given point is currently covered by a surface in the given view.

Arguments
  • point (cee.Vec3) –

  • view (cee.View) –

Return type

boolean

isPollForDataSourceChangesInProgress

cee.ug.RemoteModel.isPollForDataSourceChangesInProgress()

Returns true if a pollForDataSourceChanges call is in progress.

Return type

boolean

Use this to check before calling pollForDataSourceChanges, as this will throw if a request is in flight

isPreloadingEnabled

cee.ug.RemoteModel.isPreloadingEnabled()

Returns true if pre-loading is enabled.

Return type

boolean

openModel

cee.ug.RemoteModel.openModel(modelKey, openCompletedCallback, options)

Opens the model with the given modelKey in this RemoteModel.

Arguments
  • modelKey (string) – The identifier of the model to open. This will be translated on the server into a filename before the model is opened. This translation is done by the modelFileFromKey() function that is provided to createServerInstance() on the visualization server.

  • openCompletedCallback (cee.ug.OpenModelCallback) – Callback function that will be called when the model is ready to be used in the client. This will also be called if any errors occur (file not found etc.). When this is called the ModelDirectory will have been populated with the contents of the server CAE analysis.

  • options (cee.ug.OpenModelOptions) – Open model options. Provide any default calculators and/or an internal configString. See OpenModelOptions for more info.

Return type

void

Opens a model on the server and prepares to stream it to the client. If the model is opened successfully (as indicated when the optional callback is invoked) the initial step of the CAE model will be streamed to the client.

pollForDataSourceChanges

cee.ug.RemoteModel.pollForDataSourceChanges(pollForDataSourceChangesCompletedCallback)

Poll the current data source for changes.

Arguments
Return type

void

Note: Only one poll can be in flight at any given time, so calling this method while a poll is being processed will throw. To make sure you do not do that, use the isPollForDataSourceChangesInProgress method to check for any ongoing polls.

rayIntersect

cee.ug.RemoteModel.rayIntersect(frameIndex, ray, rayIntersectCallback)

Performs picking on the remote server model.

Arguments
Return type

void

This will perform a picking action on the remote server with the given ray. The provided callback will be called when the result is available. The hitItem provided to this callback will contain detailed information about the element that was hit in the CAE model.

To do the picking at the current state/time step, use the model.currentFrameIndex property.

recreateResultCalculator

cee.ug.RemoteModel.recreateResultCalculator(calculatorId, resultIdString, initString, callback)

Recreate the result with the given calculatorId and resultIdString.

Arguments
Return type

void

Use this method to update an already existing calculator result. From the client side it will seem like the result is just updated with the new initString, but on the server the actual calculator instance will be deleted and a new one will be initialized with the given initString.

The result will keep its id (number) so no updates are needed to the model spec or feature extraction items.

reloadModel

cee.ug.RemoteModel.reloadModel(reloadCompletedCallback)

Reload model, pick up any changes on the server since the open of the analysis.

Arguments
Return type

void

sendToCloud

cee.ug.RemoteModel.sendToCloud(view, config, callback)

Share the model on the web using the Ceetron One-Click-Sharing service.

Arguments
Return type

void

With this method you can share the remote model (with the current settings) to the Ceetron Cloud cloud service.

You can either use the default https://cloud.ceetron.com service, or use your own hosted sharing portal. The Ceetron Cloud Portal can be customized and installed on most cloud and on-premises servers.

setColorLegendTitle

cee.ug.RemoteModel.setColorLegendTitle(resultId, title)

Set the title of the color legend with the given result Id

Arguments
  • resultId (number) –

  • title (string) –

Return type

void

This will update any current legends, and also be used as the title whenever the legend is later created.

setCommunicationPerformanceHandler

cee.ug.RemoteModel.setCommunicationPerformanceHandler(performanceHandler)

Sets a handler function that will be called with information about the current communication.

Arguments
Return type

void

See CommunicationPerformanceData for more information.

setDrawStyleAllParts

cee.ug.RemoteModel.setDrawStyleAllParts(drawStyle, opacity)

Sets the draw style for all parts in the model

Arguments
  • drawStyle (cee.ug.DrawStyle) –

  • opacity (number) –

Return type

void

This is just a helper for setting PartSettings.drawStyle for all parts in the model, and optionally set opacity if provided.

setOneShotDataStreamingCompleteCallback

cee.ug.RemoteModel.setOneShotDataStreamingCompleteCallback(dataStreamingCompleteCallback)

Sets a one- shot callback that will be called the next time we observe that data streaming is complete

Arguments
Return type

void

setProgressHandler

cee.ug.RemoteModel.setProgressHandler(progressHandler)

Sets a handler function that will be called whenever a progress indication packet is received from the visualization server.

Arguments
Return type

void

setReaderOptions

cee.ug.RemoteModel.setReaderOptions(readerIdString, options)

Set options for the reader with the given readerIdString

Arguments
  • readerIdString (string) –

  • options (function) –

Return type

void

The options will be sent to the server and used whenever a file of the given type is opened.

Available options:

VTK (vtu/pvtu/pvd): readerIdString: “VTK” - ALL_VECTORS_AS_DISPLACEMENT (bool) : If set to true, all vector results in the file will be reported as displacements. - WELD_NODES_FOR_JOINT_PARTS (bool) : If set to true, all nodes in joint parts are welded together

OpenFoamProvider: See the readme file for the provider.

Example:

this.m_model.setReaderOptions("OpenFoamProvider", {
  "LOAD_BC_PARTS": true,
  "NODE_AVG_RES": true,
  "HIDE_PARALLEL_INTERFACES": false,
  "UPDATE_GEOMETRY_FOR_AMI": false
});
this.m_model.setReaderOptions("VTK", {
     "ALL_VECTORS_AS_DISPLACEMENT": true,
 });

setResultCalculatorParams

cee.ug.RemoteModel.setResultCalculatorParams(calculatorId, resultIdString, paramsDict)

Sets result calculator parameters for the given result calculator result.

Arguments
  • calculatorId (string) –

  • resultIdString (string) –

  • paramsDict (function) –

Return type

void

The result will automatically be updated.

Example:

model.setResultCalculatorParams(calcId, resIdString,  { "scaleFactor" : 2.0 });

setResultRangeChangedHandler

cee.ug.RemoteModel.setResultRangeChangedHandler(resultRangeChangedHandler)

Specifies the handler function that will be called whenever any result changes in the model. This will be called when a result is loaded the first time or when changing time step.

Arguments
Return type

void

This might be useful for updating the UI, e.g. the minimum and maximum values on a slider for an isosurface.

setServerErrorHandler

cee.ug.RemoteModel.setServerErrorHandler(errorHandler)

Sets a handler function that will be called whenever an error packet is received from the visualization server.

Arguments
Return type

void

setServerLogContextKeyValueArr

cee.ug.RemoteModel.setServerLogContextKeyValueArr(keyValueArr)

Set an array of key,value pairs that will be included as a context in the server log.

Arguments
  • keyValueArr ([function]) –

Return type

void

This key,value pairs will be available in the JSON type log, and will be included until a new key,value array is specified. To clear any current settings, pass in an empty array.

This could be used to enhance the telemetry support in your cloud solution.

startPostponedStreaming

cee.ug.RemoteModel.startPostponedStreaming()

Start the streaming of the initial 3d model from the server.

Return type

void

Note: Calling this method is only needed when using the openCompletedCallback parameter to OpenModel and returning POSTPONE_STREAMING.

getCustomServerInfo

cee.ug.RemoteModel.getCustomServerInfo(socketIOClient_socketInstance, callback)

Static method to get custom server info from the UgServer.

Arguments
  • socketIOClient_socketInstance (any) –

  • callback ((customData): void) –

Return type

void

This info is specified on the server in the createServerInstance() method or the constructor to ServerInstance.

Default response is null.