ConstantRemoteModel

class cee.cug.ConstantRemoteModel()

A constant remote model designed for viewing CAE models with a stateless, scalable server.

The ConstantRemoteModel supports an efficient and scalable streaming of pre-defined CAE model configurations. The server is a stateless REST API based server that has very low resource usage on the server side and is easy to load balance. The streaming also starts immediately when a model is opened, no matter the size of the model. Similar to RemoteModel, it utilizes 3D Progressive Object Streaming to the client. The model needs to be converted into a CUG database format before it can be streamed. This is done with the included CugComposer command line utility.

The ConstantRemoteModel is used in the viewer on Ceetron Cloud.

See the example in Examples/BuildYourFirstApp/2-Viewer for how to use the ConstantRemoteModel.

Constructors

cee.cug.ConstantRemoteModel.constructor()
ConstantRemoteModel(): ConstantRemoteModel

Creates a ConstantRemoteModel.

Returns: ConstantRemoteModel

Accessors

cee.cug.ConstantRemoteModel.animation()
get animation(): Animation

The animation control for this ConstantRemoteModel

Returns: Animation

cee.cug.ConstantRemoteModel.currentFrameIndex()
get currentFrameIndex(): number

The frame to show

The given zero-based index must be between 0 and frameCount - 1.

Returns: number

set currentFrameIndex(frameIndex: number): void

Parameters

frameIndex: number

Returns: void

cee.cug.ConstantRemoteModel.cuttingPlaneCount()
get cuttingPlaneCount(): number

Returns: number

cee.cug.ConstantRemoteModel.frameCount()
get frameCount(): number

Returns: number

cee.cug.ConstantRemoteModel.isosurfaceCount()
get isosurfaceCount(): number

Returns: number

cee.cug.ConstantRemoteModel.isovolumeCount()
get isovolumeCount(): number

Returns: number

cee.cug.ConstantRemoteModel.meshColor()
get meshColor(): Color3Like

The color of the element mesh on the surface of the part

Returns: Color3Like

set meshColor(color: Color3Like): void

Parameters

color: Color3Like

Returns: void

cee.cug.ConstantRemoteModel.modelSpec()
get modelSpec(): ModelSpec

Returns the ModelSpec describing the result used in this model

Might return null if model is not streamed yet or the model does not have result info.

Returns: ModelSpec

cee.cug.ConstantRemoteModel.name()

Name of the model.

Mainly used for debugging.

get name(): string

Name of the model.

Mainly used for debugging.

Returns: string

set name(name: string): void

Name of the model.

Mainly used for debugging.

Parameters

name: string

Returns: void

cee.cug.ConstantRemoteModel.partCount()
get partCount(): number

Returns the number of parts in this model

Returns: number

cee.cug.ConstantRemoteModel.particleTraceGroup()
get particleTraceGroup(): number

Returns: number

cee.cug.ConstantRemoteModel.simulationInfo()
get simulationInfo(): SimulationInfo

Returns the SimulationInfo describing the simulation that is the source for this model.

Might return null if model is not streamed yet or the model does not have simulation info

Returns: SimulationInfo

Methods

cee.cug.ConstantRemoteModel.closeModel()
closeModel(): void

Returns: void

cee.cug.ConstantRemoteModel.enablePreLoading()
enablePreLoading(enable: boolean): void

Parameters

enable: boolean

Returns: void

cee.cug.ConstantRemoteModel.getBoundingBox()
getBoundingBox(_options: ModelBoundingBoxOptions): BoundingBox

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

Note that currently this method does not support any ModelBoundingBoxOptions

Parameters

Returns: BoundingBox

cee.cug.ConstantRemoteModel.getBoundingBoxForPart()
getBoundingBoxForPart(partIndex: number): BoundingBox

Returns the BoundingBox (in world coordinates) of the part at the given index.

Parameters

partIndex: number

Returns: BoundingBox

cee.cug.ConstantRemoteModel.getCurrentParticleTraceTime()
getCurrentParticleTraceTime(): number

Returns: number

cee.cug.ConstantRemoteModel.getCuttingPlaneArray()
getCuttingPlaneArray(): readonly  CuttingPlane[]

Returns: readonly  CuttingPlane[]

cee.cug.ConstantRemoteModel.getCuttingPlaneAt()
getCuttingPlaneAt(index: number): CuttingPlane

Parameters

index: number

Returns: CuttingPlane

cee.cug.ConstantRemoteModel.getDefaultCameraConfig()
getDefaultCameraConfig(): CameraConfig

Returns default camera configuration for this model if there is one.

Returns: CameraConfig

cee.cug.ConstantRemoteModel.getFrameInfoArray()
getFrameInfoArray(): readonly  FrameInfo[]

Returns: readonly  FrameInfo[]

cee.cug.ConstantRemoteModel.getFrameInfoAt()
getFrameInfoAt(index: number): FrameInfo

Parameters

index: number

Returns: FrameInfo

cee.cug.ConstantRemoteModel.getIsosurfaceArray()
getIsosurfaceArray(): readonly  Isosurface[]

Returns: readonly  Isosurface[]

