Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / MS / Internal / Media3D / GeneralTransform3DTo2DTo3D.cs / 1 / GeneralTransform3DTo2DTo3D.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Declaration of the GeneralTransform3DTo2DTo3D class. // //--------------------------------------------------------------------------- using MS.Internal; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Markup; using System.Windows.Media.Media3D; using MS.Internal.PresentationCore; namespace MS.Internal.Media3D { ////// GeneralTransform3DTo2DTo3D class provides services to transform points from 3D to 2D to 3D /// internal class GeneralTransform3DTo2DTo3D : GeneralTransform3D { internal GeneralTransform3DTo2DTo3D() { } internal GeneralTransform3DTo2DTo3D(GeneralTransform3DTo2D transform3DTo2D, GeneralTransform2DTo3D transform2DTo3D) { Debug.Assert(transform3DTo2D != null && transform2DTo3D != null); _transform3DTo2D = (GeneralTransform3DTo2D)transform3DTo2D.GetAsFrozen(); _transform2DTo3D = (GeneralTransform2DTo3D)transform2DTo3D.GetAsFrozen(); } ////// Transform a point /// /// Input point /// Output point ///True if the point was transformed successfuly, false otherwise public override bool TryTransform(Point3D inPoint, out Point3D result) { Point intermediate2DPoint = new Point(); result = new Point3D(); if (_transform3DTo2D == null || !_transform3DTo2D.TryTransform(inPoint, out intermediate2DPoint)) { return false; } if (_transform2DTo3D == null || !_transform2DTo3D.TryTransform(intermediate2DPoint, out result)) { return false; } return true; } ////// Returns the inverse transform if it has an inverse, null otherwise. /// In this case we can only transform in one direction due to the ray being created /// so the inverse is null. /// public override GeneralTransform3D Inverse { get { return null; } } ////// Returns a best effort affine transform /// internal override Transform3D AffineTransform { [FriendAccessAllowed] // Built into Core, also used by Framework. get { return null; } } ////// Transforms the bounding box to the smallest axis aligned bounding box /// that contains all the points in the original bounding box /// /// Bounding box ///The transformed bounding box public override Rect3D TransformBounds(Rect3D rect) { throw new NotImplementedException(); } ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new GeneralTransform3DTo2DTo3D(); } ////// Implementation of /// protected override void CloneCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.CloneCore(sourceFreezable); CopyCommon(transform); } ///Freezable.CloneCore . ////// Implementation of /// protected override void CloneCurrentValueCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.CloneCurrentValueCore(sourceFreezable); CopyCommon(transform); } ///Freezable.CloneCurrentValueCore . ////// Implementation of /// protected override void GetAsFrozenCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.GetAsFrozenCore(sourceFreezable); CopyCommon(transform); } ///Freezable.GetAsFrozenCore . ////// Implementation of /// protected override void GetCurrentValueAsFrozenCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.GetCurrentValueAsFrozenCore(sourceFreezable); CopyCommon(transform); } ///Freezable.GetCurrentValueAsFrozenCore . ////// Clones values that do not have corresponding DPs /// /// private void CopyCommon(GeneralTransform3DTo2DTo3D transform) { _transform3DTo2D = transform._transform3DTo2D; _transform2DTo3D = transform._transform2DTo3D; } GeneralTransform3DTo2D _transform3DTo2D; GeneralTransform2DTo3D _transform2DTo3D; } } // 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: Declaration of the GeneralTransform3DTo2DTo3D class. // //--------------------------------------------------------------------------- using MS.Internal; using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Markup; using System.Windows.Media.Media3D; using MS.Internal.PresentationCore; namespace MS.Internal.Media3D { ////// GeneralTransform3DTo2DTo3D class provides services to transform points from 3D to 2D to 3D /// internal class GeneralTransform3DTo2DTo3D : GeneralTransform3D { internal GeneralTransform3DTo2DTo3D() { } internal GeneralTransform3DTo2DTo3D(GeneralTransform3DTo2D transform3DTo2D, GeneralTransform2DTo3D transform2DTo3D) { Debug.Assert(transform3DTo2D != null && transform2DTo3D != null); _transform3DTo2D = (GeneralTransform3DTo2D)transform3DTo2D.GetAsFrozen(); _transform2DTo3D = (GeneralTransform2DTo3D)transform2DTo3D.GetAsFrozen(); } ////// Transform a point /// /// Input point /// Output point ///True if the point was transformed successfuly, false otherwise public override bool TryTransform(Point3D inPoint, out Point3D result) { Point intermediate2DPoint = new Point(); result = new Point3D(); if (_transform3DTo2D == null || !_transform3DTo2D.TryTransform(inPoint, out intermediate2DPoint)) { return false; } if (_transform2DTo3D == null || !_transform2DTo3D.TryTransform(intermediate2DPoint, out result)) { return false; } return true; } ////// Returns the inverse transform if it has an inverse, null otherwise. /// In this case we can only transform in one direction due to the ray being created /// so the inverse is null. /// public override GeneralTransform3D Inverse { get { return null; } } ////// Returns a best effort affine transform /// internal override Transform3D AffineTransform { [FriendAccessAllowed] // Built into Core, also used by Framework. get { return null; } } ////// Transforms the bounding box to the smallest axis aligned bounding box /// that contains all the points in the original bounding box /// /// Bounding box ///The transformed bounding box public override Rect3D TransformBounds(Rect3D rect) { throw new NotImplementedException(); } ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new GeneralTransform3DTo2DTo3D(); } ////// Implementation of /// protected override void CloneCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.CloneCore(sourceFreezable); CopyCommon(transform); } ///Freezable.CloneCore . ////// Implementation of /// protected override void CloneCurrentValueCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.CloneCurrentValueCore(sourceFreezable); CopyCommon(transform); } ///Freezable.CloneCurrentValueCore . ////// Implementation of /// protected override void GetAsFrozenCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.GetAsFrozenCore(sourceFreezable); CopyCommon(transform); } ///Freezable.GetAsFrozenCore . ////// Implementation of /// protected override void GetCurrentValueAsFrozenCore(Freezable sourceFreezable) { GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable; base.GetCurrentValueAsFrozenCore(sourceFreezable); CopyCommon(transform); } ///Freezable.GetCurrentValueAsFrozenCore . ////// Clones values that do not have corresponding DPs /// /// private void CopyCommon(GeneralTransform3DTo2DTo3D transform) { _transform3DTo2D = transform._transform3DTo2D; _transform2DTo3D = transform._transform2DTo3D; } GeneralTransform3DTo2D _transform3DTo2D; GeneralTransform2DTo3D _transform2DTo3D; } } // 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
- Track.cs
- Configuration.cs
- ExpandCollapseProviderWrapper.cs
- invalidudtexception.cs
- InternalControlCollection.cs
- FramingDecoders.cs
- OleDbErrorCollection.cs
- InputBinding.cs
- GcHandle.cs
- Certificate.cs
- SiteMapPath.cs
- ColumnClickEvent.cs
- Animatable.cs
- Tablet.cs
- SqlDataAdapter.cs
- TagPrefixAttribute.cs
- DataGridViewCellCancelEventArgs.cs
- CheckBox.cs
- KeyNotFoundException.cs
- DocumentOrderQuery.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ByteKeyFrameCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- ProfileEventArgs.cs
- ServiceOperationParameter.cs
- Event.cs
- PeerDuplexChannelListener.cs
- Vector3DAnimationBase.cs
- DriveNotFoundException.cs
- IteratorFilter.cs
- ToolStripItemRenderEventArgs.cs
- AxHost.cs
- XmlAnyElementAttribute.cs
- ConfigurationSectionGroup.cs
- TypedElement.cs
- DefaultProxySection.cs
- StylusOverProperty.cs
- COM2FontConverter.cs
- regiisutil.cs
- KeyGestureValueSerializer.cs
- InertiaRotationBehavior.cs
- ToolstripProfessionalRenderer.cs
- FtpWebResponse.cs
- TraversalRequest.cs
- Switch.cs
- RequestTimeoutManager.cs
- HTMLTagNameToTypeMapper.cs
- AdRotator.cs
- TextSelectionProcessor.cs
- InternalConfigEventArgs.cs
- TransformerTypeCollection.cs
- ConnectionStringsExpressionEditor.cs
- SqlRowUpdatingEvent.cs
- CorrelationManager.cs
- BindableAttribute.cs
- XslCompiledTransform.cs
- SortFieldComparer.cs
- TextEditorCharacters.cs
- PrintPreviewGraphics.cs
- ExtensionDataReader.cs
- WebPartConnectionsDisconnectVerb.cs
- ProgressPage.cs
- NetworkInformationPermission.cs
- ObjectSelectorEditor.cs
- PopupEventArgs.cs
- ExpressionHelper.cs
- CustomAttributeFormatException.cs
- FactoryGenerator.cs
- ClassImporter.cs
- ToolStripTextBox.cs
- PagePropertiesChangingEventArgs.cs
- ButtonField.cs
- MarkupCompiler.cs
- VarInfo.cs
- ProxyFragment.cs
- Italic.cs
- DataRowCollection.cs
- TypefaceMetricsCache.cs
- OneOf.cs
- ButtonChrome.cs
- DataSourceControl.cs
- MessageContractImporter.cs
- WebPartDescriptionCollection.cs
- ByteStreamGeometryContext.cs
- LinearGradientBrush.cs
- RegionData.cs
- DataSpaceManager.cs
- CircleHotSpot.cs
- SamlAdvice.cs
- MetadataArtifactLoaderCompositeResource.cs
- GACMembershipCondition.cs
- ControlAdapter.cs
- DefaultPerformanceCounters.cs
- EncoderReplacementFallback.cs
- TextServicesCompartmentContext.cs
- BinHexDecoder.cs
- ToolBar.cs
- XmlNamespaceManager.cs
- dtdvalidator.cs
- XpsFilter.cs