/// <summary> /// Generate the feint dummy rendering for the passed in symbol. /// </summary> /// <param name="ms"> /// The military symbol for which to provide the feint dummy rendering. /// </param> /// <param name="height"> /// The height at which to provide the feint dummy rendering. /// </param> /// <returns> /// The graphics Path object that represents the feint dummy rendering. /// </returns> private static Path GenerateFeintDummy(MilSymbol ms, ref double height) { if (!string.IsNullOrEmpty(Echelon.GetEchelonSymbol(ms.SymbolCode))) { height = ms.Bounds.Top; } if (SymbolData.IsTopFlat(ms.SymbolCode)) { double minimum = ms.BaseRect.Top; if (height >= minimum) { height = minimum - 28; } } double bottom = height + 23; height = height - 27; const double Wide = 126; var st = new Style(typeof(Shape)) { BasedOn = SymbolData.GetStyle("BS10") }; st.SetDashArray(3, 1); return(new Path { Style = st, Data = new PathGeometry { Figures = new PathFigureCollection { new PathFigure { StartPoint = new Point(-Wide, bottom), Segments = new PathSegmentCollection { new LineSegment { Point = new Point(0.0, height) }, new LineSegment { Point = new Point(Wide, bottom) } } } } } }); }
/// <summary> /// Generate the installation rendering for the passed in symbol. /// </summary> /// <param name="ms"> /// The military symbol for which to provide the installation rendering. /// </param> /// <param name="height"> /// The height at which to provide the installation rendering. /// </param> /// <returns> /// The graphics Shape object that represents the installation rendering. /// </returns> private static Shape GenerateInstallation(MilSymbol ms, out double height) { //// U&PGW ZSGF full unknown (flat) //// AP full air (not flat) //// U subsurface (flat) //// N&L ZSGF full neutral (flat) //// AP full air (flat) //// U subsurface (flat) //// H&S ZSGF full hostile (not flat) //// AP full air (not flat) //// U subsurface (flat) //// F&ADMJK Z(IG)S full friendly (not flat) //// F(~IG) full friendly (flat) //// AP full air (not flat) //// U subsurface (flat) height = -185; Brush br = new SolidColorBrush(Colors.Black); int si = StandardIdentity.GetNormalizedStandardIdentity(ms.SymbolCode); if (SymbolData.IsTopFlat(ms.SymbolCode)) { double t = ms.BaseRect.Top; if (si == StandardIdentity.Unknown) { t += SymbolData.HalfWidth; } height = t - 30; return(GenericInstallation(br, height, t)); } int bd = CategoryBattleDimension.GetCode(ms.SymbolCode); bool ap = bd == CategoryBattleDimension.BdSpace || bd == CategoryBattleDimension.BdAir; // The cases cover those surfaces which are flat on top versus those that are not switch (si) { case StandardIdentity.Unknown: // Outside for unknown space if (ap) { return(UnknownSpaceInstallation(br, height)); } return(UnknownGroundInstallation(br, height)); case StandardIdentity.Hostile: // Outside for hostile space if (ap) { height = -165; return(HostileSpaceInstallation(br, height)); } return(HostileGroundInstallation(br, height)); case StandardIdentity.Friend: height = -175; // Outside for friendly space if (ap) { return(FriendSpaceInstallation(br, height)); } return(FriendCircleInstallation(br, height)); } return(null); }
/// <summary> /// Generate the task force rendering for the passed in symbol. /// </summary> /// <param name="ms"> /// The military symbol for which to provide the task force rendering. /// </param> /// <param name="height"> /// The height at which to provide the task force rendering. /// </param> /// <returns> /// The graphics Path object that represents the task force rendering. /// </returns> private static Path GenerateTaskForce(MilSymbol ms, out double height) { height = -185; double bottom = 0; const double Wide = 54; int si = StandardIdentity.GetNormalizedStandardIdentity(ms.SymbolCode); if (SymbolData.IsTopFlat(ms.SymbolCode)) { bottom = ms.BaseRect.Top; if (si == StandardIdentity.Unknown) { bottom += SymbolData.HalfWidth; } height = bottom - 75; } else { int bd = CategoryBattleDimension.GetCode(ms.SymbolCode); bool ap = bd == CategoryBattleDimension.BdSpace || bd == CategoryBattleDimension.BdAir; // The cases cover those surfaces which are flat on top versus those that are not switch (si) { case StandardIdentity.Unknown: if (ap) { height = -230; // space bottom = -133; } else { height = -250; // ground bottom = -154; } break; case StandardIdentity.Hostile: if (ap) { height = -230; // space bottom = -107; } else { height = -253; // ground bottom = -119; } break; case StandardIdentity.Friend: height = -222; if (ap) { bottom = -121; // space } else { bottom = -137; // ground circles } break; } } return(new Path { Style = SymbolData.GetStyle("BS10"), Data = new PathGeometry { Figures = new PathFigureCollection { new PathFigure { StartPoint = new Point(Wide, bottom), Segments = new PathSegmentCollection { new LineSegment { Point = new Point(Wide, height) }, new LineSegment { Point = new Point(-Wide, height) }, new LineSegment { Point = new Point(-Wide, bottom) } } } } } }); }