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
ClipToBound
public bool ClipToBound { get; set; }
Property Value
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
EnableBitmapCache
Gets or sets a value indicating whether [enable bitmap cache].
public bool EnableBitmapCache { get; set; }
Property Value
- bool
trueif [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
HorizontalAlignment
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
IsArrangeDirty
Gets or sets a value indicating whether this instance is arrange dirty.
public bool IsArrangeDirty { get; protected set; }
Property Value
- bool
trueif 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
trueif 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
trueif 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
trueif 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
trueif 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
trueif 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
trueif 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
trueif 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
trueif 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
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
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
MarginWidthHeight
protected Vector2 MarginWidthHeight { get; }
Property Value
MaximumHeight
public float MaximumHeight { get; set; }
Property Value
MaximumWidth
public float MaximumWidth { get; set; }
Property Value
MinimumHeight
public float MinimumHeight { get; set; }
Property Value
MinimumWidth
public float MinimumWidth { get; set; }
Property Value
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
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
Visibility
Gets or sets a value indicating whether this SceneNode2D is visible.
public Visibility Visibility { get; set; }
Property Value
- Visibility
trueif visible; otherwise,false.
Width
public float Width { get; set; }
Property Value
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
rectRectangleF
ArrangeOverride(RectangleF)
protected virtual RectangleF ArrangeOverride(RectangleF finalSize)
Parameters
finalSizeRectangleF
Returns
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
hostIRenderHostThe host.
CanHitTest()
Determines whether this instance [can hit test].
protected virtual bool CanHitTest()
Returns
- bool
trueif this instance [can hit test]; otherwise,false.
CanRender(RenderContext2D)
Determine if this can be rendered.
protected virtual bool CanRender(RenderContext2D context)
Parameters
contextRenderContext2D
Returns
CreateRenderCore()
Creates the render core.
protected virtual RenderCore2D CreateRenderCore()
Returns
Detach()
Detaches this instance.
public void Detach()
HitTest(Vector2, out HitTest2DResult?)
Hits the test.
public bool HitTest(Vector2 mousePoint, out HitTest2DResult? hitResult)
Parameters
mousePointVector2The mouse point.
hitResultHitTest2DResultThe hit result.
Returns
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
sizeVector2
MeasureOverride(Vector2)
protected virtual Vector2 MeasureOverride(Vector2 availableSize)
Parameters
availableSizeVector2
Returns
OnAttach(IRenderHost)
To override Attach routine, please override this.
protected virtual bool OnAttach(IRenderHost host)
Parameters
hostIRenderHost
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
disposeManagedResourcesboolIf 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
mousePointVector2The mouse point.
hitResultHitTest2DResultThe hit result.
Returns
OnRender(RenderContext2D)
Called when [render].
protected virtual void OnRender(RenderContext2D context)
Parameters
contextRenderContext2DThe 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
contextRenderContext2DThe context.
RenderBitmapCache(RenderContext2D)
Renders the bitmap cache to a render target only.
public void RenderBitmapCache(RenderContext2D context)
Parameters
contextRenderContext2DThe context.
SetAffectsMeasure<T>(ref T, T)
protected bool SetAffectsMeasure<T>(ref T backingField, T value)
Parameters
backingFieldTvalueT
Returns
Type Parameters
T
SetAffectsRender<T>(ref T, T)
protected bool SetAffectsRender<T>(ref T backingField, T value)
Parameters
backingFieldTvalueT
Returns
Type Parameters
T
TransformChanged(ref Matrix3x2)
Transforms the changed.
protected virtual void TransformChanged(ref Matrix3x2 totalTransform)
Parameters
totalTransformMatrix3x2The total transform.
TraverseUp(SceneNode2D, Func<SceneNode2D, bool>)
protected static void TraverseUp(SceneNode2D core, Func<SceneNode2D, bool> action)
Parameters
coreSceneNode2DactionFunc<SceneNode2D, bool>
Update(RenderContext2D)
Updates the specified context.
public virtual void Update(RenderContext2D context)
Parameters
contextRenderContext2DThe context.
Events
Attached
Occurs when [on attached].
public event EventHandler? Attached
Event Type
Detached
Occurs when [on detached].
public event EventHandler? Detached
Event Type
OnTransformChanged
Occurs when [on transform changed].
public event EventHandler<Transform2DArgs>? OnTransformChanged
Event Type
UpdateRequested
Occurs when [on update].
public event EventHandler<SceneNode2D.UpdateEventArgs>? UpdateRequested