Ejemplo n.º 1
0
        private void SelectCurve(MouldCurve cur)
        {
            if (cur == null)
                return;
            if (m_temp != null)
                View.Remove(m_temp);

            Curve = cur;

            IFitPoint[] pts = new IFitPoint[Curve.FitPoints.Length];
            for (int i = 0; i < pts.Length; i++)
                pts[i] = Curve[i].Clone();

            m_temp = new MouldCurve(cur);
            m_temp.Label += "[preview]";
            m_tents = View.AddRange(m_temp.CreateEntities(true));

            foreach (Entity[] ents in m_tents)
                foreach (Entity ee in ents)
                {
                    ee.Color = Color.LightSkyBlue;
                    ee.ColorMethod = colorMethodType.byEntity;
                    if ( ee.LineWeight == 1 ) ee.LineWeight = 2.0f;
                    ee.LineWeightMethod = colorMethodType.byEntity;
                }

            m_edit.AutoFill = Sail.Watermark(Curve, Tree.SelectedTag as IGroup).ToList<object>();
            m_edit.ReadCurve(m_temp);
            m_edit.Label = Curve.Label;
            m_edit.Refresh();

            if (Tree.SelectedTag != Curve)
                Tree.SelectedTag = Curve;

            View.Select(Curve);
            View.Refresh();
        }
Ejemplo n.º 2
0
        //public void Add(IGroup g)
        //{
        //    Entity[] groupEntities = g.CreateEntities();
        //    devDept.Eyeshot.Labels.Label[] groupLabels = g.EntityLabel;
        //    if (groupEntities == null)
        //        return;
        //    int layerIndex = AddLayer(g.Label, true);
        //    for (int i = 0; i < groupEntities.Length; i++)
        //    {
        //        if( groupEntities[i].LayerIndex == 0 )
        //            groupEntities[i].LayerIndex = layerIndex;
        //        Add(groupEntities[i], groupLabels);
        //    }
        //}
        public Entity[][] Add(MouldCurve curve)
        {
            IRebuild g = curve.Group;
            int layerIndex = AddLayer(g.Label, Color.Black, true);
            List<Entity> es = curve.CreateEntities().ToList();
            devDept.Eyeshot.Labels.Label[] labels = curve.EntityLabel;

            foreach (Entity e in es)
                e.LayerIndex = layerIndex;
            if (labels == null)
                return AddRange(es);
            return AddRange(es, labels);
        }