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 getPointManager function (the PrimitiveManagerInterface is accessed through 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 getMaterialManager. 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/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().getMaterialManager();
// 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.createMaterial(lInnerPointColor);
lOuterPointColorMaterial = lPrimitiveMaterialManager.createMaterial(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](PrimitiveManagerBoxInterface.html), [PrimitiveManagerLineInterface](PrimitiveManagerLineInterface.html), etc.
3D Primitives

See

Hierarchy

  • PrimitiveManagerPointInterface

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.

    Returns

    The id of the created point.

    Parameters

    • pPointPosition: Vector3
      in
      The 3D position of the point.
    • pPointSize: number
      in
      Size in pixels of the point (must be superior than 0.0).
    • pInnerSize: number
      in
      Size in pixels of the inner area (must be superior or equal to 0.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

  • Gets the actual number of rendered points.

    Returns

    The number of points drawn.

    Returns number

  • 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.

    Returns

    The primitive material id of the inner circle.

    Parameters

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

    Returns number

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

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

    Returns

    The size in pixels of the inner circle.

    Parameters

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

    Returns number

  • 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.

    Returns

    The primitive material id of the inner circle.

    Parameters

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

    Returns number

  • 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.

    Returns

    true if pPosition was updated.

    Parameters

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

    Returns boolean

  • Gets the full size in pixels of the point.

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

    Returns

    The size in pixels of the point.

    Parameters

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

    Returns number

  • Tells if the given point is visible.

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

    Returns

    true if the point exists and is visible.

    Parameters

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

    Returns boolean

  • Removes the point with id.

    Returns

    true if the point exists ans therefore is removed.

    Parameters

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

    Returns boolean

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

    Returns true if the point was updated.

    Returns

    true if the point was found and therefore the point rendering is 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

  • Sets the position of the given point.

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

    Returns

    true if the position was updated.

    Parameters

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

    Returns boolean

  • 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.

    Returns

    true if the point exists, pPointSize > 0 and pPointSize >= pInnerSize >= 0. If true, the point is 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

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

    Returns true if the point was updated.

    Returns

    true if the point exists.

    Parameters

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

    Returns boolean