ParticleModel

class cee.pt.ParticleModel()

Client-side particle model. Fetches, decodes, caches, and renders time-stepped particle frames via the PtServer REST API (/api/v1/models).

const model = new cee.pt.ParticleModel();
await model.openModel('http://server/api/v1/models/mydata.ptfx');
await model.setFrame(0);
model.closeModel();

Constructors

cee.pt.ParticleModel.constructor()
ParticleModel(properties: Partial): ParticleModel

Parameters

properties: Partial

Returns: ParticleModel

Accessors

cee.pt.ParticleModel.activeScalarField()
get activeScalarField(): string

Returns: string

cee.pt.ParticleModel.animation()
get animation(): Animation

The animation controller for this model.

Returns: Animation

cee.pt.ParticleModel.currentFrameIndex()
get currentFrameIndex(): number

Returns: number

cee.pt.ParticleModel.datasetInfo()
get datasetInfo(): DatasetInfo

Returns: DatasetInfo

cee.pt.ParticleModel.frameCount()
get frameCount(): number

Returns: number

cee.pt.ParticleModel.maxParticleCount()
get maxParticleCount(): number

Returns: number

cee.pt.ParticleModel.name()

Name of the model.

Mainly used for debugging.

get name(): string

Name of the model.

Mainly used for debugging.

Returns: string

set name(value: string): void

Name of the model.

Mainly used for debugging.

Parameters

value: string

Returns: void

cee.pt.ParticleModel.scalarFieldNames()
get scalarFieldNames(): string[]

Returns: string[]

Methods

cee.pt.ParticleModel.closeModel()
closeModel(): void

Close the model and release resources. Error handler is preserved.

Returns: void

cee.pt.ParticleModel.getBoundingBox()
getBoundingBox(options: ModelBoundingBoxOptions): BoundingBox

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

When called without any parameters this method will return the current bounding box of the model, including only visible parts/objects. For models that support it, the full bounding box can may queried by specifying the optional ModelBoundingBoxOptions and setting ModelBoundingBoxOptions.includeHiddenParts to true.

Parameters

Returns: BoundingBox

cee.pt.ParticleModel.getCurrentFrameScalarRange()
getCurrentFrameScalarRange(): { max: number, min: number }

Per-frame scalar range de-quantized from uint16 via the global range.

Returns: { max: number, min: number }

cee.pt.ParticleModel.getDecimationFactor()
getDecimationFactor(): number

Returns: number

cee.pt.ParticleModel.getDefaultCameraConfig()
getDefaultCameraConfig(): CameraConfig

Can return an optional default camera configuration for this model.

If a model returns a default camera config, any views displaying the model may utilize the information to do first-time setup of their camera. The camera config will not have any effect on views where the camera has already been set by the user. If multiple models are shown in the same view, the first model with a default camera config will take precedence.

Returns: CameraConfig

cee.pt.ParticleModel.getOpacity()
getOpacity(): number

Get the opacity of the particles. 0 = fully transparent, 1 = fully opaque.

Returns: number

cee.pt.ParticleModel.getParticleColor()
getParticleColor(): Color3Like

Returns: Color3Like

cee.pt.ParticleModel.getParticleSize()
getParticleSize(): number

Returns: number

cee.pt.ParticleModel.getScalarMapper()
getScalarMapper(): ScalarMapper

Returns: ScalarMapper

cee.pt.ParticleModel.getUseScalarMapping()
getUseScalarMapping(): boolean

Returns: boolean

cee.pt.ParticleModel.isOpen()
isOpen(): boolean

Returns: boolean

cee.pt.ParticleModel.openModel()
openModel(datasetUrl: string): Promise

Open a particle dataset from a URL.

Parameters

datasetUrl: string

Returns: Promise

cee.pt.ParticleModel.setActiveScalarField()
setActiveScalarField(fieldName: string): Promise

Switch active scalar field on the server. Invalidates cache and reloads current frame.

Parameters

fieldName: string

Returns: Promise

cee.pt.ParticleModel.setDecimationFactor()
setDecimationFactor(factor: number): void

Set server-side decimation factor [0.01, 1.0]. Invalidates cache and reloads current frame.

Parameters

factor: number

Returns: void

cee.pt.ParticleModel.setFrame()
setFrame(frameIndex: number): Promise

Load and display a frame. Cancels any previous inflight request.

Parameters

frameIndex: number

0-based index in [0, frameCount)

Returns: Promise

cee.pt.ParticleModel.setOpacity()
setOpacity(opacity: number): void

Set the opacity of the particles (clamped to [0, 1]).

Parameters

opacity: number

Returns: void

cee.pt.ParticleModel.setParticleColor()
setParticleColor(color: Color3Like): void

Set solid particle color (used when scalar mapping is off).

Parameters

color: Color3Like

Returns: void

cee.pt.ParticleModel.setParticleSize()
setParticleSize(size: number): void

Set point size in pixels (clamped to >= 1).

Parameters

size: number

Returns: void

cee.pt.ParticleModel.setPreloadFrameCount()
setPreloadFrameCount(count: number): void

Set the number of frames to preload ahead. 0 disables preloading. Takes effect immediately: if the model is open and a frame is loaded, a new preload batch is started from the current frame.

Parameters

count: number

Returns: void

cee.pt.ParticleModel.setScalarMapper()
setScalarMapper(mapper: ScalarMapper): void

Set scalar mapper for color mapping.

Parameters

mapper: ScalarMapper

Returns: void

cee.pt.ParticleModel.setServerErrorHandler()
setServerErrorHandler(handler: ServerErrorHandler): void

Set error handler. Persists across close/open cycles. Pass null to clear.

Parameters

Returns: void

cee.pt.ParticleModel.setUseScalarMapping()
setUseScalarMapping(enable: boolean): Promise

Enable or disable scalar-based color mapping. Toggles the server wire format between 12 BPP (scalar) and 10 BPP (position-only).

Parameters

enable: boolean

Returns: Promise