Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- CapabilitiesRule.cs
- Rect.cs
- SinglePageViewer.cs
- OleDbCommandBuilder.cs
- ConsoleTraceListener.cs
- SafeFileMapViewHandle.cs
- GiveFeedbackEvent.cs
- DelegateBodyWriter.cs
- TransformerConfigurationWizardBase.cs
- TextRangeBase.cs
- TypeConverter.cs
- MeshGeometry3D.cs
- FixedSOMLineCollection.cs
- DataGridViewMethods.cs
- GiveFeedbackEvent.cs
- TypeEnumerableViewSchema.cs
- FileAuthorizationModule.cs
- BindMarkupExtensionSerializer.cs
- InheritablePropertyChangeInfo.cs
- GeneralTransform2DTo3D.cs
- ArgumentException.cs
- TemplateNodeContextMenu.cs
- DbRetry.cs
- ObjectConverter.cs
- Int64Converter.cs
- MembershipPasswordException.cs
- EmptyEnumerator.cs
- ErrorRuntimeConfig.cs
- JsonClassDataContract.cs
- DiagnosticTraceRecords.cs
- HtmlTextArea.cs
- ListViewTableCell.cs
- TimeoutValidationAttribute.cs
- SchemaTableOptionalColumn.cs
- Set.cs
- KnownColorTable.cs
- HasActivatableWorkflowEvent.cs
- ScrollBar.cs
- PropertyChangingEventArgs.cs
- HtmlButton.cs
- FormViewDeleteEventArgs.cs
- ApplicationFileParser.cs
- HtmlContainerControl.cs
- WebPartVerb.cs
- ZoneLinkButton.cs
- TableCell.cs
- ByteAnimationUsingKeyFrames.cs
- HwndKeyboardInputProvider.cs
- SelectionItemPattern.cs
- ValidationRule.cs
- LocalValueEnumerator.cs
- ReleaseInstanceMode.cs
- ObservableDictionary.cs
- SqlConnectionStringBuilder.cs
- Trace.cs
- TranslateTransform.cs
- SystemIPAddressInformation.cs
- GlyphsSerializer.cs
- RuntimeEnvironment.cs
- CryptoStream.cs
- PopOutPanel.cs
- ResourceCategoryAttribute.cs
- AssemblySettingAttributes.cs
- XmlNodeReader.cs
- FrameworkContextData.cs
- ProviderMetadataCachedInformation.cs
- SessionEndingCancelEventArgs.cs
- NavigationProgressEventArgs.cs
- RewritingProcessor.cs
- InputProviderSite.cs
- ExecutionTracker.cs
- ViewCellSlot.cs
- DocumentXPathNavigator.cs
- FixedSOMPageConstructor.cs
- input.cs
- GlyphRunDrawing.cs
- SpellerStatusTable.cs
- ToolConsole.cs
- SettingsBase.cs
- TraceSwitch.cs
- SolidColorBrush.cs
- PropertySourceInfo.cs
- HatchBrush.cs
- NavigationFailedEventArgs.cs
- ProjectionPruner.cs
- MailWriter.cs
- DataFieldCollectionEditor.cs
- TreeNodeMouseHoverEvent.cs
- FrameDimension.cs
- XamlInt32CollectionSerializer.cs
- ColumnBinding.cs
- TransactionFormatter.cs
- CustomPopupPlacement.cs
- FramingDecoders.cs
- BitmapMetadataBlob.cs
- XmlAnyAttributeAttribute.cs
- GeneralTransform3DGroup.cs
- EventItfInfo.cs
- Html32TextWriter.cs
- ListViewAutomationPeer.cs