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
- SqlDataSourceSelectingEventArgs.cs
- FusionWrap.cs
- XmlUrlEditor.cs
- DesignerVerbCollection.cs
- SendMailErrorEventArgs.cs
- CodeSubDirectoriesCollection.cs
- COM2ColorConverter.cs
- HwndTarget.cs
- WinInet.cs
- GridViewAutoFormat.cs
- SettingsPropertyCollection.cs
- SoapEnvelopeProcessingElement.cs
- ITextView.cs
- AdRotatorDesigner.cs
- FormView.cs
- ToolStripRenderer.cs
- PrivateFontCollection.cs
- TextParagraph.cs
- TrackingStringDictionary.cs
- BoundsDrawingContextWalker.cs
- CommandField.cs
- ProfileModule.cs
- PublisherIdentityPermission.cs
- ProvidersHelper.cs
- Rotation3DAnimationUsingKeyFrames.cs
- ApplicationFileParser.cs
- SamlSubject.cs
- FilterException.cs
- TlsnegoTokenProvider.cs
- ItemType.cs
- OdbcTransaction.cs
- EventHandlerList.cs
- DoubleAnimationClockResource.cs
- METAHEADER.cs
- CalendarDesigner.cs
- UniqueEventHelper.cs
- MarkupCompilePass2.cs
- Stack.cs
- ConsoleTraceListener.cs
- SoapElementAttribute.cs
- SequenceDesigner.cs
- EpmCustomContentDeSerializer.cs
- MatrixConverter.cs
- RtfFormatStack.cs
- ThreadExceptionDialog.cs
- AttachedPropertiesService.cs
- VerificationException.cs
- ObjectDisposedException.cs
- DirtyTextRange.cs
- XsdValidatingReader.cs
- TrackingDataItemValue.cs
- XamlFilter.cs
- CodeVariableReferenceExpression.cs
- ConfigurationLocation.cs
- XmlBinaryWriterSession.cs
- ObjectQueryProvider.cs
- DataBindingHandlerAttribute.cs
- SafeNativeMethodsOther.cs
- ClientScriptItemCollection.cs
- ImportStoreException.cs
- SqlBuilder.cs
- QueryGenerator.cs
- RecognizerStateChangedEventArgs.cs
- SeekStoryboard.cs
- PaintValueEventArgs.cs
- PenContexts.cs
- BuildManagerHost.cs
- MemoryFailPoint.cs
- ExpressionHelper.cs
- HtmlEncodedRawTextWriter.cs
- columnmapkeybuilder.cs
- Subset.cs
- cookiecollection.cs
- XmlSchemaGroupRef.cs
- CreateParams.cs
- SqlUserDefinedTypeAttribute.cs
- WorkflowElementDialog.cs
- SpeechRecognizer.cs
- ActiveXHost.cs
- PropertyChangedEventArgs.cs
- SymbolTable.cs
- Baml2006ReaderSettings.cs
- PriorityItem.cs
- WebPermission.cs
- ReferencedType.cs
- StylusPointProperty.cs
- ScriptRegistrationManager.cs
- NumericPagerField.cs
- ExceptionDetail.cs
- BaseInfoTable.cs
- ResumeStoryboard.cs
- DodSequenceMerge.cs
- ImageCreator.cs
- RegionData.cs
- SymbolEqualComparer.cs
- TemplateControlParser.cs
- TextComposition.cs
- CultureTableRecord.cs
- ResumeStoryboard.cs
- DesignerHost.cs