FORGE. MediaStore

new MediaStore(viewer, config, preview)

This object stores a number of tiles used for multi resolution cases with tiles. It acts as a LRU map, as we can't store infinite amount of tiles. The number of tiles to store is Σ(6 * 4^n), with n being the number of levels. There is an exception though: the level 0 of a multi resolution is always kept in the cache.
Parameters:
Name Type Description
viewer FORGE.Viewer FORGE.Viewer reference
config SceneMediaSourceConfig the config given by a media to know how to load each tile
preview FORGE.Image | SceneMediaPreviewConfig the pattern of the preview
Source:

Extends

Members

(static) CUBE_FACE_CONFIG :CubeFaceObject

Table describing previous cube face
Type:
  • CubeFaceObject
Source:

(static) TEXTURE_STACK_INTERVAL_MS :number

Texture stack interval in milliseconds
Type:
  • number
Source:

(readonly) alive :boolean

Get the alive flag value of the object.
Type:
  • boolean
Inherited From:
Source:

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
Source:

data :*

Get and set any custom data you want to associate to this object.
Type:
  • *
Inherited From:
Source:

debug :boolean

Get and set the debug flag.
Type:
  • boolean
Inherited From:
Source:

(readonly) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
Source:

(readonly) tags :Array

Get the tags associated to this object.
Type:
  • Array
Inherited From:
Source:

(readonly) uid :string

Get the uid of the object.
Type:
  • string
Inherited From:
Source:

warning :boolean

Get and set the warning flag.
Type:
  • boolean
Inherited From:
Source:

Methods

_textureStackPop()

Pop item from texture stack.
Source:

_textureStackPush(tile)

Push item from texture stack.
Parameters:
Name Type Description
tile FORGE.Tile tile requesting texture
Source:

destroy()

Destroy routine.
Overrides:
Source:

discardTileTexture(tile)

Discard texture for a given tile
Parameters:
Name Type Description
tile FORGE.Tile tile
Source:

get(tile) → {Promise}

Get an image from this store, given four parameters: the face associated to this image, the level of quality and the x and y positions. It returns either a THREE.Texture or null. The inner working is as follow: either the image is already loaded and returned, or either the image is being loaded and nothing is returned yet. If the latter, the image is added to the map once it is completely loaded (the onLoadComplete event).
Parameters:
Name Type Description
tile FORGE.Tile tile
Source:
Returns:
returns a promise on the image
Type
Promise

has(key)

Ask store if it has a texture already available
Parameters:
Name Type Description
key string texture key
Source:

log(value)

Basic log method, log a string in the console if debug is enabled.
Parameters:
Name Type Description
value * The value you want to log in the console.
Inherited From:
Source:

warn(valuenullable)

Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name Type Attributes Description
value string | Object <nullable>
The value you want to warn in the console.
Inherited From:
Source:

FORGE. MediaStore

Members
Methods