Class: CognitePointCloudModel
@cognite/reveal.CognitePointCloudModel
Properties
modelId
• Readonly
modelId: number
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:30
revisionId
• Readonly
revisionId: number
The modelId of the point cloud model in Cognite Data Fusion.
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:34
type
• Readonly
type: SupportedModelTypes
= 'pointcloud'
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:29
Accessors
pointColorType
• get
pointColorType(): PointColorType
Determines how points currently are colored.
Returns
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:186
• set
pointColorType(type
): void
Specifies how points are colored.
Default
PointColorType.Rgb
Example
model.pointColorType = PointColorType.Rgb
Parameters
Name | Type |
---|---|
type | PointColorType |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:198
pointShape
• get
pointShape(): PointShape
Sets the point shape of each rendered point in the point cloud.
Default
PointShape.Circle
See
Returns
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:238
• set
pointShape(shape
): void
Gets the point shape of each rendered point in the point cloud.
See
Parameters
Name | Type |
---|---|
shape | PointShape |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:246
pointSize
• get
pointSize(): number
Returns the size of each rendered point in the point cloud.
Returns
number
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:205
• set
pointSize(size
): void
Sets the size of each rendered point in the point cloud.
Default
1
Parameters
Name | Type |
---|---|
size | number |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:213
pointSizeType
• get
pointSizeType(): PointSizeType
Get the point size type.
Returns
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:220
• set
pointSizeType(type
): void
Set the point size type for the point cloud. The point size type can be either Fixed or Adaptive.
Default
PointSizeType.Adaptive
Parameters
Name | Type |
---|---|
type | PointSizeType |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:229
stylableObjectCount
• get
stylableObjectCount(): number
Returns
number
The number of stylable objects
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:340
styledCollections
• get
styledCollections(): StyledPointCloudObjectCollection
[]
Gets the object collections that have been assigned a style
Returns
StyledPointCloudObjectCollection
[]
All object collections and their associated style
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:285
visiblePointCount
• get
visiblePointCount(): number
Returns the current number of visible/loaded points.
Returns
number
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:179
Methods
assignStyledObjectCollection
▸ assignStyledObjectCollection(objectCollection
, appearance
): void
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
Name | Type | Description |
---|---|---|
objectCollection | PointCloudObjectCollection | The object collection to assign a style to |
appearance | PointCloudAppearance | The style to assign to the object collection |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:295
dispose
▸ dispose(): void
Used to clean up memory.
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:58
getCameraConfiguration
▸ getCameraConfiguration(): undefined
| CameraConfiguration
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
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:84
getCdfToDefaultModelTransformation
▸ getCdfToDefaultModelTransformation(out?
): Matrix4
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 setModelTransformation
Parameters
Name | Type | Description |
---|---|---|
out? | Matrix4 | Preallocated THREE.Matrix4 (optional) |
Returns
Matrix4
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:111
getClasses
▸ getClasses(): { code
: number
; name
: string
}[]
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
{ code
: number
; name
: string
}[]
A sorted list of classification codes and names from the model.
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:172
getDefaultPointCloudAppearance
▸ getDefaultPointCloudAppearance(): PointCloudAppearance
Gets default point appearance
Returns
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:268
getModelBoundingBox
▸ getModelBoundingBox(outBbox?
): Box3
Example
const box = new THREE.Box3()
model.getModelBoundingBox(box);
// box now has the bounding box
// the following code does the same
const box = model.getModelBoundingBox();
Parameters
Name | Type | Description |
---|---|---|
outBbox? | Box3 | Optional. Used to write result to. |
Returns
Box3
Model's bounding box.
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:75
getModelClippingPlanes
▸ getModelClippingPlanes(): Plane
[]
Get the clipping planes for this model.
Returns
Plane
[]
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:261
getModelTransformation
▸ getModelTransformation(out?
): Matrix4
Gets transformation matrix that has previously been set with setModelTransformation.
Parameters
Name | Type | Description |
---|---|---|
out? | Matrix4 | Preallocated THREE.Matrix4 (optional). |
Returns
Matrix4
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:101
hasClass
▸ hasClass(pointClass
): boolean
Returns true if the model has values with the given classification class.
Parameters
Name | Type | Description |
---|---|---|
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.
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:163
isClassVisible
▸ isClassVisible(pointClass
): boolean
Determines if points from a given class are visible.
Throws
Error if the model doesn't have the class given.
Parameters
Name | Type | Description |
---|---|---|
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.
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:153
mapBoxFromCdfToModelCoordinates
▸ mapBoxFromCdfToModelCoordinates(box
, out?
): Box3
Map bounding box from CDF to model space, taking the model's custom transformation into account
Parameters
Name | Type | Description |
---|---|---|
box | Box3 | Box to compute transformation from |
out | Box3 | Optional pre-allocated box |
Returns
Box3
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:130
mapPointFromCdfToModelCoordinates
▸ mapPointFromCdfToModelCoordinates(point
, out?
): Vector3
Map point from CDF to model space, taking the model's custom transformation into account
Parameters
Name | Type | Description |
---|---|---|
point | Vector3 | Point to compute transformation from |
out | Vector3 | Optional pre-allocated point |
Returns
Vector3
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:120
removeAllStyledObjectCollections
▸ removeAllStyledObjectCollections(): void
Removes styling on all object collections in this model
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:332
setClassVisible
▸ setClassVisible(pointClass
, visible
): void
Sets a visible filter on points of a given class.
Throws
Error if the model doesn't have the class given.
Parameters
Name | Type | Description |
---|---|---|
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
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:142
setDefaultPointCloudAppearance
▸ setDefaultPointCloudAppearance(appearance
): void
Sets default apparance for points that are not styled otherwise
Parameters
Name | Type | Description |
---|---|---|
appearance | PointCloudAppearance | Appearance to assign as default |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:276
setModelClippingPlanes
▸ setModelClippingPlanes(clippingPlanes
): void
Sets the clipping planes for this model. They will be combined with the global clipping planes.
Parameters
Name | Type |
---|---|
clippingPlanes | Plane [] |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:254
setModelTransformation
▸ setModelTransformation(transformationMatrix
): void
Sets transformation matrix of the model. This overrides the current transformation.
Parameters
Name | Type | Description |
---|---|---|
transformationMatrix | Matrix4 | The new transformation matrix |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:92
traverseStylableObjects
▸ traverseStylableObjects(callback
): void
Iterates through all stylable objects for this model
Example
model.traverseStylableObjects(
annotationMetadata => console.log(annotationMetadata.annotationId)
);
Parameters
Name | Type |
---|---|
callback | (annotationMetadata : PointCloudObjectMetadata ) => void |
Returns
void
Defined in
packages/pointclouds/src/CognitePointCloudModel.ts:353
unassignStyledObjectCollection
▸ unassignStyledObjectCollection(objectCollection
): void
Unassign style from an already styled object collection.
Parameters
Name | Type | Description |
---|---|---|
objectCollection | PointCloudObjectCollection | The object collection from which to remove the style |
Returns
void