Interface FeatureManagerInterface

The FeatureManagerInterface interface is the central point used to display features of 3D geometries, create custom features, retrieve Object Oriented Bounding Boxes of geometries and perform measurements between features.

Warning: if migrated from an old evojuump, features may not be available in the given DMU, since features have been added since the 4.1 version of the 3djuump architecture.

Features consist in lines, circles and patch borders (created with a given CAD model designing tool). The patch borders may be displayed with InfiniteEngineInterface.enablePatchBorders or InfiniteEngineInterface.setPatchBordersEnabled.

patch borders rendering
The FeatureManagerInterface is obtained through the InfiniteEngineInterface.getFeatureManager.

Display features of 3D geometries

Features of specific geometric instances may be displayed (FeatureManagerInterface.setGeometricInstancesFeaturesVisible, FeatureManagerInterface.setGeometricInstanceFeaturesVisible) and then are available in picking requests. Line and arc of circles inside the given 3D geometries will then be displayed, and all lines /arc of circle rendering are also conditioned to the value of the given FeatureVisibilityMode.

Features rendering modes are modified and retrieved with FeatureManagerInterface.setGeometricInstancesFeaturesTypesVisibility and FeatureManagerInterface.getGeometricInstancesFeaturesTypesVisibility.

This may be :

This enum is a bit field, meaning that to display line data and circular features, use FeatureVisibilityMode.FVM_ArcOfCircle | FeatureVisibilityMode.FVM_Line.

The default FeatureVisibilityMode is FeatureVisibilityMode.FVM_All.

geometric `feature` display
Showing feature elements may be done through the following:
/** 
* Sample to illustrate the showing of the circle `features` of some geometric instances.
*/
import { FeatureManagerInterface, FeatureVisibilityMode, InfiniteEngineInterface } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

// the geometric instances to show `features`
let lGeometricInstanceIds : Array<number> | Uint32Array;

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

// display only circles of geometries
lFeatureManager.setGeometricInstancesFeaturesTypesVisibility(FeatureVisibilityMode.FVM_ArcOfCircle);

// hide all previously displayed `features`
lFeatureManager.clearGeometricInstanceFeaturesVisible();

// and show the `features` of the given geometries
lFeatureManager.setGeometricInstancesFeaturesVisible(lGeometricInstanceIds, true);

/** 
* Sample to illustrate the showing of the line `features` of some geometric instances.
*/
import { FeatureManagerInterface, FeatureVisibilityMode, InfiniteEngineInterface } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

// the geometric instances to show `features`
let lGeometricInstanceIds : Array<number> | Uint32Array;

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

// display only lines of geometries
lFeatureManager.setGeometricInstancesFeaturesTypesVisibility(FeatureVisibilityMode.FVM_Line);

// hide all previously displayed `features`
lFeatureManager.clearGeometricInstanceFeaturesVisible();

// and show the `features` of the given geometries
lFeatureManager.setGeometricInstancesFeaturesVisible(lGeometricInstanceIds, true);

Displayed `features` are `hover-able` and the FeatureManagerInterfaceSignal.FeatureHoverChanged is sent whenever a `feature` under the cursor changes.

Custom Feature creation

Multiple features may be created and displayed. Arcs of circle, lines, points and OOBBs may be created and displayed. Features must be register onto the FeatureManagerInterface and are assigned a unique strictly positive integer (an id). Features may be created by createApplicationFeatureFromFeature, and made visible / hidden with setApplicationFeaturesVisible. Features may be removed with removeApplicationFeature, removeApplicationFeatures and removeAllApplicationFeatures. Features are composed of a type (FeatureItem.type, FeatureType) and data that is dependent on the type of the feature.

Arcs of circle (FeatureType.FT_ArcOfCircle)

A full circle feature is represented with a center, a normal, and a radius. If added with an optional starting direction and an angle, the feature will represent only a part of a circle (arc of circle). The arc of circle is represented by the point positioned P0 = Center + radius * startDirection. Then compute the point P1 which is the rotation of P0 of the given angle from Center along the axis Normal. Positive angles between P0 and P1 are the points that belong to the arc of circle. Negative angles are set to 0 (thus a point). Angles superior to 2 * PI are cropped to 2 * PI.

Arcs of circle are created through createCircularArcApplicationFeature.

