Ejemplo n.º 1
0
        public void OnAdd(object sender, EventArgs e)
        {
            if (sail == null)
                return;

            List<Type> useThese = new List<Type>();

            useThese.Add(typeof(MouldCurve));
            useThese.Add(typeof(GuideComb));

            AddGroup dlg = new AddGroup(useThese);
            dlg.Name = "enter name";
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IRebuild cur = dlg.CreateIRebuild();
                if (cur.GetType().Name == "GuideComb")
                {
                    m_curveTracker = new CurveTracker(new GuideComb(dlg.Label, m_group.Sail, new IFitPoint[] { new FixedPoint(0, 0), new FixedPoint(1, 1) }, new Vect2[] { new Vect2(0, 1), new Vect2(1, 1) }));
                    m_curveTracker.Track(m_frame);
                }
                else
                {
                    m_curveTracker = new CurveTracker(new MouldCurve(dlg.Label, m_group.Sail, new IFitPoint[] { new FixedPoint(0, 0), new FixedPoint(1, 1) }));
                    m_curveTracker.Track(m_frame);
                }

            }
            //here we need to ask if we want a GuideComb or a normal curve
        }
Ejemplo n.º 2
0
 private void m_addCurve_Click(object sender, EventArgs e)
 {
     if (ActiveSail == null)
         return;
     AddGroup dlg = new AddGroup();
     dlg.Name = "enter name";
     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         IGroup grp = dlg.CreateGroup();
         if (grp != null)
         {
             ActiveSail.Add(grp);
             ActiveSail.Rebuild(null);
         }
     }
 }