Interface OOBBAsyncResult

Represents a oobb promise result.

This object is returned from FeatureManagerInterface.asyncRetrieveOOBB.

/** 
* Sample to illustrate the asynchronous retrieval of the OOBB of a geometry.
*/
import { FeatureManagerInterface, InfiniteEngineInterface, OOBBAsyncResult } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

// the geometric instance to retrieve OOBB from
let lGeometricInstanceId : number;

// retrieve the `feature` manager
const lFeatureManager : FeatureManagerInterface = lInfiniteEngine.getFeatureManager();

const fetchOobb = async () : Promise<void> =>
{
const lOobbResult : OOBBAsyncResult = await lFeatureManager.asyncRetrieveOOBB(lGeometricInstanceId);

if(lOobbResult.value === undefined || lOobbResult.value.oobb === undefined)
{
console.log('Failed to query oobb, is the geometric instance id correct ?');
return;
}
console.log('Found oobb', JSON.stringify(lOobbResult.value));
const lApplicationId : number = lFeatureManager.createOOBBApplicationFeature(lOobbResult.value.oobb);
if(lApplicationId <= 0)
{
console.log('feature creation failed');
}
};

// trigger the OOBB retrieval
fetchOobb();

Features

interface OOBBAsyncResult {
    reason: AsyncResultReason;
    value?: OOBBTypeAttachment;
}

Properties

Properties

The reason for the end of the promise.

The returned value of the promise. Undefined if the call failed.