Table of Contents

Class ModelContainer3DX

Namespace
HelixToolkit.WinUI.SharpDX
Assembly
HelixToolkit.WinUI.SharpDX.dll

Use to contain shared models for multiple viewports.

Suggest to bind effects manager in viewmodel. Assign effect manager from code behind may cause memory leak

public class ModelContainer3DX : HelixItemsControl, IEquatable<DependencyObject>, IAnimationObject, IVisualElement, IVisualElement2, IEquatable<UIElement>, IEquatable<FrameworkElement>, IEquatable<Control>, IItemContainerMapping, IWinRTObject, IDynamicInterfaceCastable, IEquatable<ItemsControl>, IModelContainer, IRenderHost, IGUID, IDisposable
Inheritance
ModelContainer3DX
Implements
IWinRTObject
Inherited Members

Constructors

ModelContainer3DX()

public ModelContainer3DX()

Fields

EffectsManagerProperty

The EffectsManager property. Suggest to bind effects manager in viewmodel. Assign effect manager from code behind may cause memory leak

public static readonly DependencyProperty EffectsManagerProperty

Field Value

DependencyProperty

Properties

ActualHeight

Gets the actual height.

public float ActualHeight { get; }

Property Value

float

The actual height.

ActualWidth

Gets the actual width.

public float ActualWidth { get; }

Property Value

float

The actual width.

ClearColor

Gets or sets the color of the clear.

public Color4 ClearColor { get; set; }

Property Value

Color4

The color of the clear.

Exceptions

NotImplementedException

CurrentRenderHost

public IRenderHost? CurrentRenderHost { get; set; }

Property Value

IRenderHost

D2DTarget

Gets the d2d target.

public D2DTargetProxy? D2DTarget { get; }

Property Value

D2DTargetProxy

The d2d target.

DepthStencilBufferView

Gets the depth stencil buffer view.

public DepthStencilView? DepthStencilBufferView { get; }

Property Value

DepthStencilView

The depth stencil buffer view.

Device

Gets the device.

public Device1? Device { get; }

Property Value

Device1

The device.

Device2D

Gets the device2d.

public Device? Device2D { get; }

Property Value

Device

The device2d.

DpiScale

Gets or sets the dpi scale.

public float DpiScale { get; set; }

Property Value

float

The dpi scale.

EffectsManager

Gets or sets the EffectsManagerProperty.

The EffectsManager property. Suggest bind effects manager in viewmodel. Assign effect manager from code behind may cause memory leak.

public IEffectsManager? EffectsManager { get; set; }

Property Value

IEffectsManager

EnableParallelProcessing

Use separate thread to do non-rendering related tasks during render call.

public bool EnableParallelProcessing { get; set; }

Property Value

bool

EnableRenderFrustum

Gets or sets a value indicating whether [enable render frustum].

public bool EnableRenderFrustum { get; set; }

Property Value

bool

true if [enable render frustum]; otherwise, false.

EnableSharingModelMode

Gets or sets a value indicating whether [enable sharing model mode].

public bool EnableSharingModelMode { get; set; }

Property Value

bool

true if [enable sharing model mode]; otherwise, false.

FeatureLevel

Gets the feature level.

public FeatureLevel FeatureLevel { get; }

Property Value

FeatureLevel

The feature level.

GUID

Gets the unique identifier.

public Guid GUID { get; }

Property Value

Guid

The unique identifier.

ImmediateDeviceContext

Gets the immediate device context.

public DeviceContextProxy? ImmediateDeviceContext { get; }

Property Value

DeviceContextProxy

The immediate device context.

IsBusy

Indicates if DPFCanvas busy on rendering.

public bool IsBusy { get; }

Property Value

bool

IsDeferredLighting

Gets a value indicating whether this instance is deferred lighting.

public bool IsDeferredLighting { get; }

Property Value

bool

true if this instance is deferred lighting; otherwise, false.

IsRendering

Gets or sets a value indicating whether this instance is rendering.

public bool IsRendering { get; set; }

Property Value

bool

true if this instance is rendering; otherwise, false.

IsShadowMapEnabled

Gets or sets a value indicating whether this instance is shadow map enabled.

public bool IsShadowMapEnabled { get; set; }

Property Value

bool

true if this instance is shadow map enabled; otherwise, false.

Exceptions

NotImplementedException

MSAA

Gets or sets the msaa.

public MSAALevel MSAA { get; set; }

Property Value

MSAALevel

The msaa.

MaxFPS

Gets or sets the maximum FPS.

public uint MaxFPS { get; set; }

Property Value

uint

The maximum FPS.

PerFrameFlattenedScene

Gets the current frame renderables for rendering.

public FastList<KeyValuePair<int, SceneNode>> PerFrameFlattenedScene { get; }

Property Value

FastList<KeyValuePair<int, SceneNode>>

The per frame renderable.

PerFrameLights

Gets the current frame Lights for rendering.

public IEnumerable<LightNode?> PerFrameLights { get; }

Property Value

IEnumerable<LightNode>

The per frame renderable.

PerFrameNodesWithPostEffect

Gets the per frame post effect cores.

public FastList<SceneNode> PerFrameNodesWithPostEffect { get; }

Property Value

FastList<SceneNode>

The per frame post effect cores.

PerFrameOpaqueNodes

Gets the per frame general render cores.

public FastList<SceneNode> PerFrameOpaqueNodes { get; }

Property Value

FastList<SceneNode>

The per frame general render cores.

PerFrameOpaqueNodesInFrustum

Gets the per frame opaque nodes in frustum.

public FastList<SceneNode> PerFrameOpaqueNodesInFrustum { get; }

Property Value

FastList<SceneNode>

The per frame opaque nodes in frustum.

PerFrameParticleNodes

Gets the per frame particle nodes. Particle

public FastList<SceneNode> PerFrameParticleNodes { get; }

Property Value

FastList<SceneNode>

The per frame particle nodes.

PerFrameTransparentNodes

Gets the per frame transparent nodes. , Transparent

public FastList<SceneNode> PerFrameTransparentNodes { get; }

Property Value

FastList<SceneNode>

The per frame transparent nodes.

PerFrameTransparentNodesInFrustum

Gets the per frame transparent nodes in frustum.

public FastList<SceneNode> PerFrameTransparentNodesInFrustum { get; }

Property Value

FastList<SceneNode>

The per frame transparent nodes in frustum.

RenderBuffer

Gets the render buffer.

public DX11RenderBufferProxyBase? RenderBuffer { get; }

Property Value

DX11RenderBufferProxyBase

The render buffer.

RenderConfiguration

Gets or sets the render configuration.

public DX11RenderHostConfiguration RenderConfiguration { get; set; }

Property Value

DX11RenderHostConfiguration

The render configuration.

RenderContext

Gets the render context.

public RenderContext? RenderContext { get; }

Property Value

RenderContext

The render context.

RenderStatistics

Gets the render statistics.

public IRenderStatistics? RenderStatistics { get; }

Property Value

IRenderStatistics

The render statistics.

RenderTargetBufferView

Gets the color buffer view.

public RenderTargetView? RenderTargetBufferView { get; }

Property Value

RenderTargetView

The color buffer view.

RenderTechnique

This technique is used for the entire render pass by all Element3D if not specified otherwise in the elements itself

public IRenderTechnique? RenderTechnique { get; set; }

Property Value

IRenderTechnique

Renderables

public IEnumerable<SceneNode?> Renderables { get; }

Property Value

IEnumerable<SceneNode>

Renderer

Renderer

public IRenderer? Renderer { get; }

Property Value

IRenderer

SharedModelContainer

Gets or sets the shared model container.

public IModelContainer? SharedModelContainer { get; set; }

Property Value

IModelContainer

The shared model container.

ShowRenderDetail

Gets or sets a value indicating whether [show statistics].

public RenderDetail ShowRenderDetail { get; set; }

Property Value

RenderDetail

true if [show statistics]; otherwise, false.

Viewport

Gets or sets the viewport.

public IViewport3DX? Viewport { get; set; }

Property Value

IViewport3DX

The viewport.

Methods

Attach(IRenderHost)

Attaches the specified host.

public void Attach(IRenderHost host)

Parameters

host IRenderHost

The host.

AttachViewport3DX(IViewport3DX)

public void AttachViewport3DX(IViewport3DX viewport)

Parameters

viewport IViewport3DX

ClearRenderTarget(DeviceContextProxy, bool, bool)

Clears the render target.

public void ClearRenderTarget(DeviceContextProxy context, bool clearBackBuffer, bool clearDepthStencilBuffer)

Parameters

context DeviceContextProxy

The context.

clearBackBuffer bool

if set to true [clear back buffer].

clearDepthStencilBuffer bool

if set to true [clear depth stencil buffer].

Detach(IRenderHost)

Detaches this instance.

public void Detach(IRenderHost host)

Parameters

host IRenderHost

Exceptions

IndexOutOfRangeException

D3DCounter is negative.

DettachViewport3DX(IViewport3DX)

public void DettachViewport3DX(IViewport3DX viewport)

Parameters

viewport IViewport3DX

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

EndD3D()

Ends the d3 d.

public void EndD3D()

Invalidate(InvalidateTypes)

Invalidate by InvalidateTypes

public void Invalidate(InvalidateTypes type)

Parameters

type InvalidateTypes

InvalidatePerFrameRenderables()

Invalidates the per frame renderables.

public void InvalidatePerFrameRenderables()

InvalidateRender()

Invalidates the render.

public void InvalidateRender()

InvalidateSceneGraph()

Invalidates the scene graph.

public void InvalidateSceneGraph()

Resize(int, int)

Resizes

public void Resize(int width, int height)

Parameters

width int

The width.

height int

The height.

SetDefaultRenderTargets(bool)

Sets the default render targets.

public void SetDefaultRenderTargets(bool clear = true)

Parameters

clear bool

if set to true [clear].

StartD3D(int, int)

Starts the d3 d.

public void StartD3D(int width, int height)

Parameters

width int

The width.

height int

The height.

StartRendering()

Starts the rendering. Trigger StartRenderLoop

public void StartRendering()

StopRendering()

Stops the rendering. Trigger StopRenderLoop

public void StopRendering()

UpdateAndRender()

Updates the and render.

public bool UpdateAndRender()

Returns

bool

Events

EffectsManagerChanged

Occurs when effects manager is changed.

public event EventHandler<IEffectsManager>? EffectsManagerChanged

Event Type

EventHandler<IEffectsManager>

ExceptionOccurred

Fired whenever an exception occurred on this object.

public event EventHandler<RelayExceptionEventArgs>? ExceptionOccurred

Event Type

EventHandler<RelayExceptionEventArgs>

OnNewRenderTargetTexture

Occurs when [on new render target texture].

public event EventHandler<Texture2DArgs>? OnNewRenderTargetTexture

Event Type

EventHandler<Texture2DArgs>

Rendered

Occurs when each render frame finished rendering.

public event EventHandler? Rendered

Event Type

EventHandler

SceneGraphUpdated

Occurs when [scene graph updated].

public event EventHandler? SceneGraphUpdated

Event Type

EventHandler

StartRenderLoop

Occurs when [start render loop].

public event EventHandler<EventArgs>? StartRenderLoop

Event Type

EventHandler<EventArgs>

StopRenderLoop

Occurs when [stop render loop].

public event EventHandler<EventArgs>? StopRenderLoop

Event Type

EventHandler<EventArgs>