3DTools/Matrix3DStack.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

///---------------------------------------------------------------------------
//
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Limited Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/limitedpermissivelicense.mspx
// All other rights reserved.
//
// This file is part of the 3D Tools for Windows Presentation Foundation
// project.  For more information, see:
// 
// http://CodePlex.com/Wiki/View.aspx?ProjectName=3DTools
//
//---------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Media.Media3D;

namespace _3DTools
{
    /// <summary>
    ///     Matrix3DStack is a stack of Matrix3Ds.
    /// </summary>
    public class Matrix3DStack : IEnumerable<Matrix3D>, ICollection
    {
        public Matrix3D Peek()
        {
            return _storage[_storage.Count - 1];
        }

        public void Push(Matrix3D item)
        {
            _storage.Add(item);
        }

        public void Append(Matrix3D item)
        {            
            if (Count > 0)
            {
                Matrix3D top = Peek();
                top.Append(item);
                Push(top);
            }
            else
            {
                Push(item);
            }
        }

        public void Prepend(Matrix3D item)
        {
            if (Count > 0)
            {
                Matrix3D top = Peek();
                top.Prepend(item);
                Push(top);
            }
            else
            {
后面还有 70 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。