Ejemplo n.º 1
0
        public PixelPointsManager(ValuePoints valuePoints)
        {
            pointsCur  = new PixelPoints(valuePoints);
            pointsEdit = new PixelPoints(valuePoints);

            isDrawing = editingEndedDuringDrawing = isEditing = false;
        }
        public override void Do(IDemoChartControl chartControl)
        {
            // Initialize positions.
            var positions = new Vector3F[PointsCount];

            for (int i = 0; i < PointsCount; i++)
            {
                positions[i] = new Vector3F(
                    (float)Random.NextDouble() * MaxRadius,
                    (float)Random.NextDouble() * MaxRadius,
                    (float)Random.NextDouble() * MaxRadius);
            }

            // Initialize data reader.
            var reader = new DynamicPositionValueMaskDataReader(PointsCount, new OneAxisBounds(0, ValueBound));

            // Creation of data presentation.
            var points = new ValuePoints
            {
                // Reader can be reused and we can create several presentations for 1 reader.
                Reader = reader,
                // Set name.
                Name = "Points"
            };

            // Randomize initial data.
            reader.UpdatePositions(positions);
            reader.UpdateValues(RandomizeValues(positions, 0));

            // Setup chart options.
            chartControl.Axes.IsAxes3DVisible = true;

            // Set chart data source.
            chartControl.DataSource = points;

            // Start animation.
            animationHelper.Start(
                (f) => f,
                rf => reader.UpdateValues(RandomizeValues(positions, rf)),
                0, 0.075f, 25);
        }
Ejemplo n.º 3
0
        //-------------------------------------------------------------------------

        virtual public void GetAsXml(XmlElement xml)
        {
            // Type.
            XmlAttribute attrib = xml.OwnerDocument.CreateAttribute("type");

            attrib.Value = GetType().AssemblyQualifiedName;
            xml.Attributes.Append(attrib);

            // Id.
            XmlElement element = xml.OwnerDocument.CreateElement("Id");

            element.InnerText = Id.ToString();
            xml.AppendChild(element);

            // Title.
            element           = xml.OwnerDocument.CreateElement("Title");
            element.InnerText = Title;
            xml.AppendChild(element);

            // Description.
            element           = xml.OwnerDocument.CreateElement("Description");
            element.InnerText = Description;
            xml.AppendChild(element);

            // Points.
            element           = xml.OwnerDocument.CreateElement("ValuePoints");
            element.InnerText = ValuePoints.ToString();
            xml.AppendChild(element);

            element           = xml.OwnerDocument.CreateElement("EffortPoints");
            element.InnerText = EffortPoints.ToString();
            xml.AppendChild(element);

            element           = xml.OwnerDocument.CreateElement("PriorityPoints");
            element.InnerText = PriorityPoints.ToString();
            xml.AppendChild(element);
        }