Skip to main content
Version: 3.x

Module: @cognite/reveal

Enumerations

Classes

Interfaces

Type Aliases

CadIntersection

Ƭ CadIntersection: Object

Type declaration

NameTypeDescription
distanceToCameranumberDistance from the camera to the intersection.
modelCognite3DModelThe model that was intersected.
pointTHREE.Vector3Coordinate of the intersection.
treeIndexnumberTree index of the intersected 3D node.
type"cad"The intersection type.

Defined in

packages/api/src/public/migration/types.ts:179


CadModelBudget

Ƭ CadModelBudget: Object

Represents a measurement of how much geometry can be loaded.

Type declaration

NameTypeDescription
highDetailProximityThresholdnumberSectors within this distance from the camera will always be loaded in high details. deprecated This is only used for 3D models processed prior to the Reveal 3.0 release (Q1 2022).
maximumRenderCostnumberMaximum render cost. This number can be thought of as triangle count, although the number doesn't match this directly.

Defined in

packages/cad-geometry-loaders/src/CadModelBudget.ts:10


CameraChangeDelegate

Ƭ CameraChangeDelegate: (position: THREE.Vector3, target: THREE.Vector3) => void

Type declaration

▸ (position, target): void

Parameters
NameType
positionTHREE.Vector3
targetTHREE.Vector3
Returns

void

Defined in

packages/camera-manager/src/types.ts:85


CameraConfiguration

Ƭ CameraConfiguration: Object

Represents a camera configuration, consisting of a camera position and target.

Type declaration

NameType
positionTHREE.Vector3
targetTHREE.Vector3

Defined in

packages/utilities/src/CameraConfiguration.ts:8


CameraControlsOptions

Ƭ CameraControlsOptions: Object

Type declaration

NameTypeDescription
changeCameraTargetOnClick?booleanEnables or disables change of camera target on mouse click. New target is then set to the point of the model under current cursor position. Default is false.
mouseWheelAction?"zoomToTarget" | "zoomPastCursor" | "zoomToCursor"Sets mouse wheel initiated action. Modes: 'zoomToTarget' - zooms just to the current target (center of the screen) of the camera. 'zoomPastCursor' - zooms in the direction of the ray coming from camera through cursor screen position, allows going through objects. 'zoomToCursor' - mouse wheel scroll zooms towards the point on the model where cursor is hovering over, doesn't allow going through objects. Default is 'zoomPastCursor'.

Defined in

packages/camera-manager/src/types.ts:5


CameraState

Ƭ CameraState: Object

Type declaration

NameTypeDescription
position?THREE.Vector3Camera position in world space.
rotation?THREE.QuaternionCamera local rotation in quaternion form.
target?THREE.Vector3Camera target in world space.

Defined in

packages/camera-manager/src/types.ts:66


DisposedDelegate

Ƭ DisposedDelegate: () => void

Type declaration

▸ (): void

Returns

void

Defined in

packages/utilities/src/events/types.ts:20


GeometryFilter

Ƭ GeometryFilter: Object

Type declaration

NameTypeDescription
boundingBox?THREE.Box3The bounds to load geometry within. By default this box is in CDF coordinate space which will be transformed into coordinates relative to the model using the the model transformation which can be specified using the CDF API, or set in Cognite Fusion. see isBoundingBoxInModelCoordinates.
isBoundingBoxInModelCoordinates?booleanWhen set, the geometry filter {@link boundingBox} will be considered to be in "Reveal/ThreeJS space". Rather than CDF space which is the default. When using Reveal space, the model transformation which can be specified using the CDF API, or set in Cognite Fusion.

Defined in

packages/cad-model/src/types.ts:21


Intersection

Ƭ Intersection: CadIntersection | PointCloudIntersection

Defined in

packages/api/src/public/migration/types.ts:206


LoadingStateChangeListener

Ƭ LoadingStateChangeListener: (loadingState: LoadingState) => any

Type declaration

▸ (loadingState): any

