Interface PrimitiveManagerPointInterface

The PrimitiveManagerPointInterface is used to display 3D points on top of the DMU, with a rendering hint depending on the relative depth between the 3D points and the geometries.

The PrimitiveManagerPointInterface is accessed through the PrimitiveManagerInterface.getPointManager function (the PrimitiveManagerInterface is accessed through InfiniteEngineInterface.getPrimitiveManager).

A 3D point is defined as a 3D position, an full size in pixels, an inner size in pixels. Rendered 3D points are manipulated through their ids (and not a dedicated object), indeed each point is assigned a strictly positive integer id that will represent it. 0 is an invalid point id.

The color of the 3D point is handled by the PrimitiveManagerMaterialInterface, accessed through PrimitiveManagerInterface.getPrimitiveMaterialManager. Materials are accessed by their ids, and modified by their ids. 3D primitives are rendered colored with their primitive material id, and not directly from a color.
WARNING : do not confuse the PrimitiveManagerMaterialInterface and the MaterialManagerInterface, these two interfaces are separated, do not use MaterialManagerInterface ids to draw points !!!

point display

Creating a 3D point may be done with the following :

/** 
* Sample to explain how to create 3d points on top of the rendering (PrimitiveManagerPointInterface).
*/
import { InfiniteEngineInterface, PrimitiveManagerMaterialInterface, PrimitiveManagerPointInterface, Vector4, Vector3 } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;
// created previously, the point position
let lPointPosition : Vector3;

// the material for the inner point color
let lInnerPointColorMaterial : number = -1;
// the material for the outer point color
let lOuterPointColorMaterial : number = -1;
// the primitive material manager
const lPrimitiveMaterialManager : PrimitiveManagerMaterialInterface = lInfiniteEngine.getPrimitiveManager().getPrimitiveMaterialManager();
// the point manager
const lPointManager : PrimitiveManagerPointInterface = lInfiniteEngine.getPrimitiveManager().getPointManager();

// inner point color is white opaque (1 as last parameter)
const lInnerPointColor : Vector4 = new Vector4(1, 1, 1, 1);
// outer point color is black semi transparent (0.5 as last parameter)
const lOuterPointColor : Vector4 = new Vector4(0, 0, 0, 0.5);

// create materials
lInnerPointColorMaterial = lPrimitiveMaterialManager.createPrimitiveMaterial(lInnerPointColor);
lOuterPointColorMaterial = lPrimitiveMaterialManager.createPrimitiveMaterial(lOuterPointColor);

// and create the point
const lPointId : number = lPointManager.createPoint(
// position
lPointPosition,
// sizes (quite a large point :) )
40,
35,
// colors
lInnerPointColorMaterial,
lOuterPointColorMaterial
);

console.log('Point id is ' + lPointId);

You may create also boxes, lines, etc with PrimitiveManagerBoxInterface, PrimitiveManagerLineInterface, etc.
3D Primitives

interface PrimitiveManagerPointInterface {
    createPoint(pPointPosition, pPointSize, pInnerSize, pInnerMaterialId, pOuterMaterialId): number;
    getPointInnerMaterial(pPointId): number;
    getPointInnerSize(pPointId): number;
    getPointOuterMaterial(pPointId): number;
    getPointPosition(pPointId, pPositionOut): boolean;
    getPointSize(pPointId): number;
    getPoints(pPoints): boolean;
    getPointsCount(): number;
    isPointVisible(pPointId): boolean;
    removeAllPoints(): void;
    removePoint(pPointId): boolean;
    setPointMaterial(pPointId, pInnerMaterialId, pOuterMaterialId): boolean;
    setPointPosition(pPointId, pPointPositionOut): boolean;
    setPointShape(pPointId, pPointSize, pInnerSize): boolean;
    setPointVisible(pPointId, pVisible): boolean;
}

