Home Reference Source
public class | source

Nest

Extends:

Atom → Nest

This class creates the nest atom which lets you download a nested .svg file.

Constructor Summary

Public Constructor
public

constructor(values: object)

The constructor function.

Member Summary

Public Members
public

This atom's type

public

This atom's height as drawn on the screen

public

Boolean to determine wether nesting process is ongoing

public

Number of times nesting has been tried

public

material: {"width": number, "length": number}

Length and width inputs for svg placement

public

This atom's name

public

This atom's value. Contains the value of the input geometry, not the stl

Method Summary

Public Methods
public

Defines bin which will be used to place parts for nested svg

public

The function which is called when you press the download button.

public

draw()

Draw the svg atom which has a SVG icon.

public

renderSvg(svglist: *, efficiency: *, placed: *, total: *)

NOT WORKING Defines HTML bit and defines svg list

public

Update values for config().

public

Re excecutes configure function for nesting if values are updated by user

public

async startnest()

Starts nesting, replaces html svg for nested svg

public

Stops nest and changes flag to not working

public

Turns geometry values into svg then starts nest and returns nested SVG

public

Create buttons to start nest, to download the .svg file and checkbox "Part in Part".

public

Set the value to be the input geometry, then call super updateValue()

Inherited Summary

From class Atom
public

[key]: *

Assign each of the values in values as this.value

public

A warning message displayed next to the atom.

public

A function which can be called to cancel the processing being done for this atom.

public

This atom's current color

public

This atom's default color (ie when not selected or processing)

public

A description of this atom

public

inputs: array

An array of all of the input attachment points connected to this atom

public

A flag to indicate if this atom is currently being dragged on the screen.

public

This atom's name

public

This atom's output attachment point if it has one

public

This atom's parent, usually the molecule which contains this atom

public

The path which contains the geometry represented by this atom

public

A flag to indicate if the atom is currently computing a new output.

public

This atom's radius as displayed on the screen is 1/72 width

public

A flag to indicate if this atom is currently selected

public

This atom's color when selected

public

A flag to indicate if we are hovering over this atom.

public

The color currently used for strokes

public

This atom's unique ID. Often overwritten later when loading

public

This atom's value...Is can this be done away with? Are we basically storing the value in the output now?

public

The X cordinate of this atom

public

The Y cordinate of this atom

public

addIO(type: boolean, name: string, target: object, valueType: string, defaultValue: object)

Adds a new attachment point to this atom

public

Calls a worker thread to compute the atom's value.

public

Starts propagation placeholder.

public

census(): number[]

Returns an array of length two indicating that this is one atom and if it is waiting to be computed

public

Clears the alert message attached to this atom.

public

clickDown(x: number, y: number, clickProcessed: boolean): *

Set the atom's response to a mouse click. This usually means selecting the atom and displaying it's contents in 3D

public

Set the atom's response to a mouse click and drag. Moves the atom around the screen.

public

Set the atom's response to a mouse click up. If the atom is moving this makes it stop moving.

public

createButton(list: object, parent: object, buttonText: string, functionToCall: object)

Creates button.

public

createCheckbox(list: object, buttonText: string, -: boolean, functionToCall: object)

Creates button.

public

createDropDown(list: object, parent: object, options: array, selectedOption: number, description: string, Callback: object)

Creates dropdown with multiple options to select.

public

createEditableValueListItem(list: object, object: object, key: string, label: string, resultShouldBeNumber: boolean, callBack: object)

Creates an editable HTML item to set the value of an object element.

public

createFileUpload(list: object, parent: object, buttonText: string, functionToCall: object)

Creates file upload button.

public

Creates a html representation of the passed text.

public

createNonEditableValueListItem(list: object, object: object, key: string, label: string)

Creates an non-editable HTML item to set the value of an object element.

public

Set's the output value and shows the atom output on the 3D view.

public

deleteNode(backgroundClickAfter: boolean, deletePath: boolean, silent: boolean)

Delete this atom.

public

Displays the atom in 3D and sets the output.

public

Set the atom's response to a mouse double click. By default this isn't to do anything other than mark the double click as handled.

public

draw(drawType: *)

Draws the atom on the screen

public

findIOValue(ioName: string): *

Find the value of an input for with a given name.

public

Generates the path for this atom from it's location in the graph

public

Initialized the sidebar with a title and create the HTML object.

public

Set the atom's response to a key press. Is used to delete the atom if it is selected.

public

loadTree(): *

Sets all the input and output values to match their associated atoms.

public

removeIO(type: boolean, name: string, target: object, silent: object)

Removes an attachment point from an atom.

public

requestReadme(): *[]

Return any contribution from this atom to the README file

public

selectBox(x: *, y: *, xEnd: *, yEnd: *)

Delineates bounds for selection box.

public

Send the value of this atom to the 3D display.

public

serialize(offset: {"x": number, "y": number}): *

Create an object containing the information about this atom that we want to save.

public

setAlert(message: string)

Set an alert to display next to the atom.

public

setValues(values: object)

Applies each of the passed values to this as this.x

public

update()

Runs with each frame to draw the atom.

public

Updates the side bar to display information about the atom.

public

Token update value function to give each atom one by default

public

Sets the atom to wait on coming information.

public

walkBackForConstants(callback: *)

Used to walk back out the tree generating a list of constants...used for evolve

Public Constructors

public constructor(values: object) source

The constructor function.

Override:

Atom#constructor

Params:

NameTypeAttributeDescription
values object

An array of values passed in which will be assigned to the class as this.x

Public Members

public atomType: string source

This atom's type

public height: number source

This atom's height as drawn on the screen

public isworking: boolean source

Boolean to determine wether nesting process is ongoing

public iterations: number source

Number of times nesting has been tried

public material: {"width": number, "length": number} source

Length and width inputs for svg placement

public name: string source

This atom's name

Override:

Atom#name

public value: string source

This atom's value. Contains the value of the input geometry, not the stl

Override:

Atom#value

Public Methods

public attachSvgListeners(svg: *) source

Defines bin which will be used to place parts for nested svg

Params:

NameTypeAttributeDescription
svg *

public downloadSvg() source

The function which is called when you press the download button. Stops nest in progress and downloads file to computer. Only enabled if svg has been nested at least once

public draw() source

Draw the svg atom which has a SVG icon.

Override:

Atom#draw

public renderSvg(svglist: *, efficiency: *, placed: *, total: *) source

NOT WORKING Defines HTML bit and defines svg list

Params:

NameTypeAttributeDescription
svglist *
efficiency *
placed *
total *

public setConfig(): boolean source

Update values for config(). Called when the values on sidebar have been edited.

Return:

boolean

public setValue() source

Re excecutes configure function for nesting if values are updated by user

public async startnest() source

Starts nesting, replaces html svg for nested svg

public stopnest() source

Stops nest and changes flag to not working

public svgToNest() source

Turns geometry values into svg then starts nest and returns nested SVG

public updateSidebar() source

Create buttons to start nest, to download the .svg file and checkbox "Part in Part".

Override:

Atom#updateSidebar

public updateValue() source

Set the value to be the input geometry, then call super updateValue()

Override:

Atom#updateValue