License

Copyright 2016 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Hierarchy

Implements

Constructors

Properties

RPC_TYPE_ID: string

Should be set to a constant specifying the SharedObject type identifier on the prototype of final derived owner classes. It is not used on counterpart (non-owner) classes.

chunkConstructor: ChunkConstructor<SliceViewChunk>
chunkManager: ChunkManager
chunks: Map<string, SliceViewChunk>
disposedStacks: any
freeChunks: Chunk[] = ...
isOwner: undefined | boolean
refCount: number = 1
referencedGeneration: number
rpc: null | RPC = null
rpcId: null | number = null
sourceQueueLevel: number = 0

sourceQueueLevel must be greater than the sourceQueueLevel of any ChunkSource whose download method depends on chunks from this source. A normal ChunkSource with no other dependencies should have a level of 0.

statistics: Float64Array = ...
tempChunkDataSize: Uint32Array
tempChunkPosition: Float32Array
unreferencedGeneration: number
wasDisposed: undefined | boolean

Methods

  • Helper function for computing the voxel bounds of a chunk based on its chunkGridPosition.

    This assumes that the grid of chunk positions starts at this.baseVoxelOffset. Chunks are clipped to lie within upperVoxelBound, but are not clipped to lie within lowerVoxelBound. (The frontend code currently cannot handle chunks clipped at their lower corner, and the chunk layout can generally be chosen so that lowerVoxelBound lies on a chunk boundary.)

    This sets chunk.chunkDataSize to a copy of the returned chunkDataSize if it differs from this.spec.chunkDataSize; otherwise, it is set to this.spec.chunkDataSize.

    Returns

    A globally-allocated Vec3 containing the chunk corner position in voxel coordinates. The returned Vec3 will be invalidated by any subsequent call to this method, even on a different VolumeChunkSource instance.

    Parameters

    Returns Float32Array

  • Begin downloading the specified the chunk. The returned promise should resolve when the downloaded data has been successfully decoded and stored in the chunk, or rejected if the download or decoding fails.

    Note: This method must be defined by subclasses.

    Parameters

    • chunk: Chunk

      Chunk to download.

    • cancellationToken: CancellationToken

      If this token is canceled, the download/decoding should be aborted if possible.

      TODO(jbms): Move this back to the class definition above and declare this abstract once mixins are compatible with abstract classes.

    Returns Promise<void>

Generated using TypeDoc