Click or drag to resize

SceneVisitor Class

This class tries to serve three goals
  1. As a base class for visitor patterns. Users can add visitor methods and provide code for different types of visited items.
  2. As building block for enumerators. Visitor methods can yield an enumeration.
  3. As a toolset to implement transformations on scenes. Transformations operate on scenes and alter their structure.
Visitors derived from this class may implement their own Visit methods for all kinds of scene graph elements. Visitor methods can be defined for scene nodes (although many implementations will most likely NOT have a very big inheritance tree for nodes) as well as for scene components. A Visitor method can be any instance method (not static) taking one parameter either derived from SceneNodeContainer or derived from SceneComponentContainer. To mark such a method as a Visitor method it needs to be decorated with the VisitMethodAttribute attribute. Visitor methods can have arbitrary names and don't necessarily need to be virtual.
Inheritance Hierarchy

Namespace:  Fusee.Xene
Assembly:  Fusee.Xene (in Fusee.Xene.dll) Version: 0.7.0.0 (0.7.0.0)
Syntax
C#
public class SceneVisitor

The SceneVisitor type exposes the following members.

Constructors
  NameDescription
Public methodSceneVisitor
Initializes a new instance of the SceneVisitor class
Top
Properties
  NameDescription
Protected propertyCurrentComponent
Returns the currently visited component during a traversal.
Protected propertyCurrentNode
Returns currently visited node during a traversal.
Protected propertyYieldEnumeration
Gets a value indicating whether the current enumeration should yield.
Protected propertyYieldOnCurrentComponent
Can be called in derived visitors. Set this property to true during traversals to make the visitor yield the current component when used as an enumerator.
Protected propertyYieldOnCurrentNode
Can be called in derived visitors. Set this property to true during traversals to make the visitor yield the current node when used as an enumerator.
Top
Methods
  NameDescription
Protected methodEnumInit
Enumerator Building Block to be called in derived Visitors acting as enumerators. Use this to initialize the traversing enumeration on a list of (root) nodes.
Protected methodEnumMoveNext
This method implements a re-entrant (in terms of yield, not multi-threading) non-recursive traversal over combined node and component trees. Call this method in derived classes implementing enumerators, like in the various find extension methods or the ViseratorTItem, TState
Protected methodEnumMoveNextNoComponent
Continue a currently active enumeration. Call all registered Visit methods. Visitor methods may set YieldOnCurrentComponent or YieldOnCurrentNode to true to signal the enumration to yield.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodInitState
Method is called when traversal starts to initialize the traversal state. Override this method in derived classes to initialize any state.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodPopState
Method is called when going up one hierarchy level while traversing. Override this method to perform pop on any self-defined state.
Protected methodPushState
Method is called when going down one hierarchy level while traversing. Override this method to push any self-defined state.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTraverse(SceneNodeContainer)
Start traversing a scene graph starting with the given root node. Performs a recursive depth-first traversal from the speciefiedd root.
Public methodTraverse(IEnumerableSceneNodeContainer)
Start traversing a list of nodes. Performs a recursive depth-first traversal over the list starting with the first node in the list.
Top
See Also