Пример #1
0
        public string GetMapConfigPath()
        {
            string res = Util.CStringToSharp(BrowserInterop.vtsMapGetConfigPath(Handle));

            Util.CheckError();
            return(res);
        }
Пример #2
0
        public string GetPositionUrl()
        {
            string res = Util.CStringToSharp(BrowserInterop.vtsMapGetPositionUrl(Handle));

            Util.CheckError();
            return(res);
        }
Пример #3
0
 public Map(string createOptions)
 {
     handle = BrowserInterop.vtsMapCreate(createOptions);
     Util.CheckError();
     AssignInternalDelegates();
     AssignInternalCallbacks();
 }
Пример #4
0
        public double GetPositionFov()
        {
            double res = BrowserInterop.vtsMapGetPositionFov(Handle);

            Util.CheckError();
            return(res);
        }
Пример #5
0
 public double[] GetPositionRotationLimited()
 {
     double[] res = new double[3];
     BrowserInterop.vtsMapGetPositionRotationLimited(Handle, res);
     Util.CheckError();
     return(res);
 }
Пример #6
0
        public bool GetPositionSubjective()
        {
            bool res = BrowserInterop.vtsMapGetPositionSubjective(Handle);

            Util.CheckError();
            return(res);
        }
Пример #7
0
        public bool GetMapConfigAvailable()
        {
            bool res = BrowserInterop.vtsMapGetConfigAvailable(Handle);

            Util.CheckError();
            return(res);
        }
Пример #8
0
        public void Load(IntPtr handle)
        {
            faceMode = (FaceMode)BrowserInterop.vtsGetMeshFaceMode(handle);
            Util.CheckError();
            IntPtr bufPtr;
            uint   bufSize;

            BrowserInterop.vtsGetMeshIndices(handle, out bufPtr, out bufSize, out indicesCount);
            Util.CheckError();
            if (indicesCount > 0)
            {
                short[] tmp = new short[indicesCount];
                Marshal.Copy(bufPtr, tmp, 0, (int)indicesCount);
                indices = new ushort[indicesCount];
                Buffer.BlockCopy(tmp, 0, indices, 0, (int)indicesCount * 2);
            }
            BrowserInterop.vtsGetMeshVertices(handle, out bufPtr, out bufSize, out verticesCount);
            Util.CheckError();
            vertices = new byte[bufSize];
            Marshal.Copy(bufPtr, vertices, 0, (int)bufSize);
            attributes = new List <VertexAttribute>(4);
            for (uint i = 0; i < 4; i++)
            {
                VertexAttribute a;
                uint            type;
                BrowserInterop.vtsGetMeshAttribute(handle, i, out a.offset, out a.stride, out a.components, out type, out a.enable, out a.normalized);
                Util.CheckError();
                a.type = (GpuType)type;
                attributes.Add(a);
            }
        }
Пример #9
0
        public string GetStatistics()
        {
            string res = Util.CStringToSharp(BrowserInterop.vtsMapGetStatistics(Handle));

            Util.CheckError();
            return(res);
        }
Пример #10
0
 public double[] GetProj()
 {
     double[] proj = new double[16];
     BrowserInterop.vtsCameraGetProjMatrix(Handle, proj);
     Util.CheckInterop();
     return(proj);
 }
Пример #11
0
 public double[] GetView()
 {
     double[] view = new double[16];
     BrowserInterop.vtsCameraGetViewMatrix(Handle, view);
     Util.CheckInterop();
     return(view);
 }
Пример #12
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;
         }
     }
 }
