Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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 Freezable.CloneCore .
///
///
protected override void CloneCore(Freezable sourceFreezable)
{
GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable;
base.CloneCore(sourceFreezable);
CopyCommon(transform);
}
///
/// Implementation of Freezable.CloneCurrentValueCore .
///
///
protected override void CloneCurrentValueCore(Freezable sourceFreezable)
{
GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable;
base.CloneCurrentValueCore(sourceFreezable);
CopyCommon(transform);
}
///
/// Implementation of Freezable.GetAsFrozenCore .
///
///
protected override void GetAsFrozenCore(Freezable sourceFreezable)
{
GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable;
base.GetAsFrozenCore(sourceFreezable);
CopyCommon(transform);
}
///
/// Implementation of Freezable.GetCurrentValueAsFrozenCore .
///
///
protected override void GetCurrentValueAsFrozenCore(Freezable sourceFreezable)
{
GeneralTransform3DTo2DTo3D transform = (GeneralTransform3DTo2DTo3D)sourceFreezable;
base.GetCurrentValueAsFrozenCore(sourceFreezable);
CopyCommon(transform);
}
///
/// 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
- PersonalizationState.cs
- XmlILCommand.cs
- StyleCollection.cs
- DetailsViewInsertedEventArgs.cs
- RuntimeCompatibilityAttribute.cs
- WorkflowControlEndpoint.cs
- UnionCodeGroup.cs
- RegistryDataKey.cs
- PropertyEmitter.cs
- RegistryDataKey.cs
- EventLogPermission.cs
- PartialCachingAttribute.cs
- Baml2006SchemaContext.cs
- ListDataHelper.cs
- WeakRefEnumerator.cs
- FixedPage.cs
- FixedSOMGroup.cs
- JsonEncodingStreamWrapper.cs
- EndpointBehaviorElementCollection.cs
- Sequence.cs
- XmlDocumentFragment.cs
- EmissiveMaterial.cs
- XPathParser.cs
- MimeBasePart.cs
- regiisutil.cs
- EntityDataSourceUtil.cs
- ReachDocumentPageSerializerAsync.cs
- SmiMetaData.cs
- OpacityConverter.cs
- DemultiplexingClientMessageFormatter.cs
- Invariant.cs
- DBCSCodePageEncoding.cs
- DatePickerDateValidationErrorEventArgs.cs
- ValuePattern.cs
- CodeIdentifier.cs
- AsymmetricSignatureDeformatter.cs
- RSAPKCS1SignatureFormatter.cs
- _ConnectionGroup.cs
- NamedPipeChannelListener.cs
- FactoryId.cs
- ClientScriptItem.cs
- MappingSource.cs
- CqlParserHelpers.cs
- PolyBezierSegmentFigureLogic.cs
- DragDrop.cs
- DataGridViewRowCollection.cs
- WebPartConnectionsCloseVerb.cs
- DefaultTextStore.cs
- ConcatQueryOperator.cs
- Inflater.cs
- GroupedContextMenuStrip.cs
- HttpListenerException.cs
- ConditionCollection.cs
- ScrollableControlDesigner.cs
- PtsPage.cs
- TraversalRequest.cs
- WebSysDescriptionAttribute.cs
- XXXInfos.cs
- DBParameter.cs
- CollectionEditVerbManager.cs
- TimeoutValidationAttribute.cs
- ControlCollection.cs
- Inline.cs
- OptionalColumn.cs
- CodeTypeDeclarationCollection.cs
- EventLogger.cs
- BufferModeSettings.cs
- DataListItemCollection.cs
- WindowsTooltip.cs
- storepermission.cs
- WebResourceAttribute.cs
- BamlWriter.cs
- GacUtil.cs
- TCEAdapterGenerator.cs
- HttpProfileGroupBase.cs
- FormViewCommandEventArgs.cs
- ParameterRetriever.cs
- WebRequestModuleElementCollection.cs
- JavaScriptSerializer.cs
- CryptoProvider.cs
- DockingAttribute.cs
- isolationinterop.cs
- Formatter.cs
- NetStream.cs
- ContractTypeNameCollection.cs
- TimeSpanValidatorAttribute.cs
- RangeValuePattern.cs
- SafeEventLogReadHandle.cs
- UnderstoodHeaders.cs
- OleDbReferenceCollection.cs
- DES.cs
- Sentence.cs
- HandlerBase.cs
- COM2PictureConverter.cs
- KnownBoxes.cs
- GlobalProxySelection.cs
- InProcStateClientManager.cs
- XPathNavigator.cs
- MethodCallConverter.cs
- NativeObjectSecurity.cs