Ejemplo n.º 1
0
        private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
        {
            if ((sender as DataGridView).CurrentRow == null)
            {
                return;
            }

            curRowIndex = (sender as DataGridView).CurrentRow.Index;
            tmpTV       = (sender as DataGridView).CurrentRow.Cells[2].Value as VideoObject;

            if (pf.hasClosed())
            {
                pf       = new PropertyFrm(tmpTV);
                pf.Text  = tmpTV.GUIDString + "的属性";
                pf.Owner = this;
                pf.Show();
            }
            else
            {
                pf.Text = tmpTV.GUIDString + "的属性";
                pf.SetSource(tmpTV);
            }

            cp            = (sender as DataGridView).CurrentRow.Cells[1].Value as CameraProperty;
            curVideoIndex = cp.index;
        }
Ejemplo n.º 2
0
 private void dataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     curRowIndex = (sender as DataGridView).CurrentRow.Index;
     cp          = (sender as DataGridView).CurrentRow.Cells[1].Value as CameraProperty;
     vector.Set(cp.X, cp.Y, cp.Z);
     angle.Set(cp.Heading, cp.Tilt, cp.Roll);
     this.axRenderControl1.Camera.SetCamera(vector, angle, gviSetCameraFlags.gviSetCameraNoFlags);
     curVideoIndex = cp.index;
 }
Ejemplo n.º 3
0
        void axRenderControl1_RcMouseClickSelect(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            if (IntersectPoint == null)
            {
                return;
            }

            if (EventSender.Equals(gviMouseSelectMode.gviMouseSelectClick))
            {
                this.axRenderControl1.InteractMode        = gviInteractMode.gviInteractNormal;
                this.axRenderControl1.RcMouseClickSelect -= new _IRenderControlEvents_RcMouseClickSelectEventHandler(axRenderControl1_RcMouseClickSelect);


                //把视频加入list,同时更新界面
                locationName   = tmpTV.ViewshedObject.Guid.ToString();
                cp             = new CameraProperty();
                cp.name        = locationName;
                cp.X           = tmpTV.ViewshedObject.Position.X;
                cp.Y           = tmpTV.ViewshedObject.Position.Y;
                cp.Z           = tmpTV.ViewshedObject.Position.Z;
                cp.Heading     = tmpTV.ViewshedObject.Angle.Heading;
                cp.Roll        = tmpTV.ViewshedObject.Angle.Roll;
                cp.Tilt        = tmpTV.ViewshedObject.Angle.Tilt;
                cp.AspectRatio = tmpTV.ViewshedObject.AspectRatio;
                cp.FieldOfView = tmpTV.ViewshedObject.FieldOfView;

                videoList.Add(tmpTV.ViewshedObject);
                cp.index = videoList.Count - 1;

                DataRow dr = dt.NewRow();
                dr["Name"]     = locationName;
                dr["Location"] = cp;
                dr["Object"]   = tmpTV;
                dt.Rows.Add(dr);

                this.dataGridView1.Rows[dt.Rows.Count - 1].Selected = true;

                pf.SetSource(tmpTV);
            }
            else if (EventSender.Equals(gviMouseSelectMode.gviMouseSelectMove))
            {
                this.axRenderControl1.Camera.GetCamera(out vector, out angle);
                tmpTV.SetAngle(angle);

                positionPoint    = IntersectPoint;
                positionPoint.Z += 10;
                tmpTV.SetPosition(positionPoint);
            }
        }