Point Of Interest (POI)

This PMI object represents some kind of a “label” usually used to mark any attention-grabbing element in a scene. The POI is always rendered in a plane parallel to the plane of the screen. The content of this object is just an image which is placed in its plane. Below we will consider this object in detail.

POI object

Object

Common type of the POI object (TypeScript):

export type C3DViewPoi = {
    type: C3DViewObjectTypes.Poi
    uuid?: string
    image: {
        src?: C3DViewResource
        position: C3DViewPoint
        origin?: {
            x: number
            y: number
        }
        size?: number
    }
    userData: C3DUserData
}

The properties type, uuid, and userData are described here. Additionally for this PMI object:

  • type can be C3DViewObjectTypes.Poi or a string "Poi";

  • userData object can be obtained later using the command with GetParametersTypes.AnnotationList as a type.

  1. image is a set of options necessary to specify an inner image:

    • src is a source data used to load an image;

    • position is a point of the object in a scene;

    • origin is an option to align an image;

    • size is a size of image in pixels.

The position point always lies in a plane in which the POI object is rendered.

The origin aligns an image:

  • on the plane relative to the position of object;

  • along horizontal and vertical directions via two inner parameters - x and y. x and y are measured in a range from 0 to 100%. Having values of 0% and 0% respectively defines left top alignment, while 100% and 100% – right bottom.

The size sets the equal size for an inner image and the object itself actually, as the object does not apply any padding or margin to its content.

Example

Example of the command adding a new POI object (TypeScript):

view.runCommand({
    name: "AddAnnotation",
    objs: [
        {
            type: "Poi",
            image: {
                src: {
                    id: '...',
                    load: id => {...}
                },
                position: {...},
                origin: { x: 50, y: 50 } // center alignment
                size: 32 // px
            },
            userData: {
                customField: 'custom data'
            }
        }
    ]
})