当前位置: 首页>>代码示例>>C#>>正文


C# Microsoft.TryGetData方法代码示例

本文整理汇总了C#中Microsoft.TryGetData方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.TryGetData方法的具体用法?C# Microsoft.TryGetData怎么用?C# Microsoft.TryGetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft的用法示例。


在下文中一共展示了Microsoft.TryGetData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public override void Update(Microsoft.MapPoint.Rendering3D.Scene.SceneState sceneState)
        {
            if (needUpdate && newSegment != null)
            {
                CameraData data;
                if (sceneState.TryGetData<CameraData>(out data))
                {
                    double altitude = data.MetersAboveGround / 100.0;

                    List<Vertex.PositionColored> vertices = new List<Vertex.PositionColored>();

                    LatLonAlt position = LatLonAlt.CreateUsingDegrees(newSegment.StartPoint.Y, newSegment.StartPoint.X, altitude);
                    Vector3F vec = new Vector3F(position.GetVector());
                    vertices.Add(new Vertex.PositionColored(vec, lineColor.ToArgb()));

                    foreach (System.Windows.Point point in newSegment.OtherPoints)
                    {
                        position = LatLonAlt.CreateUsingDegrees(point.Y, point.X, altitude);
                        vec = new Vector3F(position.GetVector());
                        vertices.Add(new Vertex.PositionColored(vec, lineColor.ToArgb()));
                    }

                    mesh = new MeshGraphicsObject<Vertex.PositionColored, ushort>(
                        GraphicsBufferUsage.Static,
                        GraphicsBufferUsage.Static,
                        vertices.Count,
                        vertices.Count,
                        true);

                    Material material = new Material { AmbientColor = Color.White, DiffuseColor = Color.White, SpecularColor = Color.White };
                    int id = mesh.Materials.Add(material);

                    mesh.Vertices.AddData(vertices.ToArray());

                    List<ushort> indexData = new List<ushort>();
                    for (int i = 0; i < newSegment.OtherPoints.Count + 1; i++)
                    {
                        indexData.Add((ushort)i);
                    }

                    mesh.Indices.AddData(indexData.ToArray(),
                        PrimitiveType.LineStrip,
                        id);

                    mesh.RenderState.Lighting.Enabled = false;
                    mesh.RenderState.Cull.Enabled = false;

                    oldSegment = newSegment;
                    needUpdate = false;
                    host.NeedUpdate();
                }
            }

            base.Update(sceneState);
        }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:55,代码来源:RunningIsoline.cs

示例2: Update

        public override void Update(Microsoft.MapPoint.Rendering3D.Scene.SceneState sceneState)
        {
            if (meshLayers.Count != 0)
            {
                CameraData data;
                if (sceneState.TryGetData<CameraData>(out data))
                {
                    double altitude = data.MetersAboveGround / 100.0;
                    bool needUpdate = false;
                    foreach (MeshLayer meshLayer in meshLayers)
                    {
                        if (meshLayer.LayerAltitude != altitude)
                        {
                            needUpdate = true;
                            if (meshLayer.ScalarField is PointSet)
                            {
                                PointSet pointSet = meshLayer.ScalarField as PointSet;
                                meshLayer.Mesh.Vertices.Clear();
                                meshLayer.Mesh.Vertices.AddData(BuildVertices(pointSet, altitude).ToArray());
                                meshLayer.LayerAltitude = altitude;
                                continue;
                            }
                        }
                    }
                    if (needUpdate)
                        host.NeedUpdate();
                    /*
                    if (mlayer != null && mlayer.LayerAltitude!=altitude)
                    {
                        
                    }*/


                }
            }


            base.Update(sceneState);
        }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:39,代码来源:ProbesActor.cs

示例3: Render

 public override void Render(Microsoft.MapPoint.Rendering3D.Scene.SceneState sceneState)
 {
     if (meshLayers.Count != 0)
     {
         CameraData data;
         if (sceneState.TryGetData<CameraData>(out data))
         {
             RenderQueues renderQueues = sceneState.GetData<RenderQueues>();
             lock (meshLayers)
             {
                 for (int i = 0; i < meshLayers.Count; i++)
                 {
                     if (meshLayers[i].IsVisible)
                     {
                         renderQueues.AddAlphaRenderable(data.Snapshot.Position.Altitude - meshLayers[i].LayerAltitude, meshLayers[i].Mesh);
                     }
                 }
             }
         }
     }
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:21,代码来源:ColorMapActor.cs

示例4: Render

 public override void Render(Microsoft.MapPoint.Rendering3D.Scene.SceneState sceneState)
 {
     if (meshLayers.Count != 0)
     {
         CameraData data;
         if (sceneState.TryGetData<CameraData>(out data))
         {
             RenderQueues renderQueues = sceneState.GetData<RenderQueues>();
             foreach (MeshLayer meshLayer in meshLayers)
             {
                 if (meshLayer.IsVisible)
                 {
                     renderQueues.AddRenderable(meshLayer.Mesh);
                 }
             }
         }
     }
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:18,代码来源:ProbesActor.cs


注:本文中的Microsoft.TryGetData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。