Beispiel #1
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            payload.VisualData.Bound.name = "Line Graph Bound";

            var lineGraph = VisualizerFactory.InstantiateLineGraph();

            lineGraph.Initialize(this, payload);

            AssignStates(lineGraph);

            var entries = EntryField.GetLastKeyValue(payload.Data) as IEnumerable <MutableObject>;

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }

            if (!entries.Any())
            {
                yield return(null);

                yield break;
            }

            foreach (var entry in entries)
            {
                Vector3 entryPosition =
                    new Vector3(
                        XAxis.GetLastKeyValue(entry),
                        YAxis.GetLastKeyValue(entry),
                        ZAxis.GetLastKeyValue(entry)
                        );

                Color pointColor = PointColor.GetLastKeyValue(entry);

                lineGraph.AddPoint(entryPosition, pointColor);

                yield return(null);
            }

            yield return(null);

            lineGraph.SetLineData(MainColor.GetLastKeyValue(payload.Data),
                                  LineWidth.GetLastKeyValue(payload.Data),
                                  ZDepthOffset.GetLastKeyValue(payload.Data),
                                  EdgeColor.GetLastKeyValue(payload.Data),
                                  EdgeWidth.GetLastKeyValue(payload.Data),
                                  PointWidth.GetLastKeyValue(payload.Data),
                                  PulseLine.GetLastKeyValue(payload.Data),
                                  PulseWidth.GetLastKeyValue(payload.Data),
                                  Wipe.GetLastKeyValue(payload.Data),
                                  StartTime.GetLastKeyValue(payload.Data),
                                  WipeDuration.GetLastKeyValue(payload.Data)
                                  );

            lineGraph.ApplyPoints();
        }