예제 #1
0
        private void mnuEffectCircle_Click(object sender, EventArgs e)
        {
            if (decimal.Parse(txtRadiusLeft.Text) == 0 || decimal.Parse(txtRadiusRight.Text) == 0)
            {
                MessageBox.Show("Radius must be greater than 0");
                return;
            }
            Placement.HouseItem[] Items       = SelectedGridToItems();
            Placement.Vector3D    CenterPoint = new Placement.Vector3D(
                double.Parse(txtCirCentX.Text)
                , double.Parse(txtCirCentY.Text)
                , double.Parse(txtCirCentZ.Text));
            int    StartingPoint = Percentage.Value;
            double FillPerc      = (double)Fill.Value / 359d;
            double RadiusX       = double.Parse(txtRadiusLeft.Text);
            double RadiusY       = double.Parse(txtRadiusRight.Text);

            Placement.DirectionType Reverse = (chkReverse.Checked) ? Placement.DirectionType.Reverse : Placement.DirectionType.Forward;
            int  Orientation = (cboCirclePlane.SelectedIndex != 0) ? 1 : 0;
            int  Facing      = (cboCirclePlane.SelectedIndex == 1) ? 1 : 0;
            bool sVertical   = rdo_From_Ground.Checked;
            bool Spiral      = chkSpiral.Checked;

            Items = Placement.CirclePlane(Items, CenterPoint, Orientation, RadiusX, RadiusY, Facing, double.Parse(txtEndZ.Text),
                                          Reverse, FillPerc, chkRotate.Checked, StartingPoint, chk90Offset.Checked, Spiral, sVertical, double.Parse(txtRevolutions.Text), chkPointTops.Checked);
            layout.ItemstoDB(Items);
            if (Chart.Visible)
            {
                Chart.Redraw();
            }
        }
예제 #2
0
        private void btnTile_Click(object sender, EventArgs e)
        {
            int ItemsCount = dg.SelectedRows.Count;

            if (ItemsCount == 0)
            {
                MessageBox.Show("No rows selected. Aborting."); return;
            }
            Placement.Vector3D v3 = new Placement.Vector3D(double.Parse(txtStartX.Text), double.Parse(txtStartY.Text), double.Parse(txtStartZ.Text));
            int     xUnits        = int.Parse(txtUnitsX.Text);
            int     yUnits        = int.Parse(txtUnitsY.Text);
            int     zUnits        = int.Parse(txtUnitsZ.Text);
            decimal xSpacing      = decimal.Parse(txtSpaceX.Text);
            decimal ySpacing      = decimal.Parse(txtSpaceY.Text);
            decimal zSpacing      = decimal.Parse(txtSpaceZ.Text);
            decimal Scaling       = decimal.Parse(txtScaling.Text);
            int     RC            = xUnits * yUnits * zUnits;

            if (RC == 0)
            {
                MessageBox.Show("You need to have at least 1 column and 1 row. Aborting.");
                return;
            }
            if (RC == 1)
            {
                MessageBox.Show("Your current settings will put everything in one place. Aborting.");
                return;
            }
            if (RC != ItemsCount)
            {
                string       Effect = (RC < ItemsCount) ? (ItemsCount - RC).ToString() + " items left in place" : (RC - ItemsCount).ToString() + " missing tiles";
                DialogResult dr     = MessageBox.Show(string.Format("The input you have placed for Rows and Columns requires {0} items. Currently you have {1}. Using this will have {2}.{3}Continue?",
                                                                    RC.ToString(), ItemsCount.ToString(), Effect, Environment.NewLine), "Item count mismatch", MessageBoxButtons.YesNo);
                if (dr == DialogResult.No)
                {
                    return;
                }
            }

            Placement.HouseItem[] Items = SelectedGridToItems();
            Items = Placement.Tile(Items, v3, xSpacing, ySpacing, zSpacing, xUnits, yUnits, zUnits, Scaling, chkIgnoreScaling.Checked, chkZeroRotation.Checked);
            layout.ItemstoDB(Items);
            if (Chart.Visible)
            {
                Chart.Redraw();
            }
        }
예제 #3
0
        private void btnGroupRotate_Click(object sender, EventArgs e)
        {
            Placement.RotateAxis ra = Placement.RotateAxis.z;
            if (rdo_Pitch.Checked)
            {
                ra = Placement.RotateAxis.x;
            }
            if (rdo_Roll.Checked)
            {
                ra = Placement.RotateAxis.y;
            }
            Placement.HouseItem[] Items = SelectedGridToItems();
            Placement.Vector3D    CtrPt = new Placement.Vector3D(double.Parse(txt_rg_X.Text), double.Parse(txt_rg_Y.Text), double.Parse(txt_rg_Z.Text));
            double rotation             = double.Parse(txtRotation.Text);
            bool   RotateAroundPoint    = (rdoCenter.Checked) ? false : true;

            Items = Placement.RotateGroup(Items, rotation, ra, CtrPt, RotateAroundPoint);
            layout.ItemstoDB(Items);
            if (Chart.Visible)
            {
                Chart.Redraw();
            }
        }