コード例 #1
0
        private void UpdateKeyframes(bool selected, IList <DsRow> rows, Material material, int index, float rowHeight, float aspect, Vector3 offset, float visibleColumns, Vector3 keyframeScale)
        {
            int rowNumber = 0;

            for (int i = 0; i < rows.Count; ++i)
            {
                DsRow row = rows[i];
                if (row.IsVisible)
                {
                    List <DsKeyframe> keyframes = selected ? row.SelectedKeyframes : row.Keyframes;
                    for (int j = 0; j < keyframes.Count; ++j)
                    {
                        DsKeyframe keyframe = keyframes[j];
                        m_matrices[index] = Matrix4x4.TRS(
                            offset + new Vector3(aspect * keyframe.Col / visibleColumns, -rowHeight * rowNumber, 1),
                            Quaternion.Euler(0, 0, 45),
                            keyframeScale);

                        index++;
                        if (index == k_batchSize)
                        {
                            index = 0;
                            m_rteCamera.CommandBuffer.DrawMeshInstanced(m_quad, 0, material, 0, m_matrices, k_batchSize);
                        }
                    }

                    rowNumber++;
                }
            }

            if (0 < index && index < k_batchSize)
            {
                m_rteCamera.CommandBuffer.DrawMeshInstanced(m_quad, 0, material, 0, m_matrices, index);
            }
        }
コード例 #2
0
ファイル: ABSDealUtils.cs プロジェクト: weedkiller/absmanager
        /// <summary>
        /// 合并留存金额
        /// </summary>
        private static void MergeReserveRows(DsTable dsTable)
        {
            var sumReserveRow = new DsRow();

            for (int i = 0; i < dsTable.ColumnCount - 2; i++)
            {
                sumReserveRow.AppendValue((0m).ToString("n2"));
            }

            var rowCsdcReserve = dsTable.FindRow("中证本息兑付留存.End Balance");

            if (rowCsdcReserve != null)
            {
                sumReserveRow += rowCsdcReserve;
            }

            var rows = dsTable.Rows.Where(x => x.Description.EndsWith("Reserve.End Balance", StringComparison.CurrentCultureIgnoreCase) ||
                                          x.Description.EndsWith("留存账户.End Balance", StringComparison.CurrentCultureIgnoreCase)).ToList();

            foreach (var row in rows)
            {
                sumReserveRow += row;
            }

            sumReserveRow.Name        = "Reserve Accounts";
            sumReserveRow.Description = "当期留存账户余额";

            var reserveAccountDisplayEventRow = dsTable.FindRow("留存账户显示事件");

            if (reserveAccountDisplayEventRow == null)
            {
                dsTable.RemoveRow(rowCsdcReserve);
                dsTable.RemoveRow(rows);
            }
            else
            {
                dsTable.RemoveRow(reserveAccountDisplayEventRow);
            }

            //汇总后的留存金额插入到表中
            var insertRow = false;

            for (int i = dsTable.Rows.Count - 1; i >= 0; i--)
            {
                var row = dsTable.Rows[i];
                if (row.Name.Equals("Reserve Accounts", StringComparison.CurrentCultureIgnoreCase))
                {
                    dsTable.Rows.Insert(i + 1, sumReserveRow);
                    insertRow = true;
                    break;
                }
            }

            if (!insertRow)
            {
                dsTable.Rows.Add(sumReserveRow);
            }
        }
コード例 #3
0
            public void RefreshCurve(int index)
            {
                DsRow row = m_rows[index];
                row.RefreshCurve(FrameRate);

                if(Modified != null)
                {
                    Modified();
                }
            }
コード例 #4
0
            private void SelectKeyframe(DsKeyframe kf, int key)
            {
                m_keyframes.Remove(kf);
                m_kfDictionary.Remove(key);
                kf.Row.Keyframes.Remove(kf);

                m_selectedKfDictionary.Add(key, kf);
                m_selectedKeyframes.Add(kf);

                DsRow dopesheetRow = kf.Row;
                dopesheetRow.SelectedKeyframes.Add(kf);
            }
コード例 #5
0
            private void RefreshCurves()
            {
                for (int i = 0; i < m_rows.Count; ++i)
                {
                    DsRow row = m_rows[i];
                    row.RefreshCurve(FrameRate);
                }

                if (Modified != null)
                {
                    Modified();
                }
            }
コード例 #6
0
 public bool RemoveRow(int row)
 {
     DsRow dopesheetRow = m_rows[row];
     if(dopesheetRow.Parent != null)
     {
         dopesheetRow.Parent.Children.Remove(dopesheetRow);
         if(dopesheetRow.Parent.Children.Count == 0)
         {
             dopesheetRow.Parent.Children = null;
         }
     }
     m_rows.RemoveAt(row);
     UpdateRowIndexes();
     return dopesheetRow.IsVisible;
 }
コード例 #7
0
            public void SelectKeyframes(params DsKeyframe[] keyframes)
            {
                for (int i = 0; i < keyframes.Length; ++i)
                {
                    DsKeyframe kf  = keyframes[i];
                    int        key = kf.Row.Index * ColsCount + kf.Col;

                    if (m_kfDictionary.TryGetValue(key, out kf))
                    {
                        SelectKeyframe(kf, key);
                        DsRow dopesheetRow = kf.Row;
                        while (dopesheetRow.Parent != null)
                        {
                            DsKeyframe parentKf;
                            int        parentKey = dopesheetRow.Parent.Index * ColsCount + kf.Col;
                            if (m_kfDictionary.TryGetValue(parentKey, out parentKf))
                            {
                                SelectKeyframe(parentKf, parentKey);
                            }
                            dopesheetRow = dopesheetRow.Parent;
                        }

                        dopesheetRow = kf.Row;
                        if (dopesheetRow.Children != null)
                        {
                            List <DsKeyframe> childKeyframes = new List <DsKeyframe>();
                            for (int c = 0; c < dopesheetRow.Children.Count; ++c)
                            {
                                DsRow      childRow      = dopesheetRow.Children[c];
                                DsKeyframe childKeyframe = GetKeyframe(childRow.Index, kf.Col);
                                if (childKeyframe != null)
                                {
                                    childKeyframes.Add(childKeyframe);
                                }
                            }

                            SelectKeyframes(childKeyframes.ToArray());
                        }
                    }
                }
            }
コード例 #8
0
            public DsRow AddRow(bool isVisible, int parentIndex, float initialValue, AnimationCurve curve)
            {
                DsRow row = new DsRow();
                row.IsVisible = isVisible;
                row.Index = m_rows.Count;
                m_rows.Add(row);

                if(parentIndex > -1)
                {
                    row.Parent = m_rows[parentIndex];
                    if(row.Parent.Children == null)
                    {
                        row.Parent.Children = new List<DsRow>();
                    }

                    row.Parent.Children.Add(row);
                }

                UpdateRowIndexes();
                return row;
            }
コード例 #9
0
 public DsKeyframe(DsRow row, int col, float value)
 {
     Row   = row;
     Col   = col;
     Value = value;
 }