cee.cug.ConstantRemoteModel.getIsosurfaceAt()
getIsosurfaceAt(index: number): Isosurface

Parameters

index: number

Returns: Isosurface

cee.cug.ConstantRemoteModel.getIsovolumeArray()
getIsovolumeArray(): readonly  Isovolume[]

Returns: readonly  Isovolume[]

cee.cug.ConstantRemoteModel.getIsovolumeAt()
getIsovolumeAt(index: number): Isovolume

Parameters

index: number

Returns: Isovolume

cee.cug.ConstantRemoteModel.getPartArray()
getPartArray(): readonly  Part[]

Returns: readonly  Part[]

cee.cug.ConstantRemoteModel.getPartAt()
getPartAt(index: number): Part

Parameters

index: number

Returns: Part

cee.cug.ConstantRemoteModel.getParticleTraceGroupArray()
getParticleTraceGroupArray(): readonly  ParticleTraceGroup[]

Returns: readonly  ParticleTraceGroup[]

cee.cug.ConstantRemoteModel.getParticleTraceGroupAt()
getParticleTraceGroupAt(index: number): ParticleTraceGroup

Parameters

index: number

Returns: ParticleTraceGroup

cee.cug.ConstantRemoteModel.getResultInfo()
getResultInfo(resultType: ResultType, resultId: number): ResultInfo

Get the information about the result with the given type and id.

Returns null if the result was not found.

Parameters

resultType: ResultType

resultId: number

Returns: ResultInfo

cee.cug.ConstantRemoteModel.getResultInfoArray()
getResultInfoArray(): readonly  ResultInfo[]

Get the array with all ResultInfos defined in this model

Returns: readonly  ResultInfo[]

cee.cug.ConstantRemoteModel.isFirstParticleTraceCycle()
isFirstParticleTraceCycle(): boolean

Returns: boolean

cee.cug.ConstantRemoteModel.openLocalBundle()
openLocalBundle(modelBundle: BinaryModelBundle, initializationCompleteCallback: InitializationCompleteCallback): void

Parameters

modelBundle: BinaryModelBundle

initializationCompleteCallback: InitializationCompleteCallback

Returns: void

cee.cug.ConstantRemoteModel.openModel()
openModel(serverUrl: string, modelKey: string, options: OpenModelOptions, initializationCompleteCallback: InitializationCompleteCallback): void

Parameters

serverUrl: string

modelKey: string

options: OpenModelOptions

initializationCompleteCallback: InitializationCompleteCallback

Returns: void

cee.cug.ConstantRemoteModel.openRemoteBundle()
openRemoteBundle(bundleUrl: string, options: OpenRemoteBundleOptions, initializationCompleteCallback: InitializationCompleteCallback): void

Parameters

bundleUrl: string

options: OpenRemoteBundleOptions

initializationCompleteCallback: InitializationCompleteCallback

Returns: void

cee.cug.ConstantRemoteModel.rayIntersect()
rayIntersect(ray: Ray): HitItem

Performs picking on the model using the current frame.

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

Parameters

ray: Ray

Returns: HitItem

cee.cug.ConstantRemoteModel.rayIntersectServerInfo()
rayIntersectServerInfo(ray: Ray, rayIntersectCallback: RayIntersectCallback): void

Performs picking on the model using the current frame, querying the server for additional info

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

This method will query the CUG server for additional info on the selected item

Parameters

ray: Ray

rayIntersectCallback: RayIntersectCallback

Returns: void

cee.cug.ConstantRemoteModel.setColorLegendTitle()
setColorLegendTitle(resultId: number, title: string): void

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.

Parameters

resultId: number

title: string

Returns: void

cee.cug.ConstantRemoteModel.setCurrentParticleTraceTime()
setCurrentParticleTraceTime(time: number, isFirstParticleTraceCycle: boolean): void

Parameters

time: number

isFirstParticleTraceCycle: boolean

Returns: void

cee.cug.ConstantRemoteModel.setGuidingCamera()
setGuidingCamera(camera: Camera): void

Parameters

camera: Camera

Returns: void

cee.cug.ConstantRemoteModel.setMasterModelForSyncAnimation()
setMasterModelForSyncAnimation(masterModel: ConstantRemoteModel): void

Set a master model to which animation in this model will be synchronized.

Calling this function will make this model a slave of masterModel with regards to animations. This means that animations will be controlled via the master model’s animation control and that this model’s animation control become invalid. To set this model back to normal operation, pass null to this function.

Parameters

masterModel: ConstantRemoteModel

Returns: void

cee.cug.ConstantRemoteModel.setOneShotDataStreamingCompleteCallback()
setOneShotDataStreamingCompleteCallback(dataStreamingCompleteCallback: DataStreamingCompleteCallback): void

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

Parameters

dataStreamingCompleteCallback: DataStreamingCompleteCallback

Returns: void

cee.cug.ConstantRemoteModel.setProgressHandler()
setProgressHandler(progressHandler: ProgressHandler): void

Sets a handler function that will be called whenever when new progress data is available

Parameters

progressHandler: ProgressHandler

Returns: void