Exemple #1
0
 public void Load(Map map)
 {
     if (colorHorizon == null)
     {
         colorHorizon = new float[4];
         colorZenith  = new float[4];
     }
     float[]  colors     = new float[8];
     double[] parameters = new double[5];
     BrowserInterop.vtsCelestialAtmosphere(map.Handle, colors, parameters);
     Util.CheckInterop();
     for (int i = 0; i < 4; i++)
     {
         colorHorizon[i] = colors[i];
         colorZenith[i]  = colors[i + 4];
     }
     colorGradientExponent = parameters[0];
     BrowserInterop.vtsCelestialAtmosphereDerivedAttributes(map.Handle, ref boundaryThickness, ref horizontalExponent, ref verticalExponent);
     Util.CheckInterop();
     {
         IntPtr ptr = BrowserInterop.vtsDrawsAtmosphereDensityTexture(map.Handle);
         Util.CheckInterop();
         if (ptr == IntPtr.Zero)
         {
             densityTexture = null;
         }
         else
         {
             GCHandle hnd = GCHandle.FromIntPtr(ptr);
             densityTexture = hnd.Target;
         }
     }
 }