Click or drag to resize
AB4D logo

SceneNodeVisual3D Class

SceneNodeVisual3D is a ModelVisual3D object that can show a DXEngine's SceneNode inside WPF 3D objects.
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.Media.Media3DVisual3D
        System.Windows.Media.Media3DModelVisual3D
          Ab3d.VisualsBaseDXVisual3D
            Ab3d.VisualsSceneNodeVisual3D
              Ab3d.VisualsPixelsVisual3D

Namespace: Ab3d.Visuals
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public class SceneNodeVisual3D : BaseDXVisual3D

The SceneNodeVisual3D type exposes the following members.

Constructors
 NameDescription
Public methodSceneNodeVisual3D Constructor
Top
Properties
 NameDescription
Public propertyIsWpf3DVisible Gets a Boolean that specifies if this BaseDXVisual3D can show its content when rendered with WPF 3D objects.
(Overrides BaseDXVisual3DIsWpf3DVisible)
Public propertySceneNode Gets the SceneNode that is shown with this SceneNodeVisual3D. The SceneNode is set in the constructor and cannot be changed.
Top
Extension Methods
 NameDescription
Public Extension MethodClearDXAttribute Clears the value from DXAttributeType so that IsDXAttributeSet(Visual3D, DXAttributeType) method returns false for that DXAttributeType.
(Defined by Extensions)
Public Extension MethodGetDXAttribute Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Visual3D, DXAttributeType) or GetDXAttributeOrDefaultT(Visual3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
(Defined by Extensions)
Public Extension MethodGetDXAttributeCollection Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
(Defined by Extensions)
Public Extension MethodGetDXAttributeOrDefaultT Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then a default value for the type T is returned.
(Defined by Extensions)
Public Extension MethodGetDXAttributeOrDefaultT Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then the specified defaultValue is returned.
(Defined by Extensions)
Public Extension MethodIsDXAttributeSet Returns true if the specified attributeType was set (result is true even if the value is null).
(Defined by Extensions)
Public Extension MethodSetDXAttribute Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
(Defined by Extensions)
Top
Remarks

SceneNodeVisual3D is a ModelVisual3D object that can show a DXEngine's SceneNode inside WPF 3D objects.

When SceneNodeVisual3D is rendered inside DXEngine, the SceneNode and its children are rendered. The WPF objects that are set to Content property are not shown (the Content is shown only when SceneNodeVisual3D is rendered with WPF rendering).

SceneNodeVisual3D can have Transform property set to any WPF transformation. This can be used to position, scale or rotate the 3D objects defined in the SceneNode.

SceneNodeVisual3D also provides a protected virtual Dispose method that can be override by derived class to dispose its resources. The Dispose method is called from the SceneNode's Disposing event handler.

Example

The following example shows how to use SceneNodeVisual3D to show WpfOptimizedModel3DGroupNode that is created from a Model3DGroup. This way all the memory used for WPF 3D objects can be freed.

C#
var wpfOptimizedModel3DGroupNode = new WpfOptimizedModel3DGroupNode(model3DGroup);
wpfOptimizedModel3DGroupNode.AutomaticallyClearWpfObjectsAfterInitialization = true;

var sceneNodeVisual3D = new SceneNodeVisual3D(wpfOptimizedModel3DGroupNode);
sceneNodeVisual3D.Transform = new TranslateTransform3D(100, 0, 0);

MainViewport.Children.Add(sceneNodeVisual3D);
See Also