Class: EmperorController

EmperorController

EmperorController This is the application controller

The application controller, contains all the information on how the model is being presented to the user.

Constructor

new EmperorController(dm, divId, webglcanvasopt) → {EmperorController}

Parameters:
Name Type Attributes Description
dm DecompositionModel

An object that will be represented on screen.

divId string

The element id where the controller should instantiate itself.

webglcanvas node <optional>

the canvas to use to render the information. This parameter is optional, and should rarely be set. But is useful for external applications like SAGE2.

Source:
Returns:
Type
EmperorController

Members

$divId :node

jQuery object where the object lives in.

Type:
  • node
Source:

$plotMenu :node

Internal div where the plots live in (jQuery object).

Type:
  • node
Source:

$plotSpace :node

Internal div where the menus live in (jQuery object).

Type:
  • node
Source:

controllers :object

Holds a reference to all the tabs (view controllers) in the $plotMenu.

Type:
  • object
Source:

decViews :object

Object with all the available decomposition views.

FIXME: This is a hack to go around the fact that the constructor takes a single decomposition model instead of a dictionary

Type:
  • object
Source:

dm :DecompositionModel

Ordination data being plotted.

Type:
Source:

GRID_SCALE :float

Scaling constant for grid dimensions (read only).

Type:
  • float
Source:

height :float

Height of the object.

Type:
  • float
Source:

renderer :THREE.Renderer

Object in charge of doing the rendering of the scenes.

Type:
  • THREE.Renderer
Source:

rendererBackgroundColor :THREE.Color

Background color of the scene.

Type:
  • THREE.Color
Default Value:
  • 0x00000000
Source:

SCENE_VIEW_SCALE :float

Scaling constant for scene plot view dimensions

Type:
  • float
Source:

sceneViews :Array.<ScenePlotView3D>

List of the scene plots views being rendered.

Type:
Source:

width :float

Width of the object.

Type:
  • float
Source:

Methods

addDecompositionView(key, value)

Add a new decomposition view

Parameters:
Name Type Description
key String

New name for the decomposition view.

value DecompositionView

The decomposition view that will be added.

Source:
Throws:

Error if key already exists, or if value is not a decomposition view.

addSceneView()

Helper method to add additional ScenePlotViews (i.e. another plot)

Source:

addTab(dvdict, viewConstructor)

Helper method to resize the plots.

Parameters:
Name Type Description
dvdict Array.<DecompositionView>

Dictionary of DecompositionViews.

viewConstructor EmperorViewControllerABC

Constructor of the view controller.

Source:

loadConfig(json)

Load a settings file and set all controller variables.

This method will trigger a rendering callback.

Parameters:
Name Type Description
json object

Information about the emperor session to load.

Source:

render()

Helper method to render sceneViews, gets called every time the browser indicates we can render a new frame, however it only triggers the appropriate rendering functions if something has changed since the last frame.

Source:

resize(the, the)

Helper method to resize the plots

Parameters:
Name Type Description
the width

width of the entire plotting space

the height

height of the entire plotting space

Source:

saveConfig()

Write settings file for the current controller settings

The format is as follows: a javascript object with the camera position stored in the 'cameraPosition' key and the quaternion in the 'cameraQuaternion' key. Each controller in this.controllers is then saved by calling toJSON on them, and the resulting object saved under the same key as the controllers object.

Source:

screenshot(typeopt)

Save the current canvas view to a new window

Parameters:
Name Type Attributes Default Description
type string <optional>
png

Format to save the file as: ('png', 'svg')

Source: