Table of Contents

Class ModelContainer3DX

Namespace
HelixToolkit.Avalonia.SharpDX
Assembly
HelixToolkit.Avalonia.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, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, IModelContainer, IRenderHost, IGUID, IDisposable
Inheritance
AvaloniaObject
Animatable
StyledElement
Visual
Layoutable
Interactive
InputElement
Control
TemplatedControl
ItemsControl
ModelContainer3DX
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
IStyleable
INamed
IInputElement
IDataTemplateHost
ISetterValue
IChildIndexProvider
Inherited Members
ItemsControl.ItemContainerThemeProperty
ItemsControl.ItemCountProperty
ItemsControl.ItemsPanelProperty
ItemsControl.ItemsSourceProperty
ItemsControl.ItemTemplateProperty
ItemsControl.DisplayMemberBindingProperty
ItemsControl.IndexFromContainer(Control)
ItemsControl.ItemFromContainer(Control)
ItemsControl.GetRealizedContainers()
ItemsControl.ItemsControlFromItemContainer(Control)
ItemsControl.ClearContainerForItemOverride(Control)
ItemsControl.OnApplyTemplate(TemplateAppliedEventArgs)
ItemsControl.OnGotFocus(GotFocusEventArgs)
ItemsControl.OnKeyDown(KeyEventArgs)
ItemsControl.OnCreateAutomationPeer()
ItemsControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
ItemsControl.RefreshContainers()
ItemsControl.DisplayMemberBinding
ItemsControl.ItemContainerGenerator
ItemsControl.Items
ItemsControl.ItemContainerTheme
ItemsControl.ItemCount
ItemsControl.ItemsPanel
ItemsControl.ItemsSource
ItemsControl.ItemTemplate
ItemsControl.Presenter
ItemsControl.ItemsPanelRoot
ItemsControl.ItemsView
ItemsControl.DefaultRecycleKey
ItemsControl.ContainerPrepared
ItemsControl.ContainerIndexChanged
ItemsControl.ContainerClearing
TemplatedControl.BackgroundProperty
TemplatedControl.BackgroundSizingProperty
TemplatedControl.BorderBrushProperty
TemplatedControl.BorderThicknessProperty
TemplatedControl.CornerRadiusProperty
TemplatedControl.FontFamilyProperty
TemplatedControl.FontFeaturesProperty
TemplatedControl.FontSizeProperty
TemplatedControl.FontStyleProperty
TemplatedControl.FontWeightProperty
TemplatedControl.FontStretchProperty
TemplatedControl.ForegroundProperty
TemplatedControl.PaddingProperty
TemplatedControl.TemplateProperty
TemplatedControl.IsTemplateFocusTargetProperty
TemplatedControl.TemplateAppliedEvent
TemplatedControl.GetIsTemplateFocusTarget(Control)
TemplatedControl.ApplyTemplate()
TemplatedControl.GetTemplateFocusTarget()
TemplatedControl.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
TemplatedControl.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
TemplatedControl.OnTemplateChanged(AvaloniaPropertyChangedEventArgs)
TemplatedControl.Background
TemplatedControl.BackgroundSizing
TemplatedControl.BorderBrush
TemplatedControl.BorderThickness
TemplatedControl.CornerRadius
TemplatedControl.FontFamily
TemplatedControl.FontFeatures
TemplatedControl.FontSize
TemplatedControl.FontStyle
TemplatedControl.FontWeight
TemplatedControl.FontStretch
TemplatedControl.Foreground
TemplatedControl.Padding
TemplatedControl.Template
TemplatedControl.TemplateApplied
Control.FocusAdornerProperty
Control.TagProperty
Control.ContextMenuProperty
Control.ContextFlyoutProperty
Control.RequestBringIntoViewEvent
Control.ContextRequestedEvent
Control.LoadedEvent
Control.UnloadedEvent
Control.SizeChangedEvent
Control.OnLoaded(RoutedEventArgs)
Control.OnUnloaded(RoutedEventArgs)
Control.OnSizeChanged(SizeChangedEventArgs)
Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)
Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.OnPointerReleased(PointerReleasedEventArgs)
Control.OnKeyUp(KeyEventArgs)
Control.FocusAdorner
Control.DataTemplates
Control.ContextMenu
Control.ContextFlyout
Control.IsLoaded
Control.Tag
Control.ContextRequested
Control.Loaded
Control.Unloaded
Control.SizeChanged
InputElement.FocusableProperty
InputElement.IsEnabledProperty
InputElement.IsEffectivelyEnabledProperty
InputElement.CursorProperty
InputElement.IsKeyboardFocusWithinProperty
InputElement.IsFocusedProperty
InputElement.IsHitTestVisibleProperty
InputElement.IsPointerOverProperty
InputElement.IsTabStopProperty
InputElement.GotFocusEvent
InputElement.LostFocusEvent
InputElement.KeyDownEvent
InputElement.KeyUpEvent
InputElement.TabIndexProperty
InputElement.TextInputEvent
InputElement.TextInputMethodClientRequestedEvent
InputElement.PointerEnteredEvent
InputElement.PointerExitedEvent
InputElement.PointerMovedEvent
InputElement.PointerPressedEvent
InputElement.PointerReleasedEvent
InputElement.PointerCaptureLostEvent
InputElement.PointerWheelChangedEvent
InputElement.TappedEvent
InputElement.HoldingEvent
InputElement.DoubleTappedEvent
InputElement.Focus(NavigationMethod, KeyModifiers)
InputElement.OnTextInput(TextInputEventArgs)
InputElement.OnPointerEntered(PointerEventArgs)
InputElement.OnPointerExited(PointerEventArgs)
InputElement.OnPointerMoved(PointerEventArgs)
InputElement.OnPointerPressed(PointerPressedEventArgs)
InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)
InputElement.OnPointerWheelChanged(PointerWheelEventArgs)
InputElement.UpdateIsEffectivelyEnabled()
InputElement.Focusable
InputElement.IsEnabled
InputElement.Cursor
InputElement.IsKeyboardFocusWithin
InputElement.IsFocused
InputElement.IsHitTestVisible
InputElement.IsPointerOver
InputElement.IsTabStop
InputElement.IsEffectivelyEnabled
InputElement.TabIndex
InputElement.KeyBindings
InputElement.IsEnabledCore
InputElement.GestureRecognizers
InputElement.GotFocus
InputElement.LostFocus
InputElement.KeyDown
InputElement.KeyUp
InputElement.TextInput
InputElement.TextInputMethodClientRequested
InputElement.PointerEntered
InputElement.PointerExited
InputElement.PointerMoved
InputElement.PointerPressed
InputElement.PointerReleased
InputElement.PointerCaptureLost
InputElement.PointerWheelChanged
InputElement.Tapped
InputElement.Holding
InputElement.DoubleTapped
Interactive.RaiseEvent(RoutedEventArgs)
Interactive.BuildEventRoute(RoutedEvent)
Layoutable.DesiredSizeProperty
Layoutable.WidthProperty
Layoutable.HeightProperty
Layoutable.MinWidthProperty
Layoutable.MaxWidthProperty
Layoutable.MinHeightProperty
Layoutable.MaxHeightProperty
Layoutable.MarginProperty
Layoutable.HorizontalAlignmentProperty
Layoutable.VerticalAlignmentProperty
Layoutable.UseLayoutRoundingProperty
Layoutable.UpdateLayout()
Layoutable.Measure(Size)
Layoutable.Arrange(Rect)
Layoutable.InvalidateMeasure()
Layoutable.InvalidateArrange()
Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])
Layoutable.AffectsArrange<T>(params AvaloniaProperty[])
Layoutable.MeasureCore(Size)
Layoutable.ArrangeCore(Rect)
Layoutable.OnMeasureInvalidated()
Layoutable.OnVisualParentChanged(Visual, Visual)
Layoutable.Width
Layoutable.Height
Layoutable.MinWidth
Layoutable.MaxWidth
Layoutable.MinHeight
Layoutable.MaxHeight
Layoutable.Margin
Layoutable.HorizontalAlignment
Layoutable.VerticalAlignment
Layoutable.DesiredSize
Layoutable.IsMeasureValid
Layoutable.IsArrangeValid
Layoutable.UseLayoutRounding
Layoutable.EffectiveViewportChanged
Layoutable.LayoutUpdated
Visual.BoundsProperty
Visual.ClipToBoundsProperty
Visual.ClipProperty
Visual.IsVisibleProperty
Visual.OpacityProperty
Visual.OpacityMaskProperty
Visual.EffectProperty
Visual.HasMirrorTransformProperty
Visual.RenderTransformProperty
Visual.RenderTransformOriginProperty
Visual.FlowDirectionProperty
Visual.VisualParentProperty
Visual.ZIndexProperty
Visual.GetFlowDirection(Visual)
Visual.SetFlowDirection(Visual, FlowDirection)
Visual.InvalidateVisual()
Visual.Render(DrawingContext)
Visual.AffectsRender<T>(params AvaloniaProperty[])
Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
Visual.InvalidateMirrorTransform()
Visual.Bounds
Visual.ClipToBounds
Visual.Clip
Visual.IsEffectivelyVisible
Visual.IsVisible
Visual.Opacity
Visual.OpacityMask
Visual.Effect
Visual.HasMirrorTransform
Visual.RenderTransform
Visual.RenderTransformOrigin
Visual.FlowDirection
Visual.ZIndex
Visual.VisualChildren
Visual.VisualRoot
Visual.BypassFlowDirectionPolicies
Visual.AttachedToVisualTree
Visual.DetachedFromVisualTree
StyledElement.DataContextProperty
StyledElement.NameProperty
StyledElement.ParentProperty
StyledElement.TemplatedParentProperty
StyledElement.ThemeProperty
StyledElement.BeginInit()
StyledElement.EndInit()
StyledElement.ApplyStyling()
StyledElement.InitializeIfNeeded()
StyledElement.OnDataContextBeginUpdate()
StyledElement.OnDataContextEndUpdate()
StyledElement.OnInitialized()
StyledElement.Name
StyledElement.Classes
StyledElement.DataContext
StyledElement.IsInitialized
StyledElement.Styles
StyledElement.StyleKey
StyledElement.Resources
StyledElement.TemplatedParent
StyledElement.Theme
StyledElement.LogicalChildren
StyledElement.PseudoClasses
StyledElement.StyleKeyOverride
StyledElement.Parent
StyledElement.ActualThemeVariant
StyledElement.AttachedToLogicalTree
StyledElement.DetachedFromLogicalTree
StyledElement.DataContextChanged
StyledElement.Initialized
StyledElement.ResourcesChanged
StyledElement.ActualThemeVariantChanged
Animatable.TransitionsProperty
Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
Animatable.Transitions
AvaloniaObject.CheckAccess()
AvaloniaObject.VerifyAccess()
AvaloniaObject.ClearValue(AvaloniaProperty)
AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)
AvaloniaObject.ClearValue<T>(StyledProperty<T>)
AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)
AvaloniaObject.GetHashCode()
AvaloniaObject.GetValue(AvaloniaProperty)
AvaloniaObject.GetValue<T>(StyledProperty<T>)
AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)
AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)
AvaloniaObject.IsAnimating(AvaloniaProperty)
AvaloniaObject.IsSet(AvaloniaProperty)
AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
AvaloniaObject.Bind(AvaloniaProperty, IBinding)
AvaloniaObject.CoerceValue(AvaloniaProperty)
AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
AvaloniaObject.InheritanceParent
AvaloniaObject.this[AvaloniaProperty]
AvaloniaObject.this[IndexerDescriptor]
AvaloniaObject.PropertyChanged

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 AvaloniaProperty EffectsManagerProperty

Field Value

AvaloniaProperty

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.

[TypeConverter(typeof(Color4Converter))]
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>