public glPrimitiveDialog(object glPrim)
        {
            input = (glPrimitives)glPrim;
            _Type = input.getPrimitiveType().ToUpper();

            InitializeComponent();
        }
        private void buttonOkay_Click(object sender, EventArgs e)
        {
            //Gather up the information and set it
            output = new glPrimitives();
            output = input;

            switch (_Type)
            {
                case "TRIANGLE":
                    _aTri = (triangle)input;
                    _aTri.showVerts = checkBox_showVerts.Checked;
                    _aTri.lineColor = button_VertexColor.BackColor;
                    _aTri.vertSize = (float)Convert.ToDecimal(UpDown_VertextSize.Text.ToString());

                    _aTri.showLines = checkBox_showLines.Checked;
                    _aTri.lineColor = button_LineColor.BackColor;
                    _aTri.lineWidth = (float)Convert.ToDecimal(UpDown_LineWidth.Text.ToString());
                    output = _aTri;
                    break;
                case "LINE":
                    _aLine = (line)input;
                    _aLine.showVerts = checkBox_showVerts.Checked;
                    _aLine.propColor = button_ObjectColor.BackColor;
                    _aLine.vertColor = button_VertexColor.BackColor;
                    _aLine.vertSize = (float)Convert.ToDecimal(UpDown_VertextSize.Text.ToString());
                    output = _aLine;
                    break;
                case "POINT":
                    _aPoint = (point)input;
                    output = _aPoint;
                    break;
                case "POLYGON":
                    _aPoly = (polygon)input;
                    output = _aPoly;
                    break;
                case "QUAD":
                    _aQuad = (quad)input;
                    _aQuad.showVerts = checkBox_showVerts.Checked;
                    _aQuad.lineColor = button_VertexColor.BackColor;
                    _aQuad.vertSize = (float)Convert.ToDecimal(UpDown_VertextSize.Text.ToString());

                    _aQuad.showLines = checkBox_showLines.Checked;
                    _aQuad.lineColor = button_LineColor.BackColor;
                    _aQuad.lineWidth = (float)Convert.ToDecimal(UpDown_LineWidth.Text.ToString());

                    _aQuad.propColor = button_ObjectColor.BackColor;
                    output = _aQuad;
                    break;
                case "LOOPLINE":
                    _aLoopLine = (loopline)input;
                    output = _aLoopLine;
                    break;
                default:

                    break;
            }

            this.Close();
        }
Example #3
0
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection selectedItem = listView1.SelectedItems;

            if (selectedItem.Count == 1)
            {
                // Get the glPrimitive's ID and get the glPrimitive
                string primID = selectedItem[0].SubItems[0].Text;                       //Get the ID from the ID column
                glPrimitives selectedObj = ds.getPrimByID(Convert.ToInt32(primID));     //Get the glPrimitive Object from the list
                Cursor.Position = glControl1.PointToScreen(selectedObj.getGeoData()[0]);//Move the cursor to the first point of the object
                deselectTools();
                glPrimitives copy = new glPrimitives(selectedObj.getGeoData(), selectedObj.getPrimitiveType());
                ds.setMoveProgressObj(copy);
                ds.useMoveProgress = true;
            }
        }
 public quad asQuad(glPrimitives glPrim)
 {
     return (quad)glPrim;
 }
 public point asPoint(glPrimitives glPrim)
 {
     return (point)glPrim;
 }
 public loopline asLoopLine(glPrimitives glPrim)
 {
     return (loopline)glPrim;
 }
 public line asLine(glPrimitives glPrim)
 {
     return (line)glPrim;
 }