Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / Model3DGroup.cs / 1305600 / Model3DGroup.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description: 3D model collection.
//
// See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht
//
// History:
// 06/28/2003 : t-gregr - Created
//
//---------------------------------------------------------------------------
using System;
using System.Collections;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Windows.Markup;
using MS.Internal;
using MS.Internal.Media3D;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Media3D
{
///
/// 3D model group.
///
[ContentProperty("Children")]
public sealed partial class Model3DGroup : Model3D
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Default constructor.
///
public Model3DGroup() {}
#endregion Constructors
//------------------------------------------------------
//
// Internal Methods
//
//-----------------------------------------------------
#region Internal Methods
internal override void RayHitTestCore(
RayHitTestParameters rayParams)
{
Model3DCollection children = Children;
if (children == null)
{
return;
}
for (int i = children.Count - 1; i >= 0; i--)
{
Model3D child = children.Internal_GetItem(i);
// Perform the hit-test against the child.
child.RayHitTest(rayParams);
}
}
internal override Rect3D CalculateSubgraphBoundsInnerSpace()
{
Model3DCollection children = Children;
if (children == null)
{
return Rect3D.Empty;
}
Rect3D bounds = Rect3D.Empty;
for (int i = 0, count = children.Count; i < count; i++)
{
Model3D child = children.Internal_GetItem(i);
// Calls CSBOS rather than Bounds to avoid ReadPreamble.
bounds.Union(child.CalculateSubgraphBoundsOuterSpace());
}
return bounds;
}
#endregion Internal Methods
//------------------------------------------------------
//
// Internal Properties
//
//------------------------------------------------------
#region Internal Properties
// named EmptyGroup not to collide with public Model3D.Empty
internal static Model3DGroup EmptyGroup
{
get
{
if (s_empty == null)
{
s_empty = new Model3DGroup();
s_empty.Freeze();
}
return s_empty;
}
}
#endregion Internal Properties
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private static Model3DGroup s_empty;
#endregion Private Fields
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description: 3D model collection.
//
// See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht
//
// History:
// 06/28/2003 : t-gregr - Created
//
//---------------------------------------------------------------------------
using System;
using System.Collections;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Windows.Markup;
using MS.Internal;
using MS.Internal.Media3D;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Media3D
{
///
/// 3D model group.
///
[ContentProperty("Children")]
public sealed partial class Model3DGroup : Model3D
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
///
/// Default constructor.
///
public Model3DGroup() {}
#endregion Constructors
//------------------------------------------------------
//
// Internal Methods
//
//-----------------------------------------------------
#region Internal Methods
internal override void RayHitTestCore(
RayHitTestParameters rayParams)
{
Model3DCollection children = Children;
if (children == null)
{
return;
}
for (int i = children.Count - 1; i >= 0; i--)
{
Model3D child = children.Internal_GetItem(i);
// Perform the hit-test against the child.
child.RayHitTest(rayParams);
}
}
internal override Rect3D CalculateSubgraphBoundsInnerSpace()
{
Model3DCollection children = Children;
if (children == null)
{
return Rect3D.Empty;
}
Rect3D bounds = Rect3D.Empty;
for (int i = 0, count = children.Count; i < count; i++)
{
Model3D child = children.Internal_GetItem(i);
// Calls CSBOS rather than Bounds to avoid ReadPreamble.
bounds.Union(child.CalculateSubgraphBoundsOuterSpace());
}
return bounds;
}
#endregion Internal Methods
//------------------------------------------------------
//
// Internal Properties
//
//------------------------------------------------------
#region Internal Properties
// named EmptyGroup not to collide with public Model3D.Empty
internal static Model3DGroup EmptyGroup
{
get
{
if (s_empty == null)
{
s_empty = new Model3DGroup();
s_empty.Freeze();
}
return s_empty;
}
}
#endregion Internal Properties
//-----------------------------------------------------
//
// Private Fields
//
//------------------------------------------------------
#region Private Fields
private static Model3DGroup s_empty;
#endregion Private Fields
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DefaultParameterValueAttribute.cs
- RankException.cs
- ArrayMergeHelper.cs
- SecurityException.cs
- Lazy.cs
- XmlDataDocument.cs
- XmlObjectSerializerReadContextComplex.cs
- Point3DIndependentAnimationStorage.cs
- ActiveXHost.cs
- DataRelationPropertyDescriptor.cs
- XmlChoiceIdentifierAttribute.cs
- WebScriptEndpointElement.cs
- WorkerRequest.cs
- linebase.cs
- SectionRecord.cs
- MessageQueue.cs
- MatrixStack.cs
- XMLUtil.cs
- CodeStatement.cs
- SmtpDigestAuthenticationModule.cs
- TreeViewItemAutomationPeer.cs
- HtmlInputButton.cs
- ParallelTimeline.cs
- ObjectIDGenerator.cs
- TemplateBaseAction.cs
- DataRowView.cs
- ComContractElement.cs
- ByteAnimation.cs
- _ScatterGatherBuffers.cs
- UniqueConstraint.cs
- PrintController.cs
- InfiniteIntConverter.cs
- Rotation3DAnimationBase.cs
- DoubleAnimationUsingKeyFrames.cs
- RegisteredDisposeScript.cs
- NetMsmqBindingElement.cs
- securitycriticaldataClass.cs
- VirtualizingPanel.cs
- TextEditorMouse.cs
- InputReportEventArgs.cs
- AliasedSlot.cs
- Automation.cs
- Brush.cs
- NamespaceEmitter.cs
- ComponentEvent.cs
- Configuration.cs
- ChannelEndpointElementCollection.cs
- HtmlWindow.cs
- SecUtil.cs
- MediaScriptCommandRoutedEventArgs.cs
- Timer.cs
- WmlObjectListAdapter.cs
- UInt64Storage.cs
- DrawingContextDrawingContextWalker.cs
- ExpressionBindingCollection.cs
- ProviderMetadata.cs
- XmlToDatasetMap.cs
- DataControlField.cs
- IntegerValidator.cs
- TextCompositionManager.cs
- SID.cs
- AudioStateChangedEventArgs.cs
- RegistryKey.cs
- SoapMessage.cs
- ObjectDataSourceDisposingEventArgs.cs
- Intellisense.cs
- XmlSchemaAnyAttribute.cs
- NavigationCommands.cs
- ScrollProviderWrapper.cs
- Pointer.cs
- WebEventCodes.cs
- XPathNodeInfoAtom.cs
- AmbiguousMatchException.cs
- UnsafeNativeMethods.cs
- RouteValueDictionary.cs
- MachineKeySection.cs
- SmiContext.cs
- TextEffectCollection.cs
- DataSourceCacheDurationConverter.cs
- ObjectViewEntityCollectionData.cs
- SafeArrayTypeMismatchException.cs
- AttachedPropertyInfo.cs
- Int16KeyFrameCollection.cs
- MailBnfHelper.cs
- EUCJPEncoding.cs
- MulticastIPAddressInformationCollection.cs
- PropertyPathConverter.cs
- ACE.cs
- CursorConverter.cs
- Rfc2898DeriveBytes.cs
- ImageIndexConverter.cs
- RuleSettingsCollection.cs
- RegexFCD.cs
- ApplicationSettingsBase.cs
- SQLInt64Storage.cs
- AliasedSlot.cs
- RepeaterItemCollection.cs
- XmlElementAttributes.cs
- StoreAnnotationsMap.cs
- HuffModule.cs