Esempio n. 1
0
        private static ModelVisual3D BuildRoad(IFeature feature, double width)
        {
            var curve    = new PointString(feature.GeoData);
            var mesh     = MeshHelper.Road(new PointString(feature.GeoData), width);
            var material = BlockScene.GetRoadMaterial(feature);
            var model    = new GeometryModel3D(mesh, material)
            {
                BackMaterial = material
            };

            return(new ModelVisual3D {
                Content = model
            });
        }
Esempio n. 2
0
        public CityScene(HelixViewport3D viewport, Map map)
        {
            Viewport              = viewport;
            this.Map              = map;
            this.Models           = new Dictionary <string, List <ModelVisual3D> >();
            this.MaterialBuilders = new Dictionary <string, Func <IFeature, Material> >();
            this.GeometryBuilders = new Dictionary <string, Func <IFeature, MeshGeometry3D> >();

            this.MaterialBuilders["地块"] = f => FillHelper.Simple(Colors.White, 1);
            this.MaterialBuilders["建筑"] = f => FillHelper.Simple(Colors.White, 0.8);
            this.MaterialBuilders["道路"] = f => FillHelper.Simple(Colors.Orange, 1);
            this.GeometryBuilders["地块"] = f => MeshHelper.Polygon(CityScene.GetPolyline(f));
            this.GeometryBuilders["建筑"] = f => MeshHelper.Block(CityScene.GetPolyline(f), f["高度"].TryParseToDouble(10));
            this.GeometryBuilders["道路"] = f => MeshHelper.Road(CityScene.GetPolyline(f), f["宽度"].TryParseToDouble(21));
        }