基础的Mapgis三维二次开发-插件式
最近在做一个杭州石油的项目开发一个小系统。
1.命令必须是 ICommand 的派生类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using MapGIS.PluginEngine;
using System.Windows.Forms;
using MapGIS.Scene3D;
namespace ThreeDimenModeling
{
class IsoheightModeling : ICommand
{
//应用框架对象
IApplication hock = null;
//场景视图控件
SceneControl sceneCtrl = null;
#region ICommand成员
public Bitmap Bitmap
{
get { return null; }
}
public string Caption
{
get { return "等高线建模"; }
}
public string Category
{
get { return "ThreeDimenModeling"; }
}
public bool Checked
{
get { return false; }
}
public bool Enabled
{
get { return true; }
}
public string Message
{
get { return ""; }
}
public string Name
{
get { return "等高线建模"; }
}
public string Tooltip
{
get { return ""; }
}
public void OnClick()
{
sceneCtrl = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
IsoheightModelingForm IsoHeiMoForm = new IsoheightModelingForm(sceneCtrl );
if (IsoHeiMoForm.ShowDialog() != DialogResult.OK) return;
}
public void OnCreate(IApplication hook)
{
if (hook != null)
{
this.hock = hook;
this.hock.StateManager.StateChangedEvent += new StateChangedHandler(StateManager_StateChangedEvent);
}
}
void StateManager_StateChangedEvent(object sender, StateEventArgs e)
{
this.hock.PluginContainer.PluginEnable(this, false);
bool bEnable = false;
if (this.hock.ActiveContentsView != null && this.hock.ActiveContentsView is ISceneContentsView)
{
//当存在当前编辑状态的图层时,才可以进行查询
SceneControl ctr = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
if (ctr != null && ctr.GetSceneNum() > 0)
{
bEnable = true;
}
}
this.hock.PluginContainer.PluginEnable(this, bEnable);
return;
}
private void PluginContainer_ContentsViewClosingEvent(IContentsView contentsView, ContentsViewClosingEventArgs args)
{
if (contentsView is ISceneContentsView)
{
SceneControl ctr = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
}
}
#endregion
}
}
2.弹出Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MapGIS.Scene3D;
namespace ThreeDimenModeling
{
public partial class IsoheightModelingForm : Form
{
//场景控件
SceneControl sceneCtrl = null;
public IsoheightModelingForm(SceneControl sCtrl )
{
InitializeComponent();
this.sceneCtrl = sCtrl;
}
}
}
基础的Mapgis三维二次开发-插件式的更多相关文章
- 【原创】MapGIS K9 三维二次开发入门
开发语言:C# 平台版本:MapGIS K9 SP3 MapGIS K9三维平台也提供了接口和组件以实现二次开发.用户可以根据提供的接口和组件进行二次开发,也可以借助MapGISK9数据中心框架,可以 ...
- 金蝶K3 wise 插件二次开发与配置
金蝶K3 wise 插件二次开发与配置 开发环境:K/3 Wise 13.0.K/3 Bos开发平台.Visual Basic 6.0 目录 一.二次开发插件编程二.代码演示三.配置插件四.测试插件五 ...
- 【开发者portal在线开发插件系列五】命令的响应,即命令结果的上报(mid的使用)
基础篇 [开发者portal在线开发插件系列一]profile和基本上下行消息 [开发者portal在线开发插件系列二]多条上下行消息(messageId的使用) 基础场景见上面两个帖子,这里单独介绍 ...
- 四、K3 WISE 开发插件《工业单据老单插件开发新手指导》
开发环境:K/3 Wise 13.0.K/3 Bos开发平台.Visual Basic 6.0 =============================================== 目录 一 ...
- PIE.NET-SDK插件式二次开发文档
一 PIE.Net开发环境部署 1. 开发环境部署 确保Win7系统已安装SP1 安装Visual Studio2013(支持VS2010/2012/2013/2015) 安装PIESDK.e ...
- K/3Cloud二次开发基于WebDev附加进程调试
大部分人在进行K/3cloud二次开发插件的调试时,选择的是附加IIS进程w3wp调试,本文给大家介绍一下基于WebDev附加进程调试,不用重启iis. 步骤如下: 1)拷贝K/3cloud产品安装目 ...
- Revit二次开发环境配置(Revit 2020 +Visual Studio 2019)
Revit二次开发环境搭建(Revit 2019+Visual Studio 2017)准备内容 Revit 2019开发环境的搭建,需要安装的内容如下: Revit 2019(主要的开发环境) Vi ...
- 基于EasyNVR二次开发实现自己的摄像机IPC/NVR无插件化直播解决方案
在之前的博客中<基于EasyNVR实现RTSP/Onvif监控摄像头Web无插件化直播监控>,我们已经比较多的描述EasyNVR所实现的功能,这些也在方案地址:http://www.eas ...
- 零基础ASP.NET Core MVC插件式开发
零基础ASP.NET Core MVC插件式开发 一个项目随着业务模块的不断增加,系统会越来越庞大.如果参与开发的人员越多,管理起来也难度也很大.面对这样的情况,首先想到的是模块化插件式开发,根据业务 ...
随机推荐
- Linux上传下载工具FileZilla(GNU软件) 文件传输和配置文件修改
- 黑马旅游网 url-pattern不加斜杠报错 java.util.concurrent.ExecutioException: org.apache.catalina.LifecycleException
- Java基础笔记(二)——配置环境变量
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 到此处下载jdk,并安装.(选 ...
- Django之用户认证—auth模块
用户认知———auth模块 目录: auth模块 User对象 实例 扩展默认的auth_user表 - 创建超级用户 - python3 manager.py createsuperuser - 认 ...
- CodeForces - 296A-Yaroslav and Permutations(思维)
Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring a ...
- Nginx托管.Net Core应用程序
Nginx托管.Net Core应用程序 一.安装.Net Core 参考官方文档:https://www.microsoft.com/net/core#linuxcentos 1.添加dotnet产 ...
- D. Blocks 数学题
Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent bo ...
- (转)linux下控制帐户过期的多种方法
linux下控制帐户过期的方法:原文:http://blog.51cto.com/oldboy/1289144企业里一般给无人管理的角色账户或开发人员临时需求等可以设定账户有效期,提升安全!法一:添加 ...
- (转)企业配置sudo命令用户行为日志审计
原文:https://www.cnblogs.com/Csir/p/6403830.html?utm_source=itdadao&utm_medium=referral 第15章 企业配置s ...
- 4.词法结构-JavaScript权威指南笔记
今天是第二章.所谓词法结构(lexical structure),就是写代码中最基本的东西,变量命名,注释,语句分隔等,这是抄书抄的... 1.字符集,必须是Unicode,反正Unicode是ASC ...