Table of Contents

Class SceneNode2D

Namespace
HelixToolkit.SharpDX.Model.Scene2D
Assembly
HelixToolkit.SharpDX.dll
public abstract class SceneNode2D : DisposeObject, IDisposable, IHitable2D
Inheritance
SceneNode2D
Implements
Derived
Inherited Members

Constructors

SceneNode2D()

Initializes a new instance of the SceneNode2D class.

public SceneNode2D()

Properties

ClipEnabled

public bool ClipEnabled { get; }

Property Value

bool

ClipToBound

public bool ClipToBound { get; set; }

Property Value

bool

DesiredSize

Gets the size of the desired size after measure.

public Vector2 DesiredSize { get; }

Property Value

Vector2

The size of the desired.

DpiScale

public float DpiScale { get; }

Property Value

float

EnableBitmapCache

Gets or sets a value indicating whether [enable bitmap cache].

public bool EnableBitmapCache { get; set; }

Property Value

bool

true if [enable bitmap cache]; otherwise, false.

GUID

Gets the unique identifier.

public Guid GUID { get; }

Property Value

Guid

The unique identifier.

Height

public float Height { get; set; }

Property Value

float

HorizontalAlignment

public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

IsArrangeDirty

Gets or sets a value indicating whether this instance is arrange dirty.

public bool IsArrangeDirty { get; protected set; }

Property Value

bool

true if this instance is arrange dirty; otherwise, false.

IsAttached

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

public bool IsAttached { get; }

Property Value

bool

true if this instance is attached; otherwise, false.

IsBitmapCacheValid

Gets or sets a value indicating whether this instance is bitmap cache valid.

public bool IsBitmapCacheValid { get; set; }

Property Value

bool

true if this instance is bitmap cache valid; otherwise, false.

IsHitTestVisible

Gets or sets a value indicating whether this instance is hit test visible.

public bool IsHitTestVisible { get; set; }

Property Value

bool

true if this instance is hit test visible; otherwise, false.

IsMeasureDirty

Gets or sets a value indicating whether this instance is measure dirty.

public bool IsMeasureDirty { get; protected set; }

Property Value

bool

true if this instance is measure dirty; otherwise, false.

IsMouseOver

Gets or sets a value indicating whether this instance is mouse over.

public bool IsMouseOver { get; set; }

Property Value

bool

true if this instance is mouse over; otherwise, false.

IsRenderable

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

public bool IsRenderable { get; }

Property Value

bool

true if this instance is renderable; otherwise, false.

IsTransformDirty

Gets or sets a value indicating whether this instance is transform dirty.

public bool IsTransformDirty { get; }

Property Value

bool

true if this instance is transform dirty; otherwise, false.

IsVisualDirty

Gets or sets a value indicating whether this instance is visual dirty.

public bool IsVisualDirty { get; set; }

Property Value

bool

true if this instance is visual dirty; otherwise, false.

Items

Gets the items as readonly. Expose for outside for UI access or bindings

public ReadOnlyObservableFastList<SceneNode2D> Items { get; }

Property Value

ReadOnlyObservableFastList<SceneNode2D>

The items.

LayoutBound

Gets the size of the actual layout bound without margin.

public RectangleF LayoutBound { get; }

Property Value

RectangleF

LayoutBoundWithTransform

Gets or sets the layout bound with transform.

public RectangleF LayoutBoundWithTransform { get; }

Property Value

RectangleF

The layout bound with transform.

LayoutClipBound

Gets or sets the layout clip bound. This bound includes the margin.

public RectangleF LayoutClipBound { get; }

Property Value

RectangleF

The layout clip bound.

LayoutOffsets

public Vector2 LayoutOffsets { get; }

Property Value

Vector2

LayoutTranslate

Gets or sets the layout translate.

public Matrix3x2 LayoutTranslate { get; set; }

Property Value

Matrix3x2

The layout translate.

Margin

public Thickness Margin { get; set; }

Property Value

Thickness

MarginWidthHeight

protected Vector2 MarginWidthHeight { get; }

Property Value

Vector2

MaximumHeight

public float MaximumHeight { get; set; }

Property Value

float

MaximumWidth

public float MaximumWidth { get; set; }

Property Value

float

MinimumHeight

public float MinimumHeight { get; set; }

Property Value

float

MinimumWidth

public float MinimumWidth { get; set; }

Property Value

float

ModelMatrix

Gets or sets the model matrix.

public Matrix3x2 ModelMatrix { get; set; }

Property Value

Matrix3x2

The model matrix.

Parent

Gets or sets the parent.

public SceneNode2D? Parent { get; set; }

Property Value

SceneNode2D

The parent.

ParentMatrix

Gets or sets the parent matrix.

public Matrix3x2 ParentMatrix { get; set; }

Property Value

Matrix3x2

The parent matrix.

RenderCore

Gets or sets the render core.

public RenderCore2D RenderCore { get; }

Property Value

RenderCore2D

The render core.

RenderHost

Gets or sets the render host.

protected IRenderHost? RenderHost { get; }

Property Value

IRenderHost

The render host.

RenderSize

Gets the render size. Same as the LayoutBound size

public Vector2 RenderSize { get; }

Property Value

Vector2

The size of the render.

RenderTransformOrigin

public Vector2 RenderTransformOrigin { get; set; }

Property Value

Vector2

TotalModelMatrix

Gets or sets the total model matrix.

public Matrix3x2 TotalModelMatrix { get; }

Property Value

Matrix3x2

The total model matrix.

UnclippedDesiredSize

