StreamModel
-
class
cee.vs.StreamModel() A remote Visualization Streamer (VizStreamer) model that can be displayed in the Viewer.
The
StreamModelclass supports an efficient streaming and rendering of 3D data. The data to this model is sent from the VizStreamer Service, to which data is sent using GRPC or a C++ interface.To create a new instance of the
StreamModel, theServerSessionobject needs to be created first. Afterwards, use theServerSession.createStreamModelmethod to create a model linked to the stream. By default, the model starts streaming immediately.The streaming to this model is controlled with the
startStreamingandstopStreamingmethods. You can also check whether streaming is active with theisStreamingActivemethod.The current frame of the StreamModel can be set with the
currentFrameIndexproperty.Example:
Create a StreamModel and add it to the view.
// create a cloud session first, viewer and a view const cloudSession = new cee.CloudSession(); const viewer = cloudSession.addViewer(htmlCanvasElement, { useOperators: false }); const view = viewer.addView() // Connect to the server session at the given url. const serverSession = await cee.vs.ServerSession.createInstance_async("http://localhost:8091"); // Get the available streams const streams = await serverSession.getAvailableStreams_async(); // Grab the first stream if (streams[0]) { const streamId = streams[0].streamId; const streamModel = serverSession.createStreamModel(streamId); // Add the model to the cee.View view.addModel(streamModel); // Start the streaming if not already started. if (!streamModel.isStreamingActive()) { await streamModel.startStreaming_async(); } }
Index
Accessors
Methods
addConfigReadyCallbackaddConfigReadyCallbackForRevisionaddStreamingCompleteCallbackaddStreamingCompleteCallbackForRevisiondetachFromSessiongetBoundingBoxgetDefaultCameraConfigisStreamingActiveisStreamingCompletepollForStreamConfig_asyncrayIntersectremoveAllConfigReadyCallbacksremoveAllStreamingCompleteCallbackssetGuidingCamerastartStreaming_asyncstopStreaming
Accessors
-
cee.vs.StreamModel.currentFrameIndex() - get currentFrameIndex(): number
Gets/sets the current frame index displayed in this model.
Returns: number
set currentFrameIndex(frameIndex: number): voidParameters
frameIndex: numberReturns: void
-
cee.vs.StreamModel.frameCount() - get frameCount(): number
Gets the number of frames in this model.
Returns: number
-
cee.vs.StreamModel.name() Name of the model.
Mainly used for debugging.
get name(): stringName of the model, primarily used for debugging.
Returns: string
set name(name: string): voidName of the model.
Mainly used for debugging.
Parameters
name: stringReturns: void
-
cee.vs.StreamModel.publishTag() - get publishTag(): string
The publishTag associated with the current stream config or null if no publishTag was set.
Returns: string
-
cee.vs.StreamModel.streamId() - get streamId(): string
The stream id of the stream being consumed by this model
Returns: string
-
cee.vs.StreamModel.streamRevision() - get streamRevision(): number
The current streamRevision of the stream being consumed by this model, or undefined if no stream config has been received yet.
Returns: number
Methods
-
cee.vs.StreamModel.addConfigReadyCallback() - addConfigReadyCallback(callback:
ConfigReadyCallback): voidParameters
callback:ConfigReadyCallbackReturns: void
addConfigReadyCallback(options:CallbackOptions, callback:ConfigReadyCallback): voidParameters
options:
CallbackOptionscallback:
ConfigReadyCallbackReturns: void
-
cee.vs.StreamModel.addConfigReadyCallbackForRevision() - addConfigReadyCallbackForRevision(streamRevision: number, callback:
RevisionBoundConfigReadyCallback): voidParameters
streamRevision: number
callback:
RevisionBoundConfigReadyCallbackReturns: void
-
cee.vs.StreamModel.addStreamingCompleteCallback() - addStreamingCompleteCallback(callback:
StreamingCompleteCallback): voidParameters
callback:StreamingCompleteCallbackReturns: void
addStreamingCompleteCallback(options:CallbackOptions, callback:StreamingCompleteCallback): voidParameters
options:
CallbackOptionscallback:
StreamingCompleteCallbackReturns: void
-
cee.vs.StreamModel.addStreamingCompleteCallbackForRevision() - addStreamingCompleteCallbackForRevision(streamRevision: number, callback:
RevisionBoundStreamingCompleteCallback): voidParameters
streamRevision: number
callback:
RevisionBoundStreamingCompleteCallbackReturns: void
-
cee.vs.StreamModel.detachFromSession() - detachFromSession(): void
Detaches the model from its owner server session. This will permanently stop streaming of the model.
Returns: void
-
cee.vs.StreamModel.getBoundingBox() - getBoundingBox(_options:
ModelBoundingBoxOptions):BoundingBoxReturns the
BoundingBox(in world coordinates) of the current contents of the modelNote that this method does not support any
ModelBoundingBoxOptionsParameters
_options:ModelBoundingBoxOptionsReturns:
BoundingBox
-
cee.vs.StreamModel.getDefaultCameraConfig() - getDefaultCameraConfig(): None
Returns default camera configuration, which is always null for this model.
Returns: None
-
cee.vs.StreamModel.isStreamingActive() - isStreamingActive(): boolean
Checks whether the streaming to the model is enabled or not.
Returns: boolean
-
cee.vs.StreamModel.isStreamingComplete() - isStreamingComplete(): boolean
Returns: boolean
-
cee.vs.StreamModel.pollForStreamConfig_async() - pollForStreamConfig_async(): Promise
Polls for new data for this model.
Returns: Promise
-
cee.vs.StreamModel.rayIntersect() -
Performs picking on the model using the current frame. Returns null when nothing is hit.
Parameters
ray:RayReturns:
HitItem
-
cee.vs.StreamModel.removeAllConfigReadyCallbacks() - removeAllConfigReadyCallbacks(): void
Returns: void
-
cee.vs.StreamModel.removeAllStreamingCompleteCallbacks() - removeAllStreamingCompleteCallbacks(): void
Returns: void
-
cee.vs.StreamModel.setGuidingCamera() - setGuidingCamera(camera:
Camera): voidSets the guiding camera by watching its changes and using it to guide the streaming.
Parameters
camera:CameraReturns: void
-
cee.vs.StreamModel.startStreaming_async() - startStreaming_async(): Promise
Starts the streaming from the VizStreamer Service.
Returns: Promise
-
cee.vs.StreamModel.stopStreaming() - stopStreaming(): void
Stops the streaming from the VizStreamer Service.
Returns: void