arc of circle `feature` display
/** 
* Sample to illustrate the creation and display of a circle `feature`.
*/
import { FeatureManagerInterface, InfiniteEngineInterface, Vector3 } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

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

const createArcFeature = () : void =>
{
// the circle application id
const lFeatureCircleApplicationId : number = lFeatureManager.createCircularArcApplicationFeature(
new Vector3(1, 1, 1),
50,
new Vector3(1, 0, 0),
new Vector3(0, 1, 0),
Math.PI * 2
);

if(lFeatureCircleApplicationId <= 0)
{
return;
}

// do something ...

// and later make it invisible
lFeatureManager.setApplicationFeatureVisible(lFeatureCircleApplicationId, false);

// do something ...

// and put back visible
lFeatureManager.setApplicationFeatureVisible(lFeatureCircleApplicationId, true);
};

createArcFeature();

Lines (FeatureType.FT_Line)

Lines are represented by two points (Vector3).

Lines are created through createLineApplicationFeature.

line `feature` display
/** 
* Sample to illustrate the creation and display of a line `feature`.
*/
import { FeatureManagerInterface, InfiniteEngineInterface, Vector3 } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

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

const createLineFeature = () : void =>
{
// the line application id
const lFeatureLineApplicationId : number = lFeatureManager.createLineApplicationFeature(
new Vector3(1, 1, 1),
new Vector3(100, 1, 1),
);

if(lFeatureLineApplicationId <= 0)
{
return;
}

// do something ...

// and later make it invisible
lFeatureManager.setApplicationFeatureVisible(lFeatureLineApplicationId, false);

// do something ...

// and put back visible
lFeatureManager.setApplicationFeatureVisible(lFeatureLineApplicationId, true);
};

createLineFeature();

Points (FeatureType.FT_Point)

Points are represented by a lone Vector3.

Points are created through createPointApplicationFeature.

point `feature` display
/** 
* Sample to illustrate the creation and display of a point `feature`.
*/
import { FeatureManagerInterface, InfiniteEngineInterface, Vector3 } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

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

const createPointFeature = () : void =>
{
// the point application id
const lFeaturePointApplicationId : number = lFeatureManager.createPointApplicationFeature(
new Vector3(1, 1, 1),
);

if(lFeaturePointApplicationId <= 0)
{
return;
}

// do something ...

// and later make it invisible
lFeatureManager.setApplicationFeatureVisible(lFeaturePointApplicationId, false);

// do something ...

// and put back visible
lFeatureManager.setApplicationFeatureVisible(lFeaturePointApplicationId, true);
};

createPointFeature();

OOBBs (FeatureType.FT_OOBB)

Object Oriented Bounding Boxes (OOBB) are similar to Axis Aligned Bounding Boxes (AABB) but with 3 axes that may not be axis aligned. OOBB are a lot more precise that AABB.

OOBBs can be displayed with createOOBBApplicationFeature.

OOBB `feature` display
/** 
* 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 ?');
}

Object Oriented Bounding Boxes retrieval

Object Oriented Bounding Boxes (OOBB are similar to Axis Aligned Bounding Boxes (AABB) but with 3 axes that may not be axis aligned. The OOBB are a lot more precise that AABB. The OOBB retrieval is asynchronous, each request is assigned an integer id (a strictly positive integer) while calling retrieveOOBB. The FeatureManagerInterfaceSignal.OOBBReady signal is triggered when a request has completed.

/** 
* 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 ?');
}

/** 
* 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();

Measurements

Minimal distance between features can be computed. A distance computation consists in two contact points, one for each feature. 2 more features, that cannot be displayed are used for performing computations. A measure is computed between two features, and a modifier is used to accurately define the measurement between the 2 features. The modifier is of the type MeasurementType. This allows to tell if the measurement should be processed from all the points of a feature or only the center of it (you may for example perform a measurement between the center of 2 geometries, more on this later).

/** 
* 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 ?');
}

/** 
* Sample to illustrate the measurement between a geometry and an arc of circle.
*/
import {
AABB, ArcOfCircleFeature, DataSessionInterface, FeatureManagerInterface, FeatureManagerInterfaceSignal,
FeatureType, GeometryFeature, InfiniteEngineInterface, InfiniteEvent, MeasurementType, MeasurementTypeAttachment,
Unit, Vector3
} from 'generated_files/documentation/appinfiniteapi';

