enum State (Niantic.ARDK.AR.Scanning.IScanner.State)

Overview

The scanning process can be represented as a state machine. Some methods on the scanner will only have an effect if called in specific states (described below). More...

enum State {
    Initializing  = 0,
    Ready         = 1,
    Scanning      = 2,
    Paused        = 9,
    ScanCompleted = 3,
    Processing    = 4,
    Done          = 6,
    Cancelling    = 5,
    Cancelled     = 7,
    Error         = 8,
};

Detailed Documentation

The scanning process can be represented as a state machine. Some methods on the scanner will only have an effect if called in specific states (described below).

In a typical scan without errors, the scanner will go through the following states:

  • Initializing

  • Ready

  • Scanning

  • ScanCompleted

  • Processing

  • Done

Enum Values

Initializing

Initial state of the scanner upon construction. It will automatically transition to the Ready state once the AR session and depth are initialized.

Ready

The scanner is ready to scan. From this state:

Scanning

The scanner is currently scanning. In this state, the VisualizationUpdated event will repeatedly fire with updated visualization data. From this state:

  • PauseScanning can be called to temporarily pause the scanner, transitioning to the Paused state.

  • StopScanning can be called to end the scan, transitioning to the ScanCompleted state.

Paused

Scanning is paused. From this state:

  • ResumeScanning can be called to continue scanning, transitioning to the Scanning state.

  • StopScanning can be called to end the scan, transitioning to the ScanCompleted state.

ScanCompleted

The scan has completed and is ready to be processed. From this state:

  • StartProcessing can be called to begin processing the scan, transitioning to the Processing state.

  • Restart can be called to discard the scan and reset to the Ready state.

Processing

The scan is currently being processed. From this state:

  • Processing may complete successfully and the scanner will transition to the Done state.

  • Processing may fail, and the scanner will transition to the Error state.

  • CancelProcessing can be called to cancel processing and transition to the Cancelling state.

Done

Scan processing has completed successfully. Immediately after transitioning to this state, the ScanProcessed event will fire with the resulting mesh. From this state:

  • Restart can be called to reset the scanner to the Ready state.

Cancelling

Scan processing is being cancelled. During cancellation, the scanner will spend a short period of time in this state before transitioning to the Cancelled state.

Cancelled

Scan processing has been cancelled. From this state:

  • Restart can be called to reset the scanner to the Ready state.

Error

Scan processing has failed. From this state:

  • Restart can be called to reset the scanner to the Ready state.