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
openModelto open a CAE model residing on the server. Once the optional callback passed to openModel is called, theModelDirectorywill 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
ModelSpecis 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 settingModelSpec.stateIdArray, or setup a mode shape animation withModelSpec.modeShapeFrameCountandModelSpec.modeShapeAnimationType. Animation is controlled by the Animation class which can be accessed withanimation.You can access
PartSettingsobjects withgetPartSettingsByIdand use them to set various part attributes such visibility, color, opacity and draw style.You can control how results are rendered with
ScalarSettings,VectorSettingsandDisplacementSettingsobjects, which can be accessed withgetScalarSettingsById,getVectorSettingsByIdandgetDisplacementSettingsByIdrespectively.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, andParticleTraceGroupobjects. UsegetCuttingPlaneById,getIsosurfaceById,getIsovolumeByIdandgetParticleTraceGroupByIdto access such objects.Picking is also done in the RemoteModel. Use
rayIntersectto 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:
Constructors
Accessors
Methods
addCuttingPlaneaddIsosurfaceaddIsovolumeaddNextServerUpdateCompletedCallbackaddParticleTraceGroupapplyVTFxCaseclientSideRayIntersectcloseModelcreateResultCalculatorcreateTrianglePickercreateVisibleObjectPickerdeleteAllCuttingPlanesdeleteAllIsosurfacesdeleteAllIsovolumesdeleteAllParticleTraceGroupsdeleteCuttingPlaneByIddeleteIsosurfaceByIddeleteIsovolumeByIddeleteParticleTraceGroupByIddeleteResultCalculatorenablePreloadingexecuteDataSourceRequestgetBoundingBoxgetClientSidePartBoundingBoxgetCuttingPlaneArraygetCuttingPlaneAtgetCuttingPlaneByIdgetDefaultCameraConfiggetDisplacementResultMaximumLengthgetDisplacementResultMinimumLengthgetDisplacementSettingsArraygetDisplacementSettingsAtgetDisplacementSettingsByIdgetElementCountgetIsosurfaceArraygetIsosurfaceAtgetIsosurfaceByIdgetIsovolumeArraygetIsovolumeAtgetIsovolumeByIdgetNodeCountgetPartSettingsArraygetPartSettingsAtgetPartSettingsByIdgetParticleTraceGroupArraygetParticleTraceGroupAtgetParticleTraceGroupByIdgetScalarResultMaximumValuegetScalarResultMinimumValuegetScalarSettingsArraygetScalarSettingsAtgetScalarSettingsByIdgetVectorResultMaximumLengthgetVectorResultMinimumLengthgetVectorSettingsArraygetVectorSettingsAtgetVectorSettingsByIdisDataSourceRequestInProgressisOpenisPointCoveredBySurfaceisPollForDataSourceChangesInProgressisPreloadingEnabledopenModelpollForDataSourceChangesrayIntersectrecreateResultCalculatorreloadModelsendToCloudsetColorLegendTitlesetCommunicationPerformanceHandlersetDrawStyleAllPartssetOneShotDataStreamingCompleteCallbacksetProgressHandlersetReaderOptionssetResultCalculatorParamssetResultRangeChangedHandlersetServerErrorHandlersetServerLogContextKeyValueArrstartPostponedStreaminggetCustomServerInfo
Constructors
-
RemoteModel.constructor(socketIOClient_socketInstance) Arguments: - socketIOClient_socketInstance (
any) – None
Creates a 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, "");
Return type: RemoteModel - socketIOClient_socketInstance (
Accessors
-
RemoteModel.animation() The animation control for this RemoteModel.
Return type: Animation
-
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.
Return type: number
-
RemoteModel.currentFrameIndex(frameIndex) Arguments: - frameIndex (
number) – None
Return type: void
- frameIndex (
-
RemoteModel.currentStepText() A description of the current step (e.g. time stamp, load case number, etc)
Return type: string
-
RemoteModel.cuttingPlaneCount() The number of cutting planes in the model.
Return type: number
-
RemoteModel.displacementSettingsCount() The number of displacement settings in the model.
Return type: number
-
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.
Return type: number
-
RemoteModel.isosurfaceCount() The number of isosurfaces in the model.
Return type: number
-
RemoteModel.isovolumeCount() The number of isovolumes in the model.
Return type: number
-
RemoteModel.mirrorSettings() The mirror/symmetry settings for this RemoteModel
See
MirrorSettingsfor more info.Return type: MirrorSettings
-
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
ModelDirectoryis fully available once the callback passed toopenModelis called. Until then, this is an emptyModelDirectorywith no data.Return type: ModelDirectory
-
RemoteModel.modelInfoString() Information about this model.
Return type: string
-
RemoteModel.modelSettings() The model settings for this RemoteModel
See
ModelSettingsfor more info.Return type: ModelSettings
-
RemoteModel.modelSpec() The specification of what to show in the remote model.
The
ModelSpeccontrols what is shown in the RemoteModel (states, results, mode-shape animation).The
modelSpecis available once the callback passed toopenModelis called. Until then, this is an emptyModelSpecwith no data and accessing its setters will throw an error.Return type: ModelSpec
-
RemoteModel.name() Name of the geometry model.
Mainly used for debugging.
Return type: string
-
RemoteModel.name(name) Arguments: - name (
string) – None
Return type: void
- name (
-
RemoteModel.partCount() The number of parts in the model.
Return type: number
-
RemoteModel.particleTraceGroupCount() The number of particle trace groups in the model.
Return type: number
-
RemoteModel.scalarSettingsCount() The number of scalar settings in the model.
Return type: number
-
RemoteModel.vectorSettingsCount() The number of vector settings in the model.
Return type: number
Methods
addCuttingPlane
-
RemoteModel.addCuttingPlane() Adds a
CuttingPlaneto the remote model.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
Returns: Returns the new CuttingPlane.Return type: CuttingPlane
addIsosurface
-
RemoteModel.addIsosurface() Adds an
Isosurfaceto the remote model.This will add a new isosurface to the model. The isosurface will be assigned an id by the model. Returns null if the adding fails.
The default settings are:
Isosurface.isoScalarResultId: the fringes result or the first available scalarIsosurface.mapScalarResultId: same as aboveIsosurface.isoValue: the middle of the range if known, else 0.5
Returns: Returns the new Isosurface.Return type: Isosurface
addIsovolume
-
RemoteModel.addIsovolume() Adds an
Isovolumeto the remote model.This will add a new isovolume to the model. The isovolume will be assigned an id by the model. Returns null if the adding fails.
The default settings are:
Isovolume.isoScalarResultId: the fringes result or the first available scalarIsovolume.mapScalarResultId: same as aboveIsovolume.minimumIsoValue: the minimum of the range if known, else 0Isovolume.maximumIsoValue: the middle of the range if known, else 0.5
Returns: Returns the new Isovolume.Return type: Isovolume
addNextServerUpdateCompletedCallback
-
RemoteModel.addNextServerUpdateCompletedCallback(serverVisuaizationUpdateCompleteCallback) Arguments: - serverVisuaizationUpdateCompleteCallback (
ServerUpdateCompletedCallback) – None
Adds a one-shot callback that will be called once the next server visualization update is complete.
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.
Return type: void - serverVisuaizationUpdateCompleteCallback (
addParticleTraceGroup
-
RemoteModel.addParticleTraceGroup() Adds a
ParticleTraceGroupto the remote model.This will add a new particle trace group to the model. The group will be assigned an id by the model.
Returns: Returns the new ParticleTraceGroup.Return type: ParticleTraceGroup
applyVTFxCase
-
RemoteModel.applyVTFxCase(caseId[, applyVTFxCaseCompletedCallback]) Arguments: - caseId (
number) – None - applyVTFxCaseCompletedCallback (
ApplyVTFxCaseCallback) – optional None
Apply the VTFx case with the given id to the model.
The list of available VTFx cases with name and id can be found in ModelDirectory.vtfxCaseInfoArray
Return type: void - caseId (
clientSideRayIntersect
-
RemoteModel.clientSideRayIntersect(ray) Arguments: - ray (
Ray) – None
Performs a client-side (not on server) ray pick.
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
Return type: ClientSideHitItem - ray (
closeModel
-
RemoteModel.closeModel() Closes the model, cleaning up on both the server and the client.
Return type: void
createResultCalculator
-
RemoteModel.createResultCalculator(calculatorId, resultIdString, initString[, callback]) 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 (
CreateResultCalculatorCallback) – optional 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.
Create a new result calculator result based on the given specification.
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).
Return type: void - calculatorId (
createTrianglePicker
-
RemoteModel.createTrianglePicker(view) Arguments: - view (
View) – None
Creates a TrianglePicker for this model and the specified view.
Returns null if no picker can be created, typically because WebGL resources have been exhausted.
See
TrianglePickerfor more information.Return type: TrianglePicker - view (
createVisibleObjectPicker
-
RemoteModel.createVisibleObjectPicker(view) Arguments: - view (
View) – None
Creates a VisibleObjectPicker for this model and the specified view.
Returns null if no picker can be created, typically because WebGL resources have been exhausted.
This support class is used to get information about the visible items in the model. Given a rectangular region, this class can return the parts/objects that are currently visible in that region.
See
VisibleObjectPickerfor more information.Return type: VisibleObjectPicker - view (
deleteAllCuttingPlanes
-
RemoteModel.deleteAllCuttingPlanes() Deletes all
CuttingPlanesfrom the model.Return type: void
deleteAllIsosurfaces
-
RemoteModel.deleteAllIsosurfaces() Deletes all
Isosurfacesfrom the model.Return type: void
deleteAllIsovolumes
-
RemoteModel.deleteAllIsovolumes() Delete all
Isovolumesfrom the model.Return type: void
deleteAllParticleTraceGroups
-
RemoteModel.deleteAllParticleTraceGroups() Deletes all
ParticleTraceGroupfrom the model.Return type: void
deleteCuttingPlaneById
-
RemoteModel.deleteCuttingPlaneById(id) Arguments: - id (
number) – None
Deletes the
CuttingPlanewith the given id from the model.Return type: void - id (
deleteIsosurfaceById
-
RemoteModel.deleteIsosurfaceById(id) Arguments: - id (
number) – None
Deletes the
Isosurfacewith the given id from the model.Return type: void - id (
deleteIsovolumeById
-
RemoteModel.deleteIsovolumeById(id) Arguments: - id (
number) – None
Deletes the
Isovolumewith the given id from the model.Return type: void - id (
deleteParticleTraceGroupById
-
RemoteModel.deleteParticleTraceGroupById(id) Arguments: - id (
number) – None
Deletes the
ParticleTraceGroupwith the given id from the model.Return type: void - id (
deleteResultCalculator
-
RemoteModel.deleteResultCalculator(calculatorId, resultIdString) Arguments: - calculatorId (
string) – None - resultIdString (
string) – None
Delete the result calculator with the given calculator id and result idString
Return type: void - calculatorId (
enablePreloading
-
RemoteModel.enablePreloading(enable) Arguments: - enable (
boolean) – None
Enables pre-loading of data.
If enabled, the server will stream all data specified in
ModelSpec.stateIdArrayto 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).
Return type: void - enable (
executeDataSourceRequest
-
RemoteModel.executeDataSourceRequest(message, data[, callback]) Arguments: - message (
string) – None - data (
string) – None - callback (
DataSourceRequestCallback) – optional None
Send a request to the server data source (Data Provider).
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.
Return type: void - message (
getBoundingBox
-
RemoteModel.getBoundingBox([_options]) Arguments: - _options (
ModelBoundingBoxOptions) – optional None
Returns the
BoundingBox(in world coordinates) of the current contents of the RemoteModelNote that currently this method does not support
ModelBoundingBoxOptionsso the returned bounding box will always be the “current” bounding box that accounts for visibility of parts/objects.Return type: BoundingBox - _options (
getClientSidePartBoundingBox
-
RemoteModel.getClientSidePartBoundingBox(geometryIndex, partId) Arguments: - geometryIndex (
number) – None - partId (
number) – None
Returns the
BoundingBox(in world coordinates) of the given part in the current frame.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.
Return type: BoundingBox - geometryIndex (
getCuttingPlaneArray
getCuttingPlaneAt
-
RemoteModel.getCuttingPlaneAt(index) Arguments: - index (
number) – None
Returns the
CuttingPlaneat the given index.The index must be between 0 and cuttingPlaneCount - 1.
Use the returned object to modify the settings of the cutting plane.
Return type: CuttingPlane - index (
getCuttingPlaneById
-
RemoteModel.getCuttingPlaneById(id) Arguments: - id (
number) – None
Returns the
CuttingPlanewith the given id, or null if no match is found.Use the returned object to modify the settings of the cutting plane.
Return type: CuttingPlane - id (
getDefaultCameraConfig
-
RemoteModel.getDefaultCameraConfig() Returns default camera configuration for this model if it exists
Return type: CameraConfig
getDisplacementResultMaximumLength
-
RemoteModel.getDisplacementResultMaximumLength(resultId) Arguments: - resultId (
number) – None
Returns the maximum length for all items currently loaded in the RemoteModel for the given displacement result.
The resultId must refer to one of the displacement results in
ModelDirectory.displacementResultArray.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getDisplacementResultMinimumLength
-
RemoteModel.getDisplacementResultMinimumLength(resultId) Arguments: - resultId (
number) – None
Returns the minimum length for all items currently loaded in the RemoteModel for the given displacement result.
The resultId must refer to one of the displacement results in
ModelDirectory.displacementResultArray.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getDisplacementSettingsArray
-
RemoteModel.getDisplacementSettingsArray() Returns
DisplacementSettingsfor all displacement results in the model.Return type: unknown
getDisplacementSettingsAt
-
RemoteModel.getDisplacementSettingsAt(resultIndex) Arguments: - resultIndex (
number) – None
Returns the
DisplacementSettingsfor the result at the given index.The index must be between 0 and displacementSettingsCount - 1.
Use the returned object to modify the settings of the displacement result.
Return type: DisplacementSettings - resultIndex (
getDisplacementSettingsById
-
RemoteModel.getDisplacementSettingsById(resultId) Arguments: - resultId (
number) – None
Returns the
DisplacementSettingsfor the result with the given result id, or null if no match is found.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.
Return type: DisplacementSettings - resultId (
getElementCount
-
RemoteModel.getElementCount(frameIndex) Arguments: - frameIndex (
number) – None
Returns the total number of elements in the given frame
frameIndex must be <0..frameCount-1>
Return type: number - frameIndex (
getIsosurfaceArray
-
RemoteModel.getIsosurfaceArray() Returns all
Isosurfacesin the model.Return type: unknown
getIsosurfaceAt
-
RemoteModel.getIsosurfaceAt(index) Arguments: - index (
number) – None
Returns the
Isosurfaceat the given index.The index must be between 0 and isosurfaceCount - 1.
Return type: Isosurface - index (
getIsosurfaceById
-
RemoteModel.getIsosurfaceById(id) Arguments: - id (
number) – None
Returns the
Isosurfacewith the given id, or null if no match is found.Return type: Isosurface - id (
getIsovolumeArray
-
RemoteModel.getIsovolumeArray() Returns all the
Isovolumesin the model.Return type: unknown
getIsovolumeAt
-
RemoteModel.getIsovolumeAt(index) Arguments: - index (
number) – None
Returns the
Isovolumeat the given index.The index must be between 0 and isovolumeCount - 1.
Return type: Isovolume - index (
getIsovolumeById
-
RemoteModel.getIsovolumeById(id) Arguments: - id (
number) – None
Returns the
Isovolumewith the given id, or null if no match is found.Return type: Isovolume - id (
getNodeCount
-
RemoteModel.getNodeCount(frameIndex) Arguments: - frameIndex (
number) – None
Returns the total number of nodes in the given frame
index must be <0..frameCount-1>
Return type: number - frameIndex (
getPartSettingsArray
-
RemoteModel.getPartSettingsArray() Returns
PartSettingsfor all parts in the model.Return type: unknown
getPartSettingsAt
-
RemoteModel.getPartSettingsAt(partIndex) Arguments: - partIndex (
number) – None
Returns part settings for the part at the given index.
The index must be between 0 and partCount - 1.
Return type: PartSettings - partIndex (
getPartSettingsById
-
RemoteModel.getPartSettingsById(geometryIndex, partId) 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.
Returns the part settings for the part with the given geometry index and part id.
Return type: PartSettings - geometryIndex (
getParticleTraceGroupArray
-
RemoteModel.getParticleTraceGroupArray() Returns all
ParticleTraceGroupsin the model.Return type: unknown
getParticleTraceGroupAt
-
RemoteModel.getParticleTraceGroupAt(index) Arguments: - index (
number) – None
Returns the
ParticleTraceGroupat the given index.The index must be between 0 and particleTraceGroupCount - 1.
Return type: ParticleTraceGroup - index (
getParticleTraceGroupById
-
RemoteModel.getParticleTraceGroupById(id) Arguments: - id (
number) – None
Returns the
ParticleTraceGroupwith the given id, or null if no match was found.Return type: ParticleTraceGroup - id (
getScalarResultMaximumValue
-
RemoteModel.getScalarResultMaximumValue(resultId) Arguments: - resultId (
number) – None
Returns the maximum value for all items currently loaded in the RemoteModel for the given scalar result.
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
QueryResultMinMaxclass.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getScalarResultMinimumValue
-
RemoteModel.getScalarResultMinimumValue(resultId) Arguments: - resultId (
number) – None
Returns the minimum value for all items currently loaded in the RemoteModel for the given scalar result.
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
QueryResultMinMaxclass.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getScalarSettingsArray
-
RemoteModel.getScalarSettingsArray() Returns
ScalarSettingsfor all scalar results in the model.Return type: unknown
getScalarSettingsAt
-
RemoteModel.getScalarSettingsAt(resultIndex) Arguments: - resultIndex (
number) – None
Returns the
ScalarSettingsfor the result at the given index.The index must be between 0 and scalarSettingsCount - 1.
Use the returned object to modify the settings of the scalar result
Return type: ScalarSettings - resultIndex (
getScalarSettingsById
-
RemoteModel.getScalarSettingsById(resultId) Arguments: - resultId (
number) – None
Returns the
ScalarSettingsfor the result with the given result id, or null if no match is found.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
Return type: ScalarSettings - resultId (
getVectorResultMaximumLength
-
RemoteModel.getVectorResultMaximumLength(resultId) Arguments: - resultId (
number) – None
Returns the maximum length for all items currently loaded in the RemoteModel for the given vector result.
The resultId must refer to one of the vector results in
ModelDirectory.vectorResultArray.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getVectorResultMinimumLength
-
RemoteModel.getVectorResultMinimumLength(resultId) Arguments: - resultId (
number) – None
Returns the minimum length for all items currently loaded in the RemoteModel for the given vector result.
The resultId must refer to one of the vector results in
ModelDirectory.vectorResultArray.Returns: Returns undefined if the result has not been loaded or if the resultId is invalid. Return type: number - resultId (
getVectorSettingsArray
-
RemoteModel.getVectorSettingsArray() Returns
VectorSettingsfor all vector results in the model.Return type: unknown
getVectorSettingsAt
-
RemoteModel.getVectorSettingsAt(resultIndex) Arguments: - resultIndex (
number) – None
Returns the
VectorSettingsfor the result at the given index.The index must be between 0 and vectorSettingsCount - 1.
Use the returned object to modify the settings of the vector result
Return type: VectorSettings - resultIndex (
getVectorSettingsById
-
RemoteModel.getVectorSettingsById(resultId) Arguments: - resultId (
number) – None
Returns the
VectorSettingsfor the result with the given result id, or null if no match is found.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
Return type: VectorSettings - resultId (
isDataSourceRequestInProgress
-
RemoteModel.isDataSourceRequestInProgress() Returns true if an executeDataSourceRequest call is in progress.
Use this to check before calling executeDataSourceRequest, as this will throw if a request is in flight
Return type: boolean
isOpen
-
RemoteModel.isOpen() Returs true when the model is successfully opened, i.e. once the callback passed to
openModelis called.Return type: boolean
isPointCoveredBySurface
-
RemoteModel.isPointCoveredBySurface(point, view) Arguments: - point (
Vec3) – None - view (
View) – None
Determines whether the given point is currently covered by a surface in the given view.
Return type: boolean - point (
isPollForDataSourceChangesInProgress
-
RemoteModel.isPollForDataSourceChangesInProgress() Returns true if a pollForDataSourceChanges call is in progress.
Use this to check before calling pollForDataSourceChanges, as this will throw if a request is in flight
Return type: boolean
isPreloadingEnabled
-
RemoteModel.isPreloadingEnabled() Returns true if pre-loading is enabled.
Return type: boolean
openModel
-
RemoteModel.openModel(modelKey[, openCompletedCallback[, options]]) 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 (
OpenModelCallback) – optional 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 (
OpenModelOptions) – optional Open model options. Provide any default calculators and/or an internal configString. See OpenModelOptions for more info. Example: Customize the initial appearance of the model in the callback: .. code-block:: javascript // Remove any old models var view = myViewer.getViewAt(0); view.removeAllModels(); // Open a new RemoteModel from the CAE server var mySocket = io(’http://localhost:8998’, {reconnection:false}); myModel = new cee.ug.RemoteModel(mySocket, “”); view.addModel(myModel); // Open the file on the server, setup the viz when it is done myModel.openModel(“”, function(err, model) { // Note: The model is now ready to use and the ModelDirectory is populated // with the model context received from the server // Show the first scalar as filled contours (if any) if (model.modelDirectory.scalarResultArray.length > 0) { model.modelSpec.fringesResultId = model.modelDirectory.scalarResultArray[0].id; } // Modify the part settings: First part transparent, the rest with surf mesh for (var ps of model.getPartSettingsArray()) { ps.drawStyle = cee.ug.DrawStyle.SURFACE_OUTLINE_MESH; ps.opacity = 0.5; } }); This code sample produces the following image in the 3D Viewer: 
Opens the model with the given modelKey in this RemoteModel.
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.
Return type: void - modelKey (
pollForDataSourceChanges
-
RemoteModel.pollForDataSourceChanges([pollForDataSourceChangesCompletedCallback]) Arguments: - pollForDataSourceChangesCompletedCallback (
PollForDataSourceChangesCallback) – optional None
Poll the current data source for changes.
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.
Return type: void - pollForDataSourceChangesCompletedCallback (
rayIntersect
-
RemoteModel.rayIntersect(frameIndex, ray, rayIntersectCallback) Arguments: - frameIndex (
number) – None - ray (
Ray) – None - rayIntersectCallback (
RayIntersectCallback) – None
Performs picking on the remote server model.
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.
Return type: void - frameIndex (
recreateResultCalculator
-
RemoteModel.recreateResultCalculator(calculatorId, resultIdString, initString[, callback]) Arguments: - calculatorId (
string) – None - resultIdString (
string) – None - initString (
string) – None - callback (
CreateResultCalculatorCallback) – optional None
Recreate the result with the given calculatorId and resultIdString.
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.
Return type: void - calculatorId (
reloadModel
-
RemoteModel.reloadModel([reloadCompletedCallback]) Arguments: - reloadCompletedCallback (
ReloadModelCallback) – optional None
Reload model, pick up any changes on the server since the open of the analysis.
Return type: void - reloadCompletedCallback (
sendToCloud
-
RemoteModel.sendToCloud(view, config, callback) Arguments: - view (
View) – None - config (
SendToCloudConfig) – None - callback (
SendToCloudCallback) – None
Share the model on the web using the Ceetron One-Click-Sharing service.
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.
Return type: void - view (
setColorLegendTitle
-
RemoteModel.setColorLegendTitle(resultId, title) Arguments: - resultId (
number) – None - title (
string) – None
Set the title of the color legend with the given result Id
This will update any current legends, and also be used as the title whenever the legend is later created.
Return type: void - resultId (
setCommunicationPerformanceHandler
-
RemoteModel.setCommunicationPerformanceHandler(performanceHandler) Arguments: - performanceHandler (
CommunicationPerformanceHandler) – None
Sets a handler function that will be called with information about the current communication.
See CommunicationPerformanceData for more information.
Return type: void - performanceHandler (
setDrawStyleAllParts
-
RemoteModel.setDrawStyleAllParts(drawStyle[, opacity]) Arguments: - drawStyle (
DrawStyle) – None - opacity (
number) – optional None
Sets the draw style for all parts in the model
This is just a helper for setting
PartSettings.drawStylefor all parts in the model, and optionally set opacity if provided.Return type: void - drawStyle (
setOneShotDataStreamingCompleteCallback
-
RemoteModel.setOneShotDataStreamingCompleteCallback(dataStreamingCompleteCallback) Arguments: - dataStreamingCompleteCallback (
DataStreamingCompleteCallback) – None
Sets a one- shot callback that will be called the next time we observe that data streaming is complete
Return type: void - dataStreamingCompleteCallback (
setProgressHandler
-
RemoteModel.setProgressHandler(progressHandler) Arguments: - progressHandler (
ProgressHandler) – None
Sets a handler function that will be called whenever a progress indication packet is received from the visualization server.
Return type: void - progressHandler (
setReaderOptions
-
RemoteModel.setReaderOptions(readerIdString, options) Arguments: - readerIdString (
string) – None - options (
function) – None
Set options for the reader with the given readerIdString
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”
- options:
- 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
- WELD_NODES_PART_FIELD_NAME (string) : Set the name of the field used to identify parts in the model, for instance “PartID”. The chosen field must contain integers. The default value is “”. This option only applies when WELD_NODES_FOR_JOINT_PARTS is set to true.
- CEETRON Access:
- readerIdString: “CEETRON_ACCESS” (most CAE formats)
- options:
- USE_UNDEFINED_RESULTS (bool) : If true, undefined results will be reported as undefined. If false, undefined results will be reported as zero.
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, });Return type: void - readerIdString (
setResultCalculatorParams
-
RemoteModel.setResultCalculatorParams(calculatorId, resultIdString, paramsDict) Arguments: - calculatorId (
string) – None - resultIdString (
string) – None - paramsDict (
function) – None
Sets result calculator parameters for the given result calculator result.
The result will automatically be updated.
Example:
model.setResultCalculatorParams(calcId, resIdString, { "scaleFactor" : 2.0 });
Return type: void - calculatorId (
setResultRangeChangedHandler
-
RemoteModel.setResultRangeChangedHandler(resultRangeChangedHandler) Arguments: - resultRangeChangedHandler (
ResultRangeChangedHandler) – None
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.
This might be useful for updating the UI, e.g. the minimum and maximum values on a slider for an isosurface.
Return type: void - resultRangeChangedHandler (
setServerErrorHandler
-
RemoteModel.setServerErrorHandler(errorHandler) Arguments: - errorHandler (
ServerErrorHandler) – None
Sets a handler function that will be called whenever an error packet is received from the visualization server.
Return type: void - errorHandler (
setServerLogContextKeyValueArr
-
RemoteModel.setServerLogContextKeyValueArr(keyValueArr) Arguments: - keyValueArr (
[function]) – None
Set an array of key,value pairs that will be included as a context in the server log.
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.
Return type: void - keyValueArr (
startPostponedStreaming
-
RemoteModel.startPostponedStreaming() Start the streaming of the initial 3d model from the server.
Note: Calling this method is only needed when using the openCompletedCallback parameter to OpenModel and returning POSTPONE_STREAMING.
Return type: void
static getCustomServerInfo
-
RemoteModel.getCustomServerInfo(socketIOClient_socketInstance, callback) Arguments: - socketIOClient_socketInstance (
any) – None - callback (
function) – None
Static method to get custom server info from the UgServer.
This info is specified on the server in the createServerInstance() method or the constructor to ServerInstance.
Default response is null.
Return type: void -
RemoteModel.callback(customData) Arguments: - customData (
any) – None
Return type: void
- customData (
- socketIOClient_socketInstance (