// the data session
// created previously
let lDataSession : DataSessionInterface;

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

// the geometric instance to compute measurement from
let lGeometricInstanceId : number;

// retrieve the `feature` manager
const lFeatureManager : FeatureManagerInterface = lInfiniteEngine.getFeatureManager();
// the measurement request id
let lMeasurementRequestId : number = 0;

// the callback called when a measurement result is ready
const onMeasurementDone = (pEvent: InfiniteEvent) : void =>
{
const lMeasurementAttachment : MeasurementTypeAttachment | undefined = pEvent.attachments;
// is this event valid ?
if(lMeasurementAttachment === undefined || lMeasurementAttachment.contactPoint0 === undefined)
{
console.log('invalid measurement attachment');
return;
}
// is this the correct request ?
if(lMeasurementAttachment.measurementRequestId !== lMeasurementRequestId)
{
// bail out
return;
}
// finally, we made it !
console.log('Found 2 contact points', JSON.stringify(lMeasurementAttachment.contactPoint0), JSON.stringify(lMeasurementAttachment.contactPoint1));

// make two fancy points on the rendering
let lApplicationId : number = lFeatureManager.createPointApplicationFeature(lMeasurementAttachment.contactPoint0);
if(lApplicationId <= 0)
{
console.log('feature creation failed');
}
lApplicationId = lFeatureManager.createPointApplicationFeature(lMeasurementAttachment.contactPoint1);
if(lApplicationId <= 0)
{
console.log('feature creation failed');
}
// and show the result, we are here for that
console.log('Measurement distance', lMeasurementAttachment.contactPoint0.distanceToVector(lMeasurementAttachment.contactPoint1));
};

// register our callback
lFeatureManager.addEventListener(FeatureManagerInterfaceSignal.MeasurementReady, onMeasurementDone);

// retrieve the DMU center
const lDmuAABB : AABB = new AABB();
lDataSession.getDmuAABB(lDmuAABB);

// retrieve the up and front vectors of the scene
const lDmuUpVector : Vector3 = new Vector3();
const lDmuFrontVector : Vector3 = new Vector3();
lInfiniteEngine.getCameraManager().getFrameReference(lDmuFrontVector, lDmuUpVector);

// the arc of circle radius in meters
const lCircleFeatureRadiusInMeters : number = 1.3;

// first `feature` is a geometry
const lFirstFeature : GeometryFeature = {
type: FeatureType.FT_Geometry,
geometricInstanceId: lGeometricInstanceId
};

// second `feature` is an arc of circle
const lSecondFeature : ArcOfCircleFeature = {
type: FeatureType.FT_ArcOfCircle,
center: lDmuAABB.mCenter,
normal: lDmuUpVector,
startDirection: lDmuFrontVector,
radius: lCircleFeatureRadiusInMeters * lDataSession.convertUnitFactor(Unit.U_Meter, lDataSession.getDmuBuildUnit()),
angle: Math.PI * 0.5
};

// and make a measurement between the geometry and the given arc of circle (do not use item centers)
// the measure is the smallest distance between the 2 elements
lMeasurementRequestId = lFeatureManager.computeMeasurement(lFirstFeature, lSecondFeature, MeasurementType.MT_Item_Item);
if(lMeasurementRequestId <= 0)
{
console.log('Failed to make measurement, is the geometric instance id correct ?');
}

Geometry features (FeatureType.FT_Geometry)

A geometry feature is a feature that contains a geometric instance id. Distance between geometries can be processed with geometry features. Geometry features cannot be displayed since geometries are already displayed :).

Plane features (FeatureType.FT_Plane)

A plane feature is a feature that contains a position and a normal. Plane features cannot be displayed.

See

OOBB


Features

