Class: CognitePointCloudModel<T>
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:28
Type Parameters
T
T
extends DataSourceType
= ClassicDataSourceType
Properties
modelId
readonly
modelId:number
=0
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:35
The modelId of the point cloud model in Cognite Data Fusion. 0 if not applicable
Deprecated
Use modelIdentifier instead
modelIdentifier
readonly
modelIdentifier:T
["modelIdentifier"
]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:45
The identifier of this model
revisionId
readonly
revisionId:number
=0
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:40
The revisionId of the specific model revision in Cognite Data Fusion. 0 if not applicable
Deprecated
Use modelIdentifier instead
type
readonly
type:SupportedModelTypes
='pointcloud'
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:29
Accessors
pointColorType
Get Signature
get pointColorType():
PointColorType
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:216
Determines how points currently are colored.
Returns
Set Signature
set pointColorType(
type
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:228
Specifies how points are colored.
Default
PointColorType.Rgb
Example
model.pointColorType = PointColorType.Rgb
Parameters
type
Returns
void
pointShape
Get Signature
get pointShape():
PointShape
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:268
Sets the point shape of each rendered point in the point cloud.
Default
PointShape.Circle
See
Returns
Set Signature
set pointShape(
shape
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:276
Gets the point shape of each rendered point in the point cloud.
See
Parameters
shape
Returns
void
pointSize
Get Signature
get pointSize():
number
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:235
Returns the size of each rendered point in the point cloud.
Returns
number
Set Signature
set pointSize(
size
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:243
Sets the size of each rendered point in the point cloud.
Default
2
Parameters
size
number
Returns
void
pointSizeType
Get Signature
get pointSizeType():
PointSizeType
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:250
Get the point size type.
Returns
Set Signature
set pointSizeType(
type
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:259
Set the point size type for the point cloud. The point size type can be either Fixed or Adaptive.
Default
PointSizeType.Adaptive
Parameters
type
Returns
void
stylableObjectCount
Get Signature
get stylableObjectCount():
number
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:421
Returns
number
The number of stylable objects
stylableObjects
Get Signature
get stylableObjects():
PointCloudObjectMetadata
<T
>[]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:351
Gets array of stylable objects for the point cloud model.
Example
model.stylableObjects.forEach(pointCloudMetadata => console.log(pointCloudMetadata.annotationId));
// or
model.stylableObjects.forEach(pointCloudMetadata => {
if (isDMPointCloudVolume(pointCloudMetadata))
console.log(pointCloudMetadata.volumeInstanceRef);
});
Returns
All stylable objects for this model *
styledCollections
Get Signature
get styledCollections():
StyledPointCloudVolumeCollection
<T
>[]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:334
Gets the object collections that have been assigned a style
Returns
StyledPointCloudVolumeCollection
<T
>[]
All object collections and their associated style
visible
Get Signature
get visible():
boolean
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:294
Returns the model visibility.
Returns
boolean
Set Signature
set visible(
value
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:287
Sets the model visibility.
Example
model.visible = false
Parameters
value
boolean
Returns
void
visiblePointCount
Get Signature
get visiblePointCount():
number
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:209
Returns the current number of visible/loaded points.
Returns
number
Methods
assignStyledObjectCollection()
assignStyledObjectCollection(
objectCollection
,appearance
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:361
Assign a style to a collection of objects. If the object collection has been assigned a style previously, the previous style will be replaced by the new one.
Parameters
objectCollection
T
["pointCloudCollectionType"
]
The object collection to assign a style to
appearance
The style to assign to the object collection
Returns
void
dispose()
dispose():
void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:72
Used to clean up memory.
Returns
void
getCameraConfiguration()
getCameraConfiguration():
undefined
|CameraConfiguration
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:98
Retrieves the camera position and target stored for the model. Typically this
is used to store a good starting position for a model. Returns undefined
if there
isn't any stored camera configuration for the model.
Returns
undefined
| CameraConfiguration
getCdfToDefaultModelTransformation()
getCdfToDefaultModelTransformation(
out?
):Matrix4
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:125
Gets transformation from CDF space to ThreeJS space, which includes any additional "default" transformations assigned to this model. Does not include any custom transformations set by CognitePointCloudModel.setModelTransformation
Parameters
out?
Matrix4
Preallocated THREE.Matrix4
(optional)
Returns
Matrix4
getClasses()
getClasses():
object
[]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:202
Returns a list of sorted classification names and codes present in the model. Names will be the custom names provided by the user, or a default one if none have been provided.
Returns
object
[]
A sorted list of classification codes and names from the model.
getDefaultPointCloudAppearance()
getDefaultPointCloudAppearance():
PointCloudAppearance
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:316
Gets default point appearance
Returns
getModelBoundingBox()
getModelBoundingBox(
outBoundingBox?
):Box3
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:89
Parameters
outBoundingBox?
Box3
Optional. Used to write result to.
Returns
Box3
Model's bounding box.
Example
const boundingBox = new THREE.Box3()
model.getModelBoundingBox(boundingBox);
// boundingBox now has the bounding box
// the following code does the same
const boundingBox = model.getModelBoundingBox();
getModelClippingPlanes()
getModelClippingPlanes():
Plane
[]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:309
Get the clipping planes for this model.
Returns
Plane
[]
getModelTransformation()
getModelTransformation(
out?
):Matrix4
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:115
Gets transformation matrix that has previously been set with CognitePointCloudModel.setModelTransformation.
Parameters
out?
Matrix4
Preallocated THREE.Matrix4
(optional).
Returns
Matrix4
getPointsByBoundingBox()
getPointsByBoundingBox(
box
):Vector3
[]
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:141
Retrieves all points from the point cloud that are contained within the specified bounding box.
Parameters
box
Box3
The THREE.Box3 bounding box used to filter points, defined in local model coordinates.
Returns
Vector3
[]
Array of THREE.Vector3 points that are located within the provided bounding box in local model coordinates.
Example
const boundingBox = new THREE.Box3(new THREE.Vector3(-10, -10, -10), new THREE.Vector3(10, 10, 10));
const pointsInBox = model.getPointsByBoundingBox(boundingBox);
console.log(`Found ${pointsInBox.length} points in the bounding box`);
hasClass()
hasClass(
pointClass
):boolean
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:193
Returns true if the model has values with the given classification class.
Parameters
pointClass
number
ASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
Returns
boolean
True if model has values in the class given.
isClassVisible()
isClassVisible(
pointClass
):boolean
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:183
Determines if points from a given class are visible.
Parameters
pointClass
number
ASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
Returns
boolean
True if points from the given class will be visible.
Throws
Error if the model doesn't have the class given.
mapBoxFromCdfToModelCoordinates()
mapBoxFromCdfToModelCoordinates(
box
,out
):Box3
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:160
Map bounding box from CDF to model space, taking the model's custom transformation into account
Parameters
box
Box3
Box to compute transformation from
out
Box3
= ...
Optional pre-allocated box
Returns
Box3
mapPointFromCdfToModelCoordinates()
mapPointFromCdfToModelCoordinates(
point
,out
):Vector3
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:150
Map point from CDF to model space, taking the model's custom transformation into account
Parameters
point
Vector3
Point to compute transformation from
out
Vector3
= ...
Optional pre-allocated point
Returns
Vector3
removeAllStyledObjectCollections()
removeAllStyledObjectCollections():
void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:413
Removes styling on all object collections in this model
Returns
void
setClassVisible()
setClassVisible(
pointClass
,visible
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:172
Sets a visible filter on points of a given class.
Parameters
pointClass
number
ASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
visible
boolean
Boolean flag that determines if the point class type should be visible or not.
Returns
void
Throws
Error if the model doesn't have the class given.
setDefaultPointCloudAppearance()
setDefaultPointCloudAppearance(
appearance
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:324
Sets default apparance for points that are not styled otherwise
Parameters
appearance
Appearance to assign as default
Returns
void
setModelClippingPlanes()
setModelClippingPlanes(
clippingPlanes
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:302
Sets the clipping planes for this model. They will be combined with the global clipping planes.
Parameters
clippingPlanes
Plane
[]
Returns
void
setModelTransformation()
setModelTransformation(
transformationMatrix
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:106
Sets transformation matrix of the model. This overrides the current transformation.
Parameters
transformationMatrix
Matrix4
The new transformation matrix
Returns
void
traverseStylableObjects()
traverseStylableObjects(
callback
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:435
Parameters
callback
(annotationMetadata
) => void
Returns
void
Deprecated
Use CognitePointCloudModel.stylableObjects Iterates through all stylable objects for this model
Example
model.traverseStylableObjects(
annotationMetadata => console.log(annotationMetadata.annotationId)
);
unassignStyledObjectCollection()
unassignStyledObjectCollection(
objectCollection
):void
Defined in: packages/pointclouds/src/CognitePointCloudModel.ts:381
Unassign style from an already styled object collection.
Parameters
objectCollection
T
["pointCloudCollectionType"
]
The object collection from which to remove the style
Returns
void