Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Application.cs
- QueryOperator.cs
- OutputCacheModule.cs
- WS2007HttpBinding.cs
- followingsibling.cs
- AsyncSerializedWorker.cs
- DNS.cs
- SqlBulkCopyColumnMapping.cs
- Item.cs
- ColumnCollection.cs
- Bold.cs
- GenericQueueSurrogate.cs
- TextTreeFixupNode.cs
- ServicePointManager.cs
- UpDownBase.cs
- UnicodeEncoding.cs
- SortDescription.cs
- SqlOuterApplyReducer.cs
- Binding.cs
- StateInitialization.cs
- Pens.cs
- ExpandedProjectionNode.cs
- AssemblyAttributes.cs
- Win32SafeHandles.cs
- SafeProcessHandle.cs
- ListBoxChrome.cs
- ClassHandlersStore.cs
- DataBinder.cs
- GPStream.cs
- loginstatus.cs
- MouseGestureConverter.cs
- SqlMethodCallConverter.cs
- DiagnosticsConfigurationHandler.cs
- RoleManagerModule.cs
- TransactionFilter.cs
- CollaborationHelperFunctions.cs
- DoubleKeyFrameCollection.cs
- BindingElementExtensionElement.cs
- activationcontext.cs
- WebPartMenu.cs
- StringAttributeCollection.cs
- RecipientInfo.cs
- ForwardPositionQuery.cs
- IntPtr.cs
- EntityModelBuildProvider.cs
- Preprocessor.cs
- MatrixTransform3D.cs
- DataGridState.cs
- SystemDiagnosticsSection.cs
- XmlWhitespace.cs
- AuthStoreRoleProvider.cs
- DataGridToolTip.cs
- RequestCachingSection.cs
- DbDataRecord.cs
- ListManagerBindingsCollection.cs
- DbException.cs
- QueryCacheEntry.cs
- FindCriteriaElement.cs
- Error.cs
- RemotingException.cs
- PersonalizableTypeEntry.cs
- AuthenticatingEventArgs.cs
- RadioButtonList.cs
- QueryCacheKey.cs
- PreservationFileReader.cs
- UTF8Encoding.cs
- Int64.cs
- HttpCookiesSection.cs
- InputScopeAttribute.cs
- RegexCompiler.cs
- ZipIOExtraFieldPaddingElement.cs
- ProtocolsSection.cs
- RegexParser.cs
- InputQueue.cs
- Matrix.cs
- WebInvokeAttribute.cs
- TriggerAction.cs
- CollectionViewGroupInternal.cs
- TailCallAnalyzer.cs
- ComponentManagerBroker.cs
- WSHttpBindingBaseElement.cs
- ModifierKeysValueSerializer.cs
- RepeaterItemEventArgs.cs
- _UriSyntax.cs
- SamlAuthenticationClaimResource.cs
- InkPresenter.cs
- XmlSchemaFacet.cs
- DateTimeUtil.cs
- DynamicDataResources.Designer.cs
- HostingEnvironmentException.cs
- ConnectionModeReader.cs
- ClientSettingsProvider.cs
- LineMetrics.cs
- AuthorizationRuleCollection.cs
- WebPartMovingEventArgs.cs
- XmlMembersMapping.cs
- CodeThrowExceptionStatement.cs
- XmlAttribute.cs
- ExpressionPrefixAttribute.cs
- DeadCharTextComposition.cs