private bool Apply() { if (bezierControl1.Controller.BCPSCount < 2) { return(false); } PPDSheet data = WindowUtility.LayerManager.SelectedPpdSheet; if (data == null) { return(false); } //areaselection data.ApplyTrans(poses, dirs, !radioButton7.Checked); return(true); }
public TimeLineDrawParameter(Graphics graphics, int width, int height, Image backGroundImage, PPDSheet sheet, float bpm, float bpmStart, int interval, DisplayLineMode displayMode, int leftOffset, float currentTime, DisplayBeatType beatType) { Graphics = graphics; Width = width; Height = height; BackGroundImage = backGroundImage; Sheet = sheet; BPM = bpm; BPMStart = bpmStart; Interval = interval; DisplayMode = displayMode; LeftOffset = leftOffset; CurrentTime = currentTime; BeatType = beatType; BeatSplitCount = (int)beatType + 2; }
private void CheckData() { if (WindowUtility.LayerManager == null) { return; } PPDSheet data = WindowUtility.LayerManager.SelectedPpdSheet; if (data == null) { poses = new Vector2[0]; dirs = new Vector2[0]; return; } //areaselection var mks = data.GetAreaData(); poses = new Vector2[mks.Length]; dirs = new Vector2[mks.Length]; float[] ratios = new float[mks.Length]; if (bezierControl1.Controller.BCPSCount >= 2 && poses.Length >= 2) { if (radioButton8.Checked) { float all = mks[mks.Length - 1].Time - mks[0].Time; if (all == 0) { poses = new Vector2[0]; dirs = new Vector2[0]; return; } for (int i = 0; i < mks.Length; i++) { ratios[i] = 99.9999f * (mks[i].Time - mks[0].Time) / all; } } BezierControlPoint[] bcps = bezierControl1.Controller.BCPS; var ba = new BezierAnalyzer(bcps); for (int i = 0; i < poses.Length; i++) { PointF pos; PointF dir; if (radioButton8.Checked) { ba.GetPoint(ratios[i], out pos, out dir); } else if (radioButton9.Checked) { ba.GetPoint(i * 99.9999f / (poses.Length - 1), out pos, out dir); } else if (radioButton10.Checked) { ba.GetPoint(i * 99.9999f / poses.Length, out pos, out dir); } else { float num = (float)60 / (WindowUtility.MainForm.BPM <= 10 ? 10 : WindowUtility.MainForm.BPM); float ratio = ((mks[i].Time - mks[0].Time) / num * FixedDistance) / ba.Length * BezierCaliculator.BezierAnalyzer.MaxRatio; ratio = ratio <= 0 ? 0 : ratio; ba.GetPoint(ratio >= BezierCaliculator.BezierAnalyzer.MaxRatio ? BezierCaliculator.BezierAnalyzer.MaxRatio : ratio, out pos, out dir); } poses[i] = new Vector2(pos.X, pos.Y); dirs[i] = TransDirection(new Vector2(dir.X, dir.Y)); } } if (checkBox4.Checked) { Apply(); } }