예제 #1
0
        /// <summary>
        /// Executes the command. 
        /// Creates a series of connected Line Elements given at least 2 points. Each subsequent point given adds a new Line Element.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            LineElement line;
            Joint joint1, joint2;
            LineProps props = new StraightFrameProps();
            List<LineElement> newLines = new List<LineElement>();
            List<AreaElement> newAreas = new List<AreaElement>();

            services.GetProperties(Culture.Get("addLineProps"), props);

            joint1 = services.GetJoint(newLines);
            services.TrackingService = LineTrackingService.Instance;
            services.TrackingService.SetPoint(joint1.Position);

            try
            {
                while ((joint2 = services.GetJoint(newLines)) != null)
                {
                    if (joint2 != joint1)
                    {
                        services.Model.LineList.Add(line = new LineElement(props, joint1, joint2));
                        newLines.Add(line);
                        joint1 = joint2;
                        services.TrackingService.SetPoint(joint1.Position);
                        // Para que se refleje el cambio inmediatamente
                        services.Model.ChangeModel();
                    }
                }
            }
            catch (Canguro.Controller.CancelCommandException) { }
            if (newLines.Count == 0)
                services.Model.Undo.Rollback();
            else
                JoinCmd.Join(services.Model, new List<Joint>(), newLines, newAreas);
        }
        /// <summary>
        /// Executes the command. 
        /// Asks the User for parameters and adds the Load to all selected Joints.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            GroundDisplacementLoad load = new GroundDisplacementLoad();

            services.GetProperties(Title, load);

            Joint joint;
            while ((joint = services.GetJoint()) != null)
            {
                // TODO: Checar validez
                joint.Loads.Add(load);
                // Para que se refleje el cambio inmediatamente
                services.Model.ChangeModel();
            }
        }
예제 #3
0
        /// <summary>
        /// Executes the command. 
        /// Creates one AreaElement.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            AreaElement area;
            List<Joint> joints = new List<Joint>();
            Joint joint1, joint2, joint3, joint4;
            AreaProps props = new AreaProps();
            List<LineElement> newLines = new List<LineElement>();

            try
            {
            services.GetProperties(Culture.Get("addAreaProps"), props);

            joint1 = services.GetJoint(newLines);
            services.TrackingService = PolygonTrackingService.Instance;
            services.TrackingService.SetPoint(joint1.Position);
            services.Model.ChangeModel();

            joint2 = services.GetJoint(newLines);
            services.TrackingService.SetPoint(joint2.Position);
            services.Model.ChangeModel();

            joint3 = services.GetJoint(newLines);
            services.TrackingService.SetPoint(joint3.Position);
            services.Model.ChangeModel();

            joint4 = services.GetJoint(newLines);
            if (joint4 != null)
                services.TrackingService.SetPoint(joint4.Position);

            services.Model.AreaList.Add(area = new AreaElement(props, joint1, joint2, joint3, joint4));
            services.Model.ChangeModel();

            }
            catch (Canguro.Controller.CancelCommandException) { }
            //if (newLines.Count == 0)
            //    services.Model.Undo.Rollback();
            //else
            //    JoinCmd.Join(services.Model, new List<Joint>(), newLines);
        }
예제 #4
0
        /// <summary>
        /// Executes the command. 
        /// Gets the parameters and calls createCylinder to add a Cylinder to the model
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            if (section == null)
                section = Canguro.Model.Section.SectionManager.Instance.DefaultFrameSection as Canguro.Model.Section.FrameSection;
            services.GetProperties(Culture.Get("cylinderCmdTitle"), this);

            Controller.Snap.Magnet m = services.GetPoint(Culture.Get("selectCylinderCenter"));
            if (m == null) return;
            Microsoft.DirectX.Vector3 o = m.SnapPosition;

            StraightFrameProps props = new StraightFrameProps();
            props.Section = section;
            createCylinder(services.Model, o, r, c, h, s + 1, props);
        }
예제 #5
0
 /// <summary>
 /// Executes the command. 
 /// Opens the properties window to edit the selected Item.
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     Item item = services.GetItem();
     services.GetProperties(Culture.Get("editCmdTitle"), item, false);
 }
예제 #6
0
        /// <summary>
        /// Executes the command. 
        /// Gets the parameters and calls beamGrid3D() to make the grid.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            if (section == null)
                section = Canguro.Model.Section.SectionManager.Instance.DefaultFrameSection as Canguro.Model.Section.FrameSection;
            services.GetProperties(Culture.Get("gridCmdTitle"), this);

            Controller.Snap.Magnet m = services.GetPoint(Culture.Get("selectGridOrigin"));
            if (m == null) return;
            Microsoft.DirectX.Vector3 o = m.SnapPosition;

            StraightFrameProps props = new StraightFrameProps();
            props.Section = section;
            beamGrid3D(services.Model, o.X, o.Y, o.Z, dx, 0, 0, 0, dy, 0, 0, 0, dz, nx + 1, ny + 1, nz + 1, true, props);
        }
예제 #7
0
 /// <summary>
 /// Executes the command. 
 /// Opens the properties window to edit the Active Layer
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     Layer layer = services.Model.ActiveLayer;
     services.GetProperties(Culture.Get("editCmdTitle"), layer, false);
 }