Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / Matrix3DStack.cs / 1305600 / Matrix3DStack.cs
//---------------------------------------------------------------------------- // //// Copyright (c) Microsoft Corporation. All rights reserved. // // // Description: This is a super simple Matrix3DStack implementation. // MatrixStack (2D) is optimized to avoid boxig and copying // of structs. This was written as a stop-gap to address // a bug until we can use CodeGen here. // // History: // 1/19/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; namespace System.Windows.Media.Media3D { // internal class Matrix3DStack { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- public void Clear() { _stack.Clear(); } public Matrix3D Pop() { Matrix3D top = Top; _stack.RemoveAt(_stack.Count - 1); return top; } ////// Empty => [matrix] /// tail | [top] => tail | [top] | [matrix * top] /// public void Push(Matrix3D matrix) { if (_stack.Count > 0) { matrix.Append(Top); } _stack.Add(matrix); } //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ public int Count { get { return _stack.Count; } } public bool IsEmpty { get { return (_stack.Count == 0); } } public Matrix3D Top { get { return _stack[_stack.Count - 1]; } } //----------------------------------------------------- // // Public Events // //------------------------------------------------------ //----------------------------------------------------- // // Private Fields // //----------------------------------------------------- #region Private Fields private readonly List_stack = new List (); #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------------- // // // Copyright (c) Microsoft Corporation. All rights reserved. // // // Description: This is a super simple Matrix3DStack implementation. // MatrixStack (2D) is optimized to avoid boxig and copying // of structs. This was written as a stop-gap to address // a bug until we can use CodeGen here. // // History: // 1/19/2004 : [....] - Created // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; namespace System.Windows.Media.Media3D { // internal class Matrix3DStack { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- public void Clear() { _stack.Clear(); } public Matrix3D Pop() { Matrix3D top = Top; _stack.RemoveAt(_stack.Count - 1); return top; } ////// Empty => [matrix] /// tail | [top] => tail | [top] | [matrix * top] /// public void Push(Matrix3D matrix) { if (_stack.Count > 0) { matrix.Append(Top); } _stack.Add(matrix); } //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ public int Count { get { return _stack.Count; } } public bool IsEmpty { get { return (_stack.Count == 0); } } public Matrix3D Top { get { return _stack[_stack.Count - 1]; } } //----------------------------------------------------- // // Public Events // //------------------------------------------------------ //----------------------------------------------------- // // Private Fields // //----------------------------------------------------- #region Private Fields private readonly List_stack = new List (); #endregion Private Fields } } // 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
- Sorting.cs
- CodeAttributeArgument.cs
- IxmlLineInfo.cs
- coordinatorscratchpad.cs
- FieldToken.cs
- TemplateBuilder.cs
- DeflateStream.cs
- ParagraphResult.cs
- HttpCookieCollection.cs
- MethodBuilder.cs
- ConsoleCancelEventArgs.cs
- InvalidProgramException.cs
- RoleManagerModule.cs
- XmlDataProvider.cs
- TagElement.cs
- CompressedStack.cs
- SByte.cs
- PageContentCollection.cs
- SqlClientMetaDataCollectionNames.cs
- TableRowsCollectionEditor.cs
- DataTableMapping.cs
- InputLanguageManager.cs
- HMAC.cs
- CqlGenerator.cs
- LockRecursionException.cs
- EventProxy.cs
- NativeActivityTransactionContext.cs
- InlineObject.cs
- Literal.cs
- TypeExtensionConverter.cs
- CompensationToken.cs
- FileFormatException.cs
- XmlCountingReader.cs
- EventEntry.cs
- HostingEnvironment.cs
- WebCategoryAttribute.cs
- SaveFileDialog.cs
- SessionStateSection.cs
- ControlPropertyNameConverter.cs
- ControlPager.cs
- TCEAdapterGenerator.cs
- TimeIntervalCollection.cs
- PointAnimationClockResource.cs
- RSAPKCS1KeyExchangeFormatter.cs
- TextElement.cs
- TemplateControlBuildProvider.cs
- ControlValuePropertyAttribute.cs
- ValueUtilsSmi.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- CrossSiteScriptingValidation.cs
- BitmapFrameDecode.cs
- IList.cs
- ObfuscateAssemblyAttribute.cs
- TableLayoutPanel.cs
- UIElementParagraph.cs
- XamlReaderHelper.cs
- TextBoxBase.cs
- WindowsToolbar.cs
- XmlSchemaElement.cs
- TopClause.cs
- HashAlgorithm.cs
- PageThemeBuildProvider.cs
- RectConverter.cs
- cryptoapiTransform.cs
- ServiceModelConfiguration.cs
- SecurityPolicySection.cs
- EditorPartCollection.cs
- ComponentEditorForm.cs
- RegexGroupCollection.cs
- brushes.cs
- Compiler.cs
- SemaphoreSlim.cs
- _TransmitFileOverlappedAsyncResult.cs
- DiagnosticTrace.cs
- DBCSCodePageEncoding.cs
- AudioSignalProblemOccurredEventArgs.cs
- GradientStop.cs
- Transaction.cs
- SQLByteStorage.cs
- FormsAuthenticationUserCollection.cs
- AttachedPropertyMethodSelector.cs
- CFGGrammar.cs
- XsdBuildProvider.cs
- PriorityBinding.cs
- OrderedDictionary.cs
- PaintEvent.cs
- ExpressionList.cs
- Odbc32.cs
- Rectangle.cs
- OdbcRowUpdatingEvent.cs
- FontClient.cs
- XmlILAnnotation.cs
- System.Data_BID.cs
- HtmlHead.cs
- CertificateManager.cs
- GC.cs
- HttpFileCollection.cs
- DNS.cs
- TextModifierScope.cs
- CustomAttribute.cs