在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( ...
随机推荐
- spring+mybatis多数据源动态切换
spring mvc+mybatis+多数据源切换 选取oracle,mysql作为例子切换数据源.oracle为默认数据源,在测试的action中,进行mysql和oracle的动态切换. web. ...
- mysql binlog_row_image的选择
其含义为 The default value is full. In MySQL 5.5 and earlier, full row images are always used for both b ...
- 5.1 JS中Object类型
1.Object类型是引用类型中的一种. 2.创建Object实例(对象)的方式: 方式1:使用new操作符,后面跟上Object构造函数.如: var obj = new Object();//创建 ...
- JQuery效果-淡入淡出、滑动、动画
一.JQuery Fading方法 JQuery 有四种fade方法 1.fadeIn() 淡入 对应也有$(selector).fadeIn(speed, ...
- AEAI ESB培训大纲
1. 概述 本文档的目的是为了让使用者能更好的操作.维护.服务于整个ESB系统平台,该信息系统平台不仅需要成熟稳定的产品,更需要技术熟练的运行维护人员,以便能更好地进行科学有效的运行维护工作. AEA ...
- CentOS7下安装Python的pip
root用户使用yum install -y python-pip 时会报如下错误: No package python-pip available Error:Nothing to do 解决方法如 ...
- DevExpress VCL v16.1.3发布
ExpressPDFViewer # BC3840:包含action标题和action提示的 Action classes 和 resource strings 重命名: class名称末尾中包含'A ...
- 自定义 bundle 包的创建
在我们使用第三方框架时,常常看到XXX.bundle的文件. 我们找到该文件,显示包内容,大致看到很多资源文件:图片.配置文本.XIB文件…… 什么是Bundle文件? 简单理解,就是资源文件包. ...
- 2016总结Android面试题
1.简单的设计模式:单例模式:在系统中一个类只有一个实例. 分为懒汉模式和饿汉模式.饿汉模式的代码如下:public class Singleten{private static singleten ...
- iOS 语音朗读
//判断版本大于7.0 if ([[[UIDevice currentDevice] systemVersion] integerValue] >= 7.0) { NSStr ...