在Arcscene绘制管线三维横断面(AE绘制三维点阵文字)
根据数据信息动态生成三维管线及横断面表格。效果图如下:


在获取信息后,直接构造点阵进行文字绘制即可。
绘制IElement代码:
/// <summary>
/// 绘制三维文字
/// </summary>
/// <param name="ppp">位置</param>
/// <param name="text">文本</param>
/// <param name="Fsize"></param>
/// <param name="rgb">颜色</param>
/// <param name="pTextJustification">对齐</param>
/// <returns></returns>
public IElement CreateElement( IPoint ppp, string text, double Fsize, int rgb,esriT3DJustification pTextJustification)
{
try
{
IPoint point = new PointClass();
point = ppp;
//point.Z = deep;
IText3DElement Ptext3DElement = new Text3DElementClass();
Ptext3DElement.AnchorPoint = point;
Ptext3DElement.Text = text;
Ptext3DElement.BoldFont = false;
Ptext3DElement.Alignment = esriT3DAlignment.esriT3DAlignHorizontal;//对齐-控制字是横排还是竖排
Ptext3DElement.AxisRotation = esriT3DRotationAxis.esriT3DRotateAxisX;//旋转轴x y z
Ptext3DElement.ZAxisScale = ;// 1.6;//z轴比例尺
Ptext3DElement.Justification = pTextJustification;//对齐
Ptext3DElement.Height = Fsize; Ptext3DElement.Depth = Fsize/;
Ptext3DElement.OrientationPlane = esriT3DOrientationPlane.esriT3DPlaneYZ;//初始方向,即文字所在平面 //字体颜色
IRgbColor Fcolor = new RgbColorClass();
Fcolor.RGB = rgb;
IFillSymbol pFillSymbol = new SimpleFillSymbol();
pFillSymbol.Color = Fcolor;
IFillShapeElement pFillShapeElement = Ptext3DElement as IFillShapeElement;
pFillShapeElement.Symbol = pFillSymbol; return pFillShapeElement as IElement;
}
catch (Exception ex)
{
return null;
}
}
绘制线:
public IElement CreateLineElement(IPoint pS,IPoint pE ,int rgb,double lineWidth)
{
try
{
IRgbColor pRgbColor = new RgbColorClass();
pRgbColor.RGB = rgb;
ISimpleLine3DSymbol pSimpleLine3DSymbol = new SimpleLine3DSymbolClass();
pSimpleLine3DSymbol.Style = esriSimple3DLineStyle.esriS3DLSTube;
ILineSymbol pLineSymbol = pSimpleLine3DSymbol as ILineSymbol;
pLineSymbol.Color = pRgbColor;
pLineSymbol.Width = lineWidth; //将线段对象添加到多义线对象polyline
IPolyline polyline = new PolylineClass();
object Missing1 = Type.Missing;
object Missing2 = Type.Missing;
polyline.FromPoint = pS;
polyline.ToPoint = pE; //让Z值生效
IZAware Zaware = polyline as IZAware;
Zaware.ZAware = true; IGeometry geometry = (IGeometry)polyline;
IElement pElement = new LineElementClass();
pElement.Geometry = geometry;
ILineElement pLineElement = pElement as ILineElement;
pLineElement.Symbol = pLineSymbol; return pLineElement as IElement; }
catch (Exception ex)
{
return null;
}
}
将IElementCollection添加至控件:
public void ADDElementCollectionToSceneControl2(AxSceneControl pSceneControl, IElementCollection pElCol)//IElementCollection
{
IScene pScene = pSceneControl.Scene;
IGraphicsLayer m_GraphLayer = new GraphicsLayer3DClass();
ILayer thisilayer = (ILayer)m_GraphLayer;
thisilayer.Name = "label3d" + System.DateTime.Now.Minute + System.DateTime.Now.Second;
pScene.AddLayer(thisilayer, true); I3DProperties p3DProps = RenderClass.Get3DPropsFromLayer(thisilayer);
if (p3DProps != null)
{
p3DProps.RenderMode = esriRenderMode.esriRenderCache;
p3DProps.Illuminate = false;
p3DProps.Apply3DProperties(thisilayer);
}
//IGraphicsContainer3D pGC3D = (IGraphicsContainer3D)new ESRI.ArcGIS.GlobeCore.GlobeGraphicsLayer();
//IGraphicsContainer3D pGC3D = (IGraphicsContainer3D)new ESRI.ArcGIS.GlobeCore.GlobeGraphicsLayerClass();
IGraphicsContainer3D pGC3D = (IGraphicsContainer3D)new ESRI.ArcGIS.Analyst3D.GraphicsLayer3DClass();
pGC3D = (IGraphicsContainer3D)m_GraphLayer; //让m_GraphLayer获得Container
pGC3D.AddElements(pElCol);
pScene.SceneGraph.RefreshViewers();
}
在Arcscene绘制管线三维横断面(AE绘制三维点阵文字)的更多相关文章
- (转)GPU图形绘制管线
摘抄“GPU Programming And Cg Language Primer 1rd Edition” 中文名“GPU编程与CG语言之阳春白雪下里巴人”第二章. 图形绘制管线描述GPU渲染流程, ...
- GPU图形绘制管线简介
(阅读GPU+编程与CG+语言之阳春白雪下里巴人所得总结) GPU图形绘制管线是描述GPU渲染(把三维世界显示为屏幕上的二维图像)的流程,主要分为三个主要阶段应用程序阶段.几何阶段.光栅阶段. 1.应 ...
- C#绘制立体三维饼状图
转载自原文 C#绘制立体三维饼状图(超酷) 内容原文地址:LINK [翻译]Julijan Sribar著3D Pie Chart一个用于绘制立体三维饼状图的C#类库[简介]本文的想法就是创建一个独立 ...
- MATLAB三维散点图的绘制(scatter3、plot3)
MATLAB三维散点图的绘制(scatter3.plot3) (1)函数scatter3 用法:scatter3(x,y,z,'.',c) % c 为颜色,需和x,y,z长度相同 例子: x=[422 ...
- Android绘图机制(二)——自定义View绘制形, 圆形, 三角形, 扇形, 椭圆, 曲线,文字和图片的坐标讲解
Android绘图机制(二)--自定义View绘制形, 圆形, 三角形, 扇形, 椭圆, 曲线,文字和图片的坐标讲解 我们要想画好一些炫酷的View,首先我们得知道怎么去画一些基础的图案,比如矩形,圆 ...
- 自定义界面上绘制Text,可通过拖动控制文字大小及其位置
项目地址 最近项目上有个需求,需要在一块区域中显示文字,这块区域可以拖动,也可以通过拖拽右下角来改变大小,里面的文字大小要根据区域的大小进行自适应.刚开始觉得这个需求不难,只需要一个TextView就 ...
- ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等--绘制点、线、圆,显示提示信息
ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等--绘制点.线.圆,显示提示信息 /// <summary> /// 绘制界面上的点和线 /// ...
- ArcGIS Mobile 自定义图层在绘制面时节点未绘制完全的问题
ArcGIS Mobile 自定义图层在绘制面时节点未绘制完全,如下图: 面的绘制代码如下: public void Draw(Display dis, Pen p1, Pen p2,Pen p3 , ...
- Matlab绘图基础——其他三维图形(绘制填充的五角星)
其他三维图形 %绘制魔方阵的三维条形图 subplot(2,2,1); bar3(magic(4)); %以三维杆图形式绘制曲线y=2sin(x) subplot(2,2,2); y=2*sin( ...
随机推荐
- android 帧动画,补间动画,属性动画的简单总结
帧动画——FrameAnimation 将一系列图片有序播放,形成动画的效果.其本质是一个Drawable,是一系列图片的集合,本身可以当做一个图片一样使用 在Drawable文件夹下,创建ani ...
- Windows 批处理设置dns ,解决能上qq不能开网页
对于windows 7 @echo off netsh interface ip set dns "本地连接" static 114.114.114.114 primary net ...
- 我的2013 Q.E.D
"旧历的年底毕竟最像年底,村镇上不必说,就在天空中也显出将到新年的气象来.灰白色的沉重的晚云中间时时发出闪光,接着一声钝响,是送灶的爆竹:近处燃放的可就更强烈了,震耳的大音还没有息,空气里已 ...
- AngularJS 系列 02 - 模块
引导目录: AngularJS 系列 学习笔记 目录篇 前言: 其实,在上篇文章介绍数据绑定的时候,我们的HelloWorld的代码案例中就已经使用了模块(module).哈哈. 本篇就着重介绍一下a ...
- 运维之网络安全抓包—— WireShark 和 tcpdump
------------------------------------------------本文章只解释抓包工具的捕获器和过滤器的说明,以及简单使用,应付日常而已----------------- ...
- APUE学习之出错处理
当UNIX函数发生错误时,通常会返回一个负值,而且整形变量errno通常被设置为具有特定信息的值. errno是全局变量,仅当函数出错才有被改变.对待errno,应注意两条规则 ...
- log4net在Realse下有个好大的坑呀。
原因:项目在DEBUG编译下日志是好好的,但是生成了Realse布署后却无日志产生了. 查找: 官方指导:http://logging.apache.org/log4net/release/faq.h ...
- Spring事务之详解--三种实现方式
实现购买股票案例: 一.引入JAR文件: 二.开始搭建分层架构---创建账户(Account)和股票(Stock)实体类 Account: /* * 账户 */ public class Accoun ...
- LAMP和LNMP
编译安装和yum安装 centos 7 可以使用10年 ubuntu可以使用5年 VirtualBox也是一个虚拟机 下载centos 安装centos exit 退出登陆 ping www.ba ...
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.
spring 配置文件报错报错信息:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be ...