interface FeatureManagerInterface {
    addEventListener(pType, pListener, pObject): string;
    addEventListener(pType, pListener): string;
    areSignalsBlocked(): boolean;
    asyncComputeMeasurement(pMeasurement1, pMeasurement2, pMeasurementType): Promise<MeasurementAsyncResult>;
    asyncHasFeatures(pGeometricInstanceId, pFeatureType): Promise<boolean>;
    asyncRetrieveFeaturesInfo(pGeometricInstanceId): Promise<FeaturesInfoAsyncResult>;
    asyncRetrieveOOBB(pGeometricInstanceId): Promise<OOBBAsyncResult>;
    blockSignals(pBlock): void;
    clearGeometricInstanceFeaturesVisible(): void;
    computeMeasurement(pMeasurement1, pMeasurement2, pMeasurementType): number;
    createApplicationFeatureFromFeature(pFeature): number;
    createCircularArcApplicationFeature(pCenter, pRadius, pNormal, pStartDirection?, pAngleInRadian?): number;
    createLineApplicationFeature(pPointA, pPointB): number;
    createOOBBApplicationFeature(pOOBB): number;
    createPointApplicationFeature(pPoint): number;
    fromJSON(pFeatureData): boolean;
    getApplicationFeatureType(pFeatureId): FeatureType;
    getApplicationFeatures(pApplicationFeatureIds): boolean;
    getApplicationFeaturesCount(): number;
    getCircularArcApplicationFeatureData(pApplicationFeatureId, pCenter, pNormal, pStartDirection, pRadiusAndAngle): boolean;
    getGeometricInstancesFeaturesTypesVisibility(): FeatureVisibilityMode;
    getLineApplicationFeatureData(pApplicationFeatureId, pPointA, pPointB): boolean;
    getOOBBApplicationFeatureData(pApplicationFeatureId, pOOBB): boolean;
    getPointApplicationFeatureData(pApplicationFeatureId, pPoint): boolean;
    hasEventListener(pType, pListener): boolean;
    hasEventListenerById(pId): boolean;
    isApplicationFeatureVisible(pApplicationFeatureId): boolean;
    isGeometricInstanceFeaturesVisible(pGeometricInstanceId): boolean;
    removeAllApplicationFeatures(): void;
    removeAllEventListeners(): boolean;
    removeApplicationFeature(pFeatureId): boolean;
    removeApplicationFeatures(pFeatureIds): boolean;
    removeEventListener(pType, pListener, pObject): boolean;
    removeEventListener(pType, pListener): boolean;
    removeEventListenerById(pId): boolean;
    retrieveFeaturesInfo(pGeometricInstanceId): number;
    retrieveOOBB(pGeometricInstanceId): number;
    setApplicationFeatureVisible(pApplicationFeatureId, pIsVisible): boolean;
    setApplicationFeaturesVisible(pApplicationFeatureIds, pIsVisible): boolean;
    setGeometricInstanceFeaturesVisible(pGeometricInstanceId, pIsVisible): boolean;
    setGeometricInstancesFeaturesTypesVisibility(pVisibilityMode): boolean;
    setGeometricInstancesFeaturesVisible(pGeometricInstanceIds, pIsVisible): boolean;
    toJSON(pKey?): Object;
}

Hierarchy (view full)

