Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / Point4D.cs / 1305600 / 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
- ProcessThread.cs
- IntranetCredentialPolicy.cs
- QilGeneratorEnv.cs
- ParserStreamGeometryContext.cs
- CallbackHandler.cs
- SchemaNames.cs
- IndependentAnimationStorage.cs
- NoResizeHandleGlyph.cs
- GeometryHitTestParameters.cs
- DiscoveryService.cs
- CompilerState.cs
- GrammarBuilderWildcard.cs
- StateMachineWorkflowDesigner.cs
- WebBrowsableAttribute.cs
- HitTestDrawingContextWalker.cs
- DateTimeStorage.cs
- ServiceContractListItem.cs
- CacheRequest.cs
- Attributes.cs
- CommentAction.cs
- ResourceExpressionEditorSheet.cs
- BoolExpr.cs
- PrintDialogException.cs
- UIAgentAsyncEndRequest.cs
- IdentityValidationException.cs
- EncodingDataItem.cs
- ExtractorMetadata.cs
- HttpPostClientProtocol.cs
- ItemTypeToolStripMenuItem.cs
- infer.cs
- XmlSortKey.cs
- oledbmetadatacolumnnames.cs
- _NegoStream.cs
- BuildResultCache.cs
- AuthenticodeSignatureInformation.cs
- PlainXmlWriter.cs
- BamlCollectionHolder.cs
- PersonalizationStateInfoCollection.cs
- SafeUserTokenHandle.cs
- ColorInterpolationModeValidation.cs
- TemplateApplicationHelper.cs
- BitmapMetadataEnumerator.cs
- WeakKeyDictionary.cs
- Mappings.cs
- SQLGuidStorage.cs
- PositiveTimeSpanValidatorAttribute.cs
- VBIdentifierTrimConverter.cs
- MDIWindowDialog.cs
- Configuration.cs
- Privilege.cs
- RefExpr.cs
- QueryContext.cs
- SpellerStatusTable.cs
- WorkflowDefinitionDispenser.cs
- EndpointIdentityExtension.cs
- HotSpotCollection.cs
- ManagedFilter.cs
- TreeNodeConverter.cs
- DependencyPropertyDescriptor.cs
- SecurityContext.cs
- ConfigurationStrings.cs
- ZoneButton.cs
- EntityConnectionStringBuilder.cs
- QueueProcessor.cs
- XomlCompiler.cs
- Privilege.cs
- TypeNameHelper.cs
- Rijndael.cs
- ConfigXmlCDataSection.cs
- HttpRawResponse.cs
- Visual3D.cs
- CollectionBuilder.cs
- CommandID.cs
- PageAsyncTask.cs
- sqlser.cs
- HScrollBar.cs
- HuffmanTree.cs
- CssTextWriter.cs
- ProfileEventArgs.cs
- MimeFormatExtensions.cs
- AdornerPresentationContext.cs
- PathSegmentCollection.cs
- PointConverter.cs
- BinaryMethodMessage.cs
- WinFormsSecurity.cs
- EditorPartChrome.cs
- TwoPhaseCommitProxy.cs
- ContainerUIElement3D.cs
- CorrelationManager.cs
- SystemColors.cs
- ToolStripRenderEventArgs.cs
- NumericPagerField.cs
- HtmlTableRow.cs
- InnerItemCollectionView.cs
- CollaborationHelperFunctions.cs
- ThicknessAnimationBase.cs
- ParameterToken.cs
- SqlBooleanMismatchVisitor.cs
- ReflectPropertyDescriptor.cs
- TcpConnectionPool.cs