博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WorldWind Java 版学习:5、贴地面渲染过程
阅读量:5929 次
发布时间:2019-06-19

本文共 4306 字,大约阅读时间需要 14 分钟。

1、在窗口中点击一下,实际添加了两个点,如果是面测量,还会再添一个点,共三个点,此时还没构成面对象,会使用 BasicAnnotationRenderer 对象以标记形式绘制 MeasureTool$ControlPoint 的点对象,再点一下,就有了四个点,构造 SurfacePolygon 后,添加到 CustomRenderableLayer 中,然后在 doRepaint 方法中先在 preRender 方法中创建 Tile 的网格及纹理,再在 draw 方法中进行渲染

MeasureToolController.mousePressed(MouseEvent) line: 225
MeasureTool.addControlPoint() line: 1053
MeasureTool.addControlPoint(Position, String, Object) line: 2080
MeasureTool.doAddControlPoint(MeasureTool$ControlPoint) line: 2096
MeasureTool$CustomRenderableLayer(RenderableLayer).setRenderables(Iterable<Renderable>) line: 273

2、调用 CustomRenderableLayer 的 preRender 方法中将 SurfacePolygon 添加到 dc 中

StereoOptionSceneController(BasicSceneController).doRepaint(DrawContext) line: 27
StereoOptionSceneController(AbstractSceneController).preRender(DrawContext) line: 512
MeasureTool$CustomRenderableLayer(AbstractLayer).preRender(DrawContext) line: 217
MeasureTool$CustomRenderableLayer(RenderableLayer).doPreRender(DrawContext) line: 356
MeasureTool$CustomRenderableLayer(RenderableLayer).doPreRender(DrawContext, Iterable<Renderable>) line: 378
MeasureTool$CustomRenderableLayer(AbstractLayer).preRender(DrawContext) line: 217
MeasureTool$CustomRenderableLayer(RenderableLayer).doPreRender(DrawContext) line: 356
MeasureTool$CustomRenderableLayer(RenderableLayer).doPreRender(DrawContext, Iterable<Renderable>) line: 378
SurfacePolygon(AbstractSurfaceObject).preRender(DrawContext) line: 216
SurfacePolygon(AbstractSurfaceShape).makeOrderedPreRenderable(DrawContext) line: 552
SurfacePolygon(AbstractSurfaceObject).makeOrderedPreRenderable(DrawContext) line: 464
DrawContextImpl.addOrderedSurfaceRenderable(OrderedRenderable) line: 677

3、调用 preRenderOrderedSurfaceRenderables 方法构造 SurfaceObjectTileBuilder,然后递归构造 SurfaceObjectTile,最后添加到 currentTiles 中

StereoOptionSceneController(BasicSceneController).doRepaint(DrawContext) line: 27
StereoOptionSceneController(AbstractSceneController).preRender(DrawContext) line: 529
StereoOptionSceneController(AbstractSceneController).preRenderOrderedSurfaceRenderables(DrawContext) line: 937
StereoOptionSceneController(AbstractSceneController).buildCompositeSurfaceObjects(DrawContext) line: 1051
SurfaceObjectTileBuilder.buildTiles(DrawContext, Iterable<?>) line: 344
SurfaceObjectTileBuilder.assembleTiles(DrawContext) line: 859
SurfaceObjectTileBuilder.addTileOrDescendants(DrawContext, LevelSet, SurfaceObjectTileBuilder$SurfaceObjectTile, SurfaceObjectTileBuilder$SurfaceObjectTile) line: 911
SurfaceObjectTileBuilder.addTile(SurfaceObjectTileBuilder$SurfaceObjectTile) line: 984

4、得到 currentTiles 后,遍历其中的每个 Tile,创建纹理,然后采用渲染到纹理机制,分别绘制几何体的内部和外部,完成每个 SurfaceObjectTile 的网格和纹理的设置后,返回并添加到 surfaceObjectTiles 中

StereoOptionSceneController(BasicSceneController).doRepaint(DrawContext) line: 27
StereoOptionSceneController(AbstractSceneController).preRender(DrawContext) line: 529
StereoOptionSceneController(AbstractSceneController).preRenderOrderedSurfaceRenderables(DrawContext) line: 937
StereoOptionSceneController(AbstractSceneController).buildCompositeSurfaceObjects(DrawContext) line: 1051
SurfaceObjectTileBuilder.buildTiles(DrawContext, Iterable<?>) line: 345
SurfaceObjectTileBuilder.updateTiles(DrawContext) line: 489
SurfaceObjectTileBuilder.updateTile(DrawContext, SurfaceObjectTileBuilder$SurfaceObjectTile) line: 554
SurfacePolygon(AbstractSurfaceObject).render(DrawContext) line: 268
SurfacePolygon(AbstractSurfaceObject).drawOrderedRenderable(DrawContext) line: 595
SurfacePolygon(AbstractSurfaceShape).drawGeographic(DrawContext, SurfaceTileDrawContext) line: 574
SurfacePolygon(AbstractSurfaceShape).doDrawGeographic(DrawContext, SurfaceTileDrawContext) line: 641

5、得到 surfaceObjectTiles 后,在 draw 方法中进行渲染

StereoOptionSceneController(BasicSceneController).doRepaint(DrawContext) line: 27
StereoOptionSceneController.draw(DrawContext) line: 141
StereoOptionSceneController(AbstractSceneController).draw(DrawContext) line: 843
StereoOptionSceneController(AbstractSceneController).drawOrderedSurfaceRenderables(DrawContext) line: 985
StereoOptionSceneController(AbstractSceneController).drawCompositeSurfaceObjects(DrawContext) line: 1094
GeographicSurfaceTileRenderer(SurfaceTileRenderer).renderTiles(DrawContext, Iterable<SurfaceTile>) line: 101

转载于:https://www.cnblogs.com/redfler/archive/2012/11/09/2762114.html

你可能感兴趣的文章
忘记了oracle数据库用户的密码,怎么办?
查看>>
aws上部署scrapy,出现 Out of Memory,内存溢出
查看>>
c#各类型转byte[]或转回
查看>>
oracle如何用sql查看触发器?
查看>>
注册表
查看>>
UIPickerView更改大小
查看>>
leetcode------Combination Sum
查看>>
file_get_contents抓取网页乱码的解决
查看>>
等价表达式(noip2005)
查看>>
如何对HashMap按键值排序
查看>>
c#中的Out, params,ref 细说并沉淀
查看>>
CentOs 设置静态IP 方法
查看>>
引用计数的智能指针的实现与思考
查看>>
C语言的6个标准宏
查看>>
10大白帽黑客专用的 Linux 操作系统
查看>>
iOS 模型之中添加非空的方法
查看>>
day05-Python字典
查看>>
test
查看>>
二叉树
查看>>
Unity小记
查看>>