/// <summary> /// Fills the scene with objects from the given datasource that existing inside the given boundingbox with the given projection. /// </summary> /// <param name="dataSource"></param> /// <param name="box"></param> /// <param name="projection"></param> public void FillScene(IDataSourceReadOnly dataSource, GeoCoordinateBox box, IProjection projection) { foreach (var osmGeo in dataSource.Get(box, null)) { // translate each object into scene object. LongIndex index = null; switch (osmGeo.Type) { case Osm.OsmGeoType.Node: index = _interpretedNodes; break; case Osm.OsmGeoType.Way: index = _interpretedWays; break; case Osm.OsmGeoType.Relation: index = _interpretedRelations; break; } if (!index.Contains(osmGeo.Id.Value)) { // object was not yet interpreted. index.Add(osmGeo.Id.Value); _interpreter.Translate(_scene, projection, dataSource, osmGeo); } } }
/// <summary> /// Creates a new style scene manager. /// </summary> /// <param name="scene">The scene to manage.</param> /// <param name="interpreter">The intepreter converting OSM-objects into scene-objects.</param> public StyleSceneManager(Scene2D scene, StyleInterpreter interpreter) { _scene = scene; _interpreter = interpreter; _interpretedNodes = new LongIndex(); _interpretedWays = new LongIndex(); _interpretedRelations = new LongIndex(); SimpleColor?color = _interpreter.GetCanvasColor(); //this.Scene.BackColor = color.HasValue ? color.Value.Value : SimpleColor.FromArgb(0, 255, 255, 255).Value; }
/// <summary> /// Creates depth-first enumerator. /// </summary> /// <param name="graph"></param> public CHDepthFirstEnumerator(IDynamicGraph <CHEdgeData> graph) { _graph = graph; _index = new LongIndex(); }
/// <summary> /// Resets this enumerator. /// </summary> public void Reset() { _current = null; _index = new LongIndex(); }