Gets the size of the unclipped desired size after measure.

public Vector2 UnclippedDesiredSize { get; }

Property Value

Vector2

The size of the unclipped desired.

VerticalAlignment

public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Visibility

Gets or sets a value indicating whether this SceneNode2D is visible.

public Visibility Visibility { get; set; }

Property Value

Visibility

true if visible; otherwise, false.

Width

public float Width { get; set; }

Property Value

float

WrapperSource

Gets or sets the wrapper source used to link the external wrapper with the node.

public object WrapperSource { get; set; }

Property Value

object

The hit test source.

Methods

Arrange(RectangleF)

public void Arrange(RectangleF rect)

Parameters

rect RectangleF

ArrangeOverride(RectangleF)

protected virtual RectangleF ArrangeOverride(RectangleF finalSize)

Parameters

finalSize RectangleF

Returns

RectangleF

Attach(IRenderHost?)

Attaches the element to the specified host. To overide Attach, please override OnAttach(IRenderHost) function.

Attach Flow: Set RenderHost -> Get Effect -> OnAttach(IRenderHost) -> OnAttach(IRenderHost) -> InvalidateRender()

public void Attach(IRenderHost? host)

Parameters

host IRenderHost

The host.

CanHitTest()

Determines whether this instance [can hit test].

protected virtual bool CanHitTest()

Returns

bool

true if this instance [can hit test]; otherwise, false.

CanRender(RenderContext2D)

Determine if this can be rendered.

protected virtual bool CanRender(RenderContext2D context)

Parameters

context RenderContext2D

Returns

bool

CreateRenderCore()

Creates the render core.

protected virtual RenderCore2D CreateRenderCore()

Returns

RenderCore2D

Detach()

Detaches this instance.

public void Detach()

HitTest(Vector2, out HitTest2DResult?)

Hits the test.

public bool HitTest(Vector2 mousePoint, out HitTest2DResult? hitResult)

Parameters

mousePoint Vector2

The mouse point.

hitResult HitTest2DResult

The hit result.

Returns

bool

InvalidateAll()

public void InvalidateAll()

InvalidateArrange()

public void InvalidateArrange()

InvalidateMeasure()

public void InvalidateMeasure()

InvalidateRender()

Invalidates the render.

public void InvalidateRender()

InvalidateTransform()

public void InvalidateTransform()

InvalidateVisual()

public void InvalidateVisual()

Measure(Vector2)

public void Measure(Vector2 size)

Parameters

size Vector2

MeasureOverride(Vector2)

protected virtual Vector2 MeasureOverride(Vector2 availableSize)

Parameters

availableSize Vector2

Returns

Vector2

OnAttach(IRenderHost)

To override Attach routine, please override this.

protected virtual bool OnAttach(IRenderHost host)

Parameters

host IRenderHost

Returns

bool

Return true if attached

OnDetach()

Called when [detach].

protected virtual void OnDetach()

OnDispose(bool)

Disposes of object resources.

protected override void OnDispose(bool disposeManagedResources)

Parameters

disposeManagedResources bool

If true, managed resources should be disposed of in addition to unmanaged resources.

OnHitTest(ref Vector2, out HitTest2DResult?)

Called when [hit test].

protected abstract bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult? hitResult)

Parameters

mousePoint Vector2

The mouse point.

hitResult HitTest2DResult

The hit result.

Returns

bool

OnRender(RenderContext2D)

Called when [render].

protected virtual void OnRender(RenderContext2D context)

Parameters

context RenderContext2D

The context.

Render(RenderContext2D)

Renders the element in the specified context. To override Render, please override OnRender(RenderContext2D)

Uses CanRender(RenderContext2D) to call OnRender or not.

public void Render(RenderContext2D context)

Parameters

context RenderContext2D

The context.

RenderBitmapCache(RenderContext2D)

Renders the bitmap cache to a render target only.

public void RenderBitmapCache(RenderContext2D context)

Parameters

context RenderContext2D

The context.

SetAffectsMeasure<T>(ref T, T)

protected bool SetAffectsMeasure<T>(ref T backingField, T value)

Parameters

backingField T
value T

Returns

bool

Type Parameters

T

SetAffectsRender<T>(ref T, T)

protected bool SetAffectsRender<T>(ref T backingField, T value)

Parameters

backingField T
value T

Returns

bool

Type Parameters

T

TransformChanged(ref Matrix3x2)

Transforms the changed.

protected virtual void TransformChanged(ref Matrix3x2 totalTransform)

Parameters

totalTransform Matrix3x2

The total transform.

TraverseUp(SceneNode2D, Func<SceneNode2D, bool>)

protected static void TraverseUp(SceneNode2D core, Func<SceneNode2D, bool> action)

Parameters

core SceneNode2D
action Func<SceneNode2D, bool>

Update(RenderContext2D)

Updates the specified context.

public virtual void Update(RenderContext2D context)

Parameters

context RenderContext2D

The context.

Events

Attached

Occurs when [on attached].

public event EventHandler? Attached

Event Type

EventHandler

Detached

Occurs when [on detached].

public event EventHandler? Detached

Event Type

EventHandler

OnTransformChanged

Occurs when [on transform changed].

public event EventHandler<Transform2DArgs>? OnTransformChanged

Event Type

EventHandler<Transform2DArgs>

UpdateRequested

Occurs when [on update].

public event EventHandler<SceneNode2D.UpdateEventArgs>? UpdateRequested

Event Type

EventHandler<SceneNode2D.UpdateEventArgs>