Handler for events about data being loaded.

Parameters
NameType
loadingStateLoadingState
Returns

any

Defined in

packages/api/src/public/types.ts:30


ModelState

Ƭ ModelState: Object

Type declaration

NameType
defaultNodeAppearanceNodeAppearance
modelIdnumber
revisionIdnumber
styledSets{ appearance: NodeAppearance ; options?: any ; state: any ; token: string }[]

Defined in

packages/api/src/utilities/ViewStateHelper.ts:31


NodeAppearance

Ƭ NodeAppearance: Object

Type for defining node appearance profiles to style a 3D CAD model.

see DefaultNodeAppearance

Type declaration

NameTypeDescription
color?[number, number, number]Overrides the default color of the node in RGB. Each component is in range [0, 255]. [0, 0, 0] means no override.
outlineColor?NodeOutlineColorWhen set, an outline is drawn around the node to make it stand out.
prioritizedForLoadingHint?numberWhen provided, this value can be used to prioritize certain areas of the 3D model to be loaded. This can be useful to prioritize key objects in the 3D model to always be loaded. When non-zero, sectors containing geometry in the vicinity of the prioritized sectors are given an extra priority. Recommended values are in range 1 (somewhat higher priority to be loaded) to 10 (very likely to be loaded). Usually values around 4-5 is recommended. Prioritized nodes are loaded at the expense of non-prioritized areas. There are no guarantees that the nodes are actually loaded, and the more prioritized areas/nodes provided, the less likely it is that the hint is obeyed. Extra priority doesn't accumulate when sectors are prioritized because they intersect/contain several nodes. This is an advanced feature and not recommended for most users version Only works with 3D models converted later than Q4 2021.
renderGhosted?booleanWhen set to true, the node is rendered ghosted, i.e. transparent with a fixed color. This has no effect if renderInFront is true.
renderInFront?booleanWhen set to true, the node is rendered in front of all other nodes even if it's occluded. Note that this take precedence over renderGhosted.
visible?booleanOverrides the visibility of the node.

Defined in

packages/cad-styling/src/NodeAppearance.ts:20


NodeCollectionDescriptor

Ƭ NodeCollectionDescriptor: Object

Type declaration

NameType
options?any
stateany
tokenTypeName

Defined in

packages/cad-styling/src/NodeCollectionDeserializer.ts:22


NodeCollectionSerializationContext

Ƭ NodeCollectionSerializationContext: Object

Type declaration

NameType
clientCogniteClient
modelCdfModelNodeCollectionDataProvider

Defined in

packages/cad-styling/src/NodeCollectionDeserializer.ts:21


OnLoadingCallback

