# ViewInterface

> Class

Inheritance

* [object](https://learn.microsoft.com/dotnet/api/system.object)
* [Interface](./api_interface)
* ViewInterface

***

Inherited Members

* [Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\))

* [Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\))

* [GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

* [GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)

* [MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

* [ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

* [ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

***

Namespace: UnityEngine.Pixyz.View

```csharp
public class ViewInterface : Interface
```

## Methods

### GetLastError

```csharp
public static string GetLastError()
```

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### ConfigureFunctionLogger

```csharp
[HandleProcessCorruptedStateExceptions]
public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
```

Parameters

| Type                                                           | Name                | Description |
| -------------------------------------------------------------- | ------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | functionName        |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableFunction      |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableParameters    |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableExecutionTime |             |

### DestroyContext

Destroy the Vulkan instance. All existing viewers and gpuScenes will also be destroyed and all view module properties will be reset.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DestroyContext()
```

### SuitableGPUAvailable

Returns true if a suitable device is found.

```csharp
[HandleProcessCorruptedStateExceptions]
public bool SuitableGPUAvailable()
```

Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### AddAfterFramebufferCreateCallback

```csharp
public uint AddAfterFramebufferCreateCallback(ViewInterface.AfterFramebufferCreateDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                           | Name     | Description |
| ---------------------------------------------------------------------------------------------- | -------- | ----------- |
| [ViewInterface.AfterFramebufferCreateDelegate](./viewinterface_afterframebuffercreatedelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                 | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveAfterFramebufferCreateCallback

```csharp
public void RemoveAfterFramebufferCreateCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### AddAfterViewerPropertyChangedCallback

```csharp
public uint AddAfterViewerPropertyChangedCallback(ViewInterface.AfterViewerPropertyChangedDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                                   | Name     | Description |
| ------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| [ViewInterface.AfterViewerPropertyChangedDelegate](./viewinterface_afterviewerpropertychangeddelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                         | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveAfterViewerPropertyChangedCallback

```csharp
public void RemoveAfterViewerPropertyChangedCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### AddBeforeFramebufferDeleteCallback

```csharp
public uint AddBeforeFramebufferDeleteCallback(ViewInterface.BeforeFramebufferDeleteDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                             | Name     | Description |
| ------------------------------------------------------------------------------------------------ | -------- | ----------- |
| [ViewInterface.BeforeFramebufferDeleteDelegate](./viewinterface_beforeframebufferdeletedelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                   | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveBeforeFramebufferDeleteCallback

```csharp
public void RemoveBeforeFramebufferDeleteCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### AddBeforeViewerPropertyChangedCallback

```csharp
public uint AddBeforeViewerPropertyChangedCallback(ViewInterface.BeforeViewerPropertyChangedDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                                     | Name     | Description |
| -------------------------------------------------------------------------------------------------------- | -------- | ----------- |
| [ViewInterface.BeforeViewerPropertyChangedDelegate](./viewinterface_beforeviewerpropertychangeddelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                           | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveBeforeViewerPropertyChangedCallback

```csharp
public void RemoveBeforeViewerPropertyChangedCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### ApplyPlayingAnimations

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ApplyPlayingAnimations(ulong time)
```

Parameters

| Type                                                          | Name | Description   |
| ------------------------------------------------------------- | ---- | ------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | time | Current time. |

### GetAnimationPlayerInfo

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public AnimationPlayerInfo GetAnimationPlayerInfo(uint animation)
```

Parameters

| Type                                                         | Name      | Description               |
| ------------------------------------------------------------ | --------- | ------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | animation | Animation to get info of. |

Returns

| Type                                              | Description |
| ------------------------------------------------- | ----------- |
| [AnimationPlayerInfo](./view_animationplayerinfo) |             |

### IsAnimationPlaying

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public bool IsAnimationPlaying(uint animation)
```

Parameters

| Type                                                         | Name      | Description         |
| ------------------------------------------------------------ | --------- | ------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | animation | Animation to check. |

Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### PauseAllAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void PauseAllAnimation()
```

### PauseAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void PauseAnimation(uint animation)
```

Parameters

| Type                                                         | Name      | Description         |
| ------------------------------------------------------------ | --------- | ------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | animation | Animation to pause. |

### PlayAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void PlayAnimation(uint animation, double speed = 1, bool loop = false)
```

Parameters

| Type                                                           | Name      | Description                 |
| -------------------------------------------------------------- | --------- | --------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | animation | Animation to play.          |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | speed     | Speed.                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | loop      | Should the animation loop?. |

### ResumeAllAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ResumeAllAnimation()
```

### ResumeAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ResumeAnimation(uint animation)
```

Parameters

| Type                                                         | Name      | Description          |
| ------------------------------------------------------------ | --------- | -------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | animation | Animation to resume. |

### SetAnimationFrame

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetAnimationFrame(uint animation, ulong frame)
```

Parameters

| Type                                                          | Name      | Description             |
| ------------------------------------------------------------- | --------- | ----------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | animation | Animation to set frame. |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | frame     | Frame to set.           |

### SetAnimationLoop

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetAnimationLoop(uint animation, bool loop)
```

Parameters

| Type                                                          | Name      | Description                   |
| ------------------------------------------------------------- | --------- | ----------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | animation | Animation to set loop status. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | loop      | Should the animation loop?.   |

### SetAnimationSpeed

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetAnimationSpeed(uint animation, double speed)
```

Parameters

| Type                                                           | Name      | Description             |
| -------------------------------------------------------------- | --------- | ----------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | animation | Animation to set speed. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | speed     | The speed.              |

### StopAllAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void StopAllAnimation(bool applyDefault = true)
```

Parameters

| Type                                                          | Name         | Description                             |
| ------------------------------------------------------------- | ------------ | --------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | applyDefault | Should the default position be applied. |

### StopAnimation

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void StopAnimation(uint animation, bool applyDefault = true)
```

Parameters

| Type                                                          | Name         | Description                             |
| ------------------------------------------------------------- | ------------ | --------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | animation    | Animation to stop.                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | applyDefault | Should the default position be applied. |

### AddAnimationPausedOrStoppedCallback

```csharp
public uint AddAnimationPausedOrStoppedCallback(ViewInterface.AnimationPausedOrStoppedDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                               | Name     | Description |
| -------------------------------------------------------------------------------------------------- | -------- | ----------- |
| [ViewInterface.AnimationPausedOrStoppedDelegate](./viewinterface_animationpausedorstoppeddelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                     | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveAnimationPausedOrStoppedCallback

```csharp
public void RemoveAnimationPausedOrStoppedCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### AddAnimationPlayedOrResumedCallback

```csharp
public uint AddAnimationPlayedOrResumedCallback(ViewInterface.AnimationPlayedOrResumedDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                               | Name     | Description |
| -------------------------------------------------------------------------------------------------- | -------- | ----------- |
| [ViewInterface.AnimationPlayedOrResumedDelegate](./viewinterface_animationplayedorresumeddelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                     | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveAnimationPlayedOrResumedCallback

```csharp
public void RemoveAnimationPlayedOrResumedCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### AddAnimationPlayingStatusChangedCallback

```csharp
public uint AddAnimationPlayingStatusChangedCallback(ViewInterface.AnimationPlayingStatusChangedDelegate callback, IntPtr userData)
```

Parameters

| Type                                                                                                         | Name     | Description |
| ------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| [ViewInterface.AnimationPlayingStatusChangedDelegate](./viewinterface_animationplayingstatuschangeddelegate) | callback |             |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)                                               | userData |             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### RemoveAnimationPlayingStatusChangedCallback

```csharp
public void RemoveAnimationPlayingStatusChangedCallback(uint id)
```

Parameters

| Type                                                         | Name | Description |
| ------------------------------------------------------------ | ---- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | id   |             |

### GetD3D11Texture

```csharp
[HandleProcessCorruptedStateExceptions]
public IntPtr GetD3D11Texture(RenderMap renderMap, int viewer = -1)
```

Parameters

| Type                                                       | Name      | Description |
| ---------------------------------------------------------- | --------- | ----------- |
| [RenderMap](./view_rendermap)                              | renderMap |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer    |             |

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### GetGLTextureHandle

```csharp
[HandleProcessCorruptedStateExceptions]
public int GetGLTextureHandle(RenderMap renderMap, int viewer = -1)
```

Parameters

| Type                                                       | Name      | Description |
| ---------------------------------------------------------- | --------- | ----------- |
| [RenderMap](./view_rendermap)                              | renderMap |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer    |             |

Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### GetVulkanTexture

```csharp
[HandleProcessCorruptedStateExceptions]
public IntPtr GetVulkanTexture(RenderMap renderMap, int viewer = -1)
```

Parameters

| Type                                                       | Name      | Description |
| ---------------------------------------------------------- | --------- | ----------- |
| [RenderMap](./view_rendermap)                              | renderMap |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer    |             |

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### CreateGPUScene

```csharp
[HandleProcessCorruptedStateExceptions]
public int CreateGPUScene(OccurrenceList roots, bool constructEdges = false, bool useIsolate = true)
```

Parameters

| Type                                                          | Name           | Description                                                                 |
| ------------------------------------------------------------- | -------------- | --------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | roots          | Roots of the subtrees that will be uploaded to GPU.                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | constructEdges | Construct buffer to render edges colored by topology (slower to construct). |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useIsolate     | Indicates if the isolate manager should be used for visibility.             |

Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### DestroyGPUScene

```csharp
[HandleProcessCorruptedStateExceptions]
public void DestroyGPUScene(int scene)
```

Parameters

| Type                                                       | Name  | Description                                                  |
| ---------------------------------------------------------- | ----- | ------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene | GPU Scene to destroy (previously created by createGPUScene). |

### GetGlobalGPUScene

Returns (and create if it does not exist) a global GPU scene (with the scene root) to be used commonly by several clients.

```csharp
[HandleProcessCorruptedStateExceptions]
public int GetGlobalGPUScene()
```

Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### GetLastAABB

Return the lastAABB computed during a frame drawing, requires the viewer property ComputeLastAABB to be True.

```csharp
[HandleProcessCorruptedStateExceptions]
public AABB GetLastAABB(int scene, int viewer)
```

Parameters

| Type                                                       | Name   | Description                                            |
| ---------------------------------------------------------- | ------ | ------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene  | Identifier of the GPU scene to get the last AABB from. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer |                                                        |

Returns

| Type                | Description |
| ------------------- | ----------- |
| [AABB](./geom_aabb) |             |

### GetOccurrenceIndex

Returns the occurrence index in the viewer buffers. Can be used for mapping an index retrieved in a GLTextureHandle id map.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint GetOccurrenceIndex(uint occurrence, int scene)
```

Parameters

| Type                                                         | Name       | Description            |
| ------------------------------------------------------------ | ---------- | ---------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | occurrence | Occurrence identifier. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | scene      | Scene identifier.      |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### GetSceneIndex

Returns the GPU scene index in the viewer buffers. Can be used for mapping an index retrieved in a GLTextureHandle id map.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint GetSceneIndex(int scene, int viewer)
```

Parameters

| Type                                                       | Name   | Description           |
| ---------------------------------------------------------- | ------ | --------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene  | GPU scene identifier. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer identifier.    |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### LockGPUSceneUpdate

Lock the mutex that ensure no update of the gpu scene is done between lock/unlock.

```csharp
[HandleProcessCorruptedStateExceptions]
public void LockGPUSceneUpdate(int scene)
```

Parameters

| Type                                                       | Name  | Description                                     |
| ---------------------------------------------------------- | ----- | ----------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene | Identifier of the GPU scene to lock update for. |

### LockGPUScenesUpdate

Lock the mutex that ensure no update of multiple gpu scenes is done between lock/unlock.

```csharp
[HandleProcessCorruptedStateExceptions]
public void LockGPUScenesUpdate(GPUSceneList scenes)
```

Parameters

| Type                                | Name   | Description                                       |
| ----------------------------------- | ------ | ------------------------------------------------- |
| [GPUSceneList](./view_gpuscenelist) | scenes | Identifiers of the GPU scenes to lock update for. |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public bool TryLockGPUSceneUpdate(int scene)
```

Parameters

| Type                                                       | Name  | Description                                            |
| ---------------------------------------------------------- | ----- | ------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene | Identifier of the GPU scene to try to lock update for. |

Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public BoolList TryLockGPUScenesUpdate(GPUSceneList scenes)
```

Parameters

| Type                                | Name   | Description                                              |
| ----------------------------------- | ------ | -------------------------------------------------------- |
| [GPUSceneList](./view_gpuscenelist) | scenes | Identifiers of the GPU scenes to try to lock update for. |

Returns

| Type                        | Description |
| --------------------------- | ----------- |
| [BoolList](./core_boollist) |             |

### UnlockGPUSceneUpdate

Unlock the mutex that ensure no update of the gpu scene is done between lock/unlock.

```csharp
[HandleProcessCorruptedStateExceptions]
public void UnlockGPUSceneUpdate(int scene)
```

Parameters

| Type                                                       | Name  | Description                                       |
| ---------------------------------------------------------- | ----- | ------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene | Identifier of the GPU scene to unlock update for. |

### UnlockGPUScenesUpdate

Unlock the mutex that ensure no update of multiple gpu scenes is done between lock/unlock.

```csharp
[HandleProcessCorruptedStateExceptions]
public void UnlockGPUScenesUpdate(GPUSceneList scenes)
```

Parameters

| Type                                | Name   | Description                                         |
| ----------------------------------- | ------ | --------------------------------------------------- |
| [GPUSceneList](./view_gpuscenelist) | scenes | Identifiers of the GPU scenes to unlock update for. |

### AddGPUScene

Add a GPU scene to a viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public void AddGPUScene(int scene, int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene  | GPU Scene to render in the viewer.                                                                       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

### CreateViewer

Create a new viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public int CreateViewer(int width, int height, GraphicsContext sharedContext = null, int nbViews = 1)
```

Parameters

| Type                                                       | Name          | Description                       |
| ---------------------------------------------------------- | ------------- | --------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | width         | Width of the viewer framebuffer.  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | height        | Height of the viewer framebuffer. |
| [GraphicsContext](./view_graphicscontext)                  | sharedContext | Interop context handle.           |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | nbViews       | Nb views.                         |

Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### DestroyViewer

```csharp
[HandleProcessCorruptedStateExceptions]
public void DestroyViewer(int viewer)
```

Parameters

| Type                                                       | Name   | Description        |
| ---------------------------------------------------------- | ------ | ------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer to destroy. |

### DrawCappingPlane

Create an occurrence that holds the mesh of the surfaces that have been cut by the cutting plane.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint DrawCappingPlane(uint cuttingPlane)
```

Parameters

| Type                                                         | Name         | Description                                                    |
| ------------------------------------------------------------ | ------------ | -------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | cuttingPlane | Cutting plane component for which we create the capping plane. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### GetAutoClipping

Automatically compute the near and far planes depending on the scene.

```csharp
[HandleProcessCorruptedStateExceptions]
public Point2 GetAutoClipping(int viewer, Point3 cameraPos)
```

Parameters

| Type                                                       | Name      | Description                                                                                              |
| ---------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer    | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [Point3](./geom_point3)                                    | cameraPos |                                                                                                          |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Point2](./geom_point2) |             |

### GetCameraFrontAxis

Get the front axis of the nth view matrix of a given viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public Point3 GetCameraFrontAxis(int viewer = -1, uint matrixIndex = 0)
```

Parameters

| Type                                                         | Name        | Description                                                                                              |
| ------------------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | viewer      | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | matrixIndex | Index of the view matrix to use.                                                                         |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Point3](./geom_point3) |             |

### GetCameraPosition

Get the position of the nth view matrix of a given viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public Point3 GetCameraPosition(int viewer = -1, uint matrixIndex = 0)
```

Parameters

| Type                                                         | Name        | Description                                                                                              |
| ------------------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | viewer      | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | matrixIndex | Index of the view matrix to use.                                                                         |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Point3](./geom_point3) |             |

### GetCameraRightAxis

Get the right axis of the nth view matrix of a given viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public Point3 GetCameraRightAxis(int viewer = -1, uint matrixIndex = 0)
```

Parameters

| Type                                                         | Name        | Description                                                                                              |
| ------------------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | viewer      | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | matrixIndex | Index of the view matrix to use.                                                                         |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Point3](./geom_point3) |             |

### GetCameraUpAxis

Get the up axis of the nth view matrix of a given viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public Point3 GetCameraUpAxis(int viewer = -1, uint matrixIndex = 0)
```

Parameters

| Type                                                         | Name        | Description                                                                                              |
| ------------------------------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | viewer      | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | matrixIndex | Index of the view matrix to use.                                                                         |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Point3](./geom_point3) |             |

### GetViewerProperty

Get a viewer property value.

```csharp
[HandleProcessCorruptedStateExceptions]
public string GetViewerProperty(string propertyName, int viewer = -1)
```

Parameters

| Type                                                           | Name         | Description                                                                                              |
| -------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyName |                                                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer       | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### GetViewerPropertyInfo

Get a viewer property info.

```csharp
[HandleProcessCorruptedStateExceptions]
public PropertyInfo GetViewerPropertyInfo(string propertyName, int viewer = -1)
```

Parameters

| Type                                                           | Name         | Description                                                                                              |
| -------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyName |                                                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer       | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                | Description |
| ----------------------------------- | ----------- |
| [PropertyInfo](./core_propertyinfo) |             |

### GetViewerSize

Retrieve the viewport size of a viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public GetViewerSizeReturn GetViewerSize(int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                              | Description |
| ------------------------------------------------- | ----------- |
| [GetViewerSizeReturn](./view_getviewersizereturn) |             |

### GetViewerStats

Returns the number of rendered occurrences and triangles. (Warning: this function does not handle isolate nor invertVisibility viewer property).

```csharp
[HandleProcessCorruptedStateExceptions]
public GetViewerStatsReturn GetViewerStats(int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                                | Description |
| --------------------------------------------------- | ----------- |
| [GetViewerStatsReturn](./view_getviewerstatsreturn) |             |

### IdentifySelectedEdges

> **Important:**
>
> This function is tagged as experimental.

```csharp
[HandleProcessCorruptedStateExceptions]
public void IdentifySelectedEdges(int scene)
```

Parameters

| Type                                                       | Name  | Description                                             |
| ---------------------------------------------------------- | ----- | ------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene | Identifier of the GPU scene to identify the edges from. |

### InvertSelectPrimitives

Invert the selection of the primitives (polygons, surfaces) contained in the given rectangle.

```csharp
[HandleProcessCorruptedStateExceptions]
public void InvertSelectPrimitives(int xMin, int xMax, int yMin, int yMax, PrimitiveSelectionType primitiveType, int viewer = -1)
```

Parameters

| Type                                                       | Name          | Description |
| ---------------------------------------------------------- | ------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMax          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMax          |             |
| [PrimitiveSelectionType](./view_primitiveselectiontype)    | primitiveType |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer        |             |

### ListViewerProperties

Get the list of viewer properties.

```csharp
[HandleProcessCorruptedStateExceptions]
public PropertyInfoList ListViewerProperties(int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                        | Description |
| ------------------------------------------- | ----------- |
| [PropertyInfoList](./core_propertyinfolist) |             |

### Pick

```csharp
[HandleProcessCorruptedStateExceptions]
public PickReturn Pick(int x, int y, int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description |
| ---------------------------------------------------------- | ------ | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | x      |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | y      |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer |             |

Returns

| Type                            | Description |
| ------------------------------- | ----------- |
| [PickReturn](./view_pickreturn) |             |

### PickRectangle

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList PickRectangle(int xMin, int xMax, int yMin, int yMax, int viewer = -1, bool inDepth = false)
```

Parameters

| Type                                                          | Name    | Description |
| ------------------------------------------------------------- | ------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | xMin    |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | xMax    |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | yMin    |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | yMax    |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | viewer  |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | inDepth |             |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### RefreshViewer

Refresh the viewer.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RefreshViewer(int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description        |
| ---------------------------------------------------------- | ------ | ------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer to refresh. |

### RemoveGPUScene

Remove a viewer root.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemoveGPUScene(int scene, int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | scene  | GPU Scene to remove from the viewer.                                                                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

### ResizeViewer

```csharp
[HandleProcessCorruptedStateExceptions]
public void ResizeViewer(int width, int height, int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | width  | Width of the viewer framebuffer.                                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | height | Height of the viewer framebuffer.                                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

### SelectPrimitives

Select the primitives (polygons, surfaces) contained in the given rectangle.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SelectPrimitives(int xMin, int xMax, int yMin, int yMax, PrimitiveSelectionType primitiveType, int viewer = -1)
```

Parameters

| Type                                                       | Name          | Description |
| ---------------------------------------------------------- | ------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMax          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMax          |             |
| [PrimitiveSelectionType](./view_primitiveselectiontype)    | primitiveType |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer        |             |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetDefaultViewerId(int viewer)
```

Parameters

| Type                                                       | Name   | Description |
| ---------------------------------------------------------- | ------ | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer |             |

### SetViewerProperty

Set a viewer property value.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetViewerProperty(string propertyName, string propertyValue, int viewer = -1)
```

Parameters

| Type                                                           | Name          | Description                                                                                              |
| -------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyName  |                                                                                                          |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyValue |                                                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer        | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

### UnselectPrimitives

Unselect the primitives (polygons, surfaces) contained in the given rectangle.

```csharp
[HandleProcessCorruptedStateExceptions]
public void UnselectPrimitives(int xMin, int xMax, int yMin, int yMax, PrimitiveSelectionType primitiveType, int viewer = -1)
```

Parameters

| Type                                                       | Name          | Description |
| ---------------------------------------------------------- | ------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | xMax          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMin          |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | yMax          |             |
| [PrimitiveSelectionType](./view_primitiveselectiontype)    | primitiveType |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer        |             |

### GetCompositedImage

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageDefinition GetCompositedImage(int viewer)
```

Parameters

| Type                                                       | Name   | Description |
| ---------------------------------------------------------- | ------ | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer |             |

Returns

| Type                                          | Description |
| --------------------------------------------- | ----------- |
| [ImageDefinition](./material_imagedefinition) |             |

### GetRenderMapImage

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageDefinition GetRenderMapImage(int viewer, RenderMap renderMap)
```

Parameters

| Type                                                       | Name      | Description |
| ---------------------------------------------------------- | --------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer    |             |
| [RenderMap](./view_rendermap)                              | renderMap |             |

Returns

| Type                                          | Description |
| --------------------------------------------- | ----------- |
| [ImageDefinition](./material_imagedefinition) |             |

### TakeScreenshot

```csharp
[HandleProcessCorruptedStateExceptions]
public void TakeScreenshot(string fileName, int viewer)
```

Parameters

| Type                                                           | Name     | Description                        |
| -------------------------------------------------------------- | -------- | ---------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | fileName | Path where to save the screenshot. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer   |                                    |

### CreateStreamedViewer

Create a viewer for streaming.

```csharp
[HandleProcessCorruptedStateExceptions]
public StreamedViewerInfo CreateStreamedViewer(int width, int height, EncoderSettings encoderSettings = null, bool useWebRTC = false, WebRTCInfo? webRTCInfo = null)
```

Parameters

| Type                                                          | Name            | Description                               |
| ------------------------------------------------------------- | --------------- | ----------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | width           | Width of the viewer framebuffer.          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | height          | Height of the viewer framebuffer.         |
| [EncoderSettings](./view_encodersettings)                     | encoderSettings | Settings used for the encoder.            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useWebRTC       | Switch between raw websockets and webRTC. |
| [WebRTCInfo](./view_webrtcinfo)                               | webRTCInfo      | Info for web rtc signaling connection.    |

Returns

| Type                                            | Description |
| ----------------------------------------------- | ----------- |
| [StreamedViewerInfo](./view_streamedviewerinfo) |             |

### ResizeStreamedViewer

```csharp
[HandleProcessCorruptedStateExceptions]
public void ResizeStreamedViewer(int width, int height, int viewer = -1, EncoderSettings encoderSettings = null)
```

Parameters

| Type                                                       | Name            | Description                       |
| ---------------------------------------------------------- | --------------- | --------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | width           | Width of the viewer framebuffer.  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | height          | Height of the viewer framebuffer. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer          |                                   |
| [EncoderSettings](./view_encodersettings)                  | encoderSettings | Settings used for the encoder.    |

### StartRecording

Record viewer in a file.

```csharp
[HandleProcessCorruptedStateExceptions]
public void StartRecording(string filePath, int viewer, EncoderSettings encoderSettings = null)
```

Parameters

| Type                                                           | Name            | Description                         |
| -------------------------------------------------------------- | --------------- | ----------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | filePath        | File in which video while be saved. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer          | Viewer to use for recording video.  |
| [EncoderSettings](./view_encodersettings)                      | encoderSettings | Settings used for the encoder.      |

### StopRecording

Stop recording video.

```csharp
[HandleProcessCorruptedStateExceptions]
public void StopRecording(int viewer)
```

Parameters

| Type                                                       | Name   | Description                        |
| ---------------------------------------------------------- | ------ | ---------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer to use for recording video. |

### FitCamera

Set the viewer matrices to adjust the camera to the scene.

```csharp
[HandleProcessCorruptedStateExceptions]
public void FitCamera(Point3 direction, CameraType cameraType = CameraType.Orthographic, double fov = 90, int viewer = -1, OccurrenceList fitToOccurrences = null)
```

Parameters

| Type                                                           | Name             | Description                                                                                              |
| -------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------- |
| [Point3](./geom_point3)                                        | direction        | Camera direction.                                                                                        |
| [CameraType](./view_cameratype)                                | cameraType       | Camera type, Orthographic or Perspective.                                                                |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fov              | Field of view (perspective mode only).                                                                   |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewer           | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |
| [OccurrenceList](./scene_occurrencelist)                       | fitToOccurrences |                                                                                                          |

### GetViewerMatrices

```csharp
[HandleProcessCorruptedStateExceptions]
public GetViewerMatricesReturn GetViewerMatrices(int viewer = -1)
```

Parameters

| Type                                                       | Name   | Description                                                                                              |
| ---------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

Returns

| Type                                                      | Description |
| --------------------------------------------------------- | ----------- |
| [GetViewerMatricesReturn](./view_getviewermatricesreturn) |             |

### SetViewerMatrices

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetViewerMatrices(Matrix4List views, Matrix4List projs, Point2 clipping, int viewer = -1)
```

Parameters

| Type                                                       | Name     | Description                                                                                              |
| ---------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| [Matrix4List](./geom_matrix4list)                          | views    |                                                                                                          |
| [Matrix4List](./geom_matrix4list)                          | projs    |                                                                                                          |
| [Point2](./geom_point2)                                    | clipping |                                                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | viewer   | Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId). |

### VisibilityShoot

Render one frame of the visibility session.

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList VisibilityShoot(int viewer = -1, bool parts = true, bool patches = true, bool polygons = true, bool countOnce = false)
```

Parameters

| Type                                                          | Name      | Description                                                                            |
| ------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | viewer    | Viewer to use for the visibility shoot.                                                |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | parts     | If false, optimize when parts seen are not wanted.                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | patches   | If false, optimize when patches seen are not wanted.                                   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | polygons  | If false, optimize when polygons seen are not wanted.                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | countOnce | Optimize when it is not needed to count the numbers of pixels seen during the session. |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |
