Interface FeaturesInfoTypeAttachment

The FeaturesInfoTypeAttachment interface defines the result of a call to FeatureManagerInterface.retrieveFeaturesInfo.

This interface defines if the given geometric instance id had circle or lines features, and references the feature info request id returned by FeatureManagerInterface.retrieveFeaturesInfo. Valid feature info request ids are strictly positive integers.

It is included in the attachment of the FeatureManagerInterfaceSignal.FeaturesInfoReady signal event.

/** 
* Sample to illustrate the retrieval of the OOBB of a geometry.
*/
import { FeatureManagerInterface, FeatureManagerInterfaceSignal, InfiniteEngineInterface, InfiniteEvent, OOBB, OOBBTypeAttachment } 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();
// the OOBB request id
let lRetrieveOobbRequestId : number = 0;

// the resulting OOBB
let lOobbResult : OOBB | undefined = undefined;

// the callback called when a OOBB result is ready
const onOobbRetrieved = (pEvent: InfiniteEvent) : void =>
{
const lOOBBAttachment : OOBBTypeAttachment | undefined = pEvent.attachments;
// is this event valid ?
if(lOOBBAttachment === undefined || lOOBBAttachment.oobb === undefined)
{
console.log('invalid oobb attachment');
return;
}
// is this the correct request ?
if(lOOBBAttachment.oobbRequestId !== lRetrieveOobbRequestId)
{
//
return;
}
// finally, we made it !
lOobbResult = lOOBBAttachment.oobb;
console.log('Found oobb', JSON.stringify(lOobbResult));
const lApplicationId : number = lFeatureManager.createOOBBApplicationFeature(lOobbResult);
if(lApplicationId <= 0)
{
console.log('feature creation failed');
}
};

// register our callback
lFeatureManager.addEventListener(FeatureManagerInterfaceSignal.OOBBReady, onOobbRetrieved);

// and request an oobb
lRetrieveOobbRequestId = lFeatureManager.retrieveOOBB(lGeometricInstanceId);
if(lRetrieveOobbRequestId <= 0)
{
console.log('Failed to query oobb, is the geometric instance id correct ?');
}

Features

interface FeaturesInfoTypeAttachment {
    featureInfoRequestId: number;
    hasArcOcCircleFeatures?: boolean;
    hasLineFeatures?: boolean;
}

Properties

featureInfoRequestId: number

The feature info request id, i.e. the number returned by FeatureManagerInterface.retrieveFeaturesInfo.

hasArcOcCircleFeatures?: boolean

Tells if the given geometric instance id had circle features.

hasLineFeatures?: boolean

Tells if the given geometric instance id had line features.