Ƭ OnLoadingCallback: (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void

Type declaration

▸ (itemsLoaded, itemsRequested, itemsCulled): void

Parameters
NameType
itemsLoadednumber
itemsRequestednumber
itemsCullednumber
Returns

void

Defined in

packages/api/src/public/migration/types.ts:23


PointCloudBudget

Ƭ PointCloudBudget: Object

Represents a budget of how many point from point clouds can be loaded at the same time.

Type declaration

NameTypeDescription
numberOfPointsnumberTotal number of points that can be loaded for all point clouds models accumulated.

Defined in

packages/pointclouds/src/PointCloudBudget.ts:10


PointerEventDelegate

Ƭ PointerEventDelegate: (event: PointerEventData) => void

Type declaration

▸ (event): void

Parameters
NameType
eventPointerEventData
Returns

void

Defined in

packages/utilities/src/events/types.ts:9


RevealOptions

Ƭ RevealOptions: Object

property logMetrics Might be used to disable usage statistics.

property nodeAppearanceProvider Style node by tree-index.

property internal Internals are for internal usage only (like unit-testing).

Type declaration

NameType
continuousModelStreaming?boolean
internal?{ cad?: InternalRevealCadOptions }
internal.cad?InternalRevealCadOptions
logMetrics?boolean
outputRenderTarget?{ autoSize?: boolean ; target: THREE.WebGLRenderTarget }
outputRenderTarget.autoSize?boolean
outputRenderTarget.targetTHREE.WebGLRenderTarget
renderOptions?RenderOptions
rendererResolutionThreshold?number

Defined in

packages/api/src/public/types.ts:16


SceneRenderedDelegate

Ƭ SceneRenderedDelegate: (event: { camera: THREE.PerspectiveCamera ; frameNumber: number ; renderTime: number ; renderer: THREE.WebGLRenderer }) => void

Type declaration

▸ (event): void

Parameters
NameType
eventObject
event.cameraTHREE.PerspectiveCamera
event.frameNumbernumber
event.renderTimenumber
event.rendererTHREE.WebGLRenderer
Returns

void

Defined in

packages/utilities/src/events/types.ts:26


SerializedNodeCollection

Ƭ SerializedNodeCollection: Object

Type declaration

NameType
options?any
stateany
tokenstring

Defined in

packages/cad-styling/src/SerializedNodeCollection.ts:4


SupportedModelTypes

Ƭ SupportedModelTypes: "pointcloud" | "cad"

Defined in

packages/model-base/src/SupportedModelTypes.ts:4


TypeName

Ƭ TypeName: string

Defined in

packages/cad-styling/src/NodeCollectionDeserializer.ts:20


ViewerState

Ƭ ViewerState: Object

Type declaration

NameType
camera?{ position: { x: number ; y: number ; z: number } ; target: { x: number ; y: number ; z: number } }
camera.position{ x: number ; y: number ; z: number }
camera.position.xnumber
camera.position.ynumber
camera.position.znumber
camera.target{ x: number ; y: number ; z: number }
camera.target.xnumber
camera.target.ynumber
camera.target.znumber
clippingPlanes?ClippingPlanesState[]
models?ModelState[]

Defined in

packages/api/src/utilities/ViewStateHelper.ts:15


WellKnownUnit

Ƭ WellKnownUnit: "Meters" | "Centimeters" | "Millimeters" | "Micrometers" | "Kilometers" | "Feet" | "Inches" | "Yards" | "Miles" | "Mils" | "Microinches"

Units supported by Cognite3DModel.

Defined in

packages/cad-model/src/types.ts:8

Variables

DefaultNodeAppearance

Const DefaultNodeAppearance: Object

A set of default node appearances used in Reveal.

Type declaration

NameType
DefaultNodeAppearance
GhostedNodeAppearance
HiddenNodeAppearance
Highlighted{ color?: [number, number, number] ; outlineColor?: NodeOutlineColor ; prioritizedForLoadingHint?: number ; renderGhosted?: boolean ; renderInFront?: boolean ; visible?: boolean }
Highlighted.color?[number, number, number]
Highlighted.outlineColor?NodeOutlineColor
Highlighted.prioritizedForLoadingHint?number
Highlighted.renderGhosted?boolean
Highlighted.renderInFront?boolean
Highlighted.visible?boolean
InFrontNodeAppearance
OutlinedNodeAppearance

Defined in

packages/cad-styling/src/NodeAppearance.ts:109


REVEAL_VERSION

Const REVEAL_VERSION: string = process.env.VERSION

Defined in

packages/api/index.ts:15


revealEnv

Const revealEnv: Object

Used to specify custom url for worker/wasm files in cases when you need the latest local files or CDN is blocked by CSP.

Type declaration

NameType
publicPathstring

Defined in

packages/utilities/src/revealEnv.ts:9

Functions

registerCustomNodeCollectionType

registerCustomNodeCollectionType<T>(nodeCollectionType, deserializer): void

Type parameters

NameType
Textends NodeCollection<T>

Parameters

NameType
nodeCollectionTypestring
deserializer(descriptor: NodeCollectionDescriptor, context: NodeCollectionSerializationContext) => Promise<T>

Returns

void

Defined in

packages/cad-styling/src/NodeCollectionDeserializer.ts:147