EventManager

The EventManager deals with events, create them, call them. This class is mostly for being inherited from.

new EventManager()
Instance Members
on(eventName, callback)

MorphologyPolycylinder

The MorphologyPolycylinder is a tubular representation of a morphology, using cylinders. this alternative to MorphologyPolyline is heavier on CPU and GPU so is more made when displaying a small number of morphologies. MorphologyPolycylinder extends from THREE.Object so that it's easy to integrate. It's constructor

new MorphologyPolycylinder(morpho: Object, options: object)

Extends MorphologyShapeBase

Parameters
morpho (Object) raw object that describes a morphology (usually straight from a JSON file)
options (object) the option object

mergeBufferGeometries

mergeBufferGeometries(geometries: Array<THREE.BufferGeometry>, useGroups: any): THREE.BufferGeometry
Parameters
geometries (Array<THREE.BufferGeometry>)
useGroups (any)
Returns
THREE.BufferGeometry:

mergeBufferAttributes

mergeBufferAttributes(attributes: Array<THREE.BufferAttribute>): THREE.BufferAttribute
Parameters
attributes (Array<THREE.BufferAttribute>)
Returns
THREE.BufferAttribute:

MorphologyPolyline

The MorphologyPolyline is the simplest 3D representation of a morphology, using simple polylines. Compared to its cylinder-based alternative (MorphologyPolycylinder), this one is more suitable for displaying several morphologies (up to maybe a hundred, depending on length and machine performance) MorphologyPolyline extends from THREE.Object so that it's easy to integrate. It's constructor

new MorphologyPolyline(morpho: Morphology, options: object)

Extends MorphologyShapeBase

Parameters
morpho (Morphology) raw object that describes a morphology (usually straight from a JSON file)
options (object) the option object

MorphologyShapeBase

This is the base class for MorphologyPolyline and MorphologyPolycylinder. It handles the common features, mainly related to soma creation

new MorphologyShapeBase(morpho: Object, options: object)

Extends THREE.Object3D

Parameters
morpho (Object) raw object that describes a morphology (usually straight from a JSON file)
options (object) the option object
Instance Members
getTargetPoint()
getMorphology()

MorphoViewer

The MorphoViewer class is the entry point object of the MorphoViewer project and is the only object the user should be dealing with.

new MorphoViewer(divObj: any)
Parameters
divObj (any = null)
Instance Members
addMorphology(morphoObj, options)
addStlToMeshCollection(url, options)
destroy()
getCameraFieldOfView()
setCameraFieldOfView(fov)
focusOnMorphology(name, distance)
focusOnMesh(name)
onRaycast(cb)
takeScreenshot(filename)
addObjToMeshCollection(objStr, options)
showMesh(name)
hideMesh(name)

ThreeContext

ThreeContext creates a WebGL context using THREEjs. It also handle mouse control. A MorphologyPolyline instance is added to it. An event can be associated to a ThreeContext instance: onRaycast with the method .on("onRaycast", function(s){...}) where s is the section object being raycasted.

new ThreeContext(divObj: DONObject)

Extends EventManager

Parameters
divObj (DONObject = null) the div object as a DOM element. Will be used to host the WebGL context created by THREE
Instance Members
getCameraFieldOfView()
setCameraFieldOfView(fov)
addStlToMeshCollection(url, options)
addObjToMeshCollection(objStr, options)
addMorphology(morphoMesh, options)
focusOnMorphology(name, distance)
focusOnMesh(name)
getSnapshotData()
showMesh(name)
hideMesh(name)
destroy()

Tools

Some handy static functions to do stuff that are not strictly related to the business of the project

new Tools()
Static Members
getOption(optionObj, optionName, optionDefaultValue)