Ejemplo n.º 1
0
        public FloatProgression clone()
        {
            FloatProgression clone = new FloatProgression();

            clone.Copy(this);
            return(clone);
        }
Ejemplo n.º 2
0
        private void chartControl1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            ScalarProgressionDragDropPacket packet = (ScalarProgressionDragDropPacket)e.Data.GetData(typeof(ScalarProgressionDragDropPacket));

            if (packet == null)
            {
                return;
            }

            ChartControl senderControl = (ChartControl)packet.sender;

            if (chartControl1.Handle == senderControl.Handle)
            {
                return;
            }

            FloatProgression newData = (FloatProgression)packet.data;

            if (newData == null)
            {
                return;
            }

            data.Copy(newData);

            bInitialized = false;
            getModifiedData();
            bInitialized = true;
            refreshListBox();
            refreshTextBoxes();
            refreshGraph();
            chartControl1.Refresh();
            updateEnableState();
        }
Ejemplo n.º 3
0
        public void Copy(FloatProgression f)
        {
            Stages.Clear();
            for (int i = 0; i < f.Stages.Count; ++i)
            {
                addStage(f.Stages[i].Value, f.Stages[i].ValueVariance, f.Stages[i].Alpha);
            }

            Cycles = f.Cycles;
            Loop   = f.Loop;
        }
Ejemplo n.º 4
0
 public void initControl(ScalarProgressionControl control, FloatProgression p, Color startColor, Color endColor, string name, double AxisMinY, double AxisMaxY, double default0, double default1, bool enableLooping)
 {
     control.AxisMinY        = AxisMinY;
     control.AxisMaxY        = AxisMaxY;
     control.DefaultValue0   = default0;
     control.DefaultValue1   = default1;
     control.ChartStartColor = startColor;
     control.ChartEndColor   = endColor;
     control.ProgressionName = name;
     control.LoopControl     = enableLooping;
     control.setData(p);
 }
Ejemplo n.º 5
0
        public bool IsEqual(FloatProgression f)
        {
            if ((Cycles != f.Cycles) || (Loop != f.Loop) || (Stages.Count != f.Stages.Count))
            {
                return(false);
            }

            for (int i = 0; i < Stages.Count; ++i)
            {
                if ((Stages[i].Alpha != f.Stages[i].Alpha) ||
                    (Stages[i].Value != f.Stages[i].Value) ||
                    (Stages[i].ValueVariance != f.Stages[i].ValueVariance))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 6
0
        private void LoadProgression(string filename)
        {
            XmlSerializer    s  = new XmlSerializer(typeof(FloatProgression), new Type[] { });
            Stream           st = File.OpenRead(filename);
            FloatProgression loadedProgression = new FloatProgression();

            loadedProgression = (FloatProgression)s.Deserialize(st);
            st.Close();

            data.Copy(loadedProgression);

            bInitialized = false;
            getModifiedData();
            bInitialized = true;
            refreshListBox();
            refreshTextBoxes();
            refreshGraph();
            chartControl1.Refresh();
            updateEnableState();
        }
Ejemplo n.º 7
0
        public void setData(FloatProgression p)
        {
            bInitialized = false;
            data         = p;

            m_Line.AreaFillEffect.BeginColor = ChartStartColor;
            m_Line.AreaFillEffect.EndColor   = ChartEndColor;

            setAxisMinMax(mMinX, mMaxX, mMinY, mMaxY);
            groupBox1.Text = ProgressionName;

            if (data.Stages.Count == 0)
            {
                //-- by default we always have two end points that cannot be deleted
                data.addStage(mDefaultValue0, 0, 0);
                data.addStage(mDefaultValue1, 0, 100);
            }

            //--normalize the data
            for (int i = 0; i < data.Stages.Count; ++i)
            {
                if (data.Stages[i].Value > mMaxY)
                {
                    data.Stages[i].Value = mMaxY;
                }
                else if (data.Stages[i].Value < mMinY)
                {
                    data.Stages[i].Value = mMinY;
                }
            }

            getModifiedData();
            bInitialized = true;
            refreshListBox();
            refreshTextBoxes();
            refreshGraph();
            chartControl1.Refresh();
            enableLoopControl(mLoopControl);
            updateEnableState();
        }
Ejemplo n.º 8
0
 public VectorProgression()
 {
     mXProgression = new FloatProgression();
     mYProgression = new FloatProgression();
     mZProgression = new FloatProgression();
 }