GlobalVariables
This class defines things which are made available to all objects which import it. It is a singlton which means that each time it is imported the same instance is made available so if it is written to in one place, it can be read somewhere else.
Constructor Summary
Public Constructor | ||
public |
The constructor creates a new instance of the Global Variables object. |
Member Summary
Public Members | ||
public |
atomsSelected: array A variable to save array to be copied |
|
public |
availablePaths: array A list of all of the paths in this project which can be read from memory |
|
public |
availableTypes: array An array of all of the available types of atoms which can be placed with a right click. |
|
public |
The 2D reference to the canvas object on which the atoms are drawn. |
|
public |
A function which cancels the worker processing display when called |
|
public |
The canvas object on which the atoms are drawn. |
|
public |
The size (in mm) of segments to use for circles. |
|
public |
A flag to indicate if command is pressed |
|
public |
A flag to indicate if the edges of the shape should be displayed. |
|
public |
A flag to indicate if the faces of the shape should be displayed. |
|
public |
A flag to indicate if a grid should be displayed behind the shape |
|
public |
displayProcessing: bool A flag to indicate if a display value is currently being processed. |
|
public |
A flag to indicate if the display should show axis. |
|
public |
The last path displayed. |
|
public |
A flag to indicate if the project is a fork. |
|
public |
The github object which is used to interact with GitHub. |
|
public |
An evaluator for strings as mathmatical equations which is sandboxed and secure. |
|
public |
numberOfAtomsToLoad: integer A counter used during the loading process to keep track of how many atoms are still to be loaded. |
|
public |
A flag to indicate if the program is running in run mode (ie a shared link). |
|
public |
totalAtomCount: integer A total of the number of atoms in this project |
|
public |
A flag to indicate if the program is running with a touch interface. |
Method Summary
Public Methods | ||
public |
distBetweenPoints(x1: number, x2: number, y1: number, y2: number): * Computes the distance between two points on a plane. |
|
public |
generateUniqueID(): * A function to generate a unique ID value. |
|
public |
heightToPixels(width: number): * A function to generate a pixel value for 0-1 location on screen depending on screen height |
|
public |
pixelsToHeight(width: number): * A function to generate a 0-1 value from pixels for location on screen depending on screen height |
|
public |
pixelsToWidth(width: number): * A function to generate a 0-1 value from pixels for location on screen depending on screen width |
|
public |
widthToPixels(width: number): * A function to generate a pixel value for 0-1 location on screen depending on screen width |
|
public |
writeToDisplay(The: string) A function which reads from a path and displays the geometry it contains |
Public Constructors
Public Members
public availablePaths: array source
A list of all of the paths in this project which can be read from memory
public availableTypes: array source
An array of all of the available types of atoms which can be placed with a right click.
public cancelLastDisplayWorker: * source
A function which cancels the worker processing display when called
public displayAxis: boolean source
A flag to indicate if the edges of the shape should be displayed.
public displayEdges: boolean source
A flag to indicate if the faces of the shape should be displayed.
public displayGrid: boolean source
A flag to indicate if a grid should be displayed behind the shape
public displayProcessing: bool source
A flag to indicate if a display value is currently being processed.
public displayedPath: string source
The last path displayed. Used for updating the display when the controls change.
public limitedEvaluate: function source
An evaluator for strings as mathmatical equations which is sandboxed and secure.
public numberOfAtomsToLoad: integer source
A counter used during the loading process to keep track of how many atoms are still to be loaded.
Public Methods
public distBetweenPoints(x1: number, x2: number, y1: number, y2: number): * source
Computes the distance between two points on a plane. This is a duplicate of the one in utils which should probably be deleted.
Return:
* |
public generateUniqueID(): * source
A function to generate a unique ID value. Currently uses random which does not gurintee that it will be unique.
Return:
* |
public heightToPixels(width: number): * source
A function to generate a pixel value for 0-1 location on screen depending on screen height
Params:
Name | Type | Attribute | Description |
width | number | 0-1 |
Return:
* |
public pixelsToHeight(width: number): * source
A function to generate a 0-1 value from pixels for location on screen depending on screen height
Params:
Name | Type | Attribute | Description |
width | number | 0-1 |
Return:
* |
public pixelsToWidth(width: number): * source
A function to generate a 0-1 value from pixels for location on screen depending on screen width
Params:
Name | Type | Attribute | Description |
width | number | 0-1 |
Return:
* |