internal void pnlComparison_Paint(PatchCompare form, Graphics g) { if (rbFirst.Checked) { if (patch1 == null) { g.FillRectangle(Brushes.Red, 0, 0, 32000, 32000); } else { var bmp = patch1.GetShadows(_sun); g.DrawImage(bmp, new Rectangle(new Point(0, 0), pnlComparison.Size)); } } else if (rbSecond.Checked) { if (patch2 == null) { g.FillRectangle(Brushes.Red, 0, 0, 32000, 32000); } else { var bmp = patch2.GetShadows(_sun); g.DrawImage(bmp, new Rectangle(new Point(0, 0), pnlComparison.Size)); } } else if (rbDelta.Checked) { if (patch2 == null || patch1 == null) { g.FillRectangle(Brushes.Green, 0, 0, 32000, 32000); } else { var bmp = GetImageDelta(); g.DrawImage(bmp, new Rectangle(new Point(0, 0), form.pnlComparison.Size)); } } else if (rbHorizon.Checked) { if (patch2 == null || patch1 == null) { g.FillRectangle(Brushes.Gray, 0, 0, 32000, 32000); } else { var bmp = GetHorizonDelta(); g.DrawImage(bmp, new Rectangle(new Point(0, 0), form.pnlComparison.Size)); } } }
Bitmap GetBitmap(TerrainPatch p) { switch (RenderMode) { case PatchRenderMode.AzEl: return(p.Horizons != null?p.GetShadows(azimuth_deg, elevation_deg) : p.GetHillshade()); case PatchRenderMode.ShadowCaster: return(p.Horizons != null?p.GetShadows(ShadowCaster) : p.GetHillshade()); case PatchRenderMode.Hillshade: default: return(p.GetHillshade()); } }
internal void UpdateShadowcaster(math.Vector3d caster) { LoadTexture(Patch.GetShadows(caster)); }