Methods

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal. It is possible to add an object that will be included in the callback to avoid creating too many closures. Calling twice addEventListener with the same parameters results in the second call to be ignored, only unique pairs callback / object are allowed, in order to avoid calling multiple times the same thing.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.
    • pObject: Object
      in
      The optional object the callback will be called with when the given event fires.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Tells if signals sent by the object are blocked or not.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Returns boolean

    true if signals are blocked.

  • Asynchronously requests the computation of the measurement between the two given features.

    Multiple types of measurements may be done between two features, thus, pMeasurementType tells how the computation should be performed.

    Returns a promise.

    Parameters

    • pMeasurement1: FeatureItem
      in
      The first `feature` to make the measurement from.
    • pMeasurement2: FeatureItem
      in
      The second `feature` to make the measurement to.
    • pMeasurementType: MeasurementType
      in
      The way the measurement should be performed.

    Returns Promise<MeasurementAsyncResult>

    A promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the measurement result.

  • Asynchronously tells if the given geometry has features if a given types (circle, lines or both).

    It is merely a wrap around asyncRetrieveFeaturesInfo.

    It may take time to get the result of the promise since this promise may need to download the 3D HD data of the given geometry if it was not loaded.

    Requesting pFeatureType with FeatureVisibilityMode.FVM_None will always return false.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id of the `features` to query.
    • pFeatureType: FeatureVisibilityMode
      in
      The feature type to query.

    Returns Promise<boolean>

    A promise. The promise is resolved with the result of the call.

  • Asynchronously retrieves features information of a given geometry.

    It may take time to get the result of the promise since this promise may need to download the 3D HD data of the given geometry if it was not loaded.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id of the `features` to query.

    Returns Promise<FeaturesInfoAsyncResult>

    A promise. The promise is resolved with the result of the call.

  • Asynchronously requests the computation of the OOBB of the given geometric instance.

    Returns a promise.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id to query the OOBB from.

    Returns Promise<OOBBAsyncResult>

    A promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the OOBB result.

    See

    OOBB

  • Blocks / Unblocks all signals sent by the object.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Parameters

    • pBlock: boolean
      in
      If set to true, all further signals will be silently discarded.

    Returns void

  • Clears the visibility state of all features of all geometric instance ids.

    This effectively hide all features.

    Returns void

  • Requests the computation of the measurement between the two given features.

    Multiple types of measurements may be done between two features, thus, pMeasurementType tells how the computation should be performed.

    If successful, the call returns the id of the measurement (that is the MeasurementTypeAttachment.measurementRequestId of the FeatureManagerInterfaceSignal.MeasurementReady). Returns 0 in case of failure. Valid measurement request ids are strictly positive integers.

    Parameters

    • pMeasurement1: FeatureItem
      in
      The first `feature` to make the measurement from.
    • pMeasurement2: FeatureItem
      in
      The second `feature` to make the measurement to.
    • pMeasurementType: MeasurementType
      in
      The way the measurement should be performed.

    Returns number

    A non zero number in case of success, 0 is case of failure.

  • Creates a feature to be displayed from a previously created feature.

    This call mainly allows to create application features from the features of a geometric instance id.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    /** 
    * Sample to illustrate the creation and display of a `feature` from a pick result.
    */
    import {
    FeatureItem, FeatureManagerInterface, InfiniteEngineInterface, InfiniteEngineInterfaceSignal,
    InfiniteEvent, PickingAttachment, PickingFeatureAttachmentItem, Vector3
    } from 'generated_files/documentation/appinfiniteapi';

    // created previously
    let lInfiniteEngine : InfiniteEngineInterface;

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

    // We pick a rectangle if big enough, else only a point
    const startPicking = (pEvent : MouseEvent): void =>
    {
    // pick the last point
    lInfiniteEngine.pickAt(pEvent.offsetX, pEvent.offsetY, false);
    };

    const lView : HTMLElement | undefined = lInfiniteEngine.getView();
    if(lView)
    {
    // on left click => pick
    lView.addEventListener('click', startPicking);
    }
    else
    {
    console.log('Cannot register pick since no 3d view is available');
    }

    // What to do on pick ?
    const onPicking = (pEvent : InfiniteEvent, _pCallbackData) : void =>
    {
    const lAttachment: PickingAttachment = <PickingAttachment>pEvent.attachments;
    // care only about 3d geometries (no line, point, box)
    const lFeaturesAttachment: PickingFeatureAttachmentItem[] | undefined = lAttachment.features;
    if (lFeaturesAttachment === undefined || lFeaturesAttachment.length === 0)
    {
    return;
    }
    const lFeature : FeatureItem = lFeaturesAttachment[0].feature;
    const lPickedPosition : Vector3 = lFeaturesAttachment[0].position;
    console.log('3d picked position is', JSON.stringify(lPickedPosition));
    const lFeaturePointApplicationId : number = lFeatureManager.createApplicationFeatureFromFeature(
    lFeature
    );
    if(lFeaturePointApplicationId <= 0)
    {
    console.log('feature creation failed');
    }
    };

    // and bind the callback on pick result
    lInfiniteEngine.addEventListener(InfiniteEngineInterfaceSignal.Picked, onPicking);

    Parameters

    Returns number

    The application id for such a feature, or 0 if the call failed.

  • Creates an arc of circle feature.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    An arc of circle is composed of a center, a radius (in DMU units, {DataSessionInterface.getDmuBuildUnit}), a normal of the circle, the start vector, and an angle in radian such that :

    • the normalization of the cross vector of the start vector and end vector is equal to the normal
    • the dot product of the start vector and end vector is equal to cos(pAngleInRadian).

    A full circle will therefore have pAngleInRadian equal to 2 * Math.PI.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    Parameters

    • pCenter: Vector3
      in
      The center of the circle `feature`.
    • pRadius: number
      in
      The radius of the circle `feature` in DMU units.
    • pNormal: Vector3
      in
      The normal vector of the circle `feature`.
    • Optional pStartDirection: Vector3
      in
      The start direction of the circle `feature`.
    • Optional pAngleInRadian: number
      in
      The angle in radian between the start direction and end direction.

    Returns number

    The application id for such a feature, or 0 if the call failed.

  • Creates a line feature between the two given location.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    Parameters

    • pPointA: Vector3
      in
      The first location of the line application `feature`.
    • pPointB: Vector3
      in
      The second location of the line application `feature`.

    Returns number

    The application id for such a feature, or 0 if the call failed.

  • Creates an OOBB feature from the given OOBB.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    Parameters

    • pOOBB: OOBB
      in
      The OOBB to create as an application `feature`.

    Returns number

    The application id for such a feature, or 0 if the call failed.

  • Creates a point feature at the given location.

    Returns 0 if the call failed. Valid application feature ids are strictly positive integers.

    Parameters

    • pPoint: Vector3
      in
      The location of the application `feature`.

    Returns number

    The application id for such a feature, or 0 if the call failed.

  • Sets the content of the FeatureManagerInterface from a former call to toJSON.

    Feature parameters may be streamed, using the following schema :

    {
    "$defs": {
    "arc": {
    "additionalProperties": false,
    "properties": {
    "angle": {
    "exclusiveMaximum": 6.2832,
    "minimum": 0,
    "type": "number"
    },
    "center": {
    "$ref": "#/$defs/vec3"
    },
    "id": {
    "description": "A strictly positive integer",
    "example": 3,
    "minimum": 1,
    "type": "integer"
    },
    "normal": {
    "$ref": "#/$defs/vec3"
    },
    "radius": {
    "minimum": 0,
    "type": "number"
    },
    "startdirection": {
    "$ref": "#/$defs/vec3"
    },
    "visible": {
    "default": true,
    "example": true,
    "type": "boolean"
    }
    },
    "required": [
    "id",
    "visible",
    "center",
    "normal",
    "startdirection",
    "radius",
    "angle"
    ],
    "title": "Arc of circle definition",
    "type": "object"
    },
    "boxItem": {
    "additionalProperties": false,
    "properties": {
    "box": {
    "$ref": "#/$defs/oobb"
    },
    "id": {
    "description": "A strictly positive integer",
    "example": 3,
    "minimum": 1,
    "type": "integer"
    },
    "visible": {
    "default": true,
    "example": true,
    "type": "boolean"
    }
    },
    "required": [
    "id",
    "visible",
    "box"
    ],
    "title": "OOBB definition",
    "type": "object"
    },
    "features": {
    "additionalProperties": false,
    "properties": {
    "arcs": {
    "items": {
    "$ref": "#/$defs/arc"
    },
    "type": "array"
    },
    "boxes": {
    "items": {
    "$ref": "#/$defs/boxItem"
    },
    "type": "array"
    },
    "lines": {
    "items": {
    "$ref": "#/$defs/line"
    },
    "type": "array"
    },
    "points": {
    "items": {
    "$ref": "#/$defs/point"
    },
    "type": "array"
    },
    "type": {
    "const": "features",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type"
    ],
    "title": "Features definition",
    "type": "object"
    },
    "line": {
    "additionalProperties": false,
    "properties": {
    "id": {
    "description": "A strictly positive integer",
    "example": 3,
    "minimum": 1,
    "type": "integer"
    },
    "pointA": {
    "$ref": "#/$defs/vec3"
    },
    "pointB": {
    "$ref": "#/$defs/vec3"
    },
    "visible": {
    "default": true,
    "example": true,
    "type": "boolean"
    }
    },
    "required": [
    "id",
    "visible",
    "pointA",
    "pointB"
    ],
    "title": "Line definition",
    "type": "object"
    },
    "oobb": {
    "additionalProperties": false,
    "description": "Defines the values of a Object oriented Bounding Box",
    "properties": {
    "center": {
    "$ref": "#/$defs/vec3"
    },
    "halfextent": {
    "$ref": "#/$defs/vec3extent"
    },
    "xaxis": {
    "$ref": "#/$defs/vec3"
    },
    "yaxis": {
    "$ref": "#/$defs/vec3"
    },
    "zaxis": {
    "$ref": "#/$defs/vec3"
    }
    },
    "required": [
    "center",
    "halfextent",
    "xaxis",
    "yaxis",
    "zaxis"
    ],
    "title": "OOBB definition",
    "type": "object"
    },
    "point": {
    "additionalProperties": false,
    "properties": {
    "id": {
    "description": "A strictly positive integer",
    "example": 3,
    "minimum": 1,
    "type": "integer"
    },
    "point": {
    "$ref": "#/$defs/vec3"
    },
    "visible": {
    "default": true,
    "example": true,
    "type": "boolean"
    }
    },
    "required": [
    "id",
    "visible",
    "point"
    ],
    "title": "Point definition",
    "type": "object"
    },
    "vec3": {
    "description": "Define the coordinates [x,y,z] of a point / vector",
    "items": {
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "title": "3D Vector definition",
    "type": "array"
    },
    "vec3extent": {
    "description": "Define the coordinates [x,y,z] of an extent vector",
    "items": {
    "minimum": 0,
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "title": "3D Vector extent definition",
    "type": "array"
    }
    },
    "$ref": "#/$defs/features",
    "$schema": "https://json-schema.org/draft-07/schema#"
    }

    This schema may evolve in the future.

    Parameters

    • pFeatureData: string | Object
      in
      Internal FeatureManagerInterface data to set.

    Returns boolean

    true if the data is set.

  • Gets the type of an application feature.

    Parameters

    • pFeatureId: number
      in
      The application `feature` id of the `feature` to query.

    Returns FeatureType

    The actual type of the application feature if it exists, FeatureType.FT_None else.

  • Gets all the application feature ids that were created.

    Parameters

    • pApplicationFeatureIds: number[]
      out
      The application `feature` ids that were created.

    Returns boolean

    true if the call succeeded.

  • Gets the number of application feature that were created.

    Returns number

    The number of application feature that were created.

  • Gets the arc of circle parameters of an arc of circle application feature.

    Returns false if the call failed. Valid application feature ids are strictly positive integers.

    This call retrieves the value set by a previous call to createCircularArcApplicationFeature.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id of the `feature` to query.
    • pCenter: Vector3
      out
      The center of the circle `feature` to query.
    • pNormal: Vector3
      out
      The normal of the circle `feature` to query.
    • pStartDirection: Vector3
      out
      The start direction of the circle `feature` to query.
    • pRadiusAndAngle: Vector2
      out
      The radius and angle of the circle `feature` to query. `pRadiusAndAngle.x` stores the radius, `pRadiusAndAngle.y` stores the angle.

    Returns boolean

    true if pApplicationFeatureId refers to a valid arc of circle feature.

  • Gets the point locations of a line application feature.

    Returns false if the call failed. Valid application feature ids are strictly positive integers.

    This call retrieves the value set by a previous call to createLineApplicationFeature.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id of the `feature` to query.
    • pPointA: Vector3
      out
      The first point of the application `feature` to query.
    • pPointB: Vector3
      out
      The second point of the application `feature` to query.

    Returns boolean

    true if pApplicationFeatureId refers to a valid line feature.

  • Gets the OOBB parameters of an OOBB application feature.

    Returns false if the call failed. Valid application feature ids are strictly positive integers.

    This call retrieves the value set by a previous call to createOOBBApplicationFeature.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id of the `feature` to query.
    • pOOBB: OOBB
      out
      The OOBB data of the `feature` to query.

    Returns boolean

    true if pApplicationFeatureId refers to a valid OOBB feature.

  • Gets the point location of a point application feature.

    Returns false if the call failed. Valid application feature ids are strictly positive integers.

    This call retrieves the value set by a previous call to createPointApplicationFeature.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id of the `feature` to query.
    • pPoint: Vector3
      out
      The location of the application `feature` to query.

    Returns boolean

    true if pApplicationFeatureId refers to a valid point feature.

  • Tells if the EventDispatcher has such a callback registered for the given event type.

    Parameters

    • pType: string
      in
      The type of the event to test.
    • pListener: tListenerCallback
      in
      The listener function that gets tested.

    Returns boolean

    true if such a listener is installed for the given type of event.

  • Tells if the EventDispatcher has such a callback registered for the given callback id.

    Parameters

    • pId: string
      in
      The id of the callback to test.

    Returns boolean

    true if such a listener is installed for the given callback id.

  • Tells if the given application feature is visible.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id of the application `feature` to query visibility.

    Returns boolean

    true if the given application feature is visible.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    • pObject: Object

      The listener object that was used when addEventListener was called.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener by its id.

    If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.

    Parameters

    • pId: string
      in
      The id returned by the call to addEventListener that you want to remove.

    Returns boolean

    true if the callback was removed else false.

  • Asks if the given geometry has features.

    Returns an feature info request id (0 in case of error). Valid feature info request ids are strictly positive integers.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id to query features info from.

    Returns number

    A strictly positive integer in case of success, 0 is case of failure.

    See

    OOBB

  • Asks for the computation of the OOBB (Object oriented bounding box) of the given geometry.

    Returns an OOBB request id (0 in case of error). Valid OOBB request ids are strictly positive integers.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id to query the OOBB from.

    Returns number

    A strictly positive integer in case of success, 0 is case of failure.

    See

    OOBB

  • Sets the visibility state of an application features.

    Returns true if pApplicationFeatureId is a valid application feature id, but this call still returns true if the visibility status for the given feature has not changed.

    Parameters

    • pApplicationFeatureId: number
      in
      The application `feature` id to change visibility for.
    • pIsVisible: boolean
      in
      The new visibility state of the given `feature`.

    Returns boolean

    true if pApplicationFeatureId is a valid application feature id.

  • Sets the visibility state of a list of application features.

    Returns true if at least one application feature id is valid, but this call still returns true if the visibility status for the given features has not changed.

    Parameters

    • pApplicationFeatureIds: number[] | Uint32Array
      in
      The list of application `feature` ids to change visibility for.
    • pIsVisible: boolean
      in
      The new visibility state of the given `features`.

    Returns boolean

    true if at least one application feature id is valid.

  • Sets the visibility state of the features of a geometric instance id.

    Returns true if the call succeeded.

    Note: setGeometricInstanceFeaturesVisible is independent from setGeometricInstancesFeaturesTypesVisibility which means that a geometric feature is visible if both statements are true:

    • isGeometricInstanceFeaturesVisible is true.
    • getGeometricInstancesFeaturesTypesVisibility returns a FeatureVisibilityMode that is compatible with the type of the geometric feature. Note (bis): Setting features visible will not guarantee that the features will be visible at a current time. Indeed, features are loaded (and displayed) if the 3D HD data of the given geometry is loaded. It may also happen that the given geometry has no feature, and this call, even if successful, does not imply that anything will be drawn.

    Parameters

    • pGeometricInstanceId: number
      in
      The geometric instance id of the `features` to change visibility for.
    • pIsVisible: boolean
      in
      The new visibility state of the given `features`.

    Returns boolean

    true if the call succeeded.

  • Sets the visibility state of the features of a list of geometric instance ids.

    Returns true if the call succeeded, but this call still returns true if the visibility status for the given features has not changed.

    Note: setGeometricInstancesFeaturesVisible is independent from setGeometricInstancesFeaturesTypesVisibility which means that a geometric feature is visible if both statements are true:

    • isGeometricInstanceFeaturesVisible is true.
    • getGeometricInstancesFeaturesTypesVisibility returns a FeatureVisibilityMode that is compatible with the type of the geometric feature. Note (bis): Setting features visible will not guarantee that the features will be visible at a current time. Indeed, features are loaded (and displayed) if the 3D HD data of the given geometry is loaded. It may also happen that the given geometry has no feature, and this call, even if successful, does not imply that anything will be drawn.

    Parameters

    • pGeometricInstanceIds: number[] | Uint32Array
      in
      The geometric instance ids of the `features` to change visibility for.
    • pIsVisible: boolean
      in
      The new visibility state of the given `features`.

    Returns boolean

    true if the call succeeded.

  • Gets a deep copy of the application features of the FeatureManagerInterface.

    Please refer to JSON.stringify.

    Parameters

    • Optional pKey: any
      in
      Unused.

    Returns Object

    The internal application features data.