API / geotoolkit / scene / ViewCache / ViewCache
Defines a cache strategy to prerender composite node's children in a set of tiles, which have a raster format. For example, it can be an image or texture. The format depends on rendering engine.
↳
ViewCache
Constructors
| [new ViewCache()](/solutions/geotoolkit/apis/classes/geotoolkit.scene.viewcache.viewcache.md#new viewcache()) | [new ViewCache(options)](/solutions/geotoolkit/apis/classes/geotoolkit.scene.viewcache.viewcache.md#new viewcache(options)) | [new ViewCache(tileWidth, tileHeight, mode, memoryLimit, async)](/solutions/geotoolkit/apis/classes/geotoolkit.scene.viewcache.viewcache.md#new viewcache(tilewidth, tileheight, mode, memorylimit, async)) |
|---|
Methods
Constructors
• new ViewCache()
Cache.constructor
• new ViewCache(options?)
Creates cache
| Name | Type | Description |
|---|---|---|
Optional options | Options | cache options |
Cache.constructor
• new ViewCache(tileWidth?, tileHeight?, mode?, memoryLimit?, async?)
Creates cache
| Name | Type | Description |
|---|---|---|
Optional tileWidth | number | tile width in device coordinates |
Optional tileHeight | number | tile height in device coordinates |
Optional mode | CacheMode | Shared mode by default |
Optional memoryLimit | number | memoryLimit Upper memory limit in Megabyte, ignored when in Shared mode use TileResourceManager.getInstance().setMemoryLimit() to set memory limit in Shared mode |
Optional async | boolean | true if actions are performed asynchronously |
Cache.constructor
Methods
▸ clone(): Cache
Returns a cloned cache object. All inheritors should implement copy constructor or provide custom implementation for this method.
▸ Protected copyConstructor(src): void
copy constructor
| Name | Type | Description |
|---|---|---|
src | ViewCache | Source to copy from |
void
▸ getClassName(): string
string
▸ getOwner(): Node
Returns cache owner.
owner this cache's owner
▸ getResourceManager(): TileResourceManager
Returns resource manager.
▸ getStopCreationOrUpdate(): boolean
Returns flag which freezes the cache.
boolean
stop
▸ getTileHeight(): number
Returns tile height.
number
height
▸ getTileWidth(): number
Returns tile width.
number
width
▸ invalidate(bounds?): ViewCache
Invalidates cache. Marks cache to be rendered.
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | rectangular area to be invalidated |
this
▸ isAsync(): boolean
Checks if cache is asynchronous
boolean
▸ rebuild(force?): ViewCache
Flags the ViewCache as needing a clear / rebuild. Called after zooming or when we've hit the cap for number of images
| Name | Type | Description |
|---|---|---|
Optional force | boolean | force flag |
this
▸ render(context): void
Render to context. Will only render tiles within visible model limits.
| Name | Type | Description |
|---|---|---|
context | RenderingContext | rendering context |
void
▸ setAsync(bool?): ViewCache
Sets asynchronous cache rendering
| Name | Type | Description |
|---|---|---|
Optional bool | boolean | true if cache should be asynchronous |
this
▸ setExtend(extend): ViewCache
Set extend
| Name | Type | Description |
|---|---|---|
extend | Dimension | overlap between 2 tiles |
this
▸ setKeepAlive(keepAlive): ViewCache
Set keep alive strategy, keep tiles alive when rebuild as much as possible
| Name | Type | Description |
|---|---|---|
keepAlive | boolean | flag |
▸ setOwner(owner): ViewCache
Sets cache owner.
Throws
Error This exception is thrown if type is not supported
| Name | Type | Description |
|---|---|---|
owner | Node | node which should be cached |
this
▸ setRenderContent(renderContentDelegate): ViewCache
Sets render content.
| Name | Type | Description |
|---|---|---|
renderContentDelegate | (context: RenderingContext) => void | external method to render tiles |
this
▸ setStopCreationOrUpdate(stop): ViewCache
When this is set to true will essentially freeze the cache - tiles will no longer be created, existing tiles will be used and scaled to fit the visible bounds if tiles do not exist for a particular area nothing will be rendered.
| Name | Type | Description |
|---|---|---|
stop | boolean | flag to freeze the cache |
this
▸ stopRenderAsync(): ViewCache
Stops all asynchronous rendering processes (if existed)
this
▸ Static getClassName(): string
string
▸ Static getDebugMode(): DebugInfo
Return current debug mode states
▸ Static setDebugMode(debugInfo): void
Set debug mode states
| Name | Type | Description |
|---|---|---|
debugInfo | DebugInfo | debug information |
void