File

src/loaders/event-data-loader.ts

Description

Event data loader for implementing different event data loaders.

Index

Methods

Methods

addLabelToEventObject
addLabelToEventObject(label: string, collection: string, indexInCollection: number)

Add label of event object to the labels object.

Parameters :
Name Type Optional Description
label string No

Label to add to the event object.

collection string No

Collection the event object is a part of.

indexInCollection number No

Event object's index in collection.

Returns : string

A unique label ID string.

buildEventData
buildEventData(eventData: any, graphicsLibrary: ThreeManager, ui: UIManager, infoLogger: InfoLogger)

Takes an object that represents ONE event and takes care of adding the different objects to the graphic library and the UI controls.

Parameters :
Name Type Optional Description
eventData any No

Object representing the event.

graphicsLibrary ThreeManager No

Manager containing functionality to draw the 3D objects.

ui UIManager No

Manager for showing menus and controls to manipulate the geometries.

infoLogger InfoLogger No

Logger for logging event display data..

Returns : void
getCollection
getCollection(collectionName: string)

Get all the objects inside a collection.

Parameters :
Name Type Optional Description
collectionName string No

Key of the collection that will be retrieved.

Returns : any

Object containing all physics objects from the desired collection.

getCollections
getCollections()

Get the different collections for the current stored event.

Returns : string[]

List of strings, each representing a collection of the event displayed.

getEventMetadata
getEventMetadata()

Get metadata associated to the displayed event (experiment info, time, run, event...).

Returns : any[]

Metadata of the displayed event.

getEventsList
getEventsList(eventsData: any)

Takes an object containing multiple events and returns the keys of these events.

Parameters :
Name Type Optional Description
eventsData any No

Object that contains the different events.

Returns : string[]

List of keys of the different events.

getLabelsObject
getLabelsObject()

Get the object containing labels.

Returns : literal type

The labels object.

import { ThreeManager } from '../managers/three-manager';
import { UIManager } from '../managers/ui-manager';
import { InfoLogger } from '../helpers/info-logger';

/**
 * Event data loader for implementing different event data loaders.
 */
export interface EventDataLoader {
  /**
   * Takes an object that represents ONE event and takes care of adding
   * the different objects to the graphic library and the UI controls.
   * @param eventData Object representing the event.
   * @param graphicsLibrary Manager containing functionality to draw the 3D objects.
   * @param ui Manager for showing menus and controls to manipulate the geometries.
   * @param infoLogger Logger for logging event display data..
   */
  buildEventData(
    eventData: any,
    graphicsLibrary: ThreeManager,
    ui: UIManager,
    infoLogger: InfoLogger,
  ): void;

  /**
   * Takes an object containing multiple events and returns the keys of these events.
   * @param eventsData Object that contains the different events.
   * @returns List of keys of the different events.
   */
  getEventsList(eventsData: any): string[];

  /**
   * Get the different collections for the current stored event.
   * @returns List of strings, each representing a collection of the event displayed.
   */
  getCollections(): string[];

  /**
   * Get all the objects inside a collection.
   * @param collectionName Key of the collection that will be retrieved.
   * @returns Object containing all physics objects from the desired collection.
   */
  getCollection(collectionName: string): any;

  /**
   * Get metadata associated to the displayed event (experiment info, time, run, event...).
   * @returns Metadata of the displayed event.
   */
  getEventMetadata(): any[];

  /**
   * Add label of event object to the labels object.
   * @param label Label to add to the event object.
   * @param collection Collection the event object is a part of.
   * @param indexInCollection Event object's index in collection.
   * @returns A unique label ID string.
   */
  addLabelToEventObject(
    label: string,
    collection: string,
    indexInCollection: number,
  ): string;

  /**
   * Get the object containing labels.
   * @returns The labels object.
   */
  getLabelsObject(): { [key: string]: any };
}

results matching ""

    No results matching ""