/// <summary> /// Static helper used by ModelVisual3D and Viewport3DVisual to hit test /// against their children collections. /// </summary> internal static HitTestResultBehavior HitTestChildren( HitTestFilterCallback filterCallback, RayHitTestParameters rayParams, IVisual3DContainer container) { if (container != null) { int childrenCount = container.GetChildrenCount(); for (int i = childrenCount - 1; i >= 0; i--) { Visual3D child = container.GetChild(i); // Visuall3D.RayHitTest does not apply the Visual3D's Transform. We need to // transform into the content's space before hit testing. Transform3D transform = child.Transform; rayParams.PushVisualTransform(transform); // Perform the hit-test against the child. HitTestResultBehavior result = child.RayHitTest(filterCallback, rayParams); rayParams.PopTransform(transform); if (result == HitTestResultBehavior.Stop) { return HitTestResultBehavior.Stop; } } } return HitTestResultBehavior.Continue; }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors internal Visual3DCollection(IVisual3DContainer owner) { _owner = owner; }