Ejemplo n.º 1
0
            /// <summary>
            /// Drawing method used to draw factory content
            /// </summary>
            /// <param name="graphics">Graphic environment parameters</param>
            public void Draw(PicGraphics graphics, PicFilter filter)
            {
                graphics.Initialize();

                // bounding box
                if (!graphics.DrawingBox.IsValid)
                {
                    // compute bounding box
                    using (PicVisitorBoundingBox visitor = new PicVisitorBoundingBox())
                    {
                        ProcessVisitor(visitor);
                        Box2D box = visitor.Box;
                        box.AddMarginRatio(0.01);
                        // set as drawing box
                        graphics.DrawingBox = box;
                    }
                }

                // first, draw cotation
                foreach (PicEntity entity in _entities)
                {
                    try
                    {
                        // cotation
                        PicCotation cotation = entity as PicCotation;
                        if (cotation != null && !cotation.Deleted && filter.Accept(entity))
                        {
                            cotation.Draw(graphics);
                        }
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex.Message);
                    }
                }
                // then other entities
                foreach (Object o in _entities)
                {
                    try
                    {
                        // drawable entities
                        PicDrawable drawable = o as PicDrawable;
                        if (drawable != null && !drawable.Deleted && !(drawable is PicCotation) && filter.Accept(drawable))
                        {
                            drawable.Draw(graphics);
                        }
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex.Message);
                    }
                }
                // cardboard format
                if (null != _cardboardFormat)
                {
                    _cardboardFormat.Draw(graphics);
                }

                graphics.Finish();
            }
Ejemplo n.º 2
0
 protected override void DrawSpecific(PicGraphics graphics, Transform2D transform)
 {
     foreach (PicEntity entity in _block)
     {
         PicDrawable drawable = entity as PicDrawable;
         if (null != drawable && !(drawable is PicCotation))
         {
             drawable.Draw(graphics, transform * BlockTransformation);
         }
     }
 }
Ejemplo n.º 3
0
 protected override void DrawSpecific(PicGraphics graphics)
 {
     foreach (PicEntity entity in _entities)
     {
         PicDrawable drawable = entity as PicDrawable;
         if (null != drawable && !(drawable is PicCotation))
         {
             drawable.Draw(graphics);
         }
     }
 }