public void MarkHardwareLevelsUsed(MapDataAnalysis analysis) { foreach (ContourRenderingTemplate template in templates) { template.MarkHardwareLevelsUsed(analysis); } }
public abstract void RenderOsmObject( MapMakerSettings mapMakerSettings, MapDataAnalysis analysis, InMemoryOsmDatabase osmDatabase, OsmObjectBase osmObject, OsmRelation parentRelation, CGpsMapperMapWriter mapWriter);
public void MarkHardwareLevelsUsed(MapDataAnalysis analysis) { foreach (ContoursElevationRule rule in rules.Values) { rule.MarkHardwareLevelsUsed(analysis); } }
public void MarkHardwareLevelsUsed(MapDataAnalysis analysis) { if (Style.MinZoomFactor != int.MinValue) { analysis.MarkUsedHardwareLevel(Style.MinZoomFactor); } if (Style.MaxZoomFactor != int.MaxValue) { analysis.MarkUsedHardwareLevel(Style.MaxZoomFactor); } }
public void RenderContour( IPointD2List contourPoints, double contourElevation, MapDataAnalysis analysis, CGpsMapperMapWriter mapWriter) { foreach (ContourRenderingTemplate template in templates) { template.RenderContour(contourPoints, contourElevation, analysis, mapWriter); } }
protected override void AnalyzeDataInternal() { LoadRulesIfNecessary(); Analysis = new MapDataAnalysis(); Settings.ContoursRenderingRules.MarkHardwareLevelsUsed(Analysis); Settings.ContoursRenderingRules.RegisterTypes(Settings.TypesRegistry); tileBoxRegistration = Settings.TypesRegistry.RegisterNewLineType("ContoursTileBox"); tileBoxRegistration.MaxLevel = 24; tileBoxRegistration.MinLevel = 24; tileBoxRegistration.Pattern = new PatternDefinition(); tileBoxRegistration.Pattern.AddColor("#7F3300"); tileBoxRegistration.Pattern.PatternLines.Add("0000"); }
public void RenderPolygon( MapMakerSettings mapMakerSettings, MapDataAnalysis analysis, IPointD2List polygonPoints, CGpsMapperMapWriter mapWriter) { mapWriter.AddSection("POLYGON") .AddTypeReference(TypeRegistration) .AddCoordinates( "Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], polygonPoints); mapWriter .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]) ; }
public void RenderContour( IPointD2List contourPoints, double contourElevation, MapDataAnalysis analysis, CGpsMapperMapWriter mapWriter) { mapWriter.AddSection("POLYLINE") .AddTypeReference(TypeRegistration) .AddCoordinates( "Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], contourPoints) .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]); if (showElevation) { mapWriter.Add("Label", (int)contourElevation); } }
public override void RenderOsmObject( MapMakerSettings mapMakerSettings, MapDataAnalysis analysis, InMemoryOsmDatabase osmDatabase, OsmObjectBase osmObject, OsmRelation parentRelation, CGpsMapperMapWriter mapWriter) { mapWriter.AddSection("POLYGON") .AddTypeReference(TypeRegistration) .AddCoordinates( "Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], GetNodesForWay(osmDatabase, (OsmWay)osmObject)); // rendering of holes if (osmObject is OsmAreaWithHoles) { OsmAreaWithHoles areaWithHoles = (OsmAreaWithHoles)osmObject; foreach (int holeWayId in areaWithHoles.EnumerateHolesWaysIds()) { OsmWay holeWay = osmDatabase.GetWay(holeWayId); if (holeWay.NodesCount > 3) { mapWriter.AddCoordinates( "Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], GetNodesForWay(osmDatabase, holeWay)); } } } mapWriter .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]) ; if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant) { mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation)); } }
public override void RenderOsmObject( MapMakerSettings mapMakerSettings, MapDataAnalysis analysis, InMemoryOsmDatabase osmDatabase, OsmObjectBase osmObject, OsmRelation parentRelation, CGpsMapperMapWriter mapWriter) { mapWriter.AddSection("POI") .AddTypeReference(TypeRegistration); // find the location to put the icon on OsmNode iconNode = null; if (osmObject is OsmNode) { iconNode = (OsmNode)osmObject; } else if (osmObject is OsmWay) { PointD2 location = Brejc.OsmLibrary.Helpers.OsmGeometryUtils.FindAreaCenterPoint( (OsmWay)osmObject, osmDatabase); iconNode = new OsmNode(1, location.X, location.Y); } else { throw new InvalidOperationException("Internal error."); } mapWriter .AddCoordinates("Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], iconNode) .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]) ; if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant) { mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation)); } }
public override void RenderOsmObject( MapMakerSettings mapMakerSettings, MapDataAnalysis analysis, InMemoryOsmDatabase osmDatabase, OsmObjectBase osmObject, OsmRelation parentRelation, CGpsMapperMapWriter mapWriter) { mapWriter.AddSection("POLYLINE") .AddTypeReference(TypeRegistration) .AddCoordinates( "Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], GetNodesForWay(osmDatabase, (OsmWay)osmObject)) .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]) ; if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant) { mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation).ToUpperInvariant()); } }
public RenderingRuleEngine(MapDataAnalysis analysis) { this.analysis = analysis; }