Exemplo n.º 1
0
        public void TestSow()
        {
            TabBordeoMenu ctrl = this.Controls.Where(x => x is TabBordeoMenu).FirstOrDefault() as TabBordeoMenu;
            BordeoSower   sow  = new BordeoSower(ctrl);

            sow.Sow();
        }
Exemplo n.º 2
0
 public void TestBlock()
 {
     new QuickTransactionWrapper((Document doc, Transaction tr) =>
     {
         try
         {
             Point3d start, end;
             TabBordeoMenu ctrl = this.Controls.Where(x => x is TabBordeoMenu).FirstOrDefault() as TabBordeoMenu;
             Editor ed          = Application.DocumentManager.MdiActiveDocument.Editor;
             if (Picker.Point("Selecciona el punto inicial", out start))
             {
                 end      = start + new Vector3d(10, 0, 0);
                 var size = ctrl.GetL135Panels().FirstOrDefault() as LPanelMeasure;
                 BordeoL135Panel panel = new BordeoL135Panel(SweepDirection.Counterclockwise, start, end, size);
                 panel.Draw(tr);
                 this.InitContent(panel, tr);
                 ed.Regen();
             }
         }
         catch (System.Exception exc)
         {
             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
             ed.WriteMessage(exc.Message);
         }
     }).Run();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Sows the specified panel.
        /// </summary>
        /// <param name="panel">The panel measure.</param>
        public override void Sow()
        {
            Editor           ed     = Application.DocumentManager.MdiActiveDocument.Editor;
            TabBordeoMenu    ctrl   = this.Menu as TabBordeoMenu;
            var              data   = ctrl.GetLinearPanels().ToArray();
            BordeoPanelStack panel0 = (BordeoPanelStack) new TransactionWrapper <RivieraMeasure, RivieraObject>(InitSowing).Run(data);

            ed.Regen();
            this.Sow(this.PickArrow(panel0, true, true), panel0);
        }
Exemplo n.º 4
0
 private void EraseUnsupportedDirections(ObjectIdCollection drewIds)
 {
     new QuickTransactionWrapper((Document doc, Transaction tr) =>
     {
         TabBordeoMenu ctrl = this.Menu as TabBordeoMenu;
         IEnumerable <PanelMeasure> pSize     = ctrl.GetLinearPanels();
         IEnumerable <LPanelMeasure> pLSize90 = ctrl.GetL90Panels(), pLSize135 = ctrl.GetL135Panels();
         IEnumerable <BlockReference> blkRef  = drewIds.OfType <ObjectId>().Select(x => (BlockReference)x.GetObject(OpenMode.ForRead));
     }).Run();
 }
Exemplo n.º 5
0
        public void TestPanelLInsert()
        {
            Point3d       start;
            Point3d       end;
            TabBordeoMenu ctrl = this.Controls.Where(x => x is TabBordeoMenu).FirstOrDefault() as TabBordeoMenu;
            BordeoLPanel  panel;
            var           size = ctrl.GetL90Panels().FirstOrDefault() as LPanelMeasure;
            Editor        ed   = Application.DocumentManager.MdiActiveDocument.Editor;

            for (int i = 0; i < 4 && ctrl.SelectHeights.Length > 0; i++)
            {
                new QuickTransactionWrapper((Document doc, Transaction tr) =>
                {
                    if (Picker.Point("Selecciona el punto inicial", out start))
                    {
                        end = start + new Vector3d(10, 0, 0);
                        if (i == 0)
                        {
                            panel = new BordeoL135Panel(SweepDirection.Clockwise, start, end, size);
                        }
                        else if (i == 1)
                        {
                            panel = new BordeoL135Panel(SweepDirection.Counterclockwise, start, end, size);
                        }
                        else if (i == 2)
                        {
                            panel = new BordeoL135Panel(SweepDirection.Clockwise, start, end, size.InvertFront());
                        }
                        else if (i == 3)
                        {
                            panel = new BordeoL135Panel(SweepDirection.Counterclockwise, start, end, size.InvertFront());
                        }
                        else
                        {
                            panel = null;
                        }
                        if (panel != null)
                        {
                            panel.Draw(tr);
                            panel.DrawGeometry(tr);
                        }
                        ed.Regen();
                    }
                }).Run();
            }
        }
 public void StartSowing()
 {
     App.RunCommand(
         delegate()
     {
         try
         {
             TabBordeoMenu ctrl = this.Controls.Where(x => x is TabBordeoMenu).FirstOrDefault() as TabBordeoMenu;
             BordeoSower sow    = new BordeoSower(ctrl);
             sow.Sow();
         }
         catch (System.Exception exc)
         {
             Selector.Ed.WriteMessage(exc.Message);
         }
     });
 }
 public void ContinueSowing()
 {
     App.RunCommand(
         delegate()
     {
         try
         {
             ObjectId entId;
             int state;
             if (Picker.ObjectId("Selecciona un panel para continuar la inserción", out entId, typeof(Line), typeof(Polyline)))
             {
                 RivieraObject rivObj = App.Riviera.Database.Objects.FirstOrDefault(x => x.Id == entId);
                 if (rivObj != null)
                 {
                     TabBordeoMenu ctrl = this.Controls.Where(x => x is TabBordeoMenu).FirstOrDefault() as TabBordeoMenu;
                     BordeoSower sow    = new BordeoSower(ctrl);
                     if (rivObj is BordeoPanelStack)
                     {
                         state = 1;
                     }
                     else if (rivObj is BordeoLPanelStack)
                     {
                         state = 2;
                     }
                     else
                     {
                         state = 0;
                     }
                     var dir = sow.PickArrow(rivObj as ISowable);
                     sow.Sow(dir, rivObj, state);
                 }
                 else
                 {
                     Selector.Ed.WriteMessage("No es un elemento de bordeo");
                 }
             }
         }
         catch (System.Exception exc)
         {
             Selector.Ed.WriteMessage(exc.Message);
         }
     });
 }
Exemplo n.º 8
0
        /// <summary>
        /// Picks the riviera sizes.
        /// </summary>
        /// <param name="dir">The arrow direction.</param>
        /// <returns>
        /// The Riviera measure
        /// </returns>
        public override RivieraMeasure[] PickSizes(ArrowDirection dir)
        {
            TabBordeoMenu ctrl = this.Menu as TabBordeoMenu;

            RivieraMeasure[] sizes;
            if (dir == ArrowDirection.FRONT || dir == ArrowDirection.BACK)
            {
                sizes = ctrl.GetLinearPanels().ToArray();
            }
            else if (dir.GetArrowDirectionName().Contains("90"))
            {
                sizes = ctrl.GetL90Panels().ToArray();
            }
            else
            {
                sizes = ctrl.GetL135Panels().ToArray();
            }
            return(sizes);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BordeoSower"/> class.
 /// </summary>
 public BordeoSower(TabBordeoMenu bordeoMenu, int currentState = 0) :
     base(bordeoMenu, currentState)
 {
 }