示例#1
0
文件: MainForm.cs 项目: batuZ/Samples
 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;
 }
示例#2
0
文件: MainForm.cs 项目: batuZ/Samples
        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.TerrainVideoObject.Guid.ToString();
                cp = new CameraProperty();
                cp.name = locationName;
                cp.X = tmpTV.TerrainVideoObject.Position.X;
                cp.Y = tmpTV.TerrainVideoObject.Position.Y;
                cp.Z = tmpTV.TerrainVideoObject.Position.Z;
                cp.Heading = tmpTV.TerrainVideoObject.Angle.Heading;
                cp.Roll = tmpTV.TerrainVideoObject.Angle.Roll;
                cp.Tilt = tmpTV.TerrainVideoObject.Angle.Tilt;
                cp.AspectRatio = tmpTV.TerrainVideoObject.AspectRatio;
                cp.FieldOfView = tmpTV.TerrainVideoObject.FieldOfView;
                cp.VideoOpacity = tmpTV.TerrainVideoObject.VideoOpacity;

                videoList.Add(tmpTV.TerrainVideoObject);
                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);
            }
        }
示例#3
0
文件: MainForm.cs 项目: batuZ/Samples
        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;
        }