Options
All
  • Public
  • Public/Protected
  • All
Menu

Helps to avoid doubled Geometries and so hopefully preserves some GPU-Memory. All geometries should be retrieved only from the Geometrymanager by their respective key.

Hierarchy

Index

Constructors

Private constructor

Properties

keys

keys: string[]

Used to show the available keys in the Manager. Mostly used for import.

lookup

lookup: {}

Represents the store of the data.

Type declaration

Static Private _instance

_instance: GeometryManager

Holds the instance of the GeometryManager.

Accessors

values

Static Instance

  • Returns the instance of the Manager or creates a new one if there is none. Only one instance is allowed.

    Returns GeometryManager

Methods

add

  • Saves a value in the Manager. Overrides existing values of the key.

    Parameters

    • key: string

      The key of the value

    • value: IGeometry

      The value to be saved

    Returns void

addIfNotExists

  • addIfNotExists(key: string, value: IGeometry): void
  • Adds a value if it not already exists within the storage.

    Parameters

    • key: string

      The key of the value

    • value: IGeometry

      The value to be saved

    Returns void

exists

  • exists(key: string): boolean
  • Checks if a key exists in the storage.

    Parameters

    • key: string

      The key to be checked.

    Returns boolean

get

  • Returns the value of a key or undefined if the key not exists.

    Parameters

    • key: string

      The key of the value to be returned.

    Returns IGeometry | undefined

getOrAdd

  • Checks for a key and returns its value or adds the default provided.

    Parameters

    • key: string

      The key of the value to be returned.

    • def: IGeometry

      Defaultvalue that should be added and returned, if the key not exists.

    Returns IGeometry

import

  • Imports data of another GeometrieManager into this one. Everything created anew cause JSON-serializing causes the loss of methods.

    Parameters

    • gl: WebGL2RenderingContext

      OpenGL Context to create the geometries anew.

    • manager: GeometryManager

      The data of the geometries to import.

    Returns void

Private isBox

  • Checks if the geometry is a Box.

    Parameters

    Returns o is Box

Private isModel

  • Checks if the geometry is a Model.

    Parameters

    Returns o is Model

Private isPlane

  • Checks if the geometry is a Plane.

    Parameters

    Returns o is Plane

Private isPyramide

  • Checks if the geometry is a Pyramid.

    Parameters

    Returns o is Pyramid

Private isSphere

  • Checks if the geometry is a Sphere.

    Parameters

    Returns o is Sphere

Private isTextureBox

  • isTextureBox(o: IGeometry): o is TextureBox
  • Checks if the geometry is a TextureBox.

    Parameters

    Returns o is TextureBox

Private isTexturePlane

  • isTexturePlane(o: IGeometry): o is TexturePlane
  • Checks if the geometry is a TexturePlane.

    Parameters

    Returns o is TexturePlane

remove

  • remove(key: string): void
  • Removes a certain key from the storage.

    Parameters

    • key: string

      The key of the value to be removed.

    Returns void

Generated using TypeDoc