View
Python API functions
Read time 28 minutesLast updated 8 months ago
configureFunctionLogger
view.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
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.
view.suitableGPUAvailable() -> core.Bool
Returns
Type | Name | Description |
|---|---|---|
| Bool | found | True if a suitable device was found. |
Animation Player
applyPlayingAnimations
Apply the animations.
view.applyPlayingAnimations(time)
Parameters
Type | Name | Description |
|---|---|---|
| AnimationTime | time | Current time. |
See also:
- 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.
view.getAnimationPlayerInfo(animation) -> view.AnimationPlayerInfo
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to get info of. |
Returns
Type | Name | Description |
|---|---|---|
| AnimationPlayerInfo | animationPlayerInfo |
See also:
- 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?.
view.isAnimationPlaying(animation) -> core.Bool
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to check. |
Returns
Type | Name | Description |
|---|---|---|
| Bool | playingValue |
See also:
- 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.
view.pauseAllAnimation()
See also:
- 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.
view.pauseAnimation(animation)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to pause. |
See also:
- 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.
view.playAnimation(animation, speed=1, loop=False)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to play. |
| Double | speed | Speed. |
| Boolean | loop | Should the animation loop?. |
See also:
- 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.
view.resumeAllAnimation()
See also:
- 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.
view.resumeAnimation(animation)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to resume. |
See also:
- 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.
view.setAnimationFrame(animation, frame)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to set frame. |
| AnimationTime | frame | Frame to set. |
See also:
- 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.
view.setAnimationLoop(animation, loop)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to set loop status. |
| Boolean | loop | Should the animation loop?. |
See also:
- 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.
view.setAnimationSpeed(animation, speed)
Parameters
See also:
- 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.
view.stopAllAnimation(applyDefault=True)
Parameters
Type | Name | Description |
|---|---|---|
| Bool | applyDefault | Should the default position be applied. |
See also:
- 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.
view.stopAnimation(animation, applyDefault=True)
Parameters
Type | Name | Description |
|---|---|---|
| Animation | animation | Animation to stop. |
| Bool | applyDefault | Should the default position be applied. |
See also:
- 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
view.getD3D11Texture(renderMap, viewer=-1) -> view.D3D11Texture
Parameters
Returns
Type | Name | Description |
|---|---|---|
| D3D11Texture | handle |
OpenGL interop
getGLTextureHandle
view.getGLTextureHandle(renderMap, viewer=-1) -> view.GLTextureHandle
Parameters
Returns
Type | Name | Description |
|---|---|---|
| GLTextureHandle | handle |
Vulkan interop
getVulkanTexture
view.getVulkanTexture(renderMap, viewer=-1) -> view.VulkanTexture
Parameters
Returns
Type | Name | Description |
|---|---|---|
| VulkanTexture | handle |
gpu scene
createGPUScene
view.createGPUScene(roots, constructEdges=False, useIsolate=True) -> view.GPUScene
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the newly created GPU Scene. |
See also:
- view.destroyGPUScene
- view.getGlobalGPUScene
- view.getLastAABB
- view.getOccurrenceIndex
- view.getSceneIndex
- view.lockGPUSceneUpdate
- view.lockGPUScenesUpdate
- view.tryLockGPUSceneUpdate
- view.tryLockGPUScenesUpdate
- view.unlockGPUSceneUpdate
- view.unlockGPUScenesUpdate
destroyGPUScene
view.destroyGPUScene(scene)
Parameters
Type | Name | Description |
|---|---|---|
| GPUScene | scene | GPU Scene to destroy (previously created by createGPUScene). |
See also:
- 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.
view.getGlobalGPUScene() -> view.GPUScene
Returns
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the global GPU Scene. |
See also:
- 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.
view.getLastAABB(scene, viewer) -> geom.AABB
Parameters
Returns
Type | Name | Description |
|---|---|---|
| AABB | aabb | The last scene AABB computed during the last frame. |
See also:
- 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.
view.getOccurrenceIndex(occurrence, scene) -> core.UInt
Parameters
Type | Name | Description |
|---|---|---|
| Occurrence | occurrence | Occurrence identifier. |
| GPUScene | scene | Scene identifier. |
Returns
Type | Name | Description |
|---|---|---|
| UInt | index | Occurrence index. |
See also:
- 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.
view.getSceneIndex(scene, viewer) -> core.UInt
Parameters
Returns
Type | Name | Description |
|---|---|---|
| UInt | index | GPU scene index. |
See also:
- 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.
view.lockGPUSceneUpdate(scene)
Parameters
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to lock update for. |
See also:
- 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.
view.lockGPUScenesUpdate(scenes)
Parameters
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to lock update for. |
See also:
- 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.
view.tryLockGPUSceneUpdate(scene) -> core.Bool
Parameters
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to try to lock update for. |
Returns
Type | Name | Description |
|---|---|---|
| Bool | locked | True if the mutex has been successfully locked. |
See also:
- 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.
view.tryLockGPUScenesUpdate(scenes) -> core.BoolList
Parameters
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to try to lock update for. |
Returns
Type | Name | Description |
|---|---|---|
| BoolList | locked | For each scene, true if the mutex has been successfully locked. |
See also:
- 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.
view.unlockGPUSceneUpdate(scene)
Parameters
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to unlock update for. |
See also:
- 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.
view.unlockGPUScenesUpdate(scenes)
Parameters
Type | Name | Description |
|---|---|---|
| GPUSceneList | scenes | Identifiers of the GPU scenes to unlock update for. |
See also:
- 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.
view.addGPUScene(scene, viewer=-1)
Parameters
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). |
See also:
- 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.
view.createViewer(width, height, sharedContext=view.GraphicsContext(), nbViews=1) -> view.Viewer
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
See also:
- 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
view.destroyViewer(viewer)
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to destroy. |
See also:
- 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.
view.drawCappingPlane(cuttingPlane) -> scene.Occurrence
Parameters
Type | Name | Description |
|---|---|---|
| Component | cuttingPlane | Cutting plane component for which we create the capping plane. |
Returns
Type | Name | Description |
|---|---|---|
| Occurrence | root | The created occurrence. |
See also:
- 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.
view.getAutoClipping(viewer=-1, cameraPos) -> geom.Vector2
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| Vector3 | cameraPos |
Returns
Type | Name | Description |
|---|---|---|
| Vector2 | clipping |
See also:
- 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.
view.getCameraFrontAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
See also:
- 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.
view.getCameraPosition(viewer=-1, matrixIndex=0) -> geom.Vector3
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| Vector3 | position |
See also:
- 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.
view.getCameraRightAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
See also:
- 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.
view.getCameraUpAxis(viewer=-1, matrixIndex=0) -> geom.Vector3
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| Vector3 | axis |
See also:
- 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.
view.getViewerProperty(propertyName, viewer=-1) -> core.String
Parameters
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
Type | Name | Description |
|---|---|---|
| String | propertyValue |
See also:
- 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.
view.getViewerPropertyInfo(propertyName, viewer=-1) -> core.PropertyInfo
Parameters
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
Type | Name | Description |
|---|---|---|
| PropertyInfo | propertyInfo |
See also:
- 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.
view.getViewerSize(viewer=-1) -> core.Int, core.Int
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
See also:
- 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).
view.getViewerStats(viewer=-1) -> core.Int, core.Int
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
Type | Name | Description |
|---|---|---|
| Int | renderedOccurrences | Number of rendered occurrences. |
| Int | renderedTriangles | Number of rendered triangles. |
See also:
- 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.
view.identifySelectedEdges(scene)
Parameters
Type | Name | Description |
|---|---|---|
| GPUScene | scene | Identifier of the GPU scene to identify the edges from. |
See also:
- 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.
view.invertSelectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
Parameters
See also:
- 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.
view.listViewerProperties(viewer=-1) -> core.PropertyInfoList
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
Type | Name | Description |
|---|---|---|
| PropertyInfoList | properties |
See also:
- 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
view.pick(x, y, viewer=-1) -> scene.Occurrence, geom.Point3, core.Ident
Parameters
Returns
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). |
See also:
- 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
view.pickRectangle(xMin, xMax, yMin, yMax, viewer=-1, inDepth=False) -> scene.OccurrenceList
Parameters
Returns
Type | Name | Description |
|---|---|---|
| OccurrenceList | occurrences | List of picked occurrences. |
See also:
- 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.
view.refreshViewer(viewer=-1)
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to refresh. |
See also:
- 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.
view.removeGPUScene(scene, viewer=-1)
Parameters
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). |
See also:
- 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
view.resizeViewer(width, height, viewer=-1)
Parameters
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). |
See also:
- 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.
view.selectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
Parameters
See also:
- 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.
view.setDefaultViewerId(viewer)
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
See also:
- 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.
view.setViewerProperty(propertyName, propertyValue, viewer=-1)
Parameters
Type | Name | Description |
|---|---|---|
| String | propertyName | |
| String | propertyValue | |
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
See also:
- 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.
view.unselectPrimitives(xMin, xMax, yMin, yMax, primitiveType, viewer=-1)
Parameters
See also:
- 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
view.getCompositedImage(viewer) -> material.ImageDefinition
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer |
Returns
Type | Name | Description |
|---|---|---|
| ImageDefinition | image | Returned composited image. |
See also:
getRenderMapImage
view.getRenderMapImage(viewer, renderMap) -> material.ImageDefinition
Parameters
Returns
Type | Name | Description |
|---|---|---|
| ImageDefinition | image | Returned composited image. |
See also:
takeScreenshot
view.takeScreenshot(fileName, viewer)
Parameters
Type | Name | Description |
|---|---|---|
| OutputFilePath | fileName | Path where to save the screenshot. |
| Viewer | viewer |
See also:
streaming
createStreamedViewer
Create a viewer for streaming.
view.createStreamedViewer(width, height, encoderSettings=None, useWebRTC=False, webRTCInfo=None) -> view.StreamedViewerInfo
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| StreamedViewerInfo | streamedViewerInfo | Port and host for stream connection. |
See also:
resizeStreamedViewer
view.resizeStreamedViewer(width, height, viewer=-1, encoderSettings=None)
Parameters
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. |
See also:
startRecording
Record viewer in a file.
view.startRecording(filePath, viewer, encoderSettings=None)
Parameters
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. |
See also:
stopRecording
Stop recording video.
view.stopRecording(viewer)
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer to use for recording video. |
See also:
viewer matrices
fitCamera
Set the viewer matrices to adjust the camera to the scene.
view.fitCamera(direction, cameraType=1, fov=90, viewer=-1, fitToOccurrences=[])
Parameters
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 |
See also:
getViewerMatrices
view.getViewerMatrices(viewer=-1) -> geom.Matrix4List, geom.Matrix4List, geom.Vector2
Parameters
Type | Name | Description |
|---|---|---|
| Viewer | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
Returns
Type | Name | Description |
|---|---|---|
| Matrix4List | views | |
| Matrix4List | projs | |
| Vector2 | clipping |
See also:
setViewerMatrices
view.setViewerMatrices(views, projs, clipping, viewer=-1)
Parameters
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). |
See also:
visibility
visibilityShoot
Render one frame of the visibility session.
view.visibilityShoot(viewer=-1, parts=True, patches=True, polygons=True, countOnce=False) -> scene.OccurrenceList
Parameters
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. |
Returns
Type | Name | Description |
|---|---|---|
| OccurrenceList | sceneOccurrences | The list of scene paths seen from this shoot. |