Пример #13
0
        public bool GetSearchable()
        {
            bool res = BrowserInterop.vtsMapGetSearchable(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #14
0
 private void LoadSimple(ref List <DrawSimpleTask> tasks, IntPtr group, uint cnt)
 {
     Util.CheckInterop();
     if (tasks == null)
     {
         tasks = new List <DrawSimpleTask>((int)cnt);
     }
     else
     {
         tasks.Clear();
     }
     for (uint i = 0; i < cnt; i++)
     {
         DrawSimpleTask t;
         IntPtr         pm = IntPtr.Zero, ptc = IntPtr.Zero, pbs = IntPtr.Zero;
         BrowserInterop.vtsDrawsSimpleTask(group, i, ref pm, ref ptc, ref pbs);
         Util.CheckInterop();
         if (pm == IntPtr.Zero)
         {
             continue;
         }
         t.data     = (DrawSimpleBase)Marshal.PtrToStructure(pbs, typeof(DrawSimpleBase));
         t.mesh     = Load(pm);
         t.texColor = Load(ptc);
         tasks.Add(t);
     }
 }
Пример #15
0
 public double[] GetRotation()
 {
     double[] res = new double[3];
     BrowserInterop.vtsNavigationGetRotation(Handle, res);
     Util.CheckInterop();
     return(res);
 }
Пример #16
0
        public double GetFov()
        {
            double res = BrowserInterop.vtsNavigationGetFov(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #17
0
        public bool GetMapRenderComplete()
        {
            bool res = BrowserInterop.vtsMapGetRenderComplete(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #18
0
        public bool GetSubjective()
        {
            bool res = BrowserInterop.vtsNavigationGetSubjective(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #19
0
        public SearchTask Search(string query)
        {
            IntPtr ptr = BrowserInterop.vtsMapSearch(Handle, query);

            Util.CheckInterop();
            return(new SearchTask(ptr));
        }
Пример #20
0
        public bool GetMapconfigReady()
        {
            bool res = BrowserInterop.vtsMapGetConfigReady(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #21
0
 private void Load(ref List <DrawTask> tasks, IntPtr group)
 {
     Util.CheckError();
     try
     {
         uint cnt = BrowserInterop.vtsDrawsCount(group);
         Util.CheckError();
         if (tasks == null)
         {
             tasks = new List <DrawTask>((int)cnt);
         }
         else
         {
             tasks.Clear();
         }
         for (uint i = 0; i < cnt; i++)
         {
             DrawTask t;
             IntPtr   pm, ptc, ptm;
             IntPtr   dataPtr = BrowserInterop.vtsDrawsAllInOne(group, i, out pm, out ptc, out ptm);
             Util.CheckError();
             t.data     = (DrawBase)Marshal.PtrToStructure(dataPtr, typeof(DrawBase));
             t.mesh     = Load(pm);
             t.texColor = Load(ptc);
             t.texMask  = Load(ptm);
             tasks.Add(t);
         }
     }
     finally
     {
         BrowserInterop.vtsDrawsDestroy(group);
         Util.CheckError();
     }
 }
Пример #22
0
        public bool GetProjected()
        {
            bool res = BrowserInterop.vtsMapGetProjected(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #23
0
        public double GetMapRenderProgress()
        {
            double res = BrowserInterop.vtsMapGetRenderProgress(Handle);

            Util.CheckInterop();
            return(res);
        }
Пример #24
0
        public string GetCreditsShort()
        {
            string res = Util.CStringToSharp(BrowserInterop.vtsMapGetCreditsShort(Handle));

            Util.CheckError();
            return(res);
        }
Пример #25
0
        public static uint GpuTypeSize(GpuType type)
        {
            uint s = BrowserInterop.vtsGpuTypeSize((uint)type);

            CheckInterop();
            return(s);
        }
Пример #26
0
 public double[] Convert(double[] point, Srs srsFrom, Srs srsTo)
 {
     Util.CheckArray(point, 3);
     double[] res = new double[3];
     BrowserInterop.vtsMapConvert(Handle, point, res, (uint)srsFrom, (uint)srsTo);
     Util.CheckInterop();
     return(res);
 }
Пример #27
0
 public void GetView(out double[] eye, out double[] target, out double[] up)
 {
     eye    = new double[3];
     target = new double[3];
     up     = new double[3];
     BrowserInterop.vtsCameraGetView(Handle, eye, target, up);
     Util.CheckInterop();
 }
Пример #28
0
 public static double[] Inverse44(double[] r)
 {
     Util.CheckArray(r, 16);
     double[] res = new double[16];
     BrowserInterop.vtsMathInverse44(res, r);
     Util.CheckInterop();
     return(res);
 }
Пример #29
0
 public static double[] Inverse33(double[] r)
 {
     Util.CheckArray(r, 9);
     double[] res = new double[9];
     BrowserInterop.vtsMathInverse33(res, r);
     Util.CheckError();
     return(res);
 }
Пример #30
0
 public void SetView(double[] eye, double[] target, double[] up)
 {
     Util.CheckArray(eye, 3);
     Util.CheckArray(target, 3);
     Util.CheckArray(up, 3);
     BrowserInterop.vtsCameraSetView(Handle, eye, target, up);
     Util.CheckInterop();
 }