# Importer (JavaFX 3D Model Importers)
Date: 2014-02-09

com.interactivemesh.jfx.importer

## Interface Importer

All Known Subinterfaces:
  ModelImporter

All Known Implementing Classes:
  ColModelImporter, FxmlModelImporter, ObjModelImporter, StlMeshImporter, TdsModelImporter, X3dModelImporter

    public interface Importer

The Importer interface specifies the core import capabilities of the JavaFX 3D importers.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `clear()` Disposes of the imported data.
`void` `close()` Disposes of the imported data and closes the importer.
`double` `getCreaseAngle()` Gets the crease angle for normals generation measured in degrees.
`java.lang.Object` `getImport()` Gets the imported 3D data.
`void` `onFileImported()` Method is invoked upon completion of import.
`void` `read(java.io.File file)` Imports a 3D model file passed as a File object.
`void` `read(java.lang.String filePath)` Imports a 3D model file with the passed file path.
`void` `read(java.net.URL url)` Imports a 3D model file from the passed location.
`void` `setCreaseAngle(double degrees)` Sets the crease angle for normals generation measured in degrees.

### Method Detail

#### getCreaseAngle

    double getCreaseAngle()

Gets the crease angle for normals generation measured in degrees.

Default value: 45

Returns:
  crease angle for normals generation

#### setCreaseAngle

    void setCreaseAngle(double degrees)

Sets the crease angle for normals generation measured in degrees. The value will be clamped to [0, 180].

Default value: 45

Parameters:
  `degrees` - crease angle for generating normals

#### read

    void read(java.io.File file)

Imports a 3D model file passed as a File object. The data of the last imported file will be disposed of. The imported data is available as soon as this method returns.

Parameters:
  `file` - File object to import
Throws:
  `ImportException` - if the importer encounters a problem reading or parsing the specified file or if the importer is closed

#### read

    void read(java.lang.String filePath)

Imports a 3D model file with the passed file path. The data of the last imported file will be disposed of. The imported data is available as soon as this method returns.

Parameters:
  `filePath` - location of the file to import
Throws:
  `ImportException` - if the importer encounters a problem reading or parsing the specified file or if the importer is closed

#### read

    void read(java.net.URL url)

Imports a 3D model file from the passed location. The data of the last imported file will be disposed of. The imported data is available as soon as this method returns.

Parameters:
  `url` - location of the file to import
Throws:
  `ImportException` - if the importer encounters a problem reading or parsing the specified file or if the importer is closed

#### onFileImported

    void onFileImported()

Method is invoked upon completion of import.

#### getImport

    java.lang.Object getImport()

Gets the imported 3D data. Implementations return a more specific type (covariant return type).

Returns:
  imported 3D data

#### clear

    void clear()

Disposes of the imported data. Imported data should be disposed of if the importer isn't used for some time. The importer doesn't run the garbage collector.

#### close

    void close()

Disposes of the imported data and closes the importer. The importer should be closed if it isn't used again. The importer doesn't run the garbage collector.

Copyright (C) 2013-2014 InteractiveMesh e.K.