Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConsumerConnectionPointCollection.cs
- TableChangeProcessor.cs
- XPathAncestorIterator.cs
- Freezable.cs
- ApplicationFileParser.cs
- PrintControllerWithStatusDialog.cs
- Formatter.cs
- WindowsListViewScroll.cs
- PropertyCollection.cs
- DockAndAnchorLayout.cs
- RenderContext.cs
- Closure.cs
- PerformanceCounterManager.cs
- XappLauncher.cs
- DynamicDataManager.cs
- SmiXetterAccessMap.cs
- ListViewItem.cs
- TableLayoutPanelCellPosition.cs
- _NtlmClient.cs
- HttpWebRequest.cs
- XmlNamespaceMapping.cs
- BooleanSwitch.cs
- FixedPageStructure.cs
- WebPartZone.cs
- XmlDownloadManager.cs
- CodeCompiler.cs
- EncoderFallback.cs
- WebProxyScriptElement.cs
- WebPartVerbCollection.cs
- VectorAnimationUsingKeyFrames.cs
- SystemIPGlobalProperties.cs
- ParentControlDesigner.cs
- NotificationContext.cs
- OleDbParameterCollection.cs
- RadioButtonList.cs
- PropertyGridEditorPart.cs
- MeasurementDCInfo.cs
- XmlSchemaSimpleContent.cs
- RSAOAEPKeyExchangeFormatter.cs
- ArrayElementGridEntry.cs
- TemplatedAdorner.cs
- ButtonStandardAdapter.cs
- AudioException.cs
- BatchWriter.cs
- TemplateParser.cs
- DetailsViewDeleteEventArgs.cs
- DeviceSpecificDesigner.cs
- AdornerLayer.cs
- ACL.cs
- SingletonConnectionReader.cs
- RemotingClientProxy.cs
- Crypto.cs
- DateTime.cs
- Setter.cs
- DragSelectionMessageFilter.cs
- SystemIcmpV4Statistics.cs
- HttpContext.cs
- RedistVersionInfo.cs
- Authorization.cs
- TextBoxAutomationPeer.cs
- PageContentAsyncResult.cs
- InputReport.cs
- GorillaCodec.cs
- AccessViolationException.cs
- CancelEventArgs.cs
- DirectoryInfo.cs
- HandlerFactoryCache.cs
- PenThreadWorker.cs
- StrokeSerializer.cs
- CallId.cs
- cookieexception.cs
- StylusPlugin.cs
- ArgumentOutOfRangeException.cs
- IndexedString.cs
- PointCollectionValueSerializer.cs
- CompilerCollection.cs
- WebGetAttribute.cs
- Icon.cs
- IPAddressCollection.cs
- CapabilitiesState.cs
- ServicePointManager.cs
- DbMetaDataCollectionNames.cs
- NotifyIcon.cs
- BrowserCapabilitiesCompiler.cs
- Panel.cs
- Knowncolors.cs
- DtdParser.cs
- CaseInsensitiveOrdinalStringComparer.cs
- RadialGradientBrush.cs
- TextProperties.cs
- Globals.cs
- CompareInfo.cs
- SHA256Managed.cs
- ImageAttributes.cs
- AccessViolationException.cs
- IndentTextWriter.cs
- DefaultPrintController.cs
- ProcessInfo.cs
- CodeTypeDelegate.cs
- IndexedGlyphRun.cs