예제 #1
0
        /// <summary>
        /// 将一个compositegraphic的内容merge到本对象中
        /// </summary>
        public void MergeComposite(CompositeGraphic cg, double left = 0.0f, double top = 0.0f)
        {
            List <_graphicpos> lgp = cg.getGraphicPosList();
            List <_graphicpos> l   = new List <_graphicpos>(lgp);

            for (int i = 0; i < l.Count; i++)
            {
                _graphicpos gp = l[i];
                this.Add(gp.g, left + gp.left, top + gp.top);
            }
            cg.Father = null;
        }
예제 #2
0
 public override CompositeGraphic SelectRect(Rect r, double left = 0.0f, double top = 0.0f)
 {
     CompositeGraphic cg = new CompositeGraphic();
     cg.isTemporary = true;
     RectangleGeometry rg = new RectangleGeometry(r);
     Geometry g = getGeometry(left, top);
     if (g.FillContainsWithDetail(rg) != IntersectionDetail.Empty)
     {
         cg.Add(this, left, top);
         return cg;
     }
     return null;
 }
예제 #3
0
 /// <summary>
 /// 将没有内容的cg转化为null
 /// </summary>
 protected CompositeGraphic DisposeNullComposite(CompositeGraphic cg)
 {
     if (cg == null)
     {
         return(null);
     }
     if (cg.isEmpty())
     {
         cg.DisposeMe();
         return(null);
     }
     cg.isTemporary = true;
     return(cg);
 }
        public override CompositeGraphic SelectRect(Rect r, double left = 0.0f, double top = 0.0f)
        {
            CompositeGraphic cg = new CompositeGraphic();

            cg.isTemporary = true;
            RectangleGeometry rg = new RectangleGeometry(r);
            Geometry          g  = getGeometry(left, top);

            if (g.FillContainsWithDetail(rg) != IntersectionDetail.Empty)
            {
                cg.Add(this, left, top);
                return(cg);
            }
            return(null);
        }
예제 #5
0
        /// <summary>
        /// 全选
        /// </summary>
        public CompositeGraphic SelectAll()
        {
            CompositeGraphic cg = new CompositeGraphic();

            cg.Width  = this.Width;
            cg.Height = this.Height;
            List <_graphicpos> l = new List <_graphicpos>(_list);

            for (int i = 0; i < l.Count; i++)
            {
                _graphicpos gp = l[i];
                cg.Add(gp.g, gp.left, gp.top);
            }
            this.Add(cg);
            return(cg);
        }
예제 #6
0
        public override MyGraphic Clone()
        {
            CompositeGraphic cg = new CompositeGraphic(backgroundmode);

            cg.isVisible = this.isVisible;
            foreach (_graphicpos gp in _list)
            {
                MyGraphic g = gp.g.Clone();
                cg.Add(g, gp.left, gp.top);
            }
            cg.Width       = this.Width;
            cg.Height      = this.Height;
            cg.isCombined  = this.isCombined;
            cg.isTemporary = this.isTemporary;
            return(cg);
        }
예제 #7
0
        public override CompositeGraphic SelectRect(Rect r, double left = 0.0f, double top = 0.0f)
        {
            CompositeGraphic compositegraphic = new CompositeGraphic();

            compositegraphic.isTemporary = true;
            RectangleGeometry rg = new RectangleGeometry(r);

            if (getBorder(left, top).FillContainsWithDetail(rg) != IntersectionDetail.Empty || isTemporary)
            {
                if (!isCombined)
                {
                    List <_graphicpos> lg = new List <_graphicpos>(_list);
                    for (int i = 0; i < lg.Count; i++)
                    {
                        _graphicpos      gp = lg[i];
                        CompositeGraphic cg = gp.g.SelectRect(r, gp.left, gp.top);
                        if (cg == null || cg.isEmpty())
                        {
                            continue;
                        }
                        cg.isTemporary = true;
                        compositegraphic.MergeComposite(cg, left, top);
                    }
                }
                else
                {
                    return(this);
                }
            }
            if (compositegraphic.isEmpty())
            {
                return(null);
            }
            this.Add(compositegraphic);
            return(compositegraphic);
        }
예제 #8
0
 public override CompositeGraphic SelectRect(Rect r, double left = 0.0f, double top = 0.0f)
 {
     CompositeGraphic compositegraphic = new CompositeGraphic();
     compositegraphic.isTemporary = true;
     RectangleGeometry rg = new RectangleGeometry(r);
     if (getBorder(left, top).FillContainsWithDetail(rg) != IntersectionDetail.Empty || isTemporary)
     {
         if (!isCombined)
         {
             List<_graphicpos> lg = new List<_graphicpos>(_list);
             for (int i = 0; i < lg.Count; i++)
             {
                 _graphicpos gp = lg[i];
                 CompositeGraphic cg = gp.g.SelectRect(r, gp.left, gp.top);
                 if (cg == null || cg.isEmpty()) continue;
                 cg.isTemporary = true;
                 compositegraphic.MergeComposite(cg, left, top);
             }
         }
         else
         {
             return this;
         }
     }
     if (compositegraphic.isEmpty()) return null;
     this.Add(compositegraphic);
     return compositegraphic;
 }
예제 #9
0
 /// <summary>
 /// 全选
 /// </summary>
 public CompositeGraphic SelectAll()
 {
     CompositeGraphic cg = new CompositeGraphic();
     cg.Width = this.Width;
     cg.Height = this.Height;
     List<_graphicpos> l = new List<_graphicpos>(_list);
     for (int i = 0; i < l.Count; i++)
     {
         _graphicpos gp = l[i];
         cg.Add(gp.g, gp.left, gp.top);
     }
     this.Add(cg);
     return cg;
 }
예제 #10
0
 /// <summary>
 /// 将一个compositegraphic的内容merge到本对象中
 /// </summary>
 public void MergeComposite(CompositeGraphic cg, double left = 0.0f, double top = 0.0f)
 {
     List<_graphicpos> lgp = cg.getGraphicPosList();
     List<_graphicpos> l = new List<_graphicpos>(lgp);
     for (int i = 0; i < l.Count; i++)
     {
         _graphicpos gp = l[i];
         this.Add(gp.g, left + gp.left, top + gp.top);
     }
     cg.Father = null;
 }
예제 #11
0
 public override MyGraphic Clone()
 {
     CompositeGraphic cg = new CompositeGraphic(backgroundmode);
     cg.isVisible = this.isVisible;
     foreach (_graphicpos gp in _list)
     {
         MyGraphic g = gp.g.Clone();
         cg.Add(g, gp.left, gp.top);
     }
     cg.Width = this.Width;
     cg.Height = this.Height;
     cg.isCombined = this.isCombined;
     cg.isTemporary = this.isTemporary;
     return cg;
 }
예제 #12
0
 /// <summary>
 /// 对象删除
 /// </summary>
 public void DisposeMe()
 {
     Father = null;
 }