View
Python API functions
Read time 28 minutesLast updated 19 hours ago
configureFunctionLogger
Parametersview.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Type | Name | Description |
|---|---|---|
| String | functionName | |
| Boolean | enableFunction | |
| Boolean | enableParameters | |
| Boolean | enableExecutionTime |
destroyContext
Destroy the Vulkan instance. All existing viewers and gpuScenes will also be destroyed and all view module properties will be reset.view.destroyContext()
suitableGPUAvailable
Returns true if a suitable device is found.Returnsview.suitableGPUAvailable() -> core.Bool
Type | Name | Description |
|---|---|---|
| Bool | found | True if a suitable device was found. |
Animation Player
applyPlayingAnimations
Apply the animations.
Parametersview.applyPlayingAnimations(time)
Type | Name | Description |
|---|---|---|
| AnimationTime | time | Current time. |
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
getAnimationPlayerInfo
Packs all AnimationPlayer-related info about an animation in an object.
Parametersview.getAnimationPlayerInfo(animation) -> view.AnimationPlayerInfo
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to get info of. |
Type | Name | Description |
|---|---|---|
| AnimationPlayerInfo | animationPlayerInfo |
- view.applyPlayingAnimations
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
isAnimationPlaying
Is this animation playing?.
Parametersview.isAnimationPlaying(animation) -> core.Bool
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to check. |
Type | Name | Description |
|---|---|---|
| Bool | playingValue |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
pauseAllAnimation
Pauses all animations.
See also:view.pauseAllAnimation()
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
pauseAnimation
Pauses an animation.
Parametersview.pauseAnimation(animation)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to pause. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
playAnimation
Plays an animation.
Parametersview.playAnimation(animation, speed=1, loop=False)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to play. |
| Double | speed | Speed. |
| Boolean | loop | Should the animation loop?. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
resumeAllAnimation
Resumes all animations.
See also:view.resumeAllAnimation()
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
resumeAnimation
Resumes an animation.
Parametersview.resumeAnimation(animation)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to resume. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
setAnimationFrame
Set animation's current frame.
Parametersview.setAnimationFrame(animation, frame)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to set frame. |
| AnimationTime | frame | Frame to set. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
setAnimationLoop
Set animation's looping status.
Parametersview.setAnimationLoop(animation, loop)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to set loop status. |
| Boolean | loop | Should the animation loop?. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationSpeed
- view.stopAllAnimation
- view.stopAnimation
setAnimationSpeed
Set animation's playing speed.
Parameters See also:view.setAnimationSpeed(animation, speed)
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.stopAllAnimation
- view.stopAnimation
stopAllAnimation
Stops all animations.
Parametersview.stopAllAnimation(applyDefault=True)
Type | Name | Description |
|---|---|---|
| Bool | applyDefault | Should the default position be applied. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAnimation
stopAnimation
Stops an animation.
Parametersview.stopAnimation(animation, applyDefault=True)
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to stop. |
| Bool | applyDefault | Should the default position be applied. |
- view.applyPlayingAnimations
- view.getAnimationPlayerInfo
- view.isAnimationPlaying
- view.pauseAllAnimation
- view.pauseAnimation
- view.playAnimation
- view.resumeAllAnimation
- view.resumeAnimation
- view.setAnimationFrame
- view.setAnimationLoop
- view.setAnimationSpeed
- view.stopAllAnimation
D3D11 interop
getD3D11Texture
Parameters Returnsview.getD3D11Texture(renderMap, viewer=-1) -> view.D3D11Texture
Type | Name | Description |
|---|---|---|
| D3D11Texture | handle |
OpenGL interop
getGLTextureHandle
Parameters Returnsview.getGLTextureHandle(renderMap, viewer=-1) -> view.GLTextureHandle
Type | Name | Description |
|---|---|---|
| GLTextureHandle | handle |
Vulkan interop
getVulkanTexture
Parameters Returnsview.getVulkanTexture(renderMap, viewer=-1) -> view.VulkanTexture
Type | Name | Description |
|---|---|---|
| VulkanTexture | handle |
gpu scene
createGPUScene
Parametersview.createGPUScene(roots, constructEdges=False, useIsolate=True) -> view.GPUScene
Type | Name | Description |
|---|---|---|
| OccurrenceList | roots | Roots of the subtrees that will be uploaded to GPU. |
| Bool | constructEdges | Construct buffer to render edges colored by topology (slower to construct). |
| Bool | useIsolate | Indicates if the isolate manager should be used for visibility. |
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the newly created GPU Scene. |
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
destroyGPUScene
Parametersview.destroyGPUScene(scene)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | GPU Scene to destroy (previously created by createGPUScene). |
- view.createGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
getGlobalGPUScene
Returns (and create if it does not exist) a global GPU scene (with the scene root) to be used commonly by several clients.Returnsview.getGlobalGPUScene() -> view.GPUScene
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the global GPU Scene. |
- view.createGPUScene
- view.destroyGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
getLastAABB
Return the lastAABB computed during a frame drawing, requires the viewer property ComputeLastAABB to be True.Parameters Returnsview.getLastAABB(scene, viewer) -> geom.AABB
Type | Name | Description |
|---|---|---|
| AABB | aabb | The last scene AABB computed during the last frame. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
getOccurrenceIndex
Returns the occurrence index in the viewer buffers. Can be used for mapping an index retrieved in a GLTextureHandle id map.Parametersview.getOccurrenceIndex(occurrence, scene) -> core.UInt
Type | Name | Description |
|---|---|---|
| Occurrence | occurrence | Occurrence identifier. |
| GPUScene | scene | Scene identifier. |
Type | Name | Description |
|---|---|---|
| UInt | index | Occurrence index. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
getSceneIndex
Returns the GPU scene index in the viewer buffers. Can be used for mapping an index retrieved in a GLTextureHandle id map.Parameters Returnsview.getSceneIndex(scene, viewer) -> core.UInt
Type | Name | Description |
|---|---|---|
| UInt | index | GPU scene index. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
lockGPUSceneUpdate
Lock the mutex that ensure no update of the gpu scene is done between lock/unlock.Parametersview.lockGPUSceneUpdate(scene)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to lock update for. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
lockGPUScenesUpdate
Lock the mutex that ensure no update of multiple gpu scenes is done between lock/unlock.Parametersview.lockGPUScenesUpdate(scenes)
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to lock update for. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
tryLockGPUSceneUpdate
Try to lock the mutex that ensure no update of the gpu scene is done between lock/unlock, returns true if the mutex has been locked, false if it was already locked.Parametersview.tryLockGPUSceneUpdate(scene) -> core.Bool
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to try to lock update for. |
Type | Name | Description |
|---|---|---|
| Bool | locked | True if the mutex has been successfully locked. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
tryLockGPUScenesUpdate
Try to lock the mutex that ensure no update of multiple gpu scenes is done between lock/unlock, returns true if the mutex has been locked, false if it was already locked.Parametersview.tryLockGPUScenesUpdate(scenes) -> core.BoolList
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to try to lock update for. |
Type | Name | Description |
|---|---|---|
| BoolList | locked | For each scene, true if the mutex has been successfully locked. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
unlockGPUSceneUpdate
Unlock the mutex that ensure no update of the gpu scene is done between lock/unlock.Parametersview.unlockGPUSceneUpdate(scene)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to unlock update for. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUScenesUpdate
unlockGPUScenesUpdate
Unlock the mutex that ensure no update of multiple gpu scenes is done between lock/unlock.Parametersview.unlockGPUScenesUpdate(scenes)
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to unlock update for. |
- view.createGPUScene
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
offscreen
addGPUScene
Add a GPU scene to a viewer.Parametersview.addGPUScene(scene, viewer=-1)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | GPU Scene to render in the viewer. |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
createViewer
Create a new viewer.Parametersview.createViewer(width, height, sharedContext=view.GraphicsContext(), nbViews=1) -> view.Viewer
Type | Name | Description |
|---|---|---|
| Int | width | Width of the viewer framebuffer. |
| Int | height | Height of the viewer framebuffer. |
| GraphicsContext | sharedContext | Interop context handle. |
| Int | nbViews | Nb views. |
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
- view.addGPUScene
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
destroyViewer
Parametersview.destroyViewer(viewer)
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to destroy. |
- view.addGPUScene
- view.createViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
drawCappingPlane
Create an occurrence that holds the mesh of the surfaces that have been cut by the cutting plane.Parametersview.drawCappingPlane(cuttingPlane) -> scene.Occurrence
Type | Name | Description |
|---|---|---|
| Component | cuttingPlane | Cutting plane component for which we create the capping plane. |
Type | Name | Description |
|---|---|---|
| Occurrence | root | The created occurrence. |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getAutoClipping
Automatically compute the near and far planes depending on the scene.Parametersview.getAutoClipping(viewer=-1, cameraPos) -> geom.Vector2
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| Vector3 | cameraPos |
Type | Name | Description |
|---|---|---|
| Vector2 | clipping |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getCameraFrontAxis
Get the front axis of the nth view matrix of a given viewer.Parametersview.getCameraFrontAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| UInt | matrixIndex | Index of the view matrix to use. |
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getCameraPosition
Get the position of the nth view matrix of a given viewer.Parametersview.getCameraPosition(viewer=-1, matrixIndex=0) -> geom.Vector3
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| UInt | matrixIndex | Index of the view matrix to use. |
Type | Name | Description |
|---|---|---|
| Vector3 | position |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getCameraRightAxis
Get the right axis of the nth view matrix of a given viewer.Parametersview.getCameraRightAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| UInt | matrixIndex | Index of the view matrix to use. |
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getCameraUpAxis
Get the up axis of the nth view matrix of a given viewer.Parametersview.getCameraUpAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| UInt | matrixIndex | Index of the view matrix to use. |
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getViewerProperty
Get a viewer property value.Parametersview.getViewerProperty(propertyName, viewer=-1) -> core.String
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Type | Name | Description |
|---|---|---|
| String | propertyValue |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getViewerPropertyInfo
Get a viewer property info.Parametersview.getViewerPropertyInfo(propertyName, viewer=-1) -> core.PropertyInfo
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Type | Name | Description |
|---|---|---|
| PropertyInfo | propertyInfo |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getViewerSize
Retrieve the viewport size of a viewer.Parametersview.getViewerSize(viewer=-1) -> core.Int, core.Int
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
getViewerStats
Returns the number of rendered occurrences and triangles. (Warning: this function does not handle isolate nor invertVisibility viewer property).Parametersview.getViewerStats(viewer=-1) -> core.Int, core.Int
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Type | Name | Description |
|---|---|---|
| Int | renderedOccurrences | Number of rendered occurrences. |
| Int | renderedTriangles | Number of rendered triangles. |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
identifySelectedEdges
Identify selected edges.
Parametersview.identifySelectedEdges(scene)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to identify the edges from. |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
invertSelectPrimitives
Invert the selection of the primitives (polygons, surfaces) contained in the given rectangle.Parameters See also:view.invertSelectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
listViewerProperties
Get the list of viewer properties.Parametersview.listViewerProperties(viewer=-1) -> core.PropertyInfoList
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Type | Name | Description |
|---|---|---|
| PropertyInfoList | properties |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
pick
Parameters Returnsview.pick(x, y, viewer=-1) -> scene.Occurrence, geom.Point3, core.Ident
Type | Name | Description |
|---|---|---|
| Occurrence | occurrence | Picked occurrence, 0 if not occurrence picked. |
| Point3 | position | World space position of the picking point. |
| Ident | primitiveId | Depending of the Part shape representation, it can be a triangle/quadrangle index (Mesh) or a Face identifier (BRep). |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
pickRectangle
Parameters Returnsview.pickRectangle(xMin, xMax, yMin, yMax, viewer=-1, inDepth=False) -> scene.OccurrenceList
Type | Name | Description |
|---|---|---|
| OccurrenceList | occurrences | List of picked occurrences. |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
refreshViewer
Refresh the viewer.Parametersview.refreshViewer(viewer=-1)
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to refresh. |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
removeGPUScene
Remove a viewer root.Parametersview.removeGPUScene(scene, viewer=-1)
Type | Name | Description |
|---|---|---|
| GPUScene | scene | GPU Scene to remove from the viewer. |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
resizeViewer
Parametersview.resizeViewer(width, height, viewer=-1)
Type | Name | Description |
|---|---|---|
| Int | width | Width of the viewer framebuffer. |
| Int | height | Height of the viewer framebuffer. |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
selectPrimitives
Select the primitives (polygons, surfaces) contained in the given rectangle.Parameters See also:view.selectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.setDefaultViewerId
- view.setViewerProperty
- view.unselectPrimitives
setDefaultViewerId
Set default viewer id. This viewer will be used in other functions taking a Viewer as a parameter. Useful if a viewer needs to be shared across different contexts.Parametersview.setDefaultViewerId(viewer)
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setViewerProperty
- view.unselectPrimitives
setViewerProperty
Set a viewer property value.Parametersview.setViewerProperty(propertyName, propertyValue, viewer=-1)
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| String | propertyValue | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.unselectPrimitives
unselectPrimitives
Unselect the primitives (polygons, surfaces) contained in the given rectangle.Parameters See also:view.unselectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
- view.addGPUScene
- view.createViewer
- view.destroyViewer
- view.drawCappingPlane
- view.getAutoClipping
- view.getCameraFrontAxis
- view.getCameraPosition
- view.getCameraRightAxis
- view.getCameraUpAxis
- view.getViewerProperty
- view.getViewerPropertyInfo
- view.getViewerSize
- view.getViewerStats
- view.identifySelectedEdges
- view.invertSelectPrimitives
- view.listViewerProperties
- view.pick
- view.pickRectangle
- view.refreshViewer
- view.removeGPUScene
- view.resizeViewer
- view.selectPrimitives
- view.setDefaultViewerId
- view.setViewerProperty
raw images
getCompositedImage
Parametersview.getCompositedImage(viewer) -> material.ImageDefinition
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
Type | Name | Description |
|---|---|---|
| ImageDefinition | image | Returned composited image. |
getRenderMapImage
Parameters Returnsview.getRenderMapImage(viewer, renderMap) -> material.ImageDefinition
Type | Name | Description |
|---|---|---|
| ImageDefinition | image | Returned composited image. |
takeScreenshot
Parametersview.takeScreenshot(fileName, viewer)
Type | Name | Description |
|---|---|---|
| OutputFilePath | fileName | Path where to save the screenshot. |
| Viewer | viewer |
streaming
createStreamedViewer
Create a viewer for streaming.Parametersview.createStreamedViewer(width, height, encoderSettings=None, useWebRTC=False, webRTCInfo=None) -> view.StreamedViewerInfo
Type | Name | Description |
|---|---|---|
| Int | width | Width of the viewer framebuffer. |
| Int | height | Height of the viewer framebuffer. |
| EncoderSettings | encoderSettings | Settings used for the encoder. |
| Boolean | useWebRTC | Switch between raw websockets and webRTC. |
| WebRTCInfo | webRTCInfo | Info for web rtc signaling connection. |
Type | Name | Description |
|---|---|---|
| StreamedViewerInfo | streamedViewerInfo | Port and host for stream connection. |
resizeStreamedViewer
Parametersview.resizeStreamedViewer(width, height, viewer=-1, encoderSettings=None)
Type | Name | Description |
|---|---|---|
| Int | width | Width of the viewer framebuffer. |
| Int | height | Height of the viewer framebuffer. |
| Viewer | viewer | |
| EncoderSettings | encoderSettings | Settings used for the encoder. |
startRecording
Record viewer in a file.Parametersview.startRecording(filePath, viewer, encoderSettings=None)
Type | Name | Description |
|---|---|---|
| String | filePath | File in which video while be saved. |
| Viewer | viewer | Viewer to use for recording video. |
| EncoderSettings | encoderSettings | Settings used for the encoder. |
stopRecording
Stop recording video.Parametersview.stopRecording(viewer)
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to use for recording video. |
viewer matrices
fitCamera
Set the viewer matrices to adjust the camera to the scene.Parametersview.fitCamera(direction, cameraType=1, fov=90, viewer=-1, fitToOccurrences=[])
Type | Name | Description |
|---|---|---|
| Vector3 | direction | Camera direction. |
| CameraType | cameraType | Camera type, Orthographic or Perspective. |
| Angle | fov | Field of view (perspective mode only). |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| OccurrenceList | fitToOccurrences |
getViewerMatrices
Parametersview.getViewerMatrices(viewer=-1) -> geom.Matrix4List, geom.Matrix4List, geom.Vector2
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Type | Name | Description |
|---|---|---|
| Matrix4List | views | |
| Matrix4List | projs | |
| Vector2 | clipping |
setViewerMatrices
Parametersview.setViewerMatrices(views, projs, clipping, viewer=-1)
Type | Name | Description |
|---|---|---|
| Matrix4List | views | |
| Matrix4List | projs | |
| Vector2 | clipping | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
visibility
visibilityShoot
Render one frame of the visibility session.Parametersview.visibilityShoot(viewer=-1, parts=True, patches=True, polygons=True, countOnce=False) -> scene.OccurrenceList
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to use for the visibility shoot. |
| Bool | parts | If false, optimize when parts seen are not wanted. |
| Bool | patches | If false, optimize when patches seen are not wanted. |
| Bool | polygons | If false, optimize when polygons seen are not wanted. |
| Bool | countOnce | Optimize when it is not needed to count the numbers of pixels seen during the session. |
Type | Name | Description |
|---|---|---|
| OccurrenceList | sceneOccurrences | The list of scene paths seen from this shoot. |