Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / MS / Internal / Ink / ContourSegment.cs / 1 / ContourSegment.cs
//------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Media; namespace MS.Internal.Ink { ////// A helper structure representing an edge of a contour, where /// the edge is either a straight segment or an arc of a circle. /// ContourSegment are alwais directed clockwise (i.e with the contour /// inner area being on the right side. /// Used in hit-testing a contour vs another contour. /// internal struct ContourSegment { ////// Constructor for linear segments /// /// segment's begin point /// segment's end point internal ContourSegment(Point begin, Point end) { _begin = begin; _vector = DoubleUtil.AreClose(begin, end) ? new Vector(0, 0) : (end - begin); _radius = new Vector(0, 0); } ////// Constructor for arcs /// /// arc's begin point /// arc's end point /// arc's center internal ContourSegment(Point begin, Point end, Point center) { _begin = begin; _vector = end - begin; _radius = center - begin; } ///Tells whether the segment is arc or straight internal bool IsArc { get { return (_radius.X != 0) || (_radius.Y != 0); } } ///Returns the begin point of the segment internal Point Begin { get { return _begin; } } ///Returns the end point of the segment internal Point End { get { return _begin + _vector; } } ///Returns the vector from Begin to End internal Vector Vector { get { return _vector; } } ///Returns the vector from Begin to the center of the circle /// (zero vector for linear segments internal Vector Radius { get { return _radius; } } #region Fields private Point _begin; private Vector _vector; private Vector _radius; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Media; namespace MS.Internal.Ink { ////// A helper structure representing an edge of a contour, where /// the edge is either a straight segment or an arc of a circle. /// ContourSegment are alwais directed clockwise (i.e with the contour /// inner area being on the right side. /// Used in hit-testing a contour vs another contour. /// internal struct ContourSegment { ////// Constructor for linear segments /// /// segment's begin point /// segment's end point internal ContourSegment(Point begin, Point end) { _begin = begin; _vector = DoubleUtil.AreClose(begin, end) ? new Vector(0, 0) : (end - begin); _radius = new Vector(0, 0); } ////// Constructor for arcs /// /// arc's begin point /// arc's end point /// arc's center internal ContourSegment(Point begin, Point end, Point center) { _begin = begin; _vector = end - begin; _radius = center - begin; } ///Tells whether the segment is arc or straight internal bool IsArc { get { return (_radius.X != 0) || (_radius.Y != 0); } } ///Returns the begin point of the segment internal Point Begin { get { return _begin; } } ///Returns the end point of the segment internal Point End { get { return _begin + _vector; } } ///Returns the vector from Begin to End internal Vector Vector { get { return _vector; } } ///Returns the vector from Begin to the center of the circle /// (zero vector for linear segments internal Vector Radius { get { return _radius; } } #region Fields private Point _begin; private Vector _vector; private Vector _radius; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PointAnimationUsingPath.cs
- InstanceOwner.cs
- SymbolTable.cs
- MsmqIntegrationInputMessage.cs
- PopupRoot.cs
- InternalRelationshipCollection.cs
- TraceInternal.cs
- SelectedGridItemChangedEvent.cs
- Classification.cs
- QueryContinueDragEventArgs.cs
- RectangleGeometry.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ImageAttributes.cs
- WebPartCloseVerb.cs
- ArrayConverter.cs
- dataobject.cs
- UntypedNullExpression.cs
- TagPrefixInfo.cs
- UnsafeNativeMethods.cs
- RegexNode.cs
- AuthorizationBehavior.cs
- Choices.cs
- Symbol.cs
- BigInt.cs
- UnsafeNativeMethods.cs
- HttpRawResponse.cs
- SystemGatewayIPAddressInformation.cs
- ConnectionsZone.cs
- VisualStyleInformation.cs
- SendKeys.cs
- ExtenderProvidedPropertyAttribute.cs
- ControlBindingsCollection.cs
- ExceptionNotification.cs
- clipboard.cs
- SelectedPathEditor.cs
- DataPagerFieldCommandEventArgs.cs
- AssemblyBuilderData.cs
- _UncName.cs
- IntranetCredentialPolicy.cs
- Span.cs
- StylusEditingBehavior.cs
- XmlUtil.cs
- SID.cs
- AvTraceDetails.cs
- Lease.cs
- NegotiateStream.cs
- GlobalAclOperationRequirement.cs
- RegionInfo.cs
- ConstraintConverter.cs
- OpenFileDialog.cs
- PeerChannelListener.cs
- MulticastDelegate.cs
- DataTrigger.cs
- ImageIndexEditor.cs
- ScrollContentPresenter.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- DES.cs
- DropDownButton.cs
- Rect.cs
- __ConsoleStream.cs
- DataBoundControlAdapter.cs
- DesigntimeLicenseContext.cs
- WebPartAddingEventArgs.cs
- GenerateTemporaryAssemblyTask.cs
- EntityDataSourceState.cs
- XamlWriter.cs
- DataException.cs
- CustomActivityDesigner.cs
- Int16Storage.cs
- OverflowException.cs
- SystemIPv4InterfaceProperties.cs
- OdbcParameterCollection.cs
- EncoderNLS.cs
- TransformProviderWrapper.cs
- RemoteHelper.cs
- MexHttpBindingElement.cs
- HttpCookie.cs
- CriticalHandle.cs
- ImageDrawing.cs
- CompositeDataBoundControl.cs
- EtwTrace.cs
- DesignConnection.cs
- ContentPlaceHolder.cs
- ProtocolsSection.cs
- _HeaderInfoTable.cs
- ApplyImportsAction.cs
- _HeaderInfoTable.cs
- DetailsViewRowCollection.cs
- COSERVERINFO.cs
- AssemblyAttributes.cs
- SwitchElementsCollection.cs
- XmlIncludeAttribute.cs
- CompositeFontFamily.cs
- IList.cs
- RenderOptions.cs
- EmbeddedMailObjectCollectionEditor.cs
- ImportException.cs
- TabRenderer.cs
- MulticastDelegate.cs
- WindowsSlider.cs