Esempio n. 1
0
        private void ToolStripMenuItemEditPolyline_Click(object sender, EventArgs e)
        {
            Guid            g   = this.axRenderControl1.ProjectTree.FindItem("root\\图标标签\\RenderPolyline");
            IRenderPolyline rpl = this.axRenderControl1.ObjectManager.GetObjectById(g) as IRenderPolyline;

            this.axRenderControl1.InteractMode = gviInteractMode.gviInteractEdit;
            IObjectEditor objEditor = this.axRenderControl1.ObjectEditor;

            objEditor.StartEditRenderGeometry(rpl, gviGeoEditType.gviGeoEditVertex);
        }
Esempio n. 2
0
        /// <summary>
        /// 设置三维场景可选择RenderModelPoint
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMoveMotionObject_Click(object sender, EventArgs e)
        {
            if (renderModelPoint != null)
            {
                if (_geoEditor == null)
                {
                    _geoEditor = this.axRenderControl1.ObjectEditor;
                }
                _geoEditor.FinishEdit();
                axRenderControl1.FeatureManager.UnhighlightAll();

                axRenderControl1.InteractMode = gviInteractMode.gviInteractEdit;

                resultCode = _geoEditor.StartEditRenderGeometry(renderModelPoint, gviGeoEditType.gviGeoEdit3DMove);
                if (!resultCode)
                {
                    MessageBox.Show(this.axRenderControl1.GetLastError().ToString());
                }
            }
        }
Esempio n. 3
0
        private void btnCreatePolygon_Click(object sender, EventArgs e)
        {
            this.axRenderControl1.RcObjectEditing += new _IRenderControlEvents_RcObjectEditingEventHandler(axRenderControl1_RcObjectEditing);

            this.axRenderControl1.RcObjectEditFinish += new _IRenderControlEvents_RcObjectEditFinishEventHandler(axRenderControl1_RcObjectEditFinish);

            this.axRenderControl1.InteractMode = gviInteractMode.gviInteractEdit;

            fde_polygon = (IPolygon)_geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolygon, gviVertexAttribute.gviVertexAttributeZ);
            rpolygon    = this.axRenderControl1.ObjectManager.CreateRenderPolygon(fde_polygon, null, rootId);

            if (!_geoEditor.StartEditRenderGeometry(rpolygon, gviGeoEditType.gviGeoEditCreator))
            {
                MessageBox.Show(this.axRenderControl1.GetLastError().ToString());
                return;
            }
        }
Esempio n. 4
0
        private void btnCreateModelPoint_Click(object sender, EventArgs e)
        {
            _geoEditor.FinishEdit();   //用于当拾取到基准面时,或者没有正常右键结束连续调用Start时

            if (gfactory == null)
            {
                gfactory = new GeometryFactory();
            }

            string tmpOsgPath = (strMediaPath + @"\osg\Buildings\Apartment\Apartment.osg");

            fde_modelpoint = gfactory.CreateGeometry(gviGeometryType.gviGeometryModelPoint,
                                                     gviVertexAttribute.gviVertexAttributeZ) as IModelPoint;
            fde_modelpoint.SetCoords(0, 0, 0, 0, 0);
            fde_modelpoint.ModelName = tmpOsgPath;
            //****获取包围盒
            IResourceFactory resfac = new ResourceFactory();
            IPropertySet     images = new PropertySet();
            IModel           model  = null;
            IMatrix          matrix = null;

            resfac.CreateModelAndImageFromFile(tmpOsgPath, out images, out model, out matrix);
            fde_modelpoint.ModelEnvelope = model.Envelope;
            //*************
            rmodelpoint = this.axRenderControl1.ObjectManager.CreateRenderModelPoint(fde_modelpoint, null, rootId);

            resultCode = _geoEditor.StartEditRenderGeometry(rmodelpoint, gviGeoEditType.gviGeoEditCreator);
            if (!resultCode)
            {
                MessageBox.Show(this.axRenderControl1.GetLastError().ToString());
            }

            oldfdeGeometry = fde_modelpoint;
        }