copper3d / Modules / Scene/copperSceneOnDemond / copperSceneOnDemond
Class: copperSceneOnDemond
Scene/copperSceneOnDemond.copperSceneOnDemond
Hierarchy
↳
copperSceneOnDemond
Table of contents
Constructors
Properties
- ambientLight
- camera
- cameraPositionFlag
- container
- content
- controls
- copperControl
- copperOrthographicCamera
- copperPerspectiveCamera
- depthStep
- directionalLight
- exportContent
- isHalfed
- isResize
- pickableObjects
- preRenderCallbackFunctions
- renderNrrdVolume
- renderRequested
- renderer
- scene
- sceneName
- sort
- subCamera
- subCopperControl
- subDiv
- subRender
- subScene
- viewPoint
- vignette
Methods
- addLights
- addObject
- addPreRenderCallbackFunction
- addSubView
- confirmResize
- createDemoMesh
- dispose
- fitView
- getDefaultViewPoint
- init
- loadDicom
- loadGltf
- loadMetadataUrl
- loadNrrd
- loadNrrdTexture3d
- loadOBJ
- loadView
- loadViewUrl
- onRenderCameraChange
- onWindowResize
- pickModel
- pickSpecifiedModel
- removeLights
- removePreRenderCallbackFunction
- render
- requestRenderIfNotRequested
- setCameraPose
- setDepth
- setDicomFilesOrder
- setViewPoint
- updateBackground
- updateControls
- updateDisplay
- updateLights
- updateModelChildrenVisualisation
Constructors
constructor
• new copperSceneOnDemond(container, renderer, opt?)
opt.controls picks the controls class, as it already did on copperScene. New in 3.9.0 -- this class hardcoded OrbitControls before, so passing the option produced no error and no effect.
The DEFAULT stays OrbitControls, which is what this class has always built. It differs from copperScene's default (Copper3dTrackballControls) on purpose: changing it would silently swap the controls under every existing on-demand viewer.
Note that the renderer's own options.controls is deliberately NOT consulted. It has never had any effect here, so honouring it now would change behaviour for anyone who set it and never noticed.
Parameters
| Name | Type |
|---|---|
container | HTMLDivElement |
renderer | WebGLRenderer |
opt? | ICopperSceneOpts |
Overrides
Defined in
src/Scene/copperSceneOnDemond.ts:37
Properties
ambientLight
• ambientLight: AmbientLight
Inherited from
Defined in
camera
• camera: PerspectiveCamera | OrthographicCamera
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:30
cameraPositionFlag
• cameraPositionFlag: boolean = false
Inherited from
Defined in
container
• container: HTMLDivElement
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:28
content
• content: Group<Object3DEventMap>
Inherited from
Defined in
controls
• controls: Copper3dTrackballControls | OrbitControls<Camera> | TrackballControls
Overrides
Defined in
src/Scene/copperSceneOnDemond.ts:19
copperControl
• copperControl: Controls
Inherited from
Defined in
copperOrthographicCamera
• copperOrthographicCamera: OrthographicCamera
Inherited from
baseScene.copperOrthographicCamera
Defined in
src/Scene/commonSceneMethod.ts:33
copperPerspectiveCamera
• copperPerspectiveCamera: PerspectiveCamera
Inherited from
baseScene.copperPerspectiveCamera
Defined in
src/Scene/commonSceneMethod.ts:32
depthStep
• Protected depthStep: number = 0.4
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:45
directionalLight
• directionalLight: DirectionalLight
Inherited from
Defined in
exportContent
• exportContent: Group<Object3DEventMap>
Inherited from
Defined in
isHalfed
• isHalfed: boolean = false
Inherited from
Defined in
isResize
• isResize: boolean = false
Defined in
src/Scene/copperSceneOnDemond.ts:21
pickableObjects
• Protected pickableObjects: Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>[] = []
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:47
preRenderCallbackFunctions
• Protected preRenderCallbackFunctions: preRenderCallbackFunctionType
Inherited from
baseScene.preRenderCallbackFunctions
Defined in
src/Scene/commonSceneMethod.ts:43
renderNrrdVolume
• Protected renderNrrdVolume: boolean = false
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:41
renderRequested
• renderRequested: undefined | boolean = false
Defined in
src/Scene/copperSceneOnDemond.ts:20
renderer
• renderer: WebGLRenderer
Inherited from
Defined in
scene
• scene: Scene<Object3DEventMap>
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:29
sceneName
• sceneName: string = ""
Inherited from
Defined in
sort
• Protected sort: boolean = true
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:44
subCamera
• subCamera: null | PerspectiveCamera = null
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:37
subCopperControl
• Protected subCopperControl: null | Controls = null
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:40
subDiv
• subDiv: null | HTMLDivElement = null
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:35
subRender
• Protected subRender: null | WebGLRenderer = null
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:39
subScene
• subScene: Scene<Object3DEventMap>
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:36
viewPoint
• viewPoint: CameraViewPoint
Inherited from
Defined in
vignette
• vignette: undefined | customMeshType
Inherited from
Defined in
Methods
addLights
▸ addLights(): void
Returns
void
Inherited from
Defined in
addObject
▸ addObject(obj): void
Parameters
| Name | Type |
|---|---|
obj | any |
Returns
void
Inherited from
Defined in
addPreRenderCallbackFunction
▸ addPreRenderCallbackFunction(callbackFunction): number
Registers a per-frame callback and returns its id, for removePreRenderCallbackFunction.
Parameters
| Name | Type |
|---|---|
callbackFunction | Function |
Returns
number
Inherited from
baseScene.addPreRenderCallbackFunction
Defined in
src/Scene/commonSceneMethod.ts:109
addSubView
▸ addSubView(): HTMLDivElement
create a new sub view to display models
Returns
HTMLDivElement
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:159
confirmResize
▸ confirmResize(): void
Returns
void
Defined in
src/Scene/copperSceneOnDemond.ts:153
createDemoMesh
▸ createDemoMesh(): void
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:82
dispose
▸ dispose(): void
Releases what this scene attached OUTSIDE itself.
The resize listener the constructor puts on window used to have no counterpart: every scene ever created stayed subscribed for the life of the page, kept alive by the closure, and went on calling requestRenderIfNotRequested -- and so onWindowResize, which resizes the SHARED renderer -- long after it stopped being displayed. An app that creates a scene per case leaks one of those per case.
Does not touch the scene graph or the renderer: what a scene's contents are worth keeping is the caller's decision, and the renderer is shared with every other scene. disposeScene(renderer, name) is the one that tears the contents down.
Deliberately NOT controls.dispose(). That path ends in domElement.style.touchAction = "", and every scene here shares one canvas -- only connect() sets it back to "none". Disposing one scene's controls would kill touch rotation on the canvas for the rest of the session. Disabling them is enough.
Safe to call twice.
Returns
void
Defined in
src/Scene/copperSceneOnDemond.ts:181
fitView
▸ fitView(preset, aspect, bounds, margin?): boolean
Re-frames the camera on bounds, keeping the preset's view direction and up and replacing only its distance. Returns false when there is nothing to do -- an orthographic camera (no field of view to fit against), or a preset whose eye sits exactly on its target.
Does not render: the caller decides when to draw, which matters here because this scene renders on demand.
Parameters
| Name | Type |
|---|---|
preset | CameraViewPoint |
aspect | number |
bounds | FitBounds |
margin? | number |
Returns
boolean
Defined in
src/Scene/copperSceneOnDemond.ts:122
getDefaultViewPoint
▸ getDefaultViewPoint(): CameraViewPoint
Returns
Inherited from
Defined in
init
▸ init(): void
Returns
void
Inherited from
Defined in
loadDicom
▸ loadDicom(urls, opts?): void
Parameters
| Name | Type |
|---|---|
urls | string | string[] |
opts? | dicomLoaderOptsType |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:183
loadGltf
▸ loadGltf(url, callback?, opts?): void
Parameters
| Name | Type |
|---|---|
url | string |
callback? | (content: Group<Object3DEventMap>) => void |
opts? | GltfLoadOpts |
Returns
void
Defined in
src/Scene/copperSceneOnDemond.ts:70
loadMetadataUrl
▸ loadMetadataUrl(url): void
Parameters
| Name | Type |
|---|---|
url | string |
Returns
void
Inherited from
Defined in
loadNrrd
▸ loadNrrd(url, loadingBar, segmentation, callback?, opts?): void
Parameters
| Name | Type |
|---|---|
url | string |
loadingBar | loadingBarType |
segmentation | boolean |
callback? | (volume: any, nrrdMeshes: nrrdMeshesType, nrrdSlices: nrrdSliceType, gui?: GUI) => void |
opts? | optsType |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:299
loadNrrdTexture3d
▸ loadNrrdTexture3d(url, callback?): void
Parameters
| Name | Type |
|---|---|
url | string |
callback? | (volume: any, gui?: GUI) => void |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:323
loadOBJ
▸ loadOBJ(url, callback?, opts?): void
Parameters
| Name | Type |
|---|---|
url | string |
callback? | (mesh: Group<Object3DEventMap>) => void |
opts? | Object |
opts.color | string |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:335
loadView
▸ loadView(viewpointData): void
Parameters
| Name | Type |
|---|---|
viewpointData | CameraViewPoint |
Returns
void
Inherited from
Defined in
loadViewUrl
▸ loadViewUrl(url): void
Parameters
| Name | Type |
|---|---|
url | string |
Returns
void
Inherited from
Defined in
onRenderCameraChange
▸ onRenderCameraChange(): void
Returns
void
Inherited from
baseScene.onRenderCameraChange
Defined in
onWindowResize
▸ onWindowResize(): void
Returns
void
Inherited from
Defined in
pickModel
▸ pickModel(content, callback, options?): void
Parameters
| Name | Type |
|---|---|
content | Group<Object3DEventMap> |
callback | (selectMesh: undefined | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>) => void |
options? | string[] |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:117
pickSpecifiedModel
▸ pickSpecifiedModel(content, mousePosition): Object
Parameters
| Name | Type |
|---|---|
content | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>[] |
mousePosition | mouseMovePositionType |
Returns
Object
| Name | Type |
|---|---|
intersectedObject | null | Object3D<Object3DEventMap> |
intersects | Intersection<Object3D<Object3DEventMap>>[] |
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:139
removeLights
▸ removeLights(): void
Returns
void
Inherited from
Defined in
removePreRenderCallbackFunction
▸ removePreRenderCallbackFunction(id): void
Parameters
| Name | Type |
|---|---|
id | number |
Returns
void
Inherited from
baseScene.removePreRenderCallbackFunction
Defined in
src/Scene/commonSceneMethod.ts:113
render
▸ render(): void
Returns
void
Overrides
Defined in
src/Scene/copperSceneOnDemond.ts:193
requestRenderIfNotRequested
▸ requestRenderIfNotRequested(): void
Returns
void
Defined in
src/Scene/copperSceneOnDemond.ts:200
setCameraPose
▸ setCameraPose(pose): void
Moves the camera to pose and syncs the controls' orbit pivot with it. Without that last part the next drag silently undoes the move -- see Controls/setCameraPose.ts.
Does not render; the caller decides when to draw.
Parameters
| Name | Type |
|---|---|
pose | Pose |
Returns
void
Defined in
src/Scene/copperSceneOnDemond.ts:149
setDepth
▸ setDepth(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:97
setDicomFilesOrder
▸ setDicomFilesOrder(value): void
Parameters
| Name | Type |
|---|---|
value | "ascending" | "descending" |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:100
setViewPoint
▸ setViewPoint(camera, target?): CameraViewPoint
Parameters
| Name | Type |
|---|---|
camera | PerspectiveCamera |
target? | number[] |
Returns
Inherited from
Defined in
updateBackground
▸ updateBackground(color1, color2): void
Parameters
| Name | Type |
|---|---|
color1 | string |
color2 | string |
Returns
void
Inherited from
Defined in
updateControls
▸ updateControls(camera): void
Parameters
| Name | Type |
|---|---|
camera | PerspectiveCamera | OrthographicCamera |
Returns
void
Inherited from
Defined in
src/Scene/commonSceneMethod.ts:314
updateDisplay
▸ updateDisplay(state): void
Parameters
| Name | Type |
|---|---|
state | baseStateType |
Returns
void
Inherited from
Defined in
updateLights
▸ updateLights(state): void
Parameters
| Name | Type |
|---|---|
state | baseStateType |
Returns
void
Inherited from
Defined in
updateModelChildrenVisualisation
▸ updateModelChildrenVisualisation(child): void
Parameters
| Name | Type |
|---|---|
child | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap> |
Returns
void
Inherited from
baseScene.updateModelChildrenVisualisation