Class TreeTraverser
- Namespace
- HelixToolkit.SharpDX
- Assembly
- HelixToolkit.SharpDX.dll
public static class TreeTraverser
- Inheritance
-
TreeTraverser
- Inherited Members
Methods
ForceUpdateTransformsAndBounds(SceneNode)
Forces to update transform and bounds.
public static void ForceUpdateTransformsAndBounds(this SceneNode root)
Parameters
rootSceneNodeThe root.
ForceUpdateTransformsAndBounds(IEnumerable<SceneNode>)
Forces the update transform and bounds.
public static void ForceUpdateTransformsAndBounds(this IEnumerable<SceneNode> nodes)
Parameters
nodesIEnumerable<SceneNode>The nodes.
PreorderDFT(IEnumerable<SceneNode>, Func<SceneNode, bool>, Stack<IEnumerator<SceneNode>>?)
Pre-ordered depth first traverse
public static IEnumerable<SceneNode> PreorderDFT(this IEnumerable<SceneNode> nodes, Func<SceneNode, bool> condition, Stack<IEnumerator<SceneNode>>? stackCache = null)
Parameters
nodesIEnumerable<SceneNode>conditionFunc<SceneNode, bool>stackCacheStack<IEnumerator<SceneNode>>
Returns
PreorderDFT(IList<SceneNode>, RenderContext, Func<SceneNode, RenderContext, bool>, IList<KeyValuePair<int, SceneNode>>, Stack<KeyValuePair<int, IList<SceneNode>>>?)
Preorders the DFT without using Linq.
public static void PreorderDFT(this IList<SceneNode> nodes, RenderContext context, Func<SceneNode, RenderContext, bool> condition, IList<KeyValuePair<int, SceneNode>> results, Stack<KeyValuePair<int, IList<SceneNode>>>? stackCache = null)
Parameters
nodesIList<SceneNode>The nodes.
contextRenderContextThe context.
conditionFunc<SceneNode, RenderContext, bool>The condition.
resultsIList<KeyValuePair<int, SceneNode>>The results.
stackCacheStack<KeyValuePair<int, IList<SceneNode>>>The stack cache.
PreorderDFTGetCores(IEnumerable<SceneNode>, Func<SceneNode, bool>, Stack<IEnumerator<SceneNode>>?)
Get render cores by Pre-ordered depth first traverse
public static IEnumerable<RenderCore> PreorderDFTGetCores(this IEnumerable<SceneNode> nodes, Func<SceneNode, bool> condition, Stack<IEnumerator<SceneNode>>? stackCache = null)
Parameters
nodesIEnumerable<SceneNode>conditionFunc<SceneNode, bool>stackCacheStack<IEnumerator<SceneNode>>
Returns
PreorderDFTGetCores(IEnumerable<SceneNode2D>, Func<SceneNode2D, bool>, Stack<IEnumerator<SceneNode2D>>?)
Get render cores by Pre-ordered depth first traverse
public static IEnumerable<RenderCore2D?> PreorderDFTGetCores(this IEnumerable<SceneNode2D> nodes, Func<SceneNode2D, bool> condition, Stack<IEnumerator<SceneNode2D>>? stackCache = null)
Parameters
nodesIEnumerable<SceneNode2D>conditionFunc<SceneNode2D, bool>stackCacheStack<IEnumerator<SceneNode2D>>
Returns
PreorderDFTRun(IList<SceneNode2D>, Func<SceneNode2D, bool>, Stack<KeyValuePair<int, IList<SceneNode2D>>>?)
Preorders the DFT without Linq;
public static void PreorderDFTRun(this IList<SceneNode2D> nodes, Func<SceneNode2D, bool> condition, Stack<KeyValuePair<int, IList<SceneNode2D>>>? stackCache = null)
Parameters
nodesIList<SceneNode2D>The nodes.
conditionFunc<SceneNode2D, bool>The condition.
stackCacheStack<KeyValuePair<int, IList<SceneNode2D>>>The stack cache.
Traverse(SceneNode, bool, Stack<IEnumerator<SceneNode>>?)
Traverses the specified only rendering.
public static IEnumerable<SceneNode> Traverse(this SceneNode root, bool onlyRendering = false, Stack<IEnumerator<SceneNode>>? stackCache = null)
Parameters
rootSceneNodeThe root.
onlyRenderingboolif set to
true[only rendering].stackCacheStack<IEnumerator<SceneNode>>The stack cache.
Returns
Traverse(IEnumerable<SceneNode>, bool, Stack<IEnumerator<SceneNode>>?)
Traverses the specified condition.
public static IEnumerable<SceneNode> Traverse(this IEnumerable<SceneNode> nodes, bool onlyRendering = false, Stack<IEnumerator<SceneNode>>? stackCache = null)
Parameters
nodesIEnumerable<SceneNode>The nodes.
onlyRenderingboolOnly the node is currently rendering. The nodes set to be Visible = false or IsRendering = false will not be traversed.
stackCacheStack<IEnumerator<SceneNode>>The stack cache.
Returns
TraverseUp(SceneNode?)
Traverses up to the root
public static IEnumerable<SceneNode> TraverseUp(this SceneNode? node)
Parameters
nodeSceneNodeThe node.