本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
}
}
}
示例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);
}
}
}
}
}