Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="drawobject"></param>
 public void AddSelectedObject(IDrawObject drawobject)
 {
     DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
     RemoveSelectedObject(drawobject);
     m_selection[drawobject] = true;
     obj.Selected            = true;
 }
Esempio n. 2
0
 public virtual void Copy(DrawObjectBase acopy)
 {
     UseLayerColor = acopy.UseLayerColor;
     UseLayerWidth = acopy.UseLayerWidth;
     Width         = acopy.Width;
     Color         = acopy.Color;
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="drawobject"></param>
 public void RemoveSelectedObject(IDrawObject drawobject)
 {
     if (m_selection.ContainsKey(drawobject))
     {
         DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
         obj.Selected = false;
         m_selection.Remove(drawobject);
     }
 }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        public void ClearSelectedObjects()
        {
            IEnumerable <IDrawObject> x = SelectedObjects;

            foreach (IDrawObject drawobject in x)
            {
                DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
                obj.Selected = false;
            }
            m_selection.Clear();
        }
Esempio n. 5
0
        public IDrawObject CreateObject(string type, UnitPoint point, ISnapPoint snappoint)
        {
            DrawingLayer layer = ActiveLayer as DrawingLayer;

            if (layer.Enabled == false)
            {
                return(null);
            }
            DrawTools.DrawObjectBase newobj = CreateObject(type);
            if (newobj != null)
            {
                newobj.Layer = layer;
                newobj.InitializeFromModel(point, layer, snappoint);
            }
            return(newobj as IDrawObject);
        }
        public void Draw(ICanvas canvas, RectangleF unitrect)
        {
            CommonTools.Tracing.StartTrack(Program.TracePaint);
            int cnt = 0;

            foreach (IDrawObject drawobject in m_objects)
            {
                DrawTools.DrawObjectBase obj = drawobject as DrawTools.DrawObjectBase;
                if (obj is IDrawObject && ((IDrawObject)obj).ObjectInRectangle(canvas, unitrect, true) == false)
                {
                    continue;
                }
                bool sel  = obj.Selected;
                bool high = obj.Highlighted;
                obj.Selected = false;
                drawobject.Draw(canvas, unitrect);
                obj.Selected    = sel;
                obj.Highlighted = high;
                cnt++;
            }
            CommonTools.Tracing.EndTrack(Program.TracePaint, "Draw Layer {0}, ObjCount {1}, Painted ObjCount {2}", Id, m_objects.Count, cnt);
        }
Esempio n. 7
0
 public virtual void Copy(DrawObjectBase acopy)
 {
     UseLayerColor = acopy.UseLayerColor;
     UseLayerWidth = acopy.UseLayerWidth;
     Width = acopy.Width;
     Color = acopy.Color;
 }