Class: File

File()

Allows the user to perform file related actions such as save their project or load one.

Constructor

new File()

Properties:
Name Type Description
loadFileInput Input

Input used for selecting project file to load

loadFileReader FileReader

Reads data from selected project file

maxNameLength number

Max chars a user can enter for their filename. Default 100

Source:
To Do:
  • File is already a class used within the browser. Rename this! It might be time to start referring to all components as just SomethingComponent or similar.

Extends

  • React.Component

Methods

createExportModal() → {JSX}

Creates the modal for when the user is exporting to some 3D object file.

Source:
Returns:
Type
JSX

createExportSubMenu() → {JSX}

Creates a sub-menu for each export option

Source:
Returns:
Type
JSX

createSaveModal() → {JSX}

Creates the modal for when the user is saving their project.

Source:
Returns:
Type
JSX

handleFileRead(e)

Handler for reading the data from the user's selected project file.

Parameters:
Name Type Description
e Event
Source:

handleFileSelected(e)

Handler for when the users selects the file they wish to load.

Parameters:
Name Type Description
e Event
Source:

handleSaveProject(filename)

Callback for when users wish to save their project. Creates a JSON file with the contents of the 3D scene then saves locally to the user's device.

Parameters:
Name Type Description
filename string

What to name the saved project file

Source:

onExportModel(filename)

Hanlder for exporting the voxel model to some 3D file format.

Parameters:
Name Type Description
filename string

Name of the exported 3D file

Source:

onLoadProject()

Callback for when users wish to load a pre-existing project.

Source: