Esempio n. 1
0
        private void InitMap3DComponents(List <Map3DModel> map3DModelList)
        {
            Dispatcher.Invoke(() =>
            {
                for (int i = viewport3D.Children.Count - 1; i >= 0; i--)
                {
                    if (viewport3D.Children[i] is ContainerUIElement3D)
                    {
                        viewport3D.Children.Remove(viewport3D.Children[i]);
                    }
                }

                List <ContainerUIElement3D> uIElement3Ds = new List <ContainerUIElement3D>();
                foreach (Map3DModel map3D in map3DModelList)
                {
                    ContainerUIElement3D uiElement = Map2DTo3DHelper.Map3DModelToUIElement3D(map3D);
                    uIElement3Ds.Add(uiElement);
                }

                foreach (ContainerUIElement3D uiElement in uIElement3Ds)
                {
                    uiElement.MouseLeftButtonDown += Container_MouseLeftButtonDown;
                    viewport3D.Children.Add(uiElement);
                }
            });
        }
Esempio n. 2
0
        private List <Map3DModel> Map2DTo3DData(List <Map2DModel> map2DModelList)
        {
            Rect rect = GetMap3DModelsBoundaryRect(map2DModelList);

            double zoomFactor = InflateMap2DShapeInBoundaryRectCenter(map2DModelList, rect);

            List <Map3DModel> map3DModelList = new List <Map3DModel>();

            for (int i = 0; i < map2DModelList.Count; i++)
            {
                Map3DModel map3D = Map2DTo3DHelper.Map2DTo3DModel(map2DModelList[i], 0, -10);
                map3D.ZoomFactor = zoomFactor;

                map3DModelList.Add(map3D);
            }

            return(map3DModelList);
        }