예제 #1
0
        private void ImportMap_ItemClick(object sender, ItemClickEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog
            {
                // 目前有pr(读写)和obj(读)的插件
                Filter          = "*.shp",
                ValidateNames   = true,
                CheckPathExists = true,
                CheckFileExists = true
            };

            if (player.isRunning() && dlg.ShowDialog() == DialogResult.OK)
            {
                // 打开模型必须在Player初始化并启动后
                WIZShpCompoment wizShpCom = WIZShpCompoment.From(player);
                wizShpCom.load(dlg.FileName);
            }
        }
예제 #2
0
        /// <summary>
        /// 响应Player初始化消息
        /// </summary>
        /// <param name="player"></param>
        /// <param name="param"></param>
        public void OnEngineInited(WIZPlayer player, IntPtr param)
        {
            // Player初始化后加载所需要的插件
            string pluginDir = Application.StartupPath + "\\plugin";

            player.loadPlugins(pluginDir);
            player.setRect(0, 0, wizPanel.Width, wizPanel.Height);
            player.setFocus();

            //获取标记插件
            marker = WIZMarkerCompoment.From(player);
            if (marker.isValid())
            {
                //get error
            }

            WIZTreeCompoment tree = WIZTreeCompoment.From(player);

            if (tree.isValid())
            {
                mainContext.Post((o) =>
                {
                    tree.setParent(this.navBarControl.Handle);
                    tree.setRect(0, 0, this.navBarControl.Width, this.navBarControl.Height);
                }, null);
            }
            /// 获取组建
            _wizQXSY = WIZObliquePhotograph.From(player);
            _wizGIS  = WIZGISPlatform.From(player);

            _wizCamAnim      = WIZCameraAnimation.From(player);
            _wizCamAnimPlay  = WIZCameraAnimationPlay.From(player);
            _wizShpComponent = WIZShpCompoment.From(player);
            if (_wizCamAnim.isValid())
            {
                player.addMessageHandler(WIZCameraAnimation.Const.PMSG_CAM_CURTIME, onCamAnimTimeChange = this.OnCamAnimTimeChange);
                //TODO: WIZCameraAnimation.Const.PMSG_CAM_DELETE
            }
        }