基础的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插件式开发 一个项目随着业务模块的不断增加,系统会越来越庞大.如果参与开发的人员越多,管理起来也难度也很大.面对这样的情况,首先想到的是模块化插件式开发,根据业务 ...
随机推荐
- python——函数重点总结
参数的分类 形参:位置参数.默认参数.*args.命名关键字参数.**kwargs 实参:位置参数.关键字参数 命名关键字参数:定义在*后面的位置参数和默认参数叫作命名关键字参数:用来限制实参必须以关 ...
- Linux上部署黑马旅游网Bug集锦
- Ajax案例:异步加载后台订单详情信息
- SWT的基本组件使用
1按钮组件(Button) (1)Button组件常用样式 SWT.PUSH按钮 SWT.CHECK多选按钮 SWT.RADIO单选按钮 SWT.ARROW箭头按钮 SWT.NONE默认按钮 SWT. ...
- 一个VUE的小案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- JS 检测字符串是否还有某个字符
function filer(s) { var str = "字符串"; if (str.indexOf(s) == -1) { alert("没有"); } ...
- 049 Group Anagrams 字谜分组
给定一个字符串数组,将相同字谜组合在一起.(字谜是指颠倒字母顺序而成的字)例如,给定 ["eat", "tea", "tan", " ...
- D. Edges in MST 图论
http://codeforces.com/contest/160/problem/D base on 克鲁斯卡尔, 首先每次都是对权值相同的边进行统一处理,假如加入了当前这条边出现了回路,那就能确定 ...
- (转)磁盘阵列RAID原理、种类及性能优缺点对比
磁盘阵列RAID原理.种类及性能优缺点对比 原文:http://www.cnblogs.com/chuncn/p/6008173.html 磁盘阵列(Redundant Arrays of Indep ...
- 死磕 java并发包之LongAdder源码分析
问题 (1)java8中为什么要新增LongAdder? (2)LongAdder的实现方式? (3)LongAdder与AtomicLong的对比? 简介 LongAdder是java8中新增的原子 ...