Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media3D / Model3D.cs / 1 / Model3D.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description: 3D model implementation.
//
// See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht
//
// History:
// 06/18/2003 : t-gregr - Created
//
//---------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
using MS.Internal.Media3D;
namespace System.Windows.Media.Media3D
{
///
/// Model3D is the abstract model that everything builds from.
///
[Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] // cannot be read & localized as string
public abstract partial class Model3D : Animatable
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
// Prevent 3rd parties from extending this abstract base class.
internal Model3D() {}
#endregion Constructors
//------------------------------------------------------
//
// Public Methods
//
//-----------------------------------------------------
//------------------------------------------------------
//
// Public Properties
//
//------------------------------------------------------
#region Public Properties
///
/// Gets bounds for this model.
///
public Rect3D Bounds
{
get
{
ReadPreamble();
return CalculateSubgraphBoundsOuterSpace();
}
}
#endregion Public Properties
//-----------------------------------------------------
//
// Internal Methods
//
//------------------------------------------------------
#region Internal Methods
// NOTE: Model3D hit testing takes the rayParams in the outer space of the
// Model3D. That is, RayHitTest() will apply this model's transform
// to the ray for the caller.
//
// This is different than Visual hit testing which does not transform
// the hit testing parameters by the Visual's transform.
internal void RayHitTest(RayHitTestParameters rayParams)
{
Transform3D transform = Transform;
rayParams.PushModelTransform(transform);
RayHitTestCore(rayParams);
rayParams.PopTransform(transform);
}
internal abstract void RayHitTestCore(RayHitTestParameters rayParams);
///
/// Returns the bounds of the Model3D subgraph rooted at this Model3D.
///
/// Outer space refers to the space after this Model's Transform is
/// applied -- or said another way, applying a transform to this Model
/// affects it's outer bounds. (While its inner bounds remain unchanged.)
///
internal Rect3D CalculateSubgraphBoundsOuterSpace()
{
Rect3D innerBounds = CalculateSubgraphBoundsInnerSpace();
return M3DUtil.ComputeTransformedAxisAlignedBoundingBox(ref innerBounds, Transform);
}
///
/// Returns the bounds of the Model3D subgraph rooted at this Model3D.
///
/// Inner space refers to the space before this Model's Transform is
/// applied -- or said another way, applying a transform to this Model
/// only affects it's outer bounds. Its inner bounds remain unchanged.
///
internal abstract Rect3D CalculateSubgraphBoundsInnerSpace();
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be "UpdateRealizations" like Drawings
internal abstract void MarkVisibleRealizations(RealizationContext rc);
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be using inherited "Precompute" from Animatable
internal abstract void PreCompute();
#endregion Internal Methods
#region Model3D Flags
// These flags aren't in an enum to avoid adding another Type to the assembly and
// because BitVector32 requires ints
// If this is true, then the Model3D needs PreCompute() called on it.
// Currently, this is only true for GeometryModel3D's when their Material
// property changes (and any Model3DGroup that contains such a GM3D)
//
// As needed in the future, DirtyForPreComputeFlag can be used for other
// things (i.e. if we ever cache Transform in PreCompute())
internal const int DirtyForPreComputeFlag = 1 << 0;
// If this is true, then MarkVisibleRealizations() needs to be called on
// the Model3D.
//
// Currently, this is only true for a GeometryModel3D that has text in
// it's material (and any Model3DGroup that contains such a GM3D)
//
// Unlike Visuals, we make no distinction between if something under
// this Model3D requires realization or if this Model3D itself requires
// realization
internal const int RequiresRealizationFlag = 1 << 1;
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be using inherited "RequiresRealizationUpdates" from Animatable
//
// Important: start off dirty
internal BitVector32 _flags = new BitVector32(DirtyForPreComputeFlag);
#endregion Model3D Flags
}
}
// 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 implementation.
//
// See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht
//
// History:
// 06/18/2003 : t-gregr - Created
//
//---------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
using MS.Internal.Media3D;
namespace System.Windows.Media.Media3D
{
///
/// Model3D is the abstract model that everything builds from.
///
[Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] // cannot be read & localized as string
public abstract partial class Model3D : Animatable
{
//-----------------------------------------------------
//
// Constructors
//
//-----------------------------------------------------
#region Constructors
// Prevent 3rd parties from extending this abstract base class.
internal Model3D() {}
#endregion Constructors
//------------------------------------------------------
//
// Public Methods
//
//-----------------------------------------------------
//------------------------------------------------------
//
// Public Properties
//
//------------------------------------------------------
#region Public Properties
///
/// Gets bounds for this model.
///
public Rect3D Bounds
{
get
{
ReadPreamble();
return CalculateSubgraphBoundsOuterSpace();
}
}
#endregion Public Properties
//-----------------------------------------------------
//
// Internal Methods
//
//------------------------------------------------------
#region Internal Methods
// NOTE: Model3D hit testing takes the rayParams in the outer space of the
// Model3D. That is, RayHitTest() will apply this model's transform
// to the ray for the caller.
//
// This is different than Visual hit testing which does not transform
// the hit testing parameters by the Visual's transform.
internal void RayHitTest(RayHitTestParameters rayParams)
{
Transform3D transform = Transform;
rayParams.PushModelTransform(transform);
RayHitTestCore(rayParams);
rayParams.PopTransform(transform);
}
internal abstract void RayHitTestCore(RayHitTestParameters rayParams);
///
/// Returns the bounds of the Model3D subgraph rooted at this Model3D.
///
/// Outer space refers to the space after this Model's Transform is
/// applied -- or said another way, applying a transform to this Model
/// affects it's outer bounds. (While its inner bounds remain unchanged.)
///
internal Rect3D CalculateSubgraphBoundsOuterSpace()
{
Rect3D innerBounds = CalculateSubgraphBoundsInnerSpace();
return M3DUtil.ComputeTransformedAxisAlignedBoundingBox(ref innerBounds, Transform);
}
///
/// Returns the bounds of the Model3D subgraph rooted at this Model3D.
///
/// Inner space refers to the space before this Model's Transform is
/// applied -- or said another way, applying a transform to this Model
/// only affects it's outer bounds. Its inner bounds remain unchanged.
///
internal abstract Rect3D CalculateSubgraphBoundsInnerSpace();
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be "UpdateRealizations" like Drawings
internal abstract void MarkVisibleRealizations(RealizationContext rc);
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be using inherited "Precompute" from Animatable
internal abstract void PreCompute();
#endregion Internal Methods
#region Model3D Flags
// These flags aren't in an enum to avoid adding another Type to the assembly and
// because BitVector32 requires ints
// If this is true, then the Model3D needs PreCompute() called on it.
// Currently, this is only true for GeometryModel3D's when their Material
// property changes (and any Model3DGroup that contains such a GM3D)
//
// As needed in the future, DirtyForPreComputeFlag can be used for other
// things (i.e. if we ever cache Transform in PreCompute())
internal const int DirtyForPreComputeFlag = 1 << 0;
// If this is true, then MarkVisibleRealizations() needs to be called on
// the Model3D.
//
// Currently, this is only true for a GeometryModel3D that has text in
// it's material (and any Model3DGroup that contains such a GM3D)
//
// Unlike Visuals, we make no distinction between if something under
// this Model3D requires realization or if this Model3D itself requires
// realization
internal const int RequiresRealizationFlag = 1 << 1;
// NTRAID#Longhorn-1591973-2006/03/31-[....] - Should be using inherited "RequiresRealizationUpdates" from Animatable
//
// Important: start off dirty
internal BitVector32 _flags = new BitVector32(DirtyForPreComputeFlag);
#endregion Model3D Flags
}
}
// 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
- EnumConverter.cs
- SizeF.cs
- XmlNullResolver.cs
- WebPermission.cs
- Processor.cs
- TypeSystem.cs
- EndpointInstanceProvider.cs
- JapaneseCalendar.cs
- AttributeSetAction.cs
- PlatformCulture.cs
- UserControl.cs
- ColumnBinding.cs
- SerialStream.cs
- DecoratedNameAttribute.cs
- TransformValueSerializer.cs
- DaylightTime.cs
- StackOverflowException.cs
- mansign.cs
- ImageClickEventArgs.cs
- SoapEnumAttribute.cs
- IPAddress.cs
- FileDialogCustomPlace.cs
- AccessKeyManager.cs
- CompilerError.cs
- ThousandthOfEmRealPoints.cs
- InstanceKeyCollisionException.cs
- OperationContractAttribute.cs
- JoinCqlBlock.cs
- CreateUserWizardStep.cs
- RuleSettingsCollection.cs
- DependencyPropertyChangedEventArgs.cs
- ErrorWebPart.cs
- XmlSiteMapProvider.cs
- COAUTHIDENTITY.cs
- SiteMapNodeCollection.cs
- CallbackException.cs
- HttpConfigurationSystem.cs
- ValuePattern.cs
- InvalidComObjectException.cs
- SecurityContextSecurityTokenParameters.cs
- XmlValueConverter.cs
- XmlQueryCardinality.cs
- ClientTargetCollection.cs
- XDRSchema.cs
- FormatterServices.cs
- DBSqlParser.cs
- SHA256Managed.cs
- XmlDataSourceNodeDescriptor.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- RelationshipWrapper.cs
- BigInt.cs
- DiscoveryReferences.cs
- ConfigDefinitionUpdates.cs
- ButtonFieldBase.cs
- Schema.cs
- WeakHashtable.cs
- InternalUserCancelledException.cs
- DocumentGridPage.cs
- ConvertersCollection.cs
- ComboBoxItem.cs
- KeyedQueue.cs
- TextBlockAutomationPeer.cs
- SmiRecordBuffer.cs
- SharedUtils.cs
- LocalizationComments.cs
- LayoutTable.cs
- CodeDelegateCreateExpression.cs
- RubberbandSelector.cs
- BuildProviderAppliesToAttribute.cs
- ForceCopyBuildProvider.cs
- CompilationLock.cs
- SoapAttributeOverrides.cs
- xsdvalidator.cs
- ByteStack.cs
- FtpWebResponse.cs
- CacheRequest.cs
- CustomValidator.cs
- BigInt.cs
- MergeFailedEvent.cs
- AsymmetricAlgorithm.cs
- DataGridColumnEventArgs.cs
- DataControlField.cs
- SoapInteropTypes.cs
- Helpers.cs
- CaseInsensitiveComparer.cs
- DispatcherFrame.cs
- ByteAnimation.cs
- SystemIPv4InterfaceProperties.cs
- NativeObjectSecurity.cs
- ColumnMapProcessor.cs
- XmlSerializerSection.cs
- Metafile.cs
- DebugHandleTracker.cs
- MimeTypeMapper.cs
- CodeDelegateInvokeExpression.cs
- TypeConverterValueSerializer.cs
- tibetanshape.cs
- KeyBinding.cs
- Int32CAMarshaler.cs
- RecipientInfo.cs