Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SecurityUtils.cs
- ModuleBuilderData.cs
- CodeCommentStatementCollection.cs
- XslException.cs
- Line.cs
- HwndTarget.cs
- PrePrepareMethodAttribute.cs
- ItemsChangedEventArgs.cs
- ColumnMapVisitor.cs
- SizeF.cs
- DefaultSerializationProviderAttribute.cs
- CultureTableRecord.cs
- SiteMapDataSourceView.cs
- GridViewUpdatedEventArgs.cs
- SafeArrayTypeMismatchException.cs
- EmptyControlCollection.cs
- DataGridRowClipboardEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- DataDocumentXPathNavigator.cs
- OuterGlowBitmapEffect.cs
- DesignerToolStripControlHost.cs
- ComboBox.cs
- SqlCommand.cs
- WindowsTokenRoleProvider.cs
- ResourceExpressionEditor.cs
- AttachmentCollection.cs
- TextBoxAutomationPeer.cs
- IPipelineRuntime.cs
- DataPagerFieldItem.cs
- PageHandlerFactory.cs
- WebPartMinimizeVerb.cs
- GridView.cs
- StylusPlugInCollection.cs
- DataSourceControl.cs
- TimersDescriptionAttribute.cs
- UnwrappedTypesXmlSerializerManager.cs
- WebControlParameterProxy.cs
- ZipIOLocalFileBlock.cs
- Pkcs7Signer.cs
- AnchorEditor.cs
- RegexCode.cs
- MemberPathMap.cs
- GorillaCodec.cs
- NativeRightsManagementAPIsStructures.cs
- XXXInfos.cs
- unitconverter.cs
- VisualTreeUtils.cs
- RemoveStoryboard.cs
- InkCanvasSelection.cs
- ThreadAttributes.cs
- CorrelationInitializer.cs
- Style.cs
- PersonalizationStateInfo.cs
- StylusPointCollection.cs
- ObjectQueryProvider.cs
- GridSplitterAutomationPeer.cs
- NestedContainer.cs
- CngProperty.cs
- ErrorInfoXmlDocument.cs
- OleDbPermission.cs
- ZipIOExtraField.cs
- BinaryEditor.cs
- StorageAssociationSetMapping.cs
- CollectionViewGroup.cs
- MessageEnumerator.cs
- TimeSpanStorage.cs
- NamedPipeAppDomainProtocolHandler.cs
- DocumentSequenceHighlightLayer.cs
- IndexedGlyphRun.cs
- ReflectionTypeLoadException.cs
- QueryCursorEventArgs.cs
- BmpBitmapEncoder.cs
- ParserExtension.cs
- SupportsEventValidationAttribute.cs
- TextParagraphCache.cs
- PointCollection.cs
- NullRuntimeConfig.cs
- TextPointerBase.cs
- XmlSignificantWhitespace.cs
- Pkcs7Signer.cs
- SqlVisitor.cs
- ObjectDisposedException.cs
- UserInitiatedRoutedEventPermission.cs
- DefaultTraceListener.cs
- DataFormats.cs
- SoapExtension.cs
- Binding.cs
- SrgsElementFactory.cs
- DebuggerAttributes.cs
- DecodeHelper.cs
- SmtpReplyReader.cs
- HtmlDocument.cs
- SHA512.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- WebPartMenu.cs
- Emitter.cs
- ListBase.cs
- XmlCDATASection.cs
- SqlInternalConnectionSmi.cs
- ImageDrawing.cs