Methods

  • Creates a new point at the given position with full and inner sizes.

    The sizes in pixels and the colors of the point are set by the user.
    The point is assigned a positive id that will represent this point from now on. 0 is an invalid point id. Please note that this id will be reused if the point is removed and another created again.
    Before creating a point, materials to render this point must be created in the primitive manager.

    A newly created point is visible.

    Parameters

    • pPointPosition: Vector3
      in
      The 3D position of the point.
    • pPointSize: number
      in
      Size in pixels of the point (must be superior than 0).
    • pInnerSize: number
      in
      Size in pixels of the inner area (must be superior or equal to 0, and inferior to pPointSize).
    • pInnerMaterialId: number
      in
      The material used to draw the inner circle.
    • pOuterMaterialId: number
      in
      The material used to draw the outer circle.

    Returns number

    The id of the created point.

  • Gets the primitive material id used to render the inner area of the point.

    Returns 0 if a point with the given id does not exist.

    Parameters

    • pPointId: number
      in
      The id of the point to query.

    Returns number

    The primitive material id of the inner circle.

  • Gets the size in pixels of the inner circle of the point.

    Returns 0 if a point with the given id does not exist.

    Parameters

    • pPointId: number
      in
      The id of the point to query.

    Returns number

    The size in pixels of the inner circle.

  • Gets the primitive material id used to render the outer area of the point.

    Returns 0 if a point with the given id does not exist.

    Parameters

    • pPointId: number
      in
      The id of the point to query.

    Returns number

    The primitive material id of the inner circle.

  • Gets the position of the given point.

    If found, pPositionOut is updated with the 3d position of the point. Returns true if the point exists and pPositionOut is updated.

    Parameters

    • pPointId: number
      in
      The id of the point to query.
    • pPositionOut: Vector3
      out
      The position of the point.

    Returns boolean

    true if pPosition was updated.

  • Gets the full size in pixels of the point.

    Returns 0 if a point with the given id does not exist.

    Parameters

    • pPointId: number
      in
      The id of the point to query.

    Returns number

    The size in pixels of the point.

  • Gets all the created point ids.

    Parameters

    • pPoints: number[]
      out
      The resulting point ids.

    Returns boolean

    trueif the call succeeded.

  • Gets the actual number of rendered points.

    Returns number

    The number of points drawn.

  • Tells if the given point is visible.

    Returns false if the point does not exists or is setPointVisible with false has been called.

    Parameters

    • pPointId: number
      in
      The id of the point to query.

    Returns boolean

    true if the point exists and is visible.

  • Removes all the points.

    Returns void

  • Removes the point with the given id.

    Parameters

    • pPointId: number
      in
      The id of the point to remove.

    Returns boolean

    true if the point exists ans therefore is removed.

  • Updates the rendering of the given point, by changing its inner and outer colors.

    Returns true if the point was updated.

    Parameters

    • pPointId: number
      in
      The id of the point to change.
    • pInnerMaterialId: number
      in
      The primitive material id of the inner circle color.
    • pOuterMaterialId: number
      in
      The primitive material id of the outer circle color.

    Returns boolean

    true if the point was found and therefore the point rendering is updated.

  • Sets the position of the given point.

    If found, pPointPositionOut is updated. Returns true if the point is found and therefore pPointPositionOut is updated.

    Parameters

    • pPointId: number
      in
      The id of the point to query.
    • pPointPositionOut: Vector3
      out
      The new position of the point.

    Returns boolean

    true if the position was updated.

  • Updates the rendering of the given point, by changing the pixel size of the inner and outer circles.

    Returns true if the point was updated.

    Parameters

    • pPointId: number
      in
      The id of the point to change.
    • pPointSize: number
      in
      The new size in pixels of the point.
    • pInnerSize: number
      in
      The new size in pixels of the inner circle.

    Returns boolean

    true if the point exists, pPointSize > 0 and pPointSize >= pInnerSize >= 0. If true, the point is updated.

  • Updates the rendering of the given point, by changing its visibility.

    Returns true if the point was updated.

    Parameters

    • pPointId: number
      in
      The id of the point to change.
    • pVisible: boolean
      in
      The new visibility state of the point.

    Returns boolean

    true if the point exists.