根据数据信息动态生成三维管线及横断面表格。效果图如下:

在获取信息后,直接构造点阵进行文字绘制即可。

绘制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绘制三维点阵文字)的更多相关文章

  1. (转)GPU图形绘制管线

    摘抄“GPU Programming And Cg Language Primer 1rd Edition” 中文名“GPU编程与CG语言之阳春白雪下里巴人”第二章. 图形绘制管线描述GPU渲染流程, ...

  2. GPU图形绘制管线简介

    (阅读GPU+编程与CG+语言之阳春白雪下里巴人所得总结) GPU图形绘制管线是描述GPU渲染(把三维世界显示为屏幕上的二维图像)的流程,主要分为三个主要阶段应用程序阶段.几何阶段.光栅阶段. 1.应 ...

  3. C#绘制立体三维饼状图

    转载自原文 C#绘制立体三维饼状图(超酷) 内容原文地址:LINK [翻译]Julijan Sribar著3D Pie Chart一个用于绘制立体三维饼状图的C#类库[简介]本文的想法就是创建一个独立 ...

  4. MATLAB三维散点图的绘制(scatter3、plot3)

    MATLAB三维散点图的绘制(scatter3.plot3) (1)函数scatter3 用法:scatter3(x,y,z,'.',c) % c 为颜色,需和x,y,z长度相同 例子: x=[422 ...

  5. Android绘图机制(二)——自定义View绘制形, 圆形, 三角形, 扇形, 椭圆, 曲线,文字和图片的坐标讲解

    Android绘图机制(二)--自定义View绘制形, 圆形, 三角形, 扇形, 椭圆, 曲线,文字和图片的坐标讲解 我们要想画好一些炫酷的View,首先我们得知道怎么去画一些基础的图案,比如矩形,圆 ...

  6. 自定义界面上绘制Text,可通过拖动控制文字大小及其位置

    项目地址 最近项目上有个需求,需要在一块区域中显示文字,这块区域可以拖动,也可以通过拖拽右下角来改变大小,里面的文字大小要根据区域的大小进行自适应.刚开始觉得这个需求不难,只需要一个TextView就 ...

  7. ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等--绘制点、线、圆,显示提示信息

    ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等--绘制点.线.圆,显示提示信息 /// <summary> /// 绘制界面上的点和线 ///  ...

  8. ArcGIS Mobile 自定义图层在绘制面时节点未绘制完全的问题

    ArcGIS Mobile 自定义图层在绘制面时节点未绘制完全,如下图: 面的绘制代码如下: public void Draw(Display dis, Pen p1, Pen p2,Pen p3 , ...

  9. Matlab绘图基础——其他三维图形(绘制填充的五角星)

    其他三维图形 %绘制魔方阵的三维条形图 subplot(2,2,1); bar3(magic(4));   %以三维杆图形式绘制曲线y=2sin(x) subplot(2,2,2); y=2*sin( ...

随机推荐

  1. (转)ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务 的解决方法

    早上同事用PL/SQL连接虚拟机中的Oracle数据库,发现又报了"ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务"错误,帮其解决后,发现很多人遇到过这样的问 ...

  2. CSS3学习总结——实现瀑布流布局与无限加载图片相册

    首先给大家看一下瀑布流布局与无限加载图片相册效果图: 一.pic1.html页面代码如下: <!DOCTYPE html> <html> <head> <me ...

  3. asp.net获取数据库的连接字符串

    1.添加引用 using System.Configuration; 2.代码 string strConnectionString=ConfigurationManager.AppSettings[ ...

  4. webpack+react+antd 单页面应用实例

    React框架已经火了好长一段时间了,再不学就out了! 对React还没有了解的同学可以看看我之前的一篇文章,可以快速简单的认识一下React.React入门最好的实例-TodoList 自己从开始 ...

  5. 使用IdleTest进行TDD单元测试驱动开发演练(2)

    [前言] 1. 有关上篇请参见<使用IdleTest进行TDD单元测试驱动开发演练(1)>,有关本篇用到Entity Framework Code First请参见<使用NuGet助 ...

  6. Git从码云Clone代码到本地

    Git从码云或者Github 克隆代码到本地 1.下载安装Git,傻瓜式下一步下一步即可... 2.配置Git: 2.1.选择你要clone到本地的路径:右键--->$ Git Bash Her ...

  7. 从Sql Server表中随机获取一些记录最简单的方法

    * FROM test ORDER BY NewID() 注意,使用时,请将‘test’改为真实的表名.

  8. Android学习--自己在使用HttpConnection时遇到的EOFException

    在学习第一行代码第14章酷欧天气的时候,HttpUtil类中的sendHttpRequest方法发出请求,然后返回响应信息,但是出现了EOFException异常,代码如下: HttpURLConne ...

  9. Hadoop技巧(01):插件,终端权限

    阅读目录 序 HDFS权限 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 在ha ...

  10. $(window).height(),在火狐下面获取的高度并不是可视区域的高度

    很简单,我发现是没有写<!DOCTYPE html>造成的,加上去就可以了