Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media3D / Point4D.cs / 1 / Point4D.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: 4D point implementation. // // See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht // // History: // 06/04/2003 : t-gregr - Created // //--------------------------------------------------------------------------- using System.Windows; using System.Windows.Media.Media3D; using System; namespace System.Windows.Media.Media3D { ////// Point4D - 4D point representation. /// Defaults to (0,0,0,0). /// public partial struct Point4D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Constructor that sets point's initial values. /// /// Value of the X coordinate of the new point. /// Value of the Y coordinate of the new point. /// Value of the Z coordinate of the new point. /// Value of the W coordinate of the new point. public Point4D(double x, double y, double z, double w) { _x = x; _y = y; _z = z; _w = w; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Offset - update point position by adding deltaX to X, deltaY to Y, deltaZ to Z, and deltaW to W. /// /// Offset in the X direction. /// Offset in the Y direction. /// Offset in the Z direction. /// Offset in the W direction. public void Offset(double deltaX, double deltaY, double deltaZ, double deltaW) { _x += deltaX; _y += deltaY; _z += deltaZ; _w += deltaW; } ////// Addition. /// /// First point being added. /// Second point being added. ///Result of addition. public static Point4D operator +(Point4D point1, Point4D point2) { return new Point4D(point1._x + point2._x, point1._y + point2._y, point1._z + point2._z, point1._w + point2._w); } ////// Addition. /// /// First point being added. /// Second point being added. ///Result of addition. public static Point4D Add(Point4D point1, Point4D point2) { return new Point4D(point1._x + point2._x, point1._y + point2._y, point1._z + point2._z, point1._w + point2._w); } ////// Subtraction. /// /// Point from which we are subtracting the second point. /// Point being subtracted. ///Vector between the two points. public static Point4D operator -(Point4D point1, Point4D point2) { return new Point4D(point1._x - point2._x, point1._y - point2._y, point1._z - point2._z, point1._w - point2._w); } ////// Subtraction. /// /// Point from which we are subtracting the second point. /// Point being subtracted. ///Vector between the two points. public static Point4D Subtract(Point4D point1, Point4D point2) { return new Point4D(point1._x - point2._x, point1._y - point2._y, point1._z - point2._z, point1._w - point2._w); } ////// Point4D * Matrix3D multiplication. /// /// Point being transformed. /// Transformation matrix applied to the point. ///Result of the transformation matrix applied to the point. public static Point4D operator *(Point4D point, Matrix3D matrix) { return matrix.Transform(point); } ////// Point4D * Matrix3D multiplication. /// /// Point being transformed. /// Transformation matrix applied to the point. ///Result of the transformation matrix applied to the point. public static Point4D Multiply(Point4D point, Matrix3D matrix) { return matrix.Transform(point); } #endregion Public 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: 4D point implementation. // // See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht // // History: // 06/04/2003 : t-gregr - Created // //--------------------------------------------------------------------------- using System.Windows; using System.Windows.Media.Media3D; using System; namespace System.Windows.Media.Media3D { ////// Point4D - 4D point representation. /// Defaults to (0,0,0,0). /// public partial struct Point4D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Constructor that sets point's initial values. /// /// Value of the X coordinate of the new point. /// Value of the Y coordinate of the new point. /// Value of the Z coordinate of the new point. /// Value of the W coordinate of the new point. public Point4D(double x, double y, double z, double w) { _x = x; _y = y; _z = z; _w = w; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Offset - update point position by adding deltaX to X, deltaY to Y, deltaZ to Z, and deltaW to W. /// /// Offset in the X direction. /// Offset in the Y direction. /// Offset in the Z direction. /// Offset in the W direction. public void Offset(double deltaX, double deltaY, double deltaZ, double deltaW) { _x += deltaX; _y += deltaY; _z += deltaZ; _w += deltaW; } ////// Addition. /// /// First point being added. /// Second point being added. ///Result of addition. public static Point4D operator +(Point4D point1, Point4D point2) { return new Point4D(point1._x + point2._x, point1._y + point2._y, point1._z + point2._z, point1._w + point2._w); } ////// Addition. /// /// First point being added. /// Second point being added. ///Result of addition. public static Point4D Add(Point4D point1, Point4D point2) { return new Point4D(point1._x + point2._x, point1._y + point2._y, point1._z + point2._z, point1._w + point2._w); } ////// Subtraction. /// /// Point from which we are subtracting the second point. /// Point being subtracted. ///Vector between the two points. public static Point4D operator -(Point4D point1, Point4D point2) { return new Point4D(point1._x - point2._x, point1._y - point2._y, point1._z - point2._z, point1._w - point2._w); } ////// Subtraction. /// /// Point from which we are subtracting the second point. /// Point being subtracted. ///Vector between the two points. public static Point4D Subtract(Point4D point1, Point4D point2) { return new Point4D(point1._x - point2._x, point1._y - point2._y, point1._z - point2._z, point1._w - point2._w); } ////// Point4D * Matrix3D multiplication. /// /// Point being transformed. /// Transformation matrix applied to the point. ///Result of the transformation matrix applied to the point. public static Point4D operator *(Point4D point, Matrix3D matrix) { return matrix.Transform(point); } ////// Point4D * Matrix3D multiplication. /// /// Point being transformed. /// Transformation matrix applied to the point. ///Result of the transformation matrix applied to the point. public static Point4D Multiply(Point4D point, Matrix3D matrix) { return matrix.Transform(point); } #endregion Public 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
- Identifier.cs
- reliableinputsessionchannel.cs
- Message.cs
- XmlNodeChangedEventArgs.cs
- SerTrace.cs
- SoapEnvelopeProcessingElement.cs
- IISMapPath.cs
- InfoCardCryptoHelper.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- DynamicPropertyHolder.cs
- DaylightTime.cs
- CryptographicAttribute.cs
- LockingPersistenceProvider.cs
- DependencySource.cs
- CodeDOMUtility.cs
- FilteredDataSetHelper.cs
- XamlToRtfParser.cs
- SafeFileHandle.cs
- RectangleConverter.cs
- RelationshipEndMember.cs
- RepeatInfo.cs
- HandlerBase.cs
- BuildProviderCollection.cs
- MaskInputRejectedEventArgs.cs
- InternalPolicyElement.cs
- ExtensionWindowHeader.cs
- DataGridRowClipboardEventArgs.cs
- MultipleViewProviderWrapper.cs
- ScrollItemProviderWrapper.cs
- NameValueCollection.cs
- ComplexPropertyEntry.cs
- Item.cs
- TableLayoutStyle.cs
- ObjectHelper.cs
- DataSourceControlBuilder.cs
- MediaSystem.cs
- TextParagraphCache.cs
- CngKeyCreationParameters.cs
- MemberPathMap.cs
- BasicExpressionVisitor.cs
- SqlTriggerAttribute.cs
- DropDownList.cs
- UnlockInstanceCommand.cs
- EntityDataSourceReferenceGroup.cs
- RangeValuePatternIdentifiers.cs
- WebRequestModuleElementCollection.cs
- SvcMapFileLoader.cs
- WebEventTraceProvider.cs
- SqlTypeSystemProvider.cs
- CustomErrorsSection.cs
- DesignColumn.cs
- DataBindingList.cs
- InfoCardArgumentException.cs
- MimeTypeAttribute.cs
- TextMarkerSource.cs
- _NegotiateClient.cs
- FormsAuthenticationEventArgs.cs
- EmptyEnumerator.cs
- ServiceBehaviorElement.cs
- EmptyEnumerable.cs
- DataGridColumn.cs
- MetadataFile.cs
- HtmlTableRowCollection.cs
- UTF8Encoding.cs
- ArrangedElement.cs
- ThousandthOfEmRealDoubles.cs
- Verify.cs
- TargetControlTypeAttribute.cs
- EventEntry.cs
- BinaryConverter.cs
- GroupQuery.cs
- RuleSetBrowserDialog.cs
- wgx_commands.cs
- PhysicalFontFamily.cs
- Run.cs
- DesignerCatalogPartChrome.cs
- ObjectItemCollection.cs
- HybridDictionary.cs
- CollectionViewGroupInternal.cs
- ThemeableAttribute.cs
- LinqDataSourceStatusEventArgs.cs
- safesecurityhelperavalon.cs
- RelOps.cs
- GeneralTransform3DCollection.cs
- FileFormatException.cs
- DataExchangeServiceBinder.cs
- PackageRelationshipSelector.cs
- AlignmentYValidation.cs
- StringUtil.cs
- SerializationSectionGroup.cs
- BitmapFrameEncode.cs
- DbCommandDefinition.cs
- FileCodeGroup.cs
- DataGridViewAutoSizeModeEventArgs.cs
- OnOperation.cs
- TextElementCollectionHelper.cs
- MessageSecurityVersionConverter.cs
- SqlCacheDependencyDatabase.cs
- XmlSchemaSequence.cs