Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / Model3D.cs / 1305600 / 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(); #endregion Internal Methods } } // 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(); #endregion Internal Methods } } // 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
- FixedLineResult.cs
- LostFocusEventManager.cs
- RtfFormatStack.cs
- StoreItemCollection.Loader.cs
- OrderedEnumerableRowCollection.cs
- DateTimeOffset.cs
- UIElementParaClient.cs
- OleDbStruct.cs
- ForwardPositionQuery.cs
- SingleObjectCollection.cs
- RewritingPass.cs
- XamlToRtfWriter.cs
- PerformanceCounterPermissionEntryCollection.cs
- Tuple.cs
- InfoCardPolicy.cs
- NativeMethods.cs
- DelegateCompletionCallbackWrapper.cs
- TabControlAutomationPeer.cs
- DataGridViewRowsAddedEventArgs.cs
- StylusTouchDevice.cs
- WorkflowApplicationUnloadedException.cs
- SettingsContext.cs
- IDQuery.cs
- IdleTimeoutMonitor.cs
- EdmProperty.cs
- CharAnimationUsingKeyFrames.cs
- RangeValidator.cs
- PrivateFontCollection.cs
- InternalConfigRoot.cs
- ResourceContainerWrapper.cs
- VSWCFServiceContractGenerator.cs
- LongTypeConverter.cs
- ReadWriteObjectLock.cs
- ExpandableObjectConverter.cs
- COM2PictureConverter.cs
- PointAnimationUsingPath.cs
- Vector3DKeyFrameCollection.cs
- PatternMatchRules.cs
- ExpressionBuilderContext.cs
- SiblingIterators.cs
- ClientTargetCollection.cs
- EditingCoordinator.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- ToolStripDropDownItem.cs
- AutomationPropertyInfo.cs
- Parser.cs
- RegionIterator.cs
- RightNameExpirationInfoPair.cs
- PrePrepareMethodAttribute.cs
- PersonalizationDictionary.cs
- DictionaryBase.cs
- RightsManagementInformation.cs
- basenumberconverter.cs
- RegexCharClass.cs
- DoubleLinkListEnumerator.cs
- SingleAnimationBase.cs
- SiteMembershipCondition.cs
- XmlSerializerFactory.cs
- CategoriesDocumentFormatter.cs
- ObjectListSelectEventArgs.cs
- PartialArray.cs
- ListControlConvertEventArgs.cs
- ItemMap.cs
- XmlHierarchicalEnumerable.cs
- ListViewDataItem.cs
- StorageComplexTypeMapping.cs
- LoadWorkflowAsyncResult.cs
- Grant.cs
- objectquery_tresulttype.cs
- HiddenFieldPageStatePersister.cs
- _OSSOCK.cs
- SoapServerProtocol.cs
- ImpersonateTokenRef.cs
- HostingEnvironmentException.cs
- SessionStateSection.cs
- AcceleratedTokenAuthenticator.cs
- DateTimeFormat.cs
- InfoCardBinaryReader.cs
- Line.cs
- Helpers.cs
- AutomationEventArgs.cs
- WindowsAuthenticationModule.cs
- Request.cs
- objectquery_tresulttype.cs
- CancellationHandlerDesigner.cs
- Timeline.cs
- RuntimeArgumentHandle.cs
- PasswordBox.cs
- SHA1Managed.cs
- PrimitiveList.cs
- Selection.cs
- DefaultAsyncDataDispatcher.cs
- TdsEnums.cs
- ImportCatalogPart.cs
- oledbmetadatacollectionnames.cs
- MsmqInputSessionChannel.cs
- StatusBar.cs
- XmlExpressionDumper.cs
- FontSource.cs
- TextEditorMouse.cs