Sets the content of the PrimitiveManagerInterface from a former call to toJSON.
PrimitiveManagerInterface parameters (boxes, points, lines and materials definitions) are streamed, using the following schema :
{
"$defs": {
"primitivebox": {
"additionalProperties": false,
"properties": {
"boxmaterial": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"center": {
"$ref": "#/$defs/vec3"
},
"halfextent": {
"$ref": "#/$defs/vec3extent"
},
"id": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"linematerial": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"linewidth": {
"exclusiveMinimum": 0,
"type": "number"
},
"visible": {
"type": "boolean"
}
},
"required": [
"id",
"visible",
"linematerial",
"boxmaterial",
"linewidth",
"center",
"halfextent"
],
"title": "Primitive Line definition",
"type": "object"
},
"primitiveline": {
"additionalProperties": false,
"properties": {
"id": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"material": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"pointa": {
"$ref": "#/$defs/vec3"
},
"pointb": {
"$ref": "#/$defs/vec3"
},
"visible": {
"type": "boolean"
},
"width": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"id",
"visible",
"material",
"width",
"pointa",
"pointb"
],
"title": "Primitive Line definition",
"type": "object"
},
"primitivematerial": {
"additionalProperties": false,
"properties": {
"color": {
"description": "A RGBA color in the form #XXXXXXXX",
"example": "#ABABABAB",
"maxLength": 20,
"minLength": 9,
"pattern": "^\\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})\\s*$",
"type": "string"
},
"id": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
}
},
"required": [
"id",
"color"
],
"title": "Material definition",
"type": "object"
},
"primitivepoint": {
"additionalProperties": false,
"properties": {
"id": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"innermaterial": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"innersize": {
"minimum": 0,
"type": "number"
},
"outermaterial": {
"description": "A strictly positive integer",
"example": 3,
"minimum": 1,
"type": "integer"
},
"position": {
"$ref": "#/$defs/vec3"
},
"size": {
"exclusiveMinimum": 0,
"type": "number"
},
"visible": {
"type": "boolean"
}
},
"required": [
"id",
"visible",
"innermaterial",
"outermaterial",
"innersize",
"size",
"position"
],
"title": "Primitive Point definition",
"type": "object"
},
"primitives": {
"additionalProperties": false,
"properties": {
"boxes": {
"items": {
"$ref": "#/$defs/primitivebox"
},
"type": "array"
},
"lines": {
"items": {
"$ref": "#/$defs/primitiveline"
},
"type": "array"
},
"materials": {
"items": {
"$ref": "#/$defs/primitivematerial"
},
"type": "array"
},
"points": {
"items": {
"$ref": "#/$defs/primitivepoint"
},
"type": "array"
},
"type": {
"const": "primitives",
"type": "string"
},
"version": {
"description": "Define the version of the object",
"example": 1,
"type": "integer"
}
},
"required": [
"type"
],
"title": "Primitives 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/primitives",
"$schema": "https://json-schema.org/draft-07/schema#"
}
true if the data is set.
Gets the PrimitiveManagerBoxInterface in charge of drawing 3D boxes.
Gets the PrimitiveManagerLineInterface in charge of drawing 3D lines.
Gets the PrimitiveManagerPointInterface in charge of drawing 3D points.
Gets the PrimitiveManagerMaterialInterface in charge of the primitive colors.
Gets the PrimitiveManagerRubberBandInterface in charge of drawing a single 2D rectangle.
Gets a deep copy of the internal data of the PrimitiveManagerInterface.
All boxes, points, lines and materials definitions are dumped.
Please refer to JSON.stringify.
Optional pKey: anyThe internal PrimitiveManagerInterface data.
The PrimitiveManagerInterface interface is the central point used to render primitive elements, such as points, boxes, lines and a rectangle.
This interface holds the primitive elements interfaces and the materials that are used by these primitive elements.
3D Points, 3D lines, 3D boxes and a single 2D rectangle can be rendered on top of the DMU, with a rendering hint depending on the relative depth between the 3D primitives and the geometries. This interface accessed through the InfiniteEngineInterface.getPrimitiveManager function. The colors of the 3D primitive are handled by the PrimitiveManagerMaterialInterface, accessed through getPrimitiveMaterialManager. Materials are accessed by their ids, and modified by their ids. 3D primitives are rendered colored with their material id, and not directly from a color.
3D Points
The rendering can be enriched with 3D points rendered on top of the geometries, with a rendering hint telling if the point is over or under a geometry.
Creating a point may be done with the following :
3D Lines
The rendering can be enriched with 3D lines rendered on top of the geometries.
Creating a line may be done with the following :
3D Boxes
The rendering can be enriched with 3D boxes rendered on top of the geometries, with a rendering hint telling if the edge/face is over or under a geometry.
Creating a box may be done with the following :
2D rectangle (rubber band)
The rendering can be enriched with a single 2D rectangle rendered on top of the geometries. The color cannot be changed.
Rendering a 2D rectangle may be done with the following :
See