interface IScanner (Niantic.ARDK.AR.Scanning.IScanner)
Overview
Performs 3D scanning and reconstruction. More…
interface IScanner { // enums enum State; // structs struct ScanProcessedArgs; struct StateChangedArgs; struct VisualizationUpdatedArgs; // events event ScanProcessed(); event StateChanged(); event VisualizationUpdated(); // methods void CancelProcessing(); float GetProcessingProgress(); string GetScanId(); IScanQualityClassifier GetScanQualityClassifier(); IScanStore GetScanStore(); State GetState(); void PauseScanning(); void Restart(); void ResumeScanning(); void SetScanTargetId(string scanTargetId); void StartProcessing(ReconstructionOptions reconstructionOptions); void StartScanning(ScanningOptions scanningOptions); void StopScanning(); };
Detailed Documentation
Performs 3D scanning and reconstruction.
Events
event ScanProcessed()
Invoked when the scan has successfully finished processing.
event StateChanged()
Invoked when the state of the scanner changes. See State for more information on the scanner states and transitions between them.
event VisualizationUpdated()
Invoked when the scanning visualization is updated.
Methods
void CancelProcessing()
Cancel processing that is currently in progress.
This can be called in the Processing state.
The scanner will transition to the Cancelling state.
When cancellation is complete (typically within a few seconds), the scanner will transition to the Cancelled state.
float GetProcessingProgress()
Returns the current progress of scan processing, as a value between 0 and 1.
string GetScanId()
Returns a unique ID for the current scan. The scan ID is valid after the scan has started (i.e. once the scanner has entered the Scanning state).
IScanQualityClassifier GetScanQualityClassifier()
Returns a scan quality classifier.
IScanStore GetScanStore()
Returns the scan store. This can be used to save and load scans.
State GetState()
Returns the current state of the scanner. See State for details on the scanner states and transitions between them.
void PauseScanning()
Temporarily pauses a scan that is in progress.
The scan can be resumed later by calling ResumeScanning.
void Restart()
Reset the scanner for another scan.
This can be called in the ScanCompleted, Done, Error, or Cancelled states.
The scanner will transition to the Ready state.
void ResumeScanning()
Resumes a scan that has been paused.
void SetScanTargetId(string scanTargetId)
Set the scan target ID for the current scan. You must call this method prior to saving the scan if you intend to upload it for VPS activation.
A scan target represents a location that can be scanned and activated for VPS. You can find scan targets near the user and obtain their IDs using IScanTargetClient.
Calling Restart will clear the scan target ID.
Parameters:
scanTargetId |
the ID of the scan target for the current scan |
void StartProcessing(ReconstructionOptions reconstructionOptions)
Starts processing a scan.
Processing generates a TexturedMesh from the raw scan data. Depending on the options and the, processing capabilities of the user’s device, this may take anywhere from a few seconds to several minutes.
This can be called in the ScanCompleted state.
The scanner will transition to the Processing state.
The caller should listen for the ScanProcessed event to receive the TexturedMesh when processing is complete.
Parameters:
reconstructionOptions |
options controlling the reconstruction of the scan |
void StartScanning(ScanningOptions scanningOptions)
Start scanning with the given options.
void StopScanning()
Ends the current scan.
The scanner will transition to